50 |
--------------------------------------------------------------------------------
/bin/plotline:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require 'commander/import'
3 | require 'listen'
4 | require 'plotline/version'
5 | require File.join(Dir.pwd, 'config', 'environment') # load the Rails app
6 |
7 | program :name, 'Plotline'
8 | program :version, Plotline::VERSION
9 | program :description, 'Simple CMS based on Ruby, Markdown and Postgres'
10 |
11 | command :sync do |c|
12 | c.syntax = 'plotline sync [options]'
13 | c.description = 'Sync content files from --path to the database and --media-target directories'
14 | c.option '--source-path STRING', String, 'Directory with content files'
15 | c.option '--target STRING', String, 'Rails application directory (defaults to pwd)'
16 | c.action do |args, options|
17 | options.default target: Dir.pwd
18 |
19 | importer = Plotline::Import::Runner.new(options.source_path, options.target)
20 | importer.import_all!
21 |
22 | listener = Listen.to(options.source_path) do |modified, added, removed|
23 | importer.process_files(removed | modified | added)
24 | end
25 |
26 | listener.start
27 | sleep
28 | end
29 | end
30 |
--------------------------------------------------------------------------------
/bin/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | # This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.
3 |
4 | ENGINE_ROOT = File.expand_path('../..', __FILE__)
5 | ENGINE_PATH = File.expand_path('../../lib/plotline/engine', __FILE__)
6 |
7 | # Set up gems listed in the Gemfile.
8 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
9 | require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
10 |
11 | require 'rails/all'
12 | require 'rails/engine/commands'
13 |
--------------------------------------------------------------------------------
/config/routes.rb:
--------------------------------------------------------------------------------
1 | Plotline::Engine.routes.draw do
2 | resources :images, only: [:index, :show, :destroy]
3 |
4 | scope "/:content_class" do
5 | resources :entries, except: [:new, :create, :edit, :update]
6 | end
7 |
8 | get 'sign-in', to: 'sessions#new', as: 'signin'
9 | get 'sign-out', to: 'sessions#destroy', as: 'signout'
10 |
11 | resources :sessions, only: [:new, :create, :destroy]
12 |
13 | root to: 'dashboard#index'
14 | end
15 |
--------------------------------------------------------------------------------
/db/migrate/20150831131759_create_plotline_entries.plotline.rb:
--------------------------------------------------------------------------------
1 | class CreatePlotlineEntries < ActiveRecord::Migration
2 | def change
3 | create_table :plotline_entries do |t|
4 | t.string :type, index: true
5 | t.string :title
6 | t.string :slug, index: true
7 | t.text :body
8 | t.json :payload
9 | t.datetime :published_at
10 | t.integer :status, default: 0, index: true
11 | t.text :tags, array: true, default: []
12 | t.integer :parent_id, index: true
13 | t.string :checksum
14 |
15 | t.timestamps null: false
16 | end
17 |
18 | add_index :plotline_entries, :tags, using: 'gin'
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/db/migrate/20150911135536_create_plotline_entry_search_data.plotline.rb:
--------------------------------------------------------------------------------
1 | class CreatePlotlineEntrySearchData < ActiveRecord::Migration
2 | def change
3 | create_table :plotline_entry_search_data do |t|
4 | t.integer :entry_id, index: true
5 | t.string :attr_name
6 | t.tsvector :search_data
7 | t.text :raw_data
8 |
9 | t.timestamps null: false
10 | end
11 |
12 | execute 'create index idx_search_data on plotline_entry_search_data using gin(search_data)'
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/db/migrate/20160212172219_create_plotline_images.plotline.rb:
--------------------------------------------------------------------------------
1 | # This migration comes from plotline (originally 20160208102834)
2 | class CreatePlotlineImages < ActiveRecord::Migration
3 | def change
4 | create_table :plotline_images do |t|
5 | t.string :image
6 | t.integer :width
7 | t.integer :height
8 | t.float :ratio
9 | t.integer :file_size
10 | t.string :content_type
11 | t.json :exif
12 |
13 | t.timestamps
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/db/migrate/20160224161843_create_plotline_users.plotline.rb:
--------------------------------------------------------------------------------
1 | class CreatePlotlineUsers < ActiveRecord::Migration[5.0]
2 | def change
3 | create_table :plotline_users do |t|
4 | t.string :email
5 | t.string :name
6 | t.string :password_digest
7 | t.string :auth_token
8 |
9 | t.timestamps
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/lib/plotline.rb:
--------------------------------------------------------------------------------
1 | require "plotline/engine"
2 | require "plotline/configuration"
3 | require "plotline/custom_markdown_parser"
4 | require "plotline/import/handlers/base"
5 | require "plotline/import/handlers/image_file"
6 | require "plotline/import/handlers/video_file"
7 | require "plotline/import/handlers/markdown_file"
8 | require "plotline/import/runner"
9 |
10 | module Plotline
11 |
12 | end
13 |
--------------------------------------------------------------------------------
/lib/plotline/configuration.rb:
--------------------------------------------------------------------------------
1 | module Plotline
2 | class Configuration
3 | attr_accessor :content_classes
4 |
5 | def initialize
6 | @content_classes = [].freeze
7 | end
8 |
9 | def logger(logger = nil)
10 | @logger ||= logger || Logger.new(STDOUT)
11 | @logger
12 | end
13 | end
14 |
15 | def self.configuration
16 | @configuration ||= Configuration.new
17 | end
18 |
19 | def self.configure
20 | yield configuration
21 | end
22 | end
23 |
--------------------------------------------------------------------------------
/lib/plotline/custom_markdown_parser.rb:
--------------------------------------------------------------------------------
1 | module Plotline
2 | class CustomMarkdownParser
3 | def initialize(presenter)
4 | @presenter = presenter
5 | end
6 |
7 | # Matches photoset enclosing tags:
8 | # ...
9 | PHOTOSET_PATTERN = /---(\s*\n.*?)\n?^---\s*$\n?/m
10 |
11 | # Matches a single image in the Markdown format:
12 | # 
13 | IMAGE_PATTERN = /\!\[([^\]]*)\]\(([^)]+)\)(\{([^{]+)\})?/
14 |
15 | PHOTOSET_HTML = "
%{rows}
\n\n"
16 | PHOTOSET_ROW_HTML = "
%{items}
"
17 |
18 | def parse(text)
19 | text = parse_photosets(text)
20 | text = parse_single_images(text)
21 |
22 | text
23 | end
24 |
25 | def parse_photosets(text)
26 | text.gsub(PHOTOSET_PATTERN) do |s|
27 | # Photoset row is a a set of images separated by 2 new line characters
28 | rows = $1.gsub("\r", "").strip.split("\n\n").map do |row|
29 | # Each line in row is considered an "item" (image)
30 | items = row.split("\n").reject { |i| i.strip.blank? }
31 | images = items.map { |image| parse_image(image, :photoset_item) }
32 |
33 | PHOTOSET_ROW_HTML % { items: images.join("\n") }
34 | end
35 |
36 | PHOTOSET_HTML % { rows: "\n" + rows.join("\n") + "\n" }
37 | end
38 | end
39 |
40 | def parse_single_images(text)
41 | parse_image(text, :single_image_html)
42 | end
43 |
44 | private
45 |
46 | def parse_image(text, callback)
47 | text.gsub(IMAGE_PATTERN) do
48 | attrs = parse_special_attributes($4)
49 |
50 | item = @presenter.send(callback, src: $2, alt: $1, attrs: attrs)
51 | item = item.gsub(/\s?<\/figcaption>/, '') # remove empty captions:
52 | item.gsub(/^\s+/, '') # remove indentation from the beginning of lines
53 | end
54 | end
55 |
56 | # Parses additional attributes placed within brackets:
57 | #
58 | # {.regular #hero lang=fr}
59 | # {.big #the-site data-behavior=lightbox}
60 | #
61 | # Note: works with images only.
62 | def parse_special_attributes(raw_attrs)
63 | return {} if raw_attrs.blank?
64 | items = raw_attrs.split(/\s+/)
65 |
66 | id = items.select { |i| i =~ /^#.+/ }.first.gsub('#', '')
67 | classes = items.select { |i| i =~ /^\..+/ }.map { |c| c.gsub('.', '') }
68 | attrs = Hash[items.select { |i| i.include?('=') }.map { |i| i.split('=') }]
69 |
70 | attrs.merge({
71 | 'id' => id,
72 | 'class' => classes.join(' ')
73 | })
74 | end
75 | end
76 | end
77 |
--------------------------------------------------------------------------------
/lib/plotline/engine.rb:
--------------------------------------------------------------------------------
1 | module Plotline
2 | class Engine < ::Rails::Engine
3 | isolate_namespace Plotline
4 |
5 | require 'jquery-rails'
6 | require 'rdiscount'
7 | require 'fastimage'
8 | require 'exiftool'
9 |
10 | require 'bourbon'
11 | require 'autoprefixer-rails'
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/lib/plotline/import/handlers/base.rb:
--------------------------------------------------------------------------------
1 | module Plotline
2 | module Import
3 | module Handlers
4 | class Base
5 | def initialize(runner)
6 | @runner = runner
7 | end
8 |
9 | def supported_file?(filename)
10 | raise NotImplementedError
11 | end
12 |
13 | private
14 |
15 | def log(msg)
16 | Plotline.configuration.logger.info(msg)
17 | end
18 | end
19 | end
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/lib/plotline/import/handlers/image_file.rb:
--------------------------------------------------------------------------------
1 | module Plotline
2 | module Import
3 | module Handlers
4 | class ImageFile < Base
5 | IMAGE_EXTENSIONS = %w(jpg jpeg png gif bmp tiff).freeze
6 |
7 | def supported_file?(filename)
8 | IMAGE_EXTENSIONS.include?(File.extname(filename).gsub('.', ''))
9 | end
10 |
11 | def import(filename)
12 | log "\e[34mImporting:\e[0m #{filename}"
13 |
14 | if !File.exists?(filename)
15 | log "FILE REMOVED"
16 | return
17 | end
18 |
19 | dst = filename.gsub(@runner.source_dir, @runner.uploads_dir)
20 |
21 | FileUtils.mkdir_p(File.dirname(dst))
22 | FileUtils.cp(filename, dst)
23 |
24 | file = dst.gsub(@runner.public_dir, '')
25 | image = Plotline::Image.find_or_initialize_by(image: file)
26 | return if image.persisted? && File.size(dst) == image.file_size
27 |
28 | image.save!
29 | end
30 | end
31 | end
32 | end
33 | end
34 |
--------------------------------------------------------------------------------
/lib/plotline/import/handlers/markdown_file.rb:
--------------------------------------------------------------------------------
1 | module Plotline
2 | module Import
3 | module Handlers
4 | class MarkdownFile < Base
5 | FILENAME_SPLIT_PATTERN = /^(\d{4}-\d{2}-\d{2})-(.*)/
6 | FRONT_MATTER_PATTERN = /\A(---\s*\n.*?\n?)^(---\s*$\n?)/m
7 | MARKDOWN_EXTENSIONS = %w(md markdown).freeze
8 |
9 | def supported_file?(filename)
10 | MARKDOWN_EXTENSIONS.include?(File.extname(filename).gsub('.', ''))
11 | end
12 |
13 | def import(filename)
14 | log "\e[34mImporting:\e[0m #{filename}"
15 |
16 | date, slug = filename_to_date_and_slug(filename)
17 |
18 | if !File.exists?(filename) && entry = Plotline::Entry.find_by(slug: slug)
19 | log " \e[31mFile removed, deleting entry\e[0m \e[32m##{entry.id}\e[0m"
20 | entry.destroy
21 | return
22 | end
23 |
24 | full_contents = File.read(filename)
25 | full_contents = convert_relative_image_paths(filename, full_contents)
26 |
27 | meta, contents = extract_metadata_from_contents(full_contents)
28 |
29 | if meta['type'].blank?
30 | raise "\e[31mMissing 'type' attribute in #{filename}\e[0m"
31 | end
32 |
33 | klass = meta.delete('type').classify.constantize
34 | entry = klass.find_or_initialize_by(slug: slug)
35 |
36 | process_image_urls(full_contents)
37 | update_entry(entry, meta, date, contents, full_contents)
38 | end
39 |
40 | private
41 |
42 | # Turns markdown filename to date and slug, e.g.:
43 | # 2016-03-20_hello-world.md
44 | # results in:
45 | # ['2016-03-20', 'hello-world']
46 | #
47 | # If there's no date in the filename (e.g. when file is a draft),
48 | # only slug will be returned and date will be nil.
49 | def filename_to_date_and_slug(filename)
50 | date, slug = File.basename(filename, ".*").split(FILENAME_SPLIT_PATTERN).reject { |m| m.blank? }
51 | if slug.blank?
52 | slug = date
53 | date = nil
54 | end
55 |
56 | [date, slug]
57 | end
58 |
59 | def extract_metadata_from_contents(contents)
60 | if result = contents.match(FRONT_MATTER_PATTERN)
61 | contents = contents[(result[0].length)...(contents.length)]
62 | meta = YAML.safe_load(result[0], [Date])
63 | else
64 | meta = {}
65 | end
66 |
67 | [meta, contents]
68 | end
69 |
70 | # Converts relative image paths found in markdown files
71 | # to the target path in app/public
72 | def convert_relative_image_paths(filename, contents)
73 | entry_file_dir = File.dirname(filename)
74 |
75 | contents.gsub(/(\.\.?\/.+\.(?:jpe?g|gif|png|mp4|mov|wmv|avi))/) do
76 | absolute_path = File.expand_path(File.join(entry_file_dir, $1))
77 | '/uploads' + absolute_path.gsub(@runner.source_dir, '')
78 | end
79 | end
80 |
81 | def process_image_urls(contents)
82 | URI.extract(contents).select{ |url| url[/\.(?:jpe?g|png|gif)\b/i] }.each do |url|
83 | Plotline::Image.find_or_create_by(image: url)
84 | end
85 | end
86 |
87 | def update_entry(entry, meta, date, contents, full_contents)
88 | checksum = Digest::MD5.hexdigest(full_contents)
89 | if entry.checksum == checksum
90 | log " File unchanged, skipping."
91 | return
92 | end
93 |
94 | draft = !!meta.delete('draft')
95 | entry.status = draft ? :draft : :published
96 |
97 | entry.assign_attributes(meta.merge(
98 | body: contents,
99 | checksum: checksum,
100 | published_at: (Date.parse(date) if date && !draft)
101 | ))
102 |
103 | dump_log(entry, meta)
104 |
105 | unless entry.save
106 | dump_errors(entry)
107 | end
108 | rescue ActiveModel::UnknownAttributeError => e
109 | log "\e[31mERROR: #{e.message}\e[0m"
110 | end
111 |
112 | def dump_log(entry, meta)
113 | log "\e[32m#{entry.class.name}:\e[0m"
114 | meta.each do |k, v|
115 | log " \e[32m#{k}:\e[0m #{v}"
116 | end
117 | log " \e[32mslug:\e[0m #{entry.slug}"
118 | log " \e[32mdraft:\e[0m #{entry.draft?}"
119 | log " \e[32mpublished_at:\e[0m #{entry.published_at}"
120 | log " \e[32mbody:\e[0m #{entry.body[0..100].gsub("\n", " ")}..."
121 | end
122 |
123 | def dump_errors(entry)
124 | log "\e[31mERROR: #{entry.class.name} could not be saved!\e[0m"
125 | entry.errors.each do |attr, error|
126 | log " \e[31m#{attr}:\e[0m #{error}"
127 | end
128 | end
129 | end
130 | end
131 | end
132 | end
133 |
--------------------------------------------------------------------------------
/lib/plotline/import/handlers/video_file.rb:
--------------------------------------------------------------------------------
1 | module Plotline
2 | module Import
3 | module Handlers
4 | class VideoFile < Base
5 | IMAGE_EXTENSIONS = %w(mov mp4 avi wmv).freeze
6 |
7 | def supported_file?(filename)
8 | IMAGE_EXTENSIONS.include?(File.extname(filename).gsub('.', ''))
9 | end
10 |
11 | def import(filename)
12 | log "\e[34mImporting:\e[0m #{filename}"
13 |
14 | if !File.exists?(filename)
15 | log "FILE REMOVED"
16 | return
17 | end
18 |
19 | dst = filename.gsub(@runner.source_dir, @runner.uploads_dir)
20 |
21 | FileUtils.mkdir_p(File.dirname(dst))
22 | FileUtils.cp(filename, dst)
23 | end
24 | end
25 | end
26 | end
27 | end
28 |
--------------------------------------------------------------------------------
/lib/plotline/import/runner.rb:
--------------------------------------------------------------------------------
1 | module Plotline
2 | module Import
3 | class UnsupportedFileType < StandardError; end
4 |
5 | class Runner
6 | HANDLERS = [
7 | Plotline::Import::Handlers::MarkdownFile,
8 | Plotline::Import::Handlers::ImageFile,
9 | Plotline::Import::Handlers::VideoFile
10 | ].freeze
11 |
12 | # So far this includes only the annoying Icon\r file on OSX, which
13 | # is hidden, but it's not a dotfile, so Dir lookup doesn't ignore it...
14 | #
15 | # This file appears when a directory has a custom icon (e.g shared
16 | # dropbox folder).
17 | IGNORED_FILES = [
18 | "Icon\r"
19 | ].freeze
20 |
21 | attr_reader :source_dir, :target_dir, :public_dir, :uploads_dir
22 |
23 | def initialize(source_dir, target_dir)
24 | @source_dir = source_dir
25 | @target_dir = target_dir
26 | @public_dir = target_dir + '/public'
27 | @uploads_dir = target_dir + '/public/uploads'
28 |
29 | @handlers = HANDLERS.map { |klass| klass.new(self) }
30 | end
31 |
32 | def import_all!
33 | process_files(Dir[@source_dir + '/**/*'])
34 | end
35 |
36 | def process_files(files)
37 | files.each do |filename|
38 | next if FileTest.directory?(filename)
39 | next if IGNORED_FILES.include?(File.basename(filename))
40 |
41 | handler_found = false
42 | @handlers.each do |handler|
43 | if handler.supported_file?(filename)
44 | handler.import(filename)
45 | handler_found = true
46 | end
47 | end
48 |
49 | raise UnsupportedFileType.new(filename) unless handler_found
50 | end
51 | end
52 | end
53 | end
54 | end
55 |
--------------------------------------------------------------------------------
/lib/plotline/version.rb:
--------------------------------------------------------------------------------
1 | module Plotline
2 | VERSION = "0.1.1"
3 | end
4 |
--------------------------------------------------------------------------------
/lib/tasks/plotline_tasks.rake:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pch/plotline-old/9feecd78368cdfd0088cc3d1b40dca1514535ba8/lib/tasks/plotline_tasks.rake
--------------------------------------------------------------------------------
/plotline.gemspec:
--------------------------------------------------------------------------------
1 | $:.push File.expand_path("../lib", __FILE__)
2 |
3 | # Maintain your gem's version:
4 | require "plotline/version"
5 |
6 | # Describe your gem and declare its dependencies:
7 | Gem::Specification.new do |s|
8 | s.name = "plotline"
9 | s.version = Plotline::VERSION
10 | s.authors = ["Piotr Chmolowski"]
11 | s.email = ["piotr@chmolowski.pl"]
12 | s.homepage = "https://github.com/pch/plotline"
13 | s.summary = "Markdown & Postres-based CMS engine for Rails."
14 | s.description = "Markdown & Postres-based CMS engine for Rails."
15 | s.license = "MIT"
16 |
17 | s.required_ruby_version = ">= 2.3.0"
18 |
19 | s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]
20 | s.test_files = Dir["test/**/*"]
21 |
22 | s.executables = ["plotline"]
23 |
24 | s.add_dependency "rails", "~> 5.0.0.1"
25 | s.add_dependency "bcrypt", "~> 3.1.7"
26 | s.add_dependency "sass-rails", "~> 5.0"
27 |
28 | s.add_dependency "jquery-rails"
29 | s.add_dependency "autoprefixer-rails"
30 | s.add_dependency "bourbon"
31 |
32 | # Files & images
33 | s.add_dependency "fastimage"
34 | s.add_dependency "exiftool"
35 |
36 | # Markdown
37 | s.add_dependency "rdiscount"
38 |
39 | # File sync
40 | s.add_dependency "commander"
41 | s.add_dependency "listen"
42 |
43 | s.add_development_dependency "pg"
44 | end
45 |
--------------------------------------------------------------------------------
/test/controllers/plotline/dashboard_controller_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | module Plotline
4 | class DashboardControllerTest < ActionController::TestCase
5 | setup do
6 | @routes = Engine.routes
7 | Plotline::DashboardController.any_instance.stubs(:current_user).returns(User.new)
8 | end
9 |
10 | test "should get index" do
11 | get :index
12 | assert_response :success
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/test/controllers/plotline/entries_controller_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | module Plotline
4 | class EntriesControllerTest < ActionController::TestCase
5 | setup do
6 | @entry = plotline_entries(:sample)
7 | @routes = Engine.routes
8 |
9 | EntriesController.any_instance.stubs(:current_user).returns(Plotline::User.new)
10 | end
11 |
12 | test "should redirect to sign_in_url if not logged in" do
13 | EntriesController.any_instance.stubs(:current_user).returns(nil)
14 |
15 | get :index, params: { content_class: 'BlogPost' }
16 | assert_redirected_to '/plotline/sign-in'
17 | end
18 |
19 | test "should get index" do
20 | get :index, params: { content_class: 'BlogPost' }
21 | assert_response :success
22 | assert_not_nil assigns(:entries)
23 | end
24 |
25 | test "should show entry" do
26 | get :show, params: { id: @entry, content_class: 'BlogPost' }
27 | assert_response :success
28 | end
29 |
30 | test "should destroy entry" do
31 | assert_difference('Entry.count', -1) do
32 | delete :destroy, params: { content_class: 'BlogPost', id: @entry }
33 | end
34 |
35 | assert_redirected_to entries_path(content_class: 'blog_posts')
36 | end
37 | end
38 | end
39 |
--------------------------------------------------------------------------------
/test/dummy/README.rdoc:
--------------------------------------------------------------------------------
1 | == README
2 |
3 | This README would normally document whatever steps are necessary to get the
4 | application up and running.
5 |
6 | Things you may want to cover:
7 |
8 | * Ruby version
9 |
10 | * System dependencies
11 |
12 | * Configuration
13 |
14 | * Database creation
15 |
16 | * Database initialization
17 |
18 | * How to run the test suite
19 |
20 | * Services (job queues, cache servers, search engines, etc.)
21 |
22 | * Deployment instructions
23 |
24 | * ...
25 |
26 |
27 | Please feel free to use a different markup language if you do not plan to run
28 | rake doc:app.
29 |
--------------------------------------------------------------------------------
/test/dummy/Rakefile:
--------------------------------------------------------------------------------
1 | # Add your own tasks in files placed in lib/tasks ending in .rake,
2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3 |
4 | require File.expand_path('../config/application', __FILE__)
5 |
6 | Rails.application.load_tasks
7 |
--------------------------------------------------------------------------------
/test/dummy/app/assets/images/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pch/plotline-old/9feecd78368cdfd0088cc3d1b40dca1514535ba8/test/dummy/app/assets/images/.keep
--------------------------------------------------------------------------------
/test/dummy/app/assets/javascripts/application.js:
--------------------------------------------------------------------------------
1 | // This is a manifest file that'll be compiled into application.js, which will include all the files
2 | // listed below.
3 | //
4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5 | // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6 | //
7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8 | // compiled file.
9 | //
10 | // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11 | // about supported directives.
12 | //
13 | //= require_tree .
14 |
--------------------------------------------------------------------------------
/test/dummy/app/assets/stylesheets/application.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This is a manifest file that'll be compiled into application.css, which will include all the files
3 | * listed below.
4 | *
5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6 | * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7 | *
8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9 | * compiled file so the styles you add here take precedence over styles defined in any styles
10 | * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11 | * file per style scope.
12 | *
13 | *= require_tree .
14 | *= require_self
15 | */
16 |
--------------------------------------------------------------------------------
/test/dummy/app/controllers/application_controller.rb:
--------------------------------------------------------------------------------
1 | class ApplicationController < ActionController::Base
2 | # Prevent CSRF attacks by raising an exception.
3 | # For APIs, you may want to use :null_session instead.
4 | protect_from_forgery with: :exception
5 | end
6 |
--------------------------------------------------------------------------------
/test/dummy/app/controllers/concerns/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pch/plotline-old/9feecd78368cdfd0088cc3d1b40dca1514535ba8/test/dummy/app/controllers/concerns/.keep
--------------------------------------------------------------------------------
/test/dummy/app/helpers/application_helper.rb:
--------------------------------------------------------------------------------
1 | module ApplicationHelper
2 | end
3 |
--------------------------------------------------------------------------------
/test/dummy/app/mailers/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pch/plotline-old/9feecd78368cdfd0088cc3d1b40dca1514535ba8/test/dummy/app/mailers/.keep
--------------------------------------------------------------------------------
/test/dummy/app/models/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pch/plotline-old/9feecd78368cdfd0088cc3d1b40dca1514535ba8/test/dummy/app/models/.keep
--------------------------------------------------------------------------------
/test/dummy/app/models/concerns/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pch/plotline-old/9feecd78368cdfd0088cc3d1b40dca1514535ba8/test/dummy/app/models/concerns/.keep
--------------------------------------------------------------------------------
/test/dummy/app/views/layouts/application.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Dummy
5 | <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6 | <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
7 | <%= csrf_meta_tags %>
8 |
9 |
10 |
11 | <%= yield %>
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/test/dummy/bin/bundle:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3 | load Gem.bin_path('bundler', 'bundle')
4 |
--------------------------------------------------------------------------------
/test/dummy/bin/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | APP_PATH = File.expand_path('../../config/application', __FILE__)
3 | require_relative '../config/boot'
4 | require 'rails/commands'
5 |
--------------------------------------------------------------------------------
/test/dummy/bin/rake:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require_relative '../config/boot'
3 | require 'rake'
4 | Rake.application.run
5 |
--------------------------------------------------------------------------------
/test/dummy/bin/setup:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require 'pathname'
3 |
4 | # path to your application root.
5 | APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
6 |
7 | Dir.chdir APP_ROOT do
8 | # This script is a starting point to setup your application.
9 | # Add necessary setup steps to this file:
10 |
11 | puts "== Installing dependencies =="
12 | system "gem install bundler --conservative"
13 | system "bundle check || bundle install"
14 |
15 | # puts "\n== Copying sample files =="
16 | # unless File.exist?("config/database.yml")
17 | # system "cp config/database.yml.sample config/database.yml"
18 | # end
19 |
20 | puts "\n== Preparing database =="
21 | system "bin/rake db:setup"
22 |
23 | puts "\n== Removing old logs and tempfiles =="
24 | system "rm -f log/*"
25 | system "rm -rf tmp/cache"
26 |
27 | puts "\n== Restarting application server =="
28 | system "touch tmp/restart.txt"
29 | end
30 |
--------------------------------------------------------------------------------
/test/dummy/config.ru:
--------------------------------------------------------------------------------
1 | # This file is used by Rack-based servers to start the application.
2 |
3 | require ::File.expand_path('../config/environment', __FILE__)
4 | run Rails.application
5 |
--------------------------------------------------------------------------------
/test/dummy/config/application.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../boot', __FILE__)
2 |
3 | require 'rails/all'
4 |
5 | Bundler.require(*Rails.groups)
6 | require "plotline"
7 |
8 | module Dummy
9 | class Application < Rails::Application
10 | # Settings in config/environments/* take precedence over those specified here.
11 | # Application configuration should go into files in config/initializers
12 | # -- all .rb files in that directory are automatically loaded.
13 |
14 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
15 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
16 | # config.time_zone = 'Central Time (US & Canada)'
17 |
18 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
19 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
20 | # config.i18n.default_locale = :de
21 | end
22 | end
23 |
24 |
--------------------------------------------------------------------------------
/test/dummy/config/boot.rb:
--------------------------------------------------------------------------------
1 | # Set up gems listed in the Gemfile.
2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3 |
4 | require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5 | $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
6 |
--------------------------------------------------------------------------------
/test/dummy/config/database.yml:
--------------------------------------------------------------------------------
1 | # PostgreSQL. Versions 8.2 and up are supported.
2 | #
3 | # Install the pg driver:
4 | # gem install pg
5 | # On OS X with Homebrew:
6 | # gem install pg -- --with-pg-config=/usr/local/bin/pg_config
7 | # On OS X with MacPorts:
8 | # gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
9 | # On Windows:
10 | # gem install pg
11 | # Choose the win32 build.
12 | # Install PostgreSQL and put its /bin directory on your path.
13 | #
14 | # Configure Using Gemfile
15 | # gem 'pg'
16 | #
17 | default: &default
18 | adapter: postgresql
19 | encoding: unicode
20 | # For details on connection pooling, see rails configuration guide
21 | # http://guides.rubyonrails.org/configuring.html#database-pooling
22 | pool: 5
23 |
24 | development:
25 | <<: *default
26 | database: dummy_development
27 |
28 | # The specified database role being used to connect to postgres.
29 | # To create additional roles in postgres see `$ createuser --help`.
30 | # When left blank, postgres will use the default role. This is
31 | # the same name as the operating system user that initialized the database.
32 | #username: dummy
33 |
34 | # The password associated with the postgres role (username).
35 | #password:
36 |
37 | # Connect on a TCP socket. Omitted by default since the client uses a
38 | # domain socket that doesn't need configuration. Windows does not have
39 | # domain sockets, so uncomment these lines.
40 | #host: localhost
41 |
42 | # The TCP port the server listens on. Defaults to 5432.
43 | # If your server runs on a different port number, change accordingly.
44 | #port: 5432
45 |
46 | # Schema search path. The server defaults to $user,public
47 | #schema_search_path: myapp,sharedapp,public
48 |
49 | # Minimum log levels, in increasing order:
50 | # debug5, debug4, debug3, debug2, debug1,
51 | # log, notice, warning, error, fatal, and panic
52 | # Defaults to warning.
53 | #min_messages: notice
54 |
55 | # Warning: The database defined as "test" will be erased and
56 | # re-generated from your development database when you run "rake".
57 | # Do not set this db to the same as development or production.
58 | test:
59 | <<: *default
60 | database: dummy_test
61 |
62 | # As with config/secrets.yml, you never want to store sensitive information,
63 | # like your database password, in your source code. If your source code is
64 | # ever seen by anyone, they now have access to your database.
65 | #
66 | # Instead, provide the password as a unix environment variable when you boot
67 | # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
68 | # for a full rundown on how to provide these environment variables in a
69 | # production deployment.
70 | #
71 | # On Heroku and other platform providers, you may have a full connection URL
72 | # available as an environment variable. For example:
73 | #
74 | # DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
75 | #
76 | # You can use this database configuration with:
77 | #
78 | # production:
79 | # url: <%= ENV['DATABASE_URL'] %>
80 | #
81 | production:
82 | <<: *default
83 | database: dummy_production
84 | username: dummy
85 | password: <%= ENV['DUMMY_DATABASE_PASSWORD'] %>
86 |
--------------------------------------------------------------------------------
/test/dummy/config/environment.rb:
--------------------------------------------------------------------------------
1 | # Load the Rails application.
2 | require File.expand_path('../application', __FILE__)
3 |
4 | # Initialize the Rails application.
5 | Rails.application.initialize!
6 |
--------------------------------------------------------------------------------
/test/dummy/config/environments/development.rb:
--------------------------------------------------------------------------------
1 | Rails.application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # In the development environment your application's code is reloaded on
5 | # every request. This slows down response time but is perfect for development
6 | # since you don't have to restart the web server when you make code changes.
7 | config.cache_classes = false
8 |
9 | # Do not eager load code on boot.
10 | config.eager_load = false
11 |
12 | # Show full error reports and disable caching.
13 | config.consider_all_requests_local = true
14 | config.action_controller.perform_caching = false
15 |
16 | # Don't care if the mailer can't send.
17 | config.action_mailer.raise_delivery_errors = false
18 |
19 | # Print deprecation notices to the Rails logger.
20 | config.active_support.deprecation = :log
21 |
22 | # Raise an error on page load if there are pending migrations.
23 | config.active_record.migration_error = :page_load
24 |
25 | # Debug mode disables concatenation and preprocessing of assets.
26 | # This option may cause significant delays in view rendering with a large
27 | # number of complex assets.
28 | config.assets.debug = true
29 |
30 | # Asset digests allow you to set far-future HTTP expiration dates on all assets,
31 | # yet still be able to expire them through the digest params.
32 | config.assets.digest = true
33 |
34 | # Adds additional error checking when serving assets at runtime.
35 | # Checks for improperly declared sprockets dependencies.
36 | # Raises helpful error messages.
37 | config.assets.raise_runtime_errors = true
38 |
39 | # Raises error for missing translations
40 | # config.action_view.raise_on_missing_translations = true
41 | end
42 |
--------------------------------------------------------------------------------
/test/dummy/config/environments/production.rb:
--------------------------------------------------------------------------------
1 | Rails.application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # Code is not reloaded between requests.
5 | config.cache_classes = true
6 |
7 | # Eager load code on boot. This eager loads most of Rails and
8 | # your application in memory, allowing both threaded web servers
9 | # and those relying on copy on write to perform better.
10 | # Rake tasks automatically ignore this option for performance.
11 | config.eager_load = true
12 |
13 | # Full error reports are disabled and caching is turned on.
14 | config.consider_all_requests_local = false
15 | config.action_controller.perform_caching = true
16 |
17 | # Enable Rack::Cache to put a simple HTTP cache in front of your application
18 | # Add `rack-cache` to your Gemfile before enabling this.
19 | # For large-scale production use, consider using a caching reverse proxy like
20 | # NGINX, varnish or squid.
21 | # config.action_dispatch.rack_cache = true
22 |
23 | # Disable serving static files from the `/public` folder by default since
24 | # Apache or NGINX already handles this.
25 | config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
26 |
27 | # Compress JavaScripts and CSS.
28 | config.assets.js_compressor = :uglifier
29 | # config.assets.css_compressor = :sass
30 |
31 | # Do not fallback to assets pipeline if a precompiled asset is missed.
32 | config.assets.compile = false
33 |
34 | # Asset digests allow you to set far-future HTTP expiration dates on all assets,
35 | # yet still be able to expire them through the digest params.
36 | config.assets.digest = true
37 |
38 | # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
39 |
40 | # Specifies the header that your server uses for sending files.
41 | # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
42 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
43 |
44 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
45 | # config.force_ssl = true
46 |
47 | # Use the lowest log level to ensure availability of diagnostic information
48 | # when problems arise.
49 | config.log_level = :debug
50 |
51 | # Prepend all log lines with the following tags.
52 | # config.log_tags = [ :subdomain, :uuid ]
53 |
54 | # Use a different logger for distributed setups.
55 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
56 |
57 | # Use a different cache store in production.
58 | # config.cache_store = :mem_cache_store
59 |
60 | # Enable serving of images, stylesheets, and JavaScripts from an asset server.
61 | # config.action_controller.asset_host = 'http://assets.example.com'
62 |
63 | # Ignore bad email addresses and do not raise email delivery errors.
64 | # Set this to true and configure the email server for immediate delivery to raise delivery errors.
65 | # config.action_mailer.raise_delivery_errors = false
66 |
67 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
68 | # the I18n.default_locale when a translation cannot be found).
69 | config.i18n.fallbacks = true
70 |
71 | # Send deprecation notices to registered listeners.
72 | config.active_support.deprecation = :notify
73 |
74 | # Use default logging formatter so that PID and timestamp are not suppressed.
75 | config.log_formatter = ::Logger::Formatter.new
76 |
77 | # Do not dump schema after migrations.
78 | config.active_record.dump_schema_after_migration = false
79 | end
80 |
--------------------------------------------------------------------------------
/test/dummy/config/environments/test.rb:
--------------------------------------------------------------------------------
1 | Rails.application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # The test environment is used exclusively to run your application's
5 | # test suite. You never need to work with it otherwise. Remember that
6 | # your test database is "scratch space" for the test suite and is wiped
7 | # and recreated between test runs. Don't rely on the data there!
8 | config.cache_classes = true
9 |
10 | # Do not eager load code on boot. This avoids loading your whole application
11 | # just for the purpose of running a single test. If you are using a tool that
12 | # preloads Rails for running tests, you may have to set it to true.
13 | config.eager_load = false
14 |
15 | # Configure static file server for tests with Cache-Control for performance.
16 | config.public_file_server.enabled = true
17 | config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
18 |
19 | # Show full error reports and disable caching.
20 | config.consider_all_requests_local = true
21 | config.action_controller.perform_caching = false
22 |
23 | # Raise exceptions instead of rendering exception templates.
24 | config.action_dispatch.show_exceptions = false
25 |
26 | # Disable request forgery protection in test environment.
27 | config.action_controller.allow_forgery_protection = false
28 |
29 | # Tell Action Mailer not to deliver emails to the real world.
30 | # The :test delivery method accumulates sent emails in the
31 | # ActionMailer::Base.deliveries array.
32 | config.action_mailer.delivery_method = :test
33 |
34 | # Randomize the order test cases are executed.
35 | config.active_support.test_order = :random
36 |
37 | # Print deprecation notices to the stderr.
38 | config.active_support.deprecation = :stderr
39 |
40 | # Raises error for missing translations
41 | # config.action_view.raise_on_missing_translations = true
42 | end
43 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/assets.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Version of your assets, change this if you want to expire all your assets.
4 | Rails.application.config.assets.version = '1.0'
5 |
6 | # Add additional assets to the asset load path
7 | # Rails.application.config.assets.paths << Emoji.images_path
8 |
9 | # Precompile additional assets.
10 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
11 | # Rails.application.config.assets.precompile += %w( search.js )
12 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/backtrace_silencers.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5 |
6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7 | # Rails.backtrace_cleaner.remove_silencers!
8 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/cookies_serializer.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | Rails.application.config.action_dispatch.cookies_serializer = :json
4 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/filter_parameter_logging.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Configure sensitive parameters which will be filtered from the log file.
4 | Rails.application.config.filter_parameters += [:password]
5 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/inflections.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new inflection rules using the following format. Inflections
4 | # are locale specific, and you may define rules for as many different
5 | # locales as you wish. All of these examples are active by default:
6 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
7 | # inflect.plural /^(ox)$/i, '\1en'
8 | # inflect.singular /^(ox)en/i, '\1'
9 | # inflect.irregular 'person', 'people'
10 | # inflect.uncountable %w( fish sheep )
11 | # end
12 |
13 | # These inflection rules are supported but not enabled by default:
14 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
15 | # inflect.acronym 'RESTful'
16 | # end
17 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/mime_types.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new mime types for use in respond_to blocks:
4 | # Mime::Type.register "text/richtext", :rtf
5 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/session_store.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | Rails.application.config.session_store :cookie_store, key: '_dummy_session'
4 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/wrap_parameters.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # This file contains settings for ActionController::ParamsWrapper which
4 | # is enabled by default.
5 |
6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7 | ActiveSupport.on_load(:action_controller) do
8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9 | end
10 |
11 | # To enable root element in JSON for ActiveRecord objects.
12 | # ActiveSupport.on_load(:active_record) do
13 | # self.include_root_in_json = true
14 | # end
15 |
--------------------------------------------------------------------------------
/test/dummy/config/locales/en.yml:
--------------------------------------------------------------------------------
1 | # Files in the config/locales directory are used for internationalization
2 | # and are automatically loaded by Rails. If you want to use locales other
3 | # than English, add the necessary files in this directory.
4 | #
5 | # To use the locales, use `I18n.t`:
6 | #
7 | # I18n.t 'hello'
8 | #
9 | # In views, this is aliased to just `t`:
10 | #
11 | # <%= t('hello') %>
12 | #
13 | # To use a different locale, set it with `I18n.locale`:
14 | #
15 | # I18n.locale = :es
16 | #
17 | # This would use the information in config/locales/es.yml.
18 | #
19 | # To learn more, please read the Rails Internationalization guide
20 | # available at http://guides.rubyonrails.org/i18n.html.
21 |
22 | en:
23 | hello: "Hello world"
24 |
--------------------------------------------------------------------------------
/test/dummy/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 |
3 | mount Plotline::Engine => "/plotline"
4 | end
5 |
--------------------------------------------------------------------------------
/test/dummy/config/secrets.yml:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Your secret key is used for verifying the integrity of signed cookies.
4 | # If you change this key, all old signed cookies will become invalid!
5 |
6 | # Make sure the secret is at least 30 characters and all random,
7 | # no regular words or you'll be exposed to dictionary attacks.
8 | # You can use `rake secret` to generate a secure secret key.
9 |
10 | # Make sure the secrets in this file are kept private
11 | # if you're sharing your code publicly.
12 |
13 | development:
14 | secret_key_base: d115a59538da40cbb706d0a5bb1e8d93866e15706d1bd2243c8392c157d6fc2441f70169ea976fad1251f5d9041ddae016bdf6078be3b64ab625caf52e27b3f5
15 |
16 | test:
17 | secret_key_base: e277020d8b02c126c12f0658bd48d3547476d78d12dced1da79a532d7c6424338bb18ae423a38c1b9f7eaac4b475b5c61857b47dac87ebe9f7dbf134b118d985
18 |
19 | # Do not keep production secrets in the repository,
20 | # instead read values from the environment.
21 | production:
22 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
23 |
--------------------------------------------------------------------------------
/test/dummy/db/schema.rb:
--------------------------------------------------------------------------------
1 | # encoding: UTF-8
2 | # This file is auto-generated from the current state of the database. Instead
3 | # of editing this file, please use the migrations feature of Active Record to
4 | # incrementally modify your database, and then regenerate this schema definition.
5 | #
6 | # Note that this schema.rb definition is the authoritative source for your
7 | # database schema. If you need to create the application database on another
8 | # system, you should be using db:schema:load, not running all the migrations
9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10 | # you'll amass, the slower it'll run and the greater likelihood for issues).
11 | #
12 | # It's strongly recommended that you check this file into your version control system.
13 |
14 | ActiveRecord::Schema.define(version: 20160224161843) do
15 |
16 | # These are extensions that must be enabled in order to support this database
17 | enable_extension "plpgsql"
18 |
19 | create_table "plotline_entries", force: :cascade do |t|
20 | t.string "type"
21 | t.string "title"
22 | t.string "slug"
23 | t.text "body"
24 | t.json "payload"
25 | t.datetime "published_at"
26 | t.integer "status", default: 0
27 | t.text "tags", default: [], array: true
28 | t.integer "parent_id"
29 | t.string "checksum"
30 | t.datetime "created_at", null: false
31 | t.datetime "updated_at", null: false
32 | t.index ["parent_id"], name: "index_plotline_entries_on_parent_id", using: :btree
33 | t.index ["slug"], name: "index_plotline_entries_on_slug", using: :btree
34 | t.index ["status"], name: "index_plotline_entries_on_status", using: :btree
35 | t.index ["tags"], name: "index_plotline_entries_on_tags", using: :gin
36 | t.index ["type"], name: "index_plotline_entries_on_type", using: :btree
37 | end
38 |
39 | create_table "plotline_entry_search_data", force: :cascade do |t|
40 | t.integer "entry_id"
41 | t.string "attr_name"
42 | t.tsvector "search_data"
43 | t.text "raw_data"
44 | t.datetime "created_at", null: false
45 | t.datetime "updated_at", null: false
46 | t.index ["entry_id"], name: "index_plotline_entry_search_data_on_entry_id", using: :btree
47 | t.index ["search_data"], name: "idx_search_data", using: :gin
48 | end
49 |
50 | create_table "plotline_images", force: :cascade do |t|
51 | t.string "image"
52 | t.integer "width"
53 | t.integer "height"
54 | t.float "ratio"
55 | t.integer "file_size"
56 | t.string "content_type"
57 | t.json "exif"
58 | t.datetime "created_at"
59 | t.datetime "updated_at"
60 | end
61 |
62 | create_table "plotline_users", force: :cascade do |t|
63 | t.string "email"
64 | t.string "name"
65 | t.string "password_digest"
66 | t.string "auth_token"
67 | t.datetime "created_at", null: false
68 | t.datetime "updated_at", null: false
69 | end
70 |
71 | end
72 |
--------------------------------------------------------------------------------
/test/dummy/lib/assets/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pch/plotline-old/9feecd78368cdfd0088cc3d1b40dca1514535ba8/test/dummy/lib/assets/.keep
--------------------------------------------------------------------------------
/test/dummy/log/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pch/plotline-old/9feecd78368cdfd0088cc3d1b40dca1514535ba8/test/dummy/log/.keep
--------------------------------------------------------------------------------
/test/dummy/public/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | The page you were looking for doesn't exist (404)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
The page you were looking for doesn't exist.
62 |
You may have mistyped the address or the page may have moved.
63 |
64 |
If you are the application owner check the logs for more information.