Cleanup dummy rails app

This commit is contained in:
Benjamin Neff 2017-04-04 03:28:37 +02:00
parent b0f6131527
commit 26cfe7090b
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
19 changed files with 0 additions and 210 deletions

5
.gitignore vendored
View file

@ -20,13 +20,8 @@ doc
*.directory
# dummmy app
test/dummy/db/*.sqlite3
test/dummy/db/*.sqlite3-journal
test/dummy/log/*.log
test/dummy/log/*.log*
test/dummy/tmp/
test/dummy/.sass-cache
test/dummy/test/fixtures/*.y*ml
rspec-persistance.txt

View file

@ -1,4 +0,0 @@
# desc "Explaining what the task does"
# task :diaspora_federation do
# # Task goes here
# end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -1,5 +0,0 @@
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
end

View file

@ -1,7 +0,0 @@
class DiscoveryController < ApplicationController
def discovery
discovery = DiasporaFederation::Discovery::Discovery.new(params[:q])
render json: discovery.fetch_and_save
end
end

View file

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Dummy</title>
<%= csrf_meta_tags %>
</head>
<body>
<%= yield %>
</body>
</html>

View file

@ -1,3 +0,0 @@
#!/usr/bin/env ruby
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
load Gem.bin_path('bundler', 'bundle')

View file

@ -1,9 +0,0 @@
#!/usr/bin/env ruby
begin
load File.expand_path('../spring', __FILE__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
require_relative '../config/boot'
require 'rake'
Rake.application.run

View file

@ -1,29 +0,0 @@
#!/usr/bin/env ruby
require 'pathname'
# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
Dir.chdir APP_ROOT do
# This script is a starting point to setup your application.
# Add necessary setup steps to this file:
puts "== Installing dependencies =="
system "gem install bundler --conservative"
system "bundle check || bundle install"
# puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml")
# system "cp config/database.yml.sample config/database.yml"
# end
puts "\n== Preparing database =="
system "bin/rake db:setup"
puts "\n== Removing old logs and tempfiles =="
system "rm -f log/*"
system "rm -rf tmp/cache"
puts "\n== Restarting application server =="
system "touch tmp/restart.txt"
end

View file

@ -1,16 +0,0 @@
#!/usr/bin/env ruby
# This file loads spring without using Bundler, in order to be fast.
# It gets overwritten when you run the `spring binstub` command.
unless defined?(Spring)
require 'rubygems'
require 'bundler'
lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
if spring = lockfile.specs.detect { |spec| spec.name == "spring" }
Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
gem 'spring', spring.version
require 'spring/binstub'
end
end

View file

@ -1,25 +0,0 @@
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
#
default: &default
adapter: sqlite3
pool: 5
timeout: 5000
development:
<<: *default
database: db/development.sqlite3
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: db/test.sqlite3
production:
<<: *default
database: db/production.sqlite3

View file

@ -1,7 +0,0 @@
# Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
# Rails.backtrace_cleaner.remove_silencers!

View file

@ -1,12 +0,0 @@
class CreatePeople < ActiveRecord::Migration
def change
create_table :people do |t|
t.string "guid", null: false
t.text "url", null: false
t.string "diaspora_handle", null: false
t.text "serialized_public_key", null: false
t.timestamps null: false
end
end
end

View file

@ -1,5 +0,0 @@
class RenameDiasporaHandleToDiasporaId < ActiveRecord::Migration
def change
rename_column :people, :diaspora_handle, :diaspora_id
end
end

View file

@ -1,5 +0,0 @@
class AddSerializedPrivateKeyToPerson < ActiveRecord::Migration
def change
add_column :people, :serialized_private_key, :text
end
end

View file

@ -1,11 +0,0 @@
class CreateEntity < ActiveRecord::Migration
def change
create_table :entities do |t|
t.belongs_to :author, class_name: "Person", null: false
t.string :guid, null: false
t.string :entity_type, null: false
t.timestamps null: false
end
end
end

View file

@ -1,33 +0,0 @@
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20160202221606) do
create_table "entities", force: :cascade do |t|
t.integer "author_id", null: false
t.string "guid", null: false
t.string "entity_type", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "people", force: :cascade do |t|
t.string "guid", null: false
t.text "url", null: false
t.string "diaspora_id", null: false
t.text "serialized_public_key", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.text "serialized_private_key"
end
end

View file

@ -1,22 +0,0 @@
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
# from diaspora for testing
module Diaspora
module Guid
# Creates a before_create callback which calls #set_guid
def self.included(model)
model.class_eval do
after_initialize :set_guid
validates :guid, uniqueness: true
end
end
# @return [String] The model's guid.
def set_guid
self.guid = UUID.generate :compact if guid.blank?
end
end
end