├── .gitignore ├── Gemfile ├── Gemfile.lock ├── MIT-LICENSE ├── README.md ├── Rakefile ├── app ├── assets │ ├── images │ │ └── third_rail │ │ │ └── .keep │ ├── javascripts │ │ └── third_rail │ │ │ └── application.js │ └── stylesheets │ │ └── third_rail │ │ └── application.css ├── controllers │ ├── third_rail │ │ └── application_controller.rb │ └── volt_controller.rb ├── helpers │ └── third_rail │ │ └── application_helper.rb └── views │ └── layouts │ ├── third_rail │ └── application.html.erb │ └── volt.html.erb ├── bin └── rails ├── config └── routes.rb ├── example ├── Gemfile ├── Gemfile.lock ├── README.rdoc ├── Rakefile ├── app │ ├── assets │ │ ├── images │ │ │ └── .keep │ │ ├── javascripts │ │ │ └── application.js │ │ └── stylesheets │ │ │ └── application.css │ ├── controllers │ │ ├── about_controller.rb │ │ ├── application_controller.rb │ │ ├── concerns │ │ │ └── .keep │ │ ├── home_controller.rb │ │ └── random_controller.rb │ ├── helpers │ │ └── application_helper.rb │ ├── mailers │ │ └── .keep │ ├── models │ │ ├── .keep │ │ └── concerns │ │ │ └── .keep │ ├── views │ │ ├── about │ │ │ └── index.html.erb │ │ ├── application │ │ │ └── index.html.erb │ │ ├── electric │ │ │ ├── about │ │ │ │ └── index.html.erb │ │ │ └── random │ │ │ │ └── index.html.erb │ │ ├── home │ │ │ └── index.html.erb │ │ ├── layouts │ │ │ └── volt.html.erb │ │ └── random │ │ │ └── index.html.erb │ └── voltage │ │ ├── .gitignore │ │ ├── Gemfile │ │ ├── README.md │ │ ├── app │ │ └── main │ │ │ ├── assets │ │ │ └── css │ │ │ │ └── app.css.scss │ │ │ ├── config │ │ │ ├── dependencies.rb │ │ │ └── routes.rb │ │ │ ├── controllers │ │ │ └── main_controller.rb │ │ │ ├── models │ │ │ └── user.rb │ │ │ └── views │ │ │ └── main │ │ │ ├── about.html │ │ │ ├── index.html │ │ │ ├── main.html │ │ │ └── random.html │ │ ├── config.ru │ │ ├── config │ │ ├── app.rb │ │ └── base │ │ │ └── index.html │ │ └── spec │ │ ├── app │ │ └── main │ │ │ ├── controllers │ │ │ └── server │ │ │ │ └── sample_http_controller_spec.rb │ │ │ ├── integration │ │ │ └── sample_integration_spec.rb │ │ │ ├── models │ │ │ └── sample_model_spec.rb │ │ │ └── tasks │ │ │ └── sample_task_spec.rb │ │ └── spec_helper.rb ├── bin │ ├── bundle │ ├── rails │ ├── rake │ ├── setup │ └── spring ├── config.ru ├── config │ ├── application.rb │ ├── boot.rb │ ├── database.yml │ ├── environment.rb │ ├── environments │ │ ├── development.rb │ │ ├── production.rb │ │ └── test.rb │ ├── initializers │ │ ├── backtrace_silencers.rb │ │ ├── cookies_serializer.rb │ │ ├── filter_parameter_logging.rb │ │ ├── inflections.rb │ │ ├── mime_types.rb │ │ ├── session_store.rb │ │ └── wrap_parameters.rb │ ├── locales │ │ └── en.yml │ ├── routes.rb │ └── secrets.yml ├── db │ ├── development.sqlite3 │ └── seeds.rb ├── lib │ ├── assets │ │ └── .keep │ └── tasks │ │ └── .keep ├── log │ ├── .keep │ └── development.log ├── public │ ├── 404.html │ ├── 422.html │ ├── 500.html │ ├── favicon.ico │ └── robots.txt ├── stats.sh ├── test │ ├── controllers │ │ └── .keep │ ├── fixtures │ │ └── .keep │ ├── helpers │ │ └── .keep │ ├── integration │ │ └── .keep │ ├── mailers │ │ └── .keep │ ├── models │ │ └── .keep │ └── test_helper.rb ├── tmp │ ├── sass │ │ ├── 51e9fe0c921454647aedb73508425603553da73e │ │ │ └── app.css.scssc │ │ └── 7f924a47b1f94332ade1a332aa1fb6269ebc971f │ │ │ └── notices.css.scssc │ └── sprockets │ │ ├── 1895f95d2f7325b076e4f776e1dbe79e │ │ ├── 25fdc7199a6d75029a10afbdcdab155f │ │ ├── 2779508fdeac1a9cf5aa37fecc7db703 │ │ ├── 31c0d4e8efe4a72174627857f8bbb7dd │ │ ├── 3c5244d6f61c17b407c2df712412baf1 │ │ ├── 4b256e81db78563499c14bbc7d1db20a │ │ ├── 54aa446a76a4bd0a1922ba6c0bbdb747 │ │ ├── 5534b09ee124761a6f95a03e6bc03a36 │ │ ├── 596db8409196e6154404c59523ab4b16 │ │ ├── 59f76e63952dd4059fabafff4ddbc6bb │ │ ├── 59f7c1b15d6752f90af9c15a4465e2f9 │ │ ├── 60dafff8e4167df84ae574327cd8ea20 │ │ ├── 60eaabbc3ed4188af6bc4a60cd4f3a08 │ │ ├── 7447b43aff39692d56f627e15e6a8189 │ │ ├── 91ad372d45fde17341ab5ac2401cad4a │ │ ├── a28fdb70d4035dfe8f6dde1fd751b544 │ │ ├── a378353b475c48a577c90163999ceb9c │ │ ├── ad38a2d0a3fc48bc55e5fe33179cc148 │ │ ├── c588b8b5c38aa825c7f1df25999e1c71 │ │ ├── c78064bc1b895e182373a261c2541fe2 │ │ ├── c99e60939a0004b53ed2f965ec0ae0cf │ │ ├── d01e2b77175ee6dbdf2357366ee9677d │ │ ├── d5f2c4400c86aa50e4a64715d651637a │ │ ├── e926a63fbed664e878a742b608c9e019 │ │ ├── f2eddc1b74f67f1f330e66836c028657 │ │ ├── f306466141ee19ca618caf9282acf568 │ │ └── f7254202446069694a8b12defa6a016c └── vendor │ └── assets │ ├── javascripts │ └── .keep │ └── stylesheets │ └── .keep ├── lib ├── tasks │ └── third_rail_tasks.rake ├── third_rail.rb └── third_rail │ ├── engine.rb │ └── version.rb ├── test ├── dummy │ ├── README.rdoc │ ├── Rakefile │ ├── app │ │ ├── assets │ │ │ ├── images │ │ │ │ └── .keep │ │ │ ├── javascripts │ │ │ │ └── application.js │ │ │ └── stylesheets │ │ │ │ └── application.css │ │ ├── controllers │ │ │ ├── application_controller.rb │ │ │ └── concerns │ │ │ │ └── .keep │ │ ├── helpers │ │ │ └── application_helper.rb │ │ ├── mailers │ │ │ └── .keep │ │ ├── models │ │ │ ├── .keep │ │ │ └── concerns │ │ │ │ └── .keep │ │ └── views │ │ │ └── layouts │ │ │ └── application.html.erb │ ├── bin │ │ ├── bundle │ │ ├── rails │ │ └── rake │ ├── config.ru │ ├── config │ │ ├── application.rb │ │ ├── boot.rb │ │ ├── database.yml │ │ ├── environment.rb │ │ ├── environments │ │ │ ├── development.rb │ │ │ ├── production.rb │ │ │ └── test.rb │ │ ├── initializers │ │ │ ├── backtrace_silencers.rb │ │ │ ├── cookies_serializer.rb │ │ │ ├── filter_parameter_logging.rb │ │ │ ├── inflections.rb │ │ │ ├── mime_types.rb │ │ │ ├── session_store.rb │ │ │ └── wrap_parameters.rb │ │ ├── locales │ │ │ └── en.yml │ │ ├── routes.rb │ │ └── secrets.yml │ ├── lib │ │ └── assets │ │ │ └── .keep │ ├── log │ │ └── .keep │ └── public │ │ ├── 404.html │ │ ├── 422.html │ │ ├── 500.html │ │ └── favicon.ico ├── integration │ └── navigation_test.rb ├── test_helper.rb └── third_rail_test.rb └── third_rail.gemspec /.gitignore: -------------------------------------------------------------------------------- 1 | .bundle/ 2 | log/*.log 3 | pkg/ 4 | test/dummy/db/*.sqlite3 5 | test/dummy/db/*.sqlite3-journal 6 | test/dummy/log/*.log 7 | test/dummy/tmp/ 8 | test/dummy/.sass-cache 9 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | # Declare your gem's dependencies in third_rail.gemspec. 4 | # Bundler will treat runtime dependencies like base dependencies, and 5 | # development dependencies will be added by default to the :development group. 6 | gemspec 7 | 8 | # Declare any dependencies that are still in development here instead of in 9 | # your gemspec. These might include edge Rails or gems from your path or 10 | # Git. Remember to move these dependencies to your gemspec before releasing 11 | # your gem to rubygems.org. 12 | gem 'volt', git: "git://github.com/bglusman/volt" 13 | gem 'volt-sockjs', git: "git://github.com/bglusman/sockjs-ruby" 14 | # gem 'volt-bootstrap_jumbotron_theme', git: "git@github.com:voltrb/volt-bootstrap_jumbotron_theme.git" 15 | # gem 'volt-user_templates', git: "git@github.com:voltrb/volt-user_templates.git" 16 | # To use debugger 17 | # gem 'debugger' 18 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GIT 2 | remote: git://github.com/bglusman/sockjs-ruby 3 | revision: dfade2b0bfa33c2955a30a94e912bfd48d550ca8 4 | specs: 5 | volt-sockjs (0.3.4.4) 6 | faye-websocket (~> 0.7.1) 7 | json 8 | rack 9 | rack-mount (~> 0.8.3) 10 | thin 11 | 12 | GIT 13 | remote: git://github.com/bglusman/volt 14 | revision: 3d9690bf1a0a0e61ad3a1e14132c9450f68cb551 15 | specs: 16 | volt (0.9.0.pre7) 17 | bcrypt (~> 3.1.9) 18 | bundler (>= 1.5) 19 | configurations (~> 2.0.0.pre) 20 | listen (~> 2.8.0) 21 | mongo (~> 1.9.0) 22 | opal (~> 0.7.1) 23 | opal-jquery (~> 0.3.0) 24 | pry (~> 0.10.0) 25 | rack (~> 1.5) 26 | sass (~> 3.2.5) 27 | sprockets-sass (~> 1.0.0) 28 | thor (~> 0.19.0) 29 | uglifier (>= 2.4.0) 30 | volt-sockjs (~> 0.3.4.4) 31 | yui-compressor (~> 0.12.0) 32 | 33 | PATH 34 | remote: . 35 | specs: 36 | third_rail (0.0.1) 37 | rails (~> 4.2) 38 | volt-bootstrap 39 | volt-bootstrap_jumbotron_theme 40 | volt-user_templates 41 | 42 | GEM 43 | remote: https://rubygems.org/ 44 | specs: 45 | actionmailer (4.2.1) 46 | actionpack (= 4.2.1) 47 | actionview (= 4.2.1) 48 | activejob (= 4.2.1) 49 | mail (~> 2.5, >= 2.5.4) 50 | rails-dom-testing (~> 1.0, >= 1.0.5) 51 | actionpack (4.2.1) 52 | actionview (= 4.2.1) 53 | activesupport (= 4.2.1) 54 | rack (~> 1.6) 55 | rack-test (~> 0.6.2) 56 | rails-dom-testing (~> 1.0, >= 1.0.5) 57 | rails-html-sanitizer (~> 1.0, >= 1.0.1) 58 | actionview (4.2.1) 59 | activesupport (= 4.2.1) 60 | builder (~> 3.1) 61 | erubis (~> 2.7.0) 62 | rails-dom-testing (~> 1.0, >= 1.0.5) 63 | rails-html-sanitizer (~> 1.0, >= 1.0.1) 64 | activejob (4.2.1) 65 | activesupport (= 4.2.1) 66 | globalid (>= 0.3.0) 67 | activemodel (4.2.1) 68 | activesupport (= 4.2.1) 69 | builder (~> 3.1) 70 | activerecord (4.2.1) 71 | activemodel (= 4.2.1) 72 | activesupport (= 4.2.1) 73 | arel (~> 6.0) 74 | activesupport (4.2.1) 75 | i18n (~> 0.7) 76 | json (~> 1.7, >= 1.7.7) 77 | minitest (~> 5.1) 78 | thread_safe (~> 0.3, >= 0.3.4) 79 | tzinfo (~> 1.1) 80 | arel (6.0.0) 81 | bcrypt (3.1.10) 82 | bson (1.9.2) 83 | builder (3.2.2) 84 | celluloid (0.16.0) 85 | timers (~> 4.0.0) 86 | coderay (1.1.0) 87 | configurations (2.0.0) 88 | daemons (1.2.2) 89 | erubis (2.7.0) 90 | eventmachine (1.0.7) 91 | execjs (2.5.2) 92 | faye-websocket (0.7.5) 93 | eventmachine (>= 0.12.0) 94 | websocket-driver (>= 0.3.5) 95 | ffi (1.9.8) 96 | globalid (0.3.5) 97 | activesupport (>= 4.1.0) 98 | hike (1.2.3) 99 | hitimes (1.2.2) 100 | i18n (0.7.0) 101 | json (1.8.2) 102 | listen (2.8.6) 103 | celluloid (>= 0.15.2) 104 | rb-fsevent (>= 0.9.3) 105 | rb-inotify (>= 0.9) 106 | loofah (2.0.1) 107 | nokogiri (>= 1.5.9) 108 | mail (2.6.3) 109 | mime-types (>= 1.16, < 3) 110 | method_source (0.8.2) 111 | mime-types (2.4.3) 112 | mini_portile (0.6.2) 113 | minitest (5.6.0) 114 | mongo (1.9.2) 115 | bson (~> 1.9.2) 116 | multi_json (1.11.0) 117 | nokogiri (1.6.6.2) 118 | mini_portile (~> 0.6.0) 119 | opal (0.7.1) 120 | hike (~> 1.2) 121 | sourcemap (~> 0.1.0) 122 | sprockets (>= 2.2.3, < 4.0.0) 123 | tilt (~> 1.4) 124 | opal-jquery (0.3.0) 125 | opal (~> 0.7.0) 126 | pry (0.10.1) 127 | coderay (~> 1.1.0) 128 | method_source (~> 0.8.1) 129 | slop (~> 3.4) 130 | rack (1.6.0) 131 | rack-mount (0.8.3) 132 | rack (>= 1.0.0) 133 | rack-test (0.6.3) 134 | rack (>= 1.0) 135 | rails (4.2.1) 136 | actionmailer (= 4.2.1) 137 | actionpack (= 4.2.1) 138 | actionview (= 4.2.1) 139 | activejob (= 4.2.1) 140 | activemodel (= 4.2.1) 141 | activerecord (= 4.2.1) 142 | activesupport (= 4.2.1) 143 | bundler (>= 1.3.0, < 2.0) 144 | railties (= 4.2.1) 145 | sprockets-rails 146 | rails-deprecated_sanitizer (1.0.3) 147 | activesupport (>= 4.2.0.alpha) 148 | rails-dom-testing (1.0.6) 149 | activesupport (>= 4.2.0.beta, < 5.0) 150 | nokogiri (~> 1.6.0) 151 | rails-deprecated_sanitizer (>= 1.0.1) 152 | rails-html-sanitizer (1.0.2) 153 | loofah (~> 2.0) 154 | railties (4.2.1) 155 | actionpack (= 4.2.1) 156 | activesupport (= 4.2.1) 157 | rake (>= 0.8.7) 158 | thor (>= 0.18.1, < 2.0) 159 | rake (10.4.2) 160 | rb-fsevent (0.9.4) 161 | rb-inotify (0.9.5) 162 | ffi (>= 0.5.0) 163 | sass (3.2.19) 164 | slop (3.6.0) 165 | sourcemap (0.1.1) 166 | sprockets (2.12.3) 167 | hike (~> 1.2) 168 | multi_json (~> 1.0) 169 | rack (~> 1.0) 170 | tilt (~> 1.1, != 1.3.0) 171 | sprockets-rails (2.2.4) 172 | actionpack (>= 3.0) 173 | activesupport (>= 3.0) 174 | sprockets (>= 2.8, < 4.0) 175 | sprockets-sass (1.0.0) 176 | sprockets (~> 2.0) 177 | tilt (~> 1.1) 178 | sqlite3 (1.3.10) 179 | thin (1.6.3) 180 | daemons (~> 1.0, >= 1.0.9) 181 | eventmachine (~> 1.0) 182 | rack (~> 1.0) 183 | thor (0.19.1) 184 | thread_safe (0.3.5) 185 | tilt (1.4.1) 186 | timers (4.0.1) 187 | hitimes 188 | tzinfo (1.2.2) 189 | thread_safe (~> 0.1) 190 | uglifier (2.7.1) 191 | execjs (>= 0.3.0) 192 | json (>= 1.8.0) 193 | volt-bootstrap (0.0.10) 194 | volt-bootstrap_jumbotron_theme (0.1.0) 195 | volt-fields (0.1.0) 196 | volt-user_templates (0.1.4) 197 | volt-fields (~> 0.1.0) 198 | websocket-driver (0.5.4) 199 | websocket-extensions (>= 0.1.0) 200 | websocket-extensions (0.1.2) 201 | yui-compressor (0.12.0) 202 | 203 | PLATFORMS 204 | ruby 205 | 206 | DEPENDENCIES 207 | sqlite3 208 | third_rail! 209 | volt! 210 | volt-sockjs! 211 | -------------------------------------------------------------------------------- /MIT-LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2015 YOURNAME 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | third-rail 2 | ========== 3 | 4 | ##voltrb on rails 5 | 6 | The goal is to provide access to voltrb from within existing rails apps via addition of a third-rail gem. 7 | 8 | Any thoughts or discussion is welcome at [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/catprintlabs/third-rail?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 9 | 10 | 11 | ##install 12 | 13 | Currently this repo is a basic engine extracted from a proof of concept demo rails app. It's using a forked copy of the volt gem just for development, because a few changes were made that are not ready to pull in to volt master. 14 | 15 | Clone the repo, 16 | bundle install 17 | bundle exec rails s 18 | 19 | The app should come up... let me know via gitter if you have any problems. 20 | 21 | ##implementation status: 22 | 23 | So far the only thing implemented is the being able to use volt to create a layout within the rails app, and to have volt request a partial be delivered as part of the volt view. This is _very preliminary proof of concept implementation_. 24 | 25 | Volt code goes into a directory called "voltage" within the top level rails "app" directory. 26 | 27 | The volt code follows the normal volt framework conventions, within that directory, with the addition of a the 28 | 29 | {{ content_for }} 30 | 31 | binding. `content_for` will be replaced with a view from rails that has the matching name as the current volt view being rendered. 32 | 33 | To get things started on the rails side use the `volt_layout` helper 34 | 35 | <%= volt_layout %> 36 | 37 | The `content_for` binding can tie into a particular part of the rails view by specifying a symbol. The matching rails view will have a matching `content_for` with the same symbol. For example 38 | 39 | {{ content_for :footer }} 40 | 41 | will be replaced by the some section of the rails view that is defined by 42 | 43 | <% content_for :footer do %> 44 | # stuff to go into the footer 45 | <% end %> 46 | 47 | To summarize: 48 | 49 | * Within the rails layout do a `<%= volt_layout %>` to hand control for rendering the the layout to volt. 50 | * The volt code goes in a `voltage` directory within the rails `app` directory. 51 | * Within a volt view you give control of rendering back to rails by doing a `content_for` 52 | * Within the matching rails view you can break up parts of the content by labelling them as `<% content_for symbol do %> ... <% end %>`. These sections will matched to any `{{ content_for symbol }}` bindings in the volt view. 53 | 54 | ## Proposed auto update from rails on content for: 55 | 56 | Thinking about how to get any data delivered from rails to automagically: 57 | 58 | I am thinking that something like `<% invalidate :after => 37.seconds %>` 59 | 60 | Invalidate would mark the current content as being invalid under some conditions (simpliest is time). This would get sent down to the volt client, and then setup inside the binding. 61 | 62 | For time its easy, but how about some other property (like the user changes) 63 | 64 | As an alternative / addition what if the `{{ content_for }}` associated a bunch of locals that were passed up to the rails view, like this: 65 | 66 | ```ruby 67 | {{ content_for :foo => _thing._property, :fob => _other_thing * 10 }} 68 | ``` 69 | 70 | Within the rails view :foo and :fob would be bound to the values of _thing.property, and _other_thing * 10. The opal computation mechanism would then take care of re-requesting the view whenever _thing._property or _other_thing changed. 71 | 72 | 73 | 74 | ?? any ideas 75 | 76 | ##Initial thoughts (sort of stream of conscience random ideas) 77 | 78 | rails and volt will coexist with volt being a separate rack app. Communication between the two will be via mongodb. 79 | 80 | add mongoid or mongomapper to active record models ala https://github.com/hayesdavis/active-expando (very old but provides a starting point) similar concept here: http://britg.com/2012/01/07/forging-forgecraft-a-hybrid-sql-mongodb-data-solution/ 81 | 82 | this should provide the basic communication mechanism. 83 | 84 | ##syncing the two databases 85 | 86 | ###Brute Force: 87 | Syncronize every change between the databases using activerecord and mongos builtin monitoring... 88 | 89 | ###More Intelligent - but more work: 90 | Describe mapping in the active record models to volt models 91 | 92 | ###Harder still - but probably how you would do it from scratch: 93 | Map volt models to rails, and manually connect 94 | 95 | ###Forget Mongo + Rails... 96 | use an automatically generated API to talk between the volt app and rails. 97 | 98 | ##Different Approach altogether 99 | 100 | think of a typical migration. You have some pages that are rails views, but you want to start using volt. 101 | What you would like initially is something like this: 102 | * request the page, 103 | * controller does normal stuff 104 | * then makes sure that any "volt" models are synced to the rails data. 105 | * then does a "special" render operation that hands control over to volt, which delivers the page 106 | 107 | ## goals / Use cases / how will this be used 108 | 109 | #### upgrade existing rails app to on page code more dynamic, and use Opal rather than javascript. 110 | 111 | Be able to use volt rendering, views, bindings, and computations within a rails page. 112 | 113 | Currently the direction to achieve this goal is the <%= volt_layout %> and {{ content_for }} mechanisms. 114 | 115 | These allow an existing rails page to be electrified with no architectectural changes to the rails app. 116 | 117 | As pages are "electrified" the become part of a single page volt app, and can communicate internally giving a better user experience. 118 | 119 | #### async updates of one rails client page, when another client page changes. 120 | 121 | At some point it may be desirable to have one client page of the rails app communicate data with another client page. 122 | 123 | For example the rails app needs to support a dynamic "likes" button. Where if one client likes an item, then all other browsers viewing that item will get updated. 124 | 125 | ???? How do we achieve this is the question I am struggling with at the moment ??? 126 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | begin 2 | require 'bundler/setup' 3 | rescue LoadError 4 | puts 'You must `gem install bundler` and `bundle install` to run rake tasks' 5 | end 6 | 7 | require 'rdoc/task' 8 | 9 | RDoc::Task.new(:rdoc) do |rdoc| 10 | rdoc.rdoc_dir = 'rdoc' 11 | rdoc.title = 'ThirdRail' 12 | rdoc.options << '--line-numbers' 13 | rdoc.rdoc_files.include('README.rdoc') 14 | rdoc.rdoc_files.include('lib/**/*.rb') 15 | end 16 | 17 | APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__) 18 | load 'rails/tasks/engine.rake' 19 | 20 | 21 | 22 | Bundler::GemHelper.install_tasks 23 | 24 | require 'rake/testtask' 25 | 26 | Rake::TestTask.new(:test) do |t| 27 | t.libs << 'lib' 28 | t.libs << 'test' 29 | t.pattern = 'test/**/*_test.rb' 30 | t.verbose = false 31 | end 32 | 33 | 34 | task default: :test 35 | -------------------------------------------------------------------------------- /app/assets/images/third_rail/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/app/assets/images/third_rail/.keep -------------------------------------------------------------------------------- /app/assets/javascripts/third_rail/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 | -------------------------------------------------------------------------------- /app/assets/stylesheets/third_rail/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 | -------------------------------------------------------------------------------- /app/controllers/third_rail/application_controller.rb: -------------------------------------------------------------------------------- 1 | module ThirdRail 2 | class ApplicationController < ActionController::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /app/controllers/volt_controller.rb: -------------------------------------------------------------------------------- 1 | class VoltController < ApplicationController 2 | 3 | def volt 4 | render(inline: "", layout: "volt") and return unless params[:_volt_update] 5 | render inline: "", status: 404 6 | end 7 | 8 | end 9 | -------------------------------------------------------------------------------- /app/helpers/third_rail/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ThirdRail 2 | module ApplicationHelper 3 | 4 | def volt_layout 5 | script_blocks = @view_flow.content.collect do |key, html| 6 | "" 7 | end 8 | 9 | if params[:_volt_update] 10 | script_blocks.join("\n").html_safe 11 | else 12 | script_blocks += Volt::Server.index_files.javascript_files.collect do |javascript_file| 13 | "" 14 | end 15 | 16 | script_blocks += Volt::Server.index_files.css_files.collect do |css_file| 17 | "" 18 | end 19 | 20 | [ 21 | "", 22 | "", 23 | "", 24 | "", 25 | script_blocks.join("\n"), 26 | "", 27 | "", 28 | "", 29 | "" 30 | ].join("\n").html_safe 31 | 32 | end 33 | end 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /app/views/layouts/third_rail/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ThirdRail 5 | <%= stylesheet_link_tag "third_rail/application", media: "all" %> 6 | <%= javascript_include_tag "third_rail/application" %> 7 | <%= csrf_meta_tags %> 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/views/layouts/volt.html.erb: -------------------------------------------------------------------------------- 1 | <%= volt_layout %> 2 | -------------------------------------------------------------------------------- /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/third_rail/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 | # require 'pry' 2 | # binding.pry 3 | # require_relative '/lib/third_rail/engine' 4 | ThirdRail::Engine.routes.draw do 5 | 6 | mount Rails.application.config.volt_server => "/volt" 7 | root "volt#volt" 8 | get "*path" => "volt#volt" 9 | # The priority is based upon order of creation: first created -> highest priority. 10 | # See how all your routes lay out with "rake routes". 11 | 12 | # You can have the root of your site routed with "root" 13 | # root 'welcome#index' 14 | 15 | # Example of regular route: 16 | # get 'products/:id' => 'catalog#view' 17 | 18 | # Example of named route that can be invoked with purchase_url(id: product.id) 19 | # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase 20 | 21 | # Example resource route (maps HTTP verbs to controller actions automatically): 22 | # resources :products 23 | 24 | # Example resource route with options: 25 | # resources :products do 26 | # member do 27 | # get 'short' 28 | # post 'toggle' 29 | # end 30 | # 31 | # collection do 32 | # get 'sold' 33 | # end 34 | # end 35 | 36 | # Example resource route with sub-resources: 37 | # resources :products do 38 | # resources :comments, :sales 39 | # resource :seller 40 | # end 41 | 42 | # Example resource route with more complex sub-resources: 43 | # resources :products do 44 | # resources :comments 45 | # resources :sales do 46 | # get 'recent', on: :collection 47 | # end 48 | # end 49 | 50 | # Example resource route with concerns: 51 | # concern :toggleable do 52 | # post 'toggle' 53 | # end 54 | # resources :posts, concerns: :toggleable 55 | # resources :photos, concerns: :toggleable 56 | 57 | # Example resource route within a namespace: 58 | # namespace :admin do 59 | # # Directs /admin/products/* to Admin::ProductsController 60 | # # (app/controllers/admin/products_controller.rb) 61 | # resources :products 62 | # end 63 | end 64 | -------------------------------------------------------------------------------- /example/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | 4 | # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 5 | gem 'rails', '4.2.0' 6 | # Use sqlite3 as the database for Active Record 7 | gem 'sqlite3' 8 | # Use SCSS for stylesheets 9 | gem 'sass-rails', '~> 4.0.3' 10 | # Use Uglifier as compressor for JavaScript assets 11 | gem 'uglifier', '>= 1.3.0' 12 | # Use CoffeeScript for .js.coffee assets and views 13 | gem 'coffee-rails', '~> 4.0.0' 14 | # See https://github.com/sstephenson/execjs#readme for more supported runtimes 15 | # gem 'therubyracer', platforms: :ruby 16 | 17 | # Use jquery as the JavaScript library 18 | gem 'jquery-rails' 19 | # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks 20 | gem 'turbolinks' 21 | # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 22 | gem 'jbuilder', '~> 2.0' 23 | # bundle exec rake doc:rails generates the API under doc/api. 24 | gem 'sdoc', '~> 0.4.0', group: :doc 25 | 26 | # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 27 | gem 'spring', group: :development 28 | 29 | #needed for now? 30 | gem 'volt', git: "git://github.com/bglusman/volt" 31 | gem 'volt-sockjs', git: "git://github.com/bglusman/sockjs-ruby" 32 | # gem 'volt-bootstrap_jumbotron_theme' 33 | # gem 'volt-user_templates' 34 | 35 | gem 'pry' 36 | gem 'third_rail', path: '../' 37 | # Use ActiveModel has_secure_password 38 | # gem 'bcrypt', '~> 3.1.7' 39 | 40 | # Use unicorn as the app server 41 | # gem 'unicorn' 42 | 43 | # Use Capistrano for deployment 44 | # gem 'capistrano-rails', group: :development 45 | 46 | # Use debugger 47 | # gem 'debugger', group: [:development, :test] 48 | 49 | -------------------------------------------------------------------------------- /example/Gemfile.lock: -------------------------------------------------------------------------------- 1 | GIT 2 | remote: git://github.com/bglusman/sockjs-ruby 3 | revision: dfade2b0bfa33c2955a30a94e912bfd48d550ca8 4 | specs: 5 | volt-sockjs (0.3.4.4) 6 | faye-websocket (~> 0.7.1) 7 | json 8 | rack 9 | rack-mount (~> 0.8.3) 10 | thin 11 | 12 | GIT 13 | remote: git://github.com/bglusman/volt 14 | revision: 3d9690bf1a0a0e61ad3a1e14132c9450f68cb551 15 | specs: 16 | volt (0.9.0.pre7) 17 | bcrypt (~> 3.1.9) 18 | bundler (>= 1.5) 19 | configurations (~> 2.0.0.pre) 20 | listen (~> 2.8.0) 21 | mongo (~> 1.9.0) 22 | opal (~> 0.7.1) 23 | opal-jquery (~> 0.3.0) 24 | pry (~> 0.10.0) 25 | rack (~> 1.5) 26 | sass (~> 3.2.5) 27 | sprockets-sass (~> 1.0.0) 28 | thor (~> 0.19.0) 29 | uglifier (>= 2.4.0) 30 | volt-sockjs (~> 0.3.4.4) 31 | yui-compressor (~> 0.12.0) 32 | 33 | PATH 34 | remote: ../ 35 | specs: 36 | third_rail (0.0.1) 37 | rails (~> 4.2) 38 | volt-bootstrap 39 | volt-bootstrap_jumbotron_theme 40 | volt-user_templates 41 | 42 | GEM 43 | remote: https://rubygems.org/ 44 | specs: 45 | actionmailer (4.2.0) 46 | actionpack (= 4.2.0) 47 | actionview (= 4.2.0) 48 | activejob (= 4.2.0) 49 | mail (~> 2.5, >= 2.5.4) 50 | rails-dom-testing (~> 1.0, >= 1.0.5) 51 | actionpack (4.2.0) 52 | actionview (= 4.2.0) 53 | activesupport (= 4.2.0) 54 | rack (~> 1.6.0) 55 | rack-test (~> 0.6.2) 56 | rails-dom-testing (~> 1.0, >= 1.0.5) 57 | rails-html-sanitizer (~> 1.0, >= 1.0.1) 58 | actionview (4.2.0) 59 | activesupport (= 4.2.0) 60 | builder (~> 3.1) 61 | erubis (~> 2.7.0) 62 | rails-dom-testing (~> 1.0, >= 1.0.5) 63 | rails-html-sanitizer (~> 1.0, >= 1.0.1) 64 | activejob (4.2.0) 65 | activesupport (= 4.2.0) 66 | globalid (>= 0.3.0) 67 | activemodel (4.2.0) 68 | activesupport (= 4.2.0) 69 | builder (~> 3.1) 70 | activerecord (4.2.0) 71 | activemodel (= 4.2.0) 72 | activesupport (= 4.2.0) 73 | arel (~> 6.0) 74 | activesupport (4.2.0) 75 | i18n (~> 0.7) 76 | json (~> 1.7, >= 1.7.7) 77 | minitest (~> 5.1) 78 | thread_safe (~> 0.3, >= 0.3.4) 79 | tzinfo (~> 1.1) 80 | arel (6.0.0) 81 | bcrypt (3.1.10) 82 | bson (1.9.2) 83 | builder (3.2.2) 84 | celluloid (0.16.0) 85 | timers (~> 4.0.0) 86 | coderay (1.1.0) 87 | coffee-rails (4.0.1) 88 | coffee-script (>= 2.2.0) 89 | railties (>= 4.0.0, < 5.0) 90 | coffee-script (2.4.1) 91 | coffee-script-source 92 | execjs 93 | coffee-script-source (1.9.1.1) 94 | configurations (2.0.0) 95 | daemons (1.2.2) 96 | erubis (2.7.0) 97 | eventmachine (1.0.7) 98 | execjs (2.5.2) 99 | faye-websocket (0.7.5) 100 | eventmachine (>= 0.12.0) 101 | websocket-driver (>= 0.3.5) 102 | ffi (1.9.8) 103 | globalid (0.3.5) 104 | activesupport (>= 4.1.0) 105 | hike (1.2.3) 106 | hitimes (1.2.2) 107 | i18n (0.7.0) 108 | jbuilder (2.2.13) 109 | activesupport (>= 3.0.0, < 5) 110 | multi_json (~> 1.2) 111 | jquery-rails (4.0.3) 112 | rails-dom-testing (~> 1.0) 113 | railties (>= 4.2.0) 114 | thor (>= 0.14, < 2.0) 115 | json (1.8.2) 116 | listen (2.8.6) 117 | celluloid (>= 0.15.2) 118 | rb-fsevent (>= 0.9.3) 119 | rb-inotify (>= 0.9) 120 | loofah (2.0.1) 121 | nokogiri (>= 1.5.9) 122 | mail (2.6.3) 123 | mime-types (>= 1.16, < 3) 124 | method_source (0.8.2) 125 | mime-types (2.4.3) 126 | mini_portile (0.6.2) 127 | minitest (5.6.0) 128 | mongo (1.9.2) 129 | bson (~> 1.9.2) 130 | multi_json (1.11.0) 131 | nokogiri (1.6.6.2) 132 | mini_portile (~> 0.6.0) 133 | opal (0.7.1) 134 | hike (~> 1.2) 135 | sourcemap (~> 0.1.0) 136 | sprockets (>= 2.2.3, < 4.0.0) 137 | tilt (~> 1.4) 138 | opal-jquery (0.3.0) 139 | opal (~> 0.7.0) 140 | pry (0.10.1) 141 | coderay (~> 1.1.0) 142 | method_source (~> 0.8.1) 143 | slop (~> 3.4) 144 | rack (1.6.0) 145 | rack-mount (0.8.3) 146 | rack (>= 1.0.0) 147 | rack-test (0.6.3) 148 | rack (>= 1.0) 149 | rails (4.2.0) 150 | actionmailer (= 4.2.0) 151 | actionpack (= 4.2.0) 152 | actionview (= 4.2.0) 153 | activejob (= 4.2.0) 154 | activemodel (= 4.2.0) 155 | activerecord (= 4.2.0) 156 | activesupport (= 4.2.0) 157 | bundler (>= 1.3.0, < 2.0) 158 | railties (= 4.2.0) 159 | sprockets-rails 160 | rails-deprecated_sanitizer (1.0.3) 161 | activesupport (>= 4.2.0.alpha) 162 | rails-dom-testing (1.0.6) 163 | activesupport (>= 4.2.0.beta, < 5.0) 164 | nokogiri (~> 1.6.0) 165 | rails-deprecated_sanitizer (>= 1.0.1) 166 | rails-html-sanitizer (1.0.2) 167 | loofah (~> 2.0) 168 | railties (4.2.0) 169 | actionpack (= 4.2.0) 170 | activesupport (= 4.2.0) 171 | rake (>= 0.8.7) 172 | thor (>= 0.18.1, < 2.0) 173 | rake (10.4.2) 174 | rb-fsevent (0.9.4) 175 | rb-inotify (0.9.5) 176 | ffi (>= 0.5.0) 177 | rdoc (4.2.0) 178 | json (~> 1.4) 179 | sass (3.2.19) 180 | sass-rails (4.0.5) 181 | railties (>= 4.0.0, < 5.0) 182 | sass (~> 3.2.2) 183 | sprockets (~> 2.8, < 3.0) 184 | sprockets-rails (~> 2.0) 185 | sdoc (0.4.1) 186 | json (~> 1.7, >= 1.7.7) 187 | rdoc (~> 4.0) 188 | slop (3.6.0) 189 | sourcemap (0.1.1) 190 | spring (1.3.4) 191 | sprockets (2.12.3) 192 | hike (~> 1.2) 193 | multi_json (~> 1.0) 194 | rack (~> 1.0) 195 | tilt (~> 1.1, != 1.3.0) 196 | sprockets-rails (2.2.4) 197 | actionpack (>= 3.0) 198 | activesupport (>= 3.0) 199 | sprockets (>= 2.8, < 4.0) 200 | sprockets-sass (1.0.3) 201 | sprockets (~> 2.0) 202 | tilt (~> 1.1) 203 | sqlite3 (1.3.10) 204 | thin (1.6.3) 205 | daemons (~> 1.0, >= 1.0.9) 206 | eventmachine (~> 1.0) 207 | rack (~> 1.0) 208 | thor (0.19.1) 209 | thread_safe (0.3.5) 210 | tilt (1.4.1) 211 | timers (4.0.1) 212 | hitimes 213 | turbolinks (2.5.3) 214 | coffee-rails 215 | tzinfo (1.2.2) 216 | thread_safe (~> 0.1) 217 | uglifier (2.7.1) 218 | execjs (>= 0.3.0) 219 | json (>= 1.8.0) 220 | volt-bootstrap (0.0.10) 221 | volt-bootstrap_jumbotron_theme (0.1.0) 222 | volt-fields (0.1.0) 223 | volt-user_templates (0.1.4) 224 | volt-fields (~> 0.1.0) 225 | websocket-driver (0.5.4) 226 | websocket-extensions (>= 0.1.0) 227 | websocket-extensions (0.1.2) 228 | yui-compressor (0.12.0) 229 | 230 | PLATFORMS 231 | ruby 232 | 233 | DEPENDENCIES 234 | coffee-rails (~> 4.0.0) 235 | jbuilder (~> 2.0) 236 | jquery-rails 237 | pry 238 | rails (= 4.2.0) 239 | sass-rails (~> 4.0.3) 240 | sdoc (~> 0.4.0) 241 | spring 242 | sqlite3 243 | third_rail! 244 | turbolinks 245 | uglifier (>= 1.3.0) 246 | volt! 247 | volt-sockjs! 248 | -------------------------------------------------------------------------------- /example/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 | -------------------------------------------------------------------------------- /example/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 | -------------------------------------------------------------------------------- /example/app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/app/assets/images/.keep -------------------------------------------------------------------------------- /example/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 jquery 14 | //= require jquery_ujs 15 | //= require turbolinks 16 | //= require_tree . 17 | -------------------------------------------------------------------------------- /example/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 | -------------------------------------------------------------------------------- /example/app/controllers/about_controller.rb: -------------------------------------------------------------------------------- 1 | class AboutController < ApplicationController 2 | layout 'volt' 3 | def index 4 | end 5 | 6 | end -------------------------------------------------------------------------------- /example/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 | helper ThirdRail::Engine.helpers 6 | # layout 'volt' 7 | end 8 | -------------------------------------------------------------------------------- /example/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /example/app/controllers/home_controller.rb: -------------------------------------------------------------------------------- 1 | class HomeController < ApplicationController 2 | def index 3 | end 4 | 5 | end 6 | -------------------------------------------------------------------------------- /example/app/controllers/random_controller.rb: -------------------------------------------------------------------------------- 1 | class RandomController < ApplicationController 2 | layout 'volt' 3 | def index 4 | end 5 | 6 | end -------------------------------------------------------------------------------- /example/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /example/app/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/app/mailers/.keep -------------------------------------------------------------------------------- /example/app/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/app/models/.keep -------------------------------------------------------------------------------- /example/app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/example/app/models/concerns/.keep -------------------------------------------------------------------------------- /example/app/views/about/index.html.erb: -------------------------------------------------------------------------------- 1 |

HEY THIS IS SOME ABOUT CONTENT RENDERED VIA THE RAILS APP, and sent to you on <%= Time.now %>

2 | -------------------------------------------------------------------------------- /example/app/views/application/index.html.erb: -------------------------------------------------------------------------------- 1 |

HEY THIS IS SOME ABOUT CONTENT RENDERED VIA THE RAILS APP, and sent to you on <%= Time.now %>

2 | -------------------------------------------------------------------------------- /example/app/views/electric/about/index.html.erb: -------------------------------------------------------------------------------- 1 |

HEY THIS IS SOME ABOUT CONTENT RENDERED VIA THE RAILS APP, and sent to you on <%= Time.now %>

2 | -------------------------------------------------------------------------------- /example/app/views/electric/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/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 |

About

6 | 7 |

About page...

8 | 9 |

and this brought to you by rails

10 | {{ content_for }} -------------------------------------------------------------------------------- /example/app/voltage/app/main/views/main/index.html: -------------------------------------------------------------------------------- 1 | <:Title> 2 | Home 3 | 4 | <:Body> 5 |

The Third Rail

6 | {{ content_for }} 7 | -------------------------------------------------------------------------------- /example/app/voltage/app/main/views/main/main.html: -------------------------------------------------------------------------------- 1 | <:Title> 2 | {{ view main_path, "title", {controller_group: 'main'} }} 3 | 4 | <:Body> 5 |
6 |
7 | 12 |

sample

13 |
14 | 15 | <:volt:notices /> 16 | 17 | {{ view main_path, 'body', {controller_group: 'main'} }} 18 | 19 | 22 | 23 |
24 | 25 | <:Nav> 26 |
  • 27 | {{ yield }} 28 |
  • 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.

    65 |
    66 | 67 | 68 | -------------------------------------------------------------------------------- /example/public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
    60 |
    61 |

    The change you wanted was rejected.

    62 |

    Maybe you tried to change something you didn't have access to.

    63 |
    64 |

    If you are the application owner check the logs for more information.

    65 |
    66 | 67 | 68 | -------------------------------------------------------------------------------- /example/public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
    60 |
    61 |

    We're sorry, but something went wrong.

    62 |
    63 |

    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.

    65 |
    66 | 67 | 68 | -------------------------------------------------------------------------------- /test/dummy/public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
    60 |
    61 |

    The change you wanted was rejected.

    62 |

    Maybe you tried to change something you didn't have access to.

    63 |
    64 |

    If you are the application owner check the logs for more information.

    65 |
    66 | 67 | 68 | -------------------------------------------------------------------------------- /test/dummy/public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
    60 |
    61 |

    We're sorry, but something went wrong.

    62 |
    63 |

    If you are the application owner check the logs for more information.

    64 |
    65 | 66 | 67 | -------------------------------------------------------------------------------- /test/dummy/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/catprintlabs/third-rail/11700e53829ad8fba83aa8db7e5404404e2e3d16/test/dummy/public/favicon.ico -------------------------------------------------------------------------------- /test/integration/navigation_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class NavigationTest < ActionDispatch::IntegrationTest 4 | fixtures :all 5 | 6 | # test "the truth" do 7 | # assert true 8 | # end 9 | end 10 | 11 | -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | # Configure Rails Environment 2 | ENV["RAILS_ENV"] = "test" 3 | 4 | require File.expand_path("../dummy/config/environment.rb", __FILE__) 5 | require "rails/test_help" 6 | 7 | Rails.backtrace_cleaner.remove_silencers! 8 | 9 | # Load support files 10 | Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } 11 | 12 | # Load fixtures from the engine 13 | if ActiveSupport::TestCase.method_defined?(:fixture_path=) 14 | ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__) 15 | end 16 | -------------------------------------------------------------------------------- /test/third_rail_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ThirdRailTest < ActiveSupport::TestCase 4 | test "truth" do 5 | assert_kind_of Module, ThirdRail 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /third_rail.gemspec: -------------------------------------------------------------------------------- 1 | $:.push File.expand_path("../lib", __FILE__) 2 | 3 | # Maintain your gem's version: 4 | require "third_rail/version" 5 | 6 | # Describe your gem and declare its dependencies: 7 | Gem::Specification.new do |s| 8 | s.name = "third_rail" 9 | s.version = ThirdRail::VERSION 10 | s.authors = ["TODO: Your name"] 11 | s.email = ["TODO: Your email"] 12 | s.homepage = "TODO" 13 | s.summary = "TODO: Summary of ThirdRail." 14 | s.description = "TODO: Description of ThirdRail." 15 | s.license = "MIT" 16 | 17 | s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"] 18 | s.test_files = Dir["test/**/*"] 19 | 20 | s.add_dependency "rails", "~> 4.2" 21 | s.add_dependency 'volt-bootstrap' 22 | s.add_dependency 'volt-bootstrap_jumbotron_theme' 23 | s.add_dependency 'volt-user_templates' 24 | 25 | s.add_development_dependency "sqlite3" 26 | end 27 | --------------------------------------------------------------------------------