2 | <%= SecureRandom.hex %> generated at <%= Time.now %>
3 |
4 | <% content_for :footer_stuff do %>
5 | And this is some random footer stuff also from rails
6 | <% end %>
--------------------------------------------------------------------------------
/example/app/views/home/index.html.erb:
--------------------------------------------------------------------------------
1 | This is plain rails no volt
2 |
--------------------------------------------------------------------------------
/example/app/views/layouts/volt.html.erb:
--------------------------------------------------------------------------------
1 | <%= volt_layout %>
2 |
--------------------------------------------------------------------------------
/example/app/views/random/index.html.erb:
--------------------------------------------------------------------------------
1 |
Here is a random string
2 | <%= SecureRandom.hex %> generated at <%= Time.now %>
3 |
4 | <% content_for :footer_stuff do %>
5 | And this is some random footer stuff also from rails
6 | <% end %>
--------------------------------------------------------------------------------
/example/app/voltage/.gitignore:
--------------------------------------------------------------------------------
1 | .bundle
2 | .config
3 | .yardoc
4 | tmp
5 | .idea
6 | .yardoc
7 | .sass-cache
8 | .DS_Store
9 | compiled
--------------------------------------------------------------------------------
/example/app/voltage/Gemfile:
--------------------------------------------------------------------------------
1 | source 'https://rubygems.org'
2 |
3 | gem 'volt', '0.9.0.pre5'
4 |
5 | # The following gem's are optional for themeing
6 | # Twitter bootstrap
7 | gem 'volt-bootstrap', '~> 0.0.10'
8 |
9 | # Simple theme for bootstrap, remove to theme yourself.
10 | gem 'volt-bootstrap_jumbotron_theme', '~> 0.1.0'
11 |
12 | # User templates for login, signup, and logout menu.
13 | gem 'volt-user_templates', '~> 0.1.3'
14 |
15 | group :development, :test do
16 | # Testing dependencies
17 | gem 'rspec', '~> 3.2.0'
18 | gem 'opal-rspec', '~> 0.4.2'
19 | gem 'capybara', '~> 2.4.2'
20 | gem 'selenium-webdriver', '~> 2.43.0'
21 | gem 'chromedriver2-helper', '~> 0.0.8'
22 | gem 'poltergeist', '~> 1.5.0'
23 | end
24 |
25 | # Server for MRI
26 | platform :mri do
27 | gem 'thin', '~> 1.6.0'
28 | gem 'bson_ext', '~> 1.9.0'
29 | end
30 |
--------------------------------------------------------------------------------
/example/app/voltage/README.md:
--------------------------------------------------------------------------------
1 | # Place your app's docs here.
2 |
3 | ## New to Volt?
4 | Be sure to read the volt docs at http://docs.voltframework.com
--------------------------------------------------------------------------------
/example/app/voltage/app/main/assets/css/app.css.scss:
--------------------------------------------------------------------------------
1 | // Place your apps css here
--------------------------------------------------------------------------------
/example/app/voltage/app/main/config/dependencies.rb:
--------------------------------------------------------------------------------
1 | # Specify which components you wish to include when
2 | # the "home" component loads.
3 |
4 | # bootstrap css framework
5 | component 'bootstrap'
6 |
7 | # a default theme for the bootstrap framework
8 | component 'bootstrap_jumbotron_theme'
9 |
10 | # provides templates for login, signup, and logout
11 | component 'user_templates'
12 |
--------------------------------------------------------------------------------
/example/app/voltage/app/main/config/routes.rb:
--------------------------------------------------------------------------------
1 | # See https://github.com/voltrb/volt#routes for more info on routes
2 |
3 | client '/about', action: 'about'
4 |
5 | # Routes for login and signup, provided by user_templates component gem
6 | client '/signup', component: 'user_templates', controller: 'signup'
7 | client '/login', component: 'user_templates', controller: 'login'
8 |
9 | # The main route, this should be last. It will match any params not
10 | # previously matched.
11 | client '/', {}
12 |
--------------------------------------------------------------------------------
/example/app/voltage/app/main/controllers/main_controller.rb:
--------------------------------------------------------------------------------
1 | # By default Volt generates this controller for your Main component
2 | module Main
3 | class MainController < Volt::ModelController
4 | def index
5 | # Add code for when the index view is loaded
6 | end
7 |
8 | def about
9 | # Add code for when the about view is loaded
10 | end
11 |
12 | def random
13 | # Add code for when the about view is loaded
14 | end
15 |
16 | class << self
17 | def start_watcher(&block)
18 | puts 'inside start_watcher'
19 | block.watch! unless @watcher_running
20 | @watcher_running = true
21 | end
22 | end
23 |
24 | def initialize
25 | puts 'initializing main'
26 | super
27 | puts 'after super'
28 | MainController.start_watcher do
29 | puts 'in here'
30 | unless page._last_valid_path
31 | puts 'first time in start watcher'
32 | page._last_valid_path = url.path
33 | page._rails_content = `$(document)`
34 | end
35 | url_path = url.path # we don't want it changing while we are waiting
36 | if page._last_valid_path != url.path
37 | puts 'url.path changed'
38 | HTTP.get("#{url_path}?_volt_update=true") do |response|
39 | if response.ok?
40 | page._last_valid_path = url_path
41 | puts "response okay, page changed!"
42 | body = response.body
43 | page._rails_content = `$('').append($.parseHTML(body, true))`
44 | puts "now @rails_content = #{page._rails_content}"
45 | end
46 | puts "last valid path now = #{page._last_valid_path}"
47 | end
48 | end
49 | end
50 | end
51 |
52 | def content_for(tag = :layout)
53 | the_rails_content = page._rails_content
54 | tag = "#rails_content_#{tag}"
55 | # Element.find(tag, the_rails_content)
56 | raw `$(#{tag}, #{the_rails_content})`.html
57 | end
58 |
59 | private
60 |
61 | # The main template contains a #template binding that shows another
62 | # template. This is the path to that template. It may change based
63 | # on the params._controller and params._action values.
64 | def main_path
65 | params._controller || 'main' + '/' + (params._action || 'index')
66 | end
67 |
68 | # Determine if the current nav component is the active one by looking
69 | # at the first part of the url against the href attribute.
70 | def active_tab?
71 | url.path.split('/')[1] == attrs.href.split('/')[1]
72 | end
73 |
74 | end
75 | end
76 |
--------------------------------------------------------------------------------
/example/app/voltage/app/main/models/user.rb:
--------------------------------------------------------------------------------
1 | # By default Volt generates this User model which inherits from Volt::User,
2 | # you can rename this if you want.
3 | # Opal::Processor.source_map_enabled = true
4 | class User < Volt::User
5 | end
6 |
--------------------------------------------------------------------------------
/example/app/voltage/app/main/views/main/about.html:
--------------------------------------------------------------------------------
1 | <:Title>
2 | About
3 |
4 | <:Body>
5 |
29 |
30 |
--------------------------------------------------------------------------------
/example/app/voltage/app/main/views/main/random.html:
--------------------------------------------------------------------------------
1 | <:Title>
2 | Random
3 |
4 | <:Body>
5 | {{ content_for }}
6 | above is content_for (:layout by default)
7 | below is content_for :footer_stuff
8 | {{ content_for :footer_stuff }}
--------------------------------------------------------------------------------
/example/app/voltage/config.ru:
--------------------------------------------------------------------------------
1 | # Run via rack server
2 | require 'bundler/setup'
3 | require 'volt/server'
4 | run Volt::Server.new.app
5 |
--------------------------------------------------------------------------------
/example/app/voltage/config/app.rb:
--------------------------------------------------------------------------------
1 | # Opal::Processor.source_map_enabled = true
2 | Volt.configure do |config|
3 | # Setup your global app config here.
4 |
5 | # Your app secret is used for signing things like the user cookie so it can't
6 | # be tampered with. A random value is generated on new projects that will work
7 | # without the need to customize. Make sure this value doesn't leave your server.
8 | #
9 | # For added security we reccomend moving the app secret into an enviromnet. You can
10 | # setup that like so:
11 | #
12 | # config.app_secret = ENV['APP_SECRET']
13 | #
14 | config.app_secret = 'X2dhOHj9C22HFYhpUawozBDy0JGy-MvRXgrG-Q5ZqP_Ocp0YvBFML-2Iny-Tur1fxZk'
15 |
16 | # Data updates from the client come in via Tasks. The task dispatcher logs all calls to tasks.
17 | # By default hashes in the arguments can be filtered based on keys. So any hash with a key of
18 | # password will be filtered. You can add more fields to filter below:
19 | config.filter_keys = [:password]
20 |
21 | # Database config all start with db_ and can be set either in the config
22 | # file or with an environment variable (DB_NAME for example).
23 |
24 | # config.db_driver = 'mongo'
25 | # config.db_name = (config.app_name + '_' + Volt.env.to_s)
26 | # config.db_host = 'localhost'
27 | # config.db_port = 27017
28 |
29 | # Compression options
30 |
31 | # If you are not running behind something like nginx in production, you can
32 | # have rack deflate all files.
33 | # config.deflate = true
34 |
35 | # Public configurations
36 | # Anything under config.public will be sent to the client as well as the server,
37 | # so be sure no private data ends up under public
38 |
39 | # Use username instead of email as the login
40 | # config.public.auth.use_username = true
41 |
42 | end
--------------------------------------------------------------------------------
/example/app/voltage/config/base/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <% javascript_files.each do |javascript_file| %>
6 |
7 | <% end %>
8 |
9 | <% css_files.each do |css_file| %>
10 |
11 | <% end %>
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/example/app/voltage/spec/app/main/controllers/server/sample_http_controller_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | describe 'sample http controller test', type: :http_controller do
4 | # Specs here
5 | end
6 |
--------------------------------------------------------------------------------
/example/app/voltage/spec/app/main/integration/sample_integration_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | describe 'sample integration test', type: :feature do
4 | # An example integration spec, this will only be run if ENV['BROWSER'] is
5 | # specified. Current values for ENV['BROWSER'] are 'firefox' and 'phantom'
6 | it 'should load the page' do
7 | visit '/'
8 |
9 | expect(page).to have_content('Home')
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/example/app/voltage/spec/app/main/models/sample_model_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | describe "sample model" do
4 | # Specs here
5 | end
--------------------------------------------------------------------------------
/example/app/voltage/spec/app/main/tasks/sample_task_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | describe "sample task", type: :task do
4 | # Specs here
5 | end
--------------------------------------------------------------------------------
/example/app/voltage/spec/spec_helper.rb:
--------------------------------------------------------------------------------
1 | # Volt sets up rspec and capybara for testing.
2 | require 'volt/spec/setup'
3 | Volt.spec_setup
4 |
5 | RSpec.configure do |config|
6 | config.run_all_when_everything_filtered = true
7 | config.filter_run :focus
8 |
9 | # Run specs in random order to surface order dependencies. If you find an
10 | # order dependency and want to debug it, you can fix the order by providing
11 | # the seed, which is printed after each run.
12 | # --seed 1234
13 | config.order = 'random'
14 | end
15 |
--------------------------------------------------------------------------------
/example/bin/bundle:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3 | load Gem.bin_path('bundler', 'bundle')
4 |
--------------------------------------------------------------------------------
/example/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 |
--------------------------------------------------------------------------------
/example/bin/rake:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require_relative '../config/boot'
3 | require 'rake'
4 | Rake.application.run
5 |
--------------------------------------------------------------------------------
/example/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 |
--------------------------------------------------------------------------------
/example/bin/spring:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | # This file loads spring without using Bundler, in order to be fast.
4 | # It gets overwritten when you run the `spring binstub` command.
5 |
6 | unless defined?(Spring)
7 | require "rubygems"
8 | require "bundler"
9 |
10 | if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)
11 | Gem.paths = { "GEM_PATH" => [Bundler.bundle_path.to_s, *Gem.path].uniq }
12 | gem "spring", match[1]
13 | require "spring/binstub"
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/example/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 |
--------------------------------------------------------------------------------
/example/config/application.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../boot', __FILE__)
2 |
3 | require 'rails/all'
4 |
5 | # Require the gems listed in Gemfile, including any gems
6 | # you've limited to :test, :development, or :production.
7 | Bundler.require(*Rails.groups)
8 |
9 | module ThirdRailTestApp
10 | class Application < Rails::Application
11 | # Settings in config/environments/* take precedence over those specified here.
12 | # Application configuration should go into files in config/initializers
13 | # -- all .rb files in that directory are automatically loaded.
14 |
15 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
16 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
17 | # config.time_zone = 'Central Time (US & Canada)'
18 |
19 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
20 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
21 | # config.i18n.default_locale = :de
22 | end
23 | end
24 |
--------------------------------------------------------------------------------
/example/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 |
--------------------------------------------------------------------------------
/example/config/database.yml:
--------------------------------------------------------------------------------
1 | # SQLite version 3.x
2 | # gem install sqlite3
3 | #
4 | # Ensure the SQLite 3 gem is defined in your Gemfile
5 | # gem 'sqlite3'
6 | #
7 | default: &default
8 | adapter: sqlite3
9 | pool: 5
10 | timeout: 5000
11 |
12 | development:
13 | <<: *default
14 | database: db/development.sqlite3
15 |
16 | # Warning: The database defined as "test" will be erased and
17 | # re-generated from your development database when you run "rake".
18 | # Do not set this db to the same as development or production.
19 | test:
20 | <<: *default
21 | database: db/test.sqlite3
22 |
23 | production:
24 | <<: *default
25 | database: db/production.sqlite3
26 |
--------------------------------------------------------------------------------
/example/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 |
--------------------------------------------------------------------------------
/example/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 | # Adds additional error checking when serving assets at runtime.
31 | # Checks for improperly declared sprockets dependencies.
32 | # Raises helpful error messages.
33 | config.assets.raise_runtime_errors = true
34 |
35 | # Raises error for missing translations
36 | # config.action_view.raise_on_missing_translations = true
37 | end
38 |
--------------------------------------------------------------------------------
/example/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 nginx, varnish or squid.
20 | # config.action_dispatch.rack_cache = true
21 |
22 | # Disable Rails's static asset server (Apache or nginx will already do this).
23 | config.serve_static_assets = false
24 |
25 | # Compress JavaScripts and CSS.
26 | config.assets.js_compressor = :uglifier
27 | # config.assets.css_compressor = :sass
28 |
29 | # Do not fallback to assets pipeline if a precompiled asset is missed.
30 | config.assets.compile = false
31 |
32 | # Generate digests for assets URLs.
33 | config.assets.digest = true
34 |
35 | # Version of your assets, change this if you want to expire all your assets.
36 | config.assets.version = '1.0'
37 |
38 | # Specifies the header that your server uses for sending files.
39 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
40 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
41 |
42 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
43 | # config.force_ssl = true
44 |
45 | # Set to :debug to see everything in the log.
46 | config.log_level = :info
47 |
48 | # Prepend all log lines with the following tags.
49 | # config.log_tags = [ :subdomain, :uuid ]
50 |
51 | # Use a different logger for distributed setups.
52 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
53 |
54 | # Use a different cache store in production.
55 | # config.cache_store = :mem_cache_store
56 |
57 | # Enable serving of images, stylesheets, and JavaScripts from an asset server.
58 | # config.action_controller.asset_host = "http://assets.example.com"
59 |
60 | # Precompile additional assets.
61 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
62 | # config.assets.precompile += %w( search.js )
63 |
64 | # Ignore bad email addresses and do not raise email delivery errors.
65 | # Set this to true and configure the email server for immediate delivery to raise delivery errors.
66 | # config.action_mailer.raise_delivery_errors = false
67 |
68 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
69 | # the I18n.default_locale when a translation cannot be found).
70 | config.i18n.fallbacks = true
71 |
72 | # Send deprecation notices to registered listeners.
73 | config.active_support.deprecation = :notify
74 |
75 | # Disable automatic flushing of the log to improve performance.
76 | # config.autoflush_log = false
77 |
78 | # Use default logging formatter so that PID and timestamp are not suppressed.
79 | config.log_formatter = ::Logger::Formatter.new
80 |
81 | # Do not dump schema after migrations.
82 | config.active_record.dump_schema_after_migration = false
83 | end
84 |
--------------------------------------------------------------------------------
/example/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 asset server for tests with Cache-Control for performance.
16 | config.serve_static_assets = true
17 | config.static_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 | # Print deprecation notices to the stderr.
35 | config.active_support.deprecation = :stderr
36 |
37 | # Raises error for missing translations
38 | # config.action_view.raise_on_missing_translations = true
39 | end
40 |
--------------------------------------------------------------------------------
/example/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 |
--------------------------------------------------------------------------------
/example/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
--------------------------------------------------------------------------------
/example/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 |
--------------------------------------------------------------------------------
/example/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 |
--------------------------------------------------------------------------------
/example/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 |
--------------------------------------------------------------------------------
/example/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: '_third_rail_test_app_session'
4 |
--------------------------------------------------------------------------------
/example/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 |
--------------------------------------------------------------------------------
/example/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 |
--------------------------------------------------------------------------------
/example/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 |
3 | root 'home#index'
4 | get "/about" => "about#index"
5 | get "/random" => "random#index"
6 | mount ThirdRail::Engine => "/"
7 | # Example of regular route:
8 | # get 'products/:id' => 'catalog#view'
9 |
10 | # Example of named route that can be invoked with purchase_url(id: product.id)
11 | # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
12 |
13 | # Example resource route (maps HTTP verbs to controller actions automatically):
14 | # resources :products
15 |
16 | # Example resource route with options:
17 | # resources :products do
18 | # member do
19 | # get 'short'
20 | # post 'toggle'
21 | # end
22 | #
23 | # collection do
24 | # get 'sold'
25 | # end
26 | # end
27 |
28 | # Example resource route with sub-resources:
29 | # resources :products do
30 | # resources :comments, :sales
31 | # resource :seller
32 | # end
33 |
34 | # Example resource route with more complex sub-resources:
35 | # resources :products do
36 | # resources :comments
37 | # resources :sales do
38 | # get 'recent', on: :collection
39 | # end
40 | # end
41 |
42 | # Example resource route with concerns:
43 | # concern :toggleable do
44 | # post 'toggle'
45 | # end
46 | # resources :posts, concerns: :toggleable
47 | # resources :photos, concerns: :toggleable
48 |
49 | # Example resource route within a namespace:
50 | # namespace :admin do
51 | # # Directs /admin/products/* to Admin::ProductsController
52 | # # (app/controllers/admin/products_controller.rb)
53 | # resources :products
54 | # end
55 | end
56 |
--------------------------------------------------------------------------------
/example/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: aa5b4a61f2636fb8df637776f6f02d6294de78aec4ee1b4fffc6e23383223843fbeca2159b72109ae4cc87cdb4e588f09c079e310cfc150a11cccb219fd6d21f
15 |
16 | test:
17 | secret_key_base: 4072697a4a43b7b4de4e39023bb6fdb34633ccdf8f42fe6c46a7e668c8c141fbcb1cec33f9b0dc47d7205f3bd7fbf5de441e5b5ddafe2dd3ae617cfa0c868bf9
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 |
--------------------------------------------------------------------------------
/example/db/development.sqlite3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/db/development.sqlite3
--------------------------------------------------------------------------------
/example/db/seeds.rb:
--------------------------------------------------------------------------------
1 | # This file should contain all the record creation needed to seed the database with its default values.
2 | # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3 | #
4 | # Examples:
5 | #
6 | # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
7 | # Mayor.create(name: 'Emanuel', city: cities.first)
8 |
--------------------------------------------------------------------------------
/example/lib/assets/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/lib/assets/.keep
--------------------------------------------------------------------------------
/example/lib/tasks/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/lib/tasks/.keep
--------------------------------------------------------------------------------
/example/log/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/log/.keep
--------------------------------------------------------------------------------
/example/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.
If you are the application owner check the logs for more information.
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/example/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/public/favicon.ico
--------------------------------------------------------------------------------
/example/public/robots.txt:
--------------------------------------------------------------------------------
1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
2 | #
3 | # To ban all spiders from the entire site uncomment the next two lines:
4 | # User-agent: *
5 | # Disallow: /
6 |
--------------------------------------------------------------------------------
/example/stats.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 |
5 | git rev-list --reverse HEAD | # get commits from latest to earliest
6 | while read rev; do
7 | echo; # print newline
8 | echo REV $rev; # print REV some_hash
9 | git ls-tree -r $rev | # recursively get all of the trees changed files
10 | awk '{print $3}'| # get row 3 (shows entire changeset from commit)
11 | xargs git show | # pipe to xargs
12 | wc -l; # word count by line
13 | done # YAY STATS
14 |
--------------------------------------------------------------------------------
/example/test/controllers/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/test/controllers/.keep
--------------------------------------------------------------------------------
/example/test/fixtures/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/test/fixtures/.keep
--------------------------------------------------------------------------------
/example/test/helpers/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/test/helpers/.keep
--------------------------------------------------------------------------------
/example/test/integration/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/test/integration/.keep
--------------------------------------------------------------------------------
/example/test/mailers/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/test/mailers/.keep
--------------------------------------------------------------------------------
/example/test/models/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/test/models/.keep
--------------------------------------------------------------------------------
/example/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | ENV['RAILS_ENV'] ||= 'test'
2 | require File.expand_path('../../config/environment', __FILE__)
3 | require 'rails/test_help'
4 |
5 | class ActiveSupport::TestCase
6 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
7 | #
8 | # Note: You'll currently still have to declare fixtures explicitly in integration tests
9 | # -- they do not yet inherit this setting
10 | fixtures :all
11 |
12 | # Add more helper methods to be used by all tests here...
13 | end
14 |
--------------------------------------------------------------------------------
/example/tmp/sass/51e9fe0c921454647aedb73508425603553da73e/app.css.scssc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sass/51e9fe0c921454647aedb73508425603553da73e/app.css.scssc
--------------------------------------------------------------------------------
/example/tmp/sass/7f924a47b1f94332ade1a332aa1fb6269ebc971f/notices.css.scssc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sass/7f924a47b1f94332ade1a332aa1fb6269ebc971f/notices.css.scssc
--------------------------------------------------------------------------------
/example/tmp/sprockets/1895f95d2f7325b076e4f776e1dbe79e:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sprockets/1895f95d2f7325b076e4f776e1dbe79e
--------------------------------------------------------------------------------
/example/tmp/sprockets/25fdc7199a6d75029a10afbdcdab155f:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sprockets/25fdc7199a6d75029a10afbdcdab155f
--------------------------------------------------------------------------------
/example/tmp/sprockets/2779508fdeac1a9cf5aa37fecc7db703:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sprockets/2779508fdeac1a9cf5aa37fecc7db703
--------------------------------------------------------------------------------
/example/tmp/sprockets/31c0d4e8efe4a72174627857f8bbb7dd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sprockets/31c0d4e8efe4a72174627857f8bbb7dd
--------------------------------------------------------------------------------
/example/tmp/sprockets/3c5244d6f61c17b407c2df712412baf1:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sprockets/3c5244d6f61c17b407c2df712412baf1
--------------------------------------------------------------------------------
/example/tmp/sprockets/4b256e81db78563499c14bbc7d1db20a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sprockets/4b256e81db78563499c14bbc7d1db20a
--------------------------------------------------------------------------------
/example/tmp/sprockets/54aa446a76a4bd0a1922ba6c0bbdb747:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sprockets/54aa446a76a4bd0a1922ba6c0bbdb747
--------------------------------------------------------------------------------
/example/tmp/sprockets/5534b09ee124761a6f95a03e6bc03a36:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sprockets/5534b09ee124761a6f95a03e6bc03a36
--------------------------------------------------------------------------------
/example/tmp/sprockets/596db8409196e6154404c59523ab4b16:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sprockets/596db8409196e6154404c59523ab4b16
--------------------------------------------------------------------------------
/example/tmp/sprockets/59f76e63952dd4059fabafff4ddbc6bb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sprockets/59f76e63952dd4059fabafff4ddbc6bb
--------------------------------------------------------------------------------
/example/tmp/sprockets/59f7c1b15d6752f90af9c15a4465e2f9:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sprockets/59f7c1b15d6752f90af9c15a4465e2f9
--------------------------------------------------------------------------------
/example/tmp/sprockets/60dafff8e4167df84ae574327cd8ea20:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sprockets/60dafff8e4167df84ae574327cd8ea20
--------------------------------------------------------------------------------
/example/tmp/sprockets/60eaabbc3ed4188af6bc4a60cd4f3a08:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sprockets/60eaabbc3ed4188af6bc4a60cd4f3a08
--------------------------------------------------------------------------------
/example/tmp/sprockets/7447b43aff39692d56f627e15e6a8189:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sprockets/7447b43aff39692d56f627e15e6a8189
--------------------------------------------------------------------------------
/example/tmp/sprockets/91ad372d45fde17341ab5ac2401cad4a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sprockets/91ad372d45fde17341ab5ac2401cad4a
--------------------------------------------------------------------------------
/example/tmp/sprockets/a28fdb70d4035dfe8f6dde1fd751b544:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sprockets/a28fdb70d4035dfe8f6dde1fd751b544
--------------------------------------------------------------------------------
/example/tmp/sprockets/a378353b475c48a577c90163999ceb9c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sprockets/a378353b475c48a577c90163999ceb9c
--------------------------------------------------------------------------------
/example/tmp/sprockets/ad38a2d0a3fc48bc55e5fe33179cc148:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sprockets/ad38a2d0a3fc48bc55e5fe33179cc148
--------------------------------------------------------------------------------
/example/tmp/sprockets/c588b8b5c38aa825c7f1df25999e1c71:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sprockets/c588b8b5c38aa825c7f1df25999e1c71
--------------------------------------------------------------------------------
/example/tmp/sprockets/c78064bc1b895e182373a261c2541fe2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sprockets/c78064bc1b895e182373a261c2541fe2
--------------------------------------------------------------------------------
/example/tmp/sprockets/c99e60939a0004b53ed2f965ec0ae0cf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sprockets/c99e60939a0004b53ed2f965ec0ae0cf
--------------------------------------------------------------------------------
/example/tmp/sprockets/d01e2b77175ee6dbdf2357366ee9677d:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sprockets/d01e2b77175ee6dbdf2357366ee9677d
--------------------------------------------------------------------------------
/example/tmp/sprockets/d5f2c4400c86aa50e4a64715d651637a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sprockets/d5f2c4400c86aa50e4a64715d651637a
--------------------------------------------------------------------------------
/example/tmp/sprockets/e926a63fbed664e878a742b608c9e019:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sprockets/e926a63fbed664e878a742b608c9e019
--------------------------------------------------------------------------------
/example/tmp/sprockets/f2eddc1b74f67f1f330e66836c028657:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sprockets/f2eddc1b74f67f1f330e66836c028657
--------------------------------------------------------------------------------
/example/tmp/sprockets/f306466141ee19ca618caf9282acf568:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sprockets/f306466141ee19ca618caf9282acf568
--------------------------------------------------------------------------------
/example/tmp/sprockets/f7254202446069694a8b12defa6a016c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/tmp/sprockets/f7254202446069694a8b12defa6a016c
--------------------------------------------------------------------------------
/example/vendor/assets/javascripts/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/vendor/assets/javascripts/.keep
--------------------------------------------------------------------------------
/example/vendor/assets/stylesheets/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/vendor/assets/stylesheets/.keep
--------------------------------------------------------------------------------
/lib/tasks/third_rail_tasks.rake:
--------------------------------------------------------------------------------
1 | # desc "Explaining what the task does"
2 | # task :third_rail do
3 | # # Task goes here
4 | # end
5 |
--------------------------------------------------------------------------------
/lib/third_rail.rb:
--------------------------------------------------------------------------------
1 | require "third_rail/engine"
2 |
3 | module ThirdRail
4 | end
5 |
--------------------------------------------------------------------------------
/lib/third_rail/engine.rb:
--------------------------------------------------------------------------------
1 | require 'volt/server'
2 | module ThirdRail
3 | class Engine < ::Rails::Engine
4 | isolate_namespace ThirdRail
5 | config.volt_path = (defined? VOLT_PATH) ? VOLT_PATH : '/app/voltage'
6 |
7 | ::VOLT_PATH = config.volt_path
8 | server = Volt::Server.new(File.expand_path("#{Dir.pwd}/#{config.volt_path}")).app
9 | config.volt_server = server
10 | config.middleware.delete Rack::Lock
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/lib/third_rail/version.rb:
--------------------------------------------------------------------------------
1 | module ThirdRail
2 | VERSION = "0.0.1"
3 | end
4 |
--------------------------------------------------------------------------------
/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/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/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 vendor/assets/javascripts of plugins, if any, 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/sstephenson/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 vendor/assets/stylesheets of plugins, if any, 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/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/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/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/test/dummy/app/mailers/.keep
--------------------------------------------------------------------------------
/test/dummy/app/models/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/test/dummy/app/models/.keep
--------------------------------------------------------------------------------
/test/dummy/app/models/concerns/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/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/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 "third_rail"
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 | # SQLite version 3.x
2 | # gem install sqlite3
3 | #
4 | # Ensure the SQLite 3 gem is defined in your Gemfile
5 | # gem 'sqlite3'
6 | #
7 | default: &default
8 | adapter: sqlite3
9 | pool: 5
10 | timeout: 5000
11 |
12 | development:
13 | <<: *default
14 | database: db/development.sqlite3
15 |
16 | # Warning: The database defined as "test" will be erased and
17 | # re-generated from your development database when you run "rake".
18 | # Do not set this db to the same as development or production.
19 | test:
20 | <<: *default
21 | database: db/test.sqlite3
22 |
23 | production:
24 | <<: *default
25 | database: db/production.sqlite3
26 |
--------------------------------------------------------------------------------
/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 | # Adds additional error checking when serving assets at runtime.
31 | # Checks for improperly declared sprockets dependencies.
32 | # Raises helpful error messages.
33 | config.assets.raise_runtime_errors = true
34 |
35 | # Raises error for missing translations
36 | # config.action_view.raise_on_missing_translations = true
37 | end
38 |
--------------------------------------------------------------------------------
/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 nginx, varnish or squid.
20 | # config.action_dispatch.rack_cache = true
21 |
22 | # Disable Rails's static asset server (Apache or nginx will already do this).
23 | config.serve_static_assets = false
24 |
25 | # Compress JavaScripts and CSS.
26 | config.assets.js_compressor = :uglifier
27 | # config.assets.css_compressor = :sass
28 |
29 | # Do not fallback to assets pipeline if a precompiled asset is missed.
30 | config.assets.compile = false
31 |
32 | # Generate digests for assets URLs.
33 | config.assets.digest = true
34 |
35 | # Version of your assets, change this if you want to expire all your assets.
36 | config.assets.version = '1.0'
37 |
38 | # Specifies the header that your server uses for sending files.
39 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
40 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
41 |
42 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
43 | # config.force_ssl = true
44 |
45 | # Set to :debug to see everything in the log.
46 | config.log_level = :info
47 |
48 | # Prepend all log lines with the following tags.
49 | # config.log_tags = [ :subdomain, :uuid ]
50 |
51 | # Use a different logger for distributed setups.
52 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
53 |
54 | # Use a different cache store in production.
55 | # config.cache_store = :mem_cache_store
56 |
57 | # Enable serving of images, stylesheets, and JavaScripts from an asset server.
58 | # config.action_controller.asset_host = "http://assets.example.com"
59 |
60 | # Precompile additional assets.
61 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
62 | # config.assets.precompile += %w( search.js )
63 |
64 | # Ignore bad email addresses and do not raise email delivery errors.
65 | # Set this to true and configure the email server for immediate delivery to raise delivery errors.
66 | # config.action_mailer.raise_delivery_errors = false
67 |
68 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
69 | # the I18n.default_locale when a translation cannot be found).
70 | config.i18n.fallbacks = true
71 |
72 | # Send deprecation notices to registered listeners.
73 | config.active_support.deprecation = :notify
74 |
75 | # Disable automatic flushing of the log to improve performance.
76 | # config.autoflush_log = false
77 |
78 | # Use default logging formatter so that PID and timestamp are not suppressed.
79 | config.log_formatter = ::Logger::Formatter.new
80 |
81 | # Do not dump schema after migrations.
82 | config.active_record.dump_schema_after_migration = false
83 | end
84 |
--------------------------------------------------------------------------------
/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 asset server for tests with Cache-Control for performance.
16 | config.serve_static_assets = true
17 | config.static_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 | # Print deprecation notices to the stderr.
35 | config.active_support.deprecation = :stderr
36 |
37 | # Raises error for missing translations
38 | # config.action_view.raise_on_missing_translations = true
39 | end
40 |
--------------------------------------------------------------------------------
/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
--------------------------------------------------------------------------------
/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 ThirdRail::Engine => "/third_rail"
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: f68b3e19aa7f0c421caedc7179b375bab7629b3c30eb28576e53da57119d4671ac1fd61ab2599005f46200e2b38ac26cb786f372bc31cf702f6010027b690c5b
15 |
16 | test:
17 | secret_key_base: 7036294c424de05136ef9adff89593461318c231b34a217833b7a18a7beec5bd9dff68790f1ec14fc35b1a40b1358e0c12c64722f9370f34b6bad7707147cfd0
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/lib/assets/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/test/dummy/lib/assets/.keep
--------------------------------------------------------------------------------
/test/dummy/log/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/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.