fierce 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/.rspec +2 -0
  4. data/.rvmrc +6 -0
  5. data/Gemfile +4 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +144 -0
  8. data/Rakefile +15 -0
  9. data/fierce.gemspec +28 -0
  10. data/integration_spec/dummy/.gitignore +16 -0
  11. data/integration_spec/dummy/.rspec +1 -0
  12. data/integration_spec/dummy/Gemfile +8 -0
  13. data/integration_spec/dummy/README.rdoc +28 -0
  14. data/integration_spec/dummy/Rakefile +6 -0
  15. data/integration_spec/dummy/app/assets/images/.keep +0 -0
  16. data/integration_spec/dummy/app/assets/javascripts/application.js +13 -0
  17. data/integration_spec/dummy/app/assets/javascripts/home.js +2 -0
  18. data/integration_spec/dummy/app/assets/stylesheets/application.css +13 -0
  19. data/integration_spec/dummy/app/assets/stylesheets/home.css +4 -0
  20. data/integration_spec/dummy/app/controllers/application_controller.rb +5 -0
  21. data/integration_spec/dummy/app/controllers/home_controller.rb +9 -0
  22. data/integration_spec/dummy/app/helpers/application_helper.rb +2 -0
  23. data/integration_spec/dummy/app/helpers/home_helper.rb +5 -0
  24. data/integration_spec/dummy/app/mailers/.keep +0 -0
  25. data/integration_spec/dummy/app/models/.keep +0 -0
  26. data/integration_spec/dummy/app/models/concerns/.keep +0 -0
  27. data/integration_spec/dummy/app/presenters/home/index.rb +15 -0
  28. data/integration_spec/dummy/app/presenters/home/show.rb +22 -0
  29. data/integration_spec/dummy/app/presenters/layouts/application.rb +19 -0
  30. data/integration_spec/dummy/app/views/home/_hamlton.html.haml +1 -0
  31. data/integration_spec/dummy/app/views/home/_local.html.mustache +1 -0
  32. data/integration_spec/dummy/app/views/home/_looplet.html.mustache +1 -0
  33. data/integration_spec/dummy/app/views/home/index.html.mustache +8 -0
  34. data/integration_spec/dummy/app/views/home/show.html.mustache +4 -0
  35. data/integration_spec/dummy/app/views/layouts/_far_away.html.mustache +1 -0
  36. data/integration_spec/dummy/app/views/layouts/application.html.mustache +14 -0
  37. data/integration_spec/dummy/bin/bundle +3 -0
  38. data/integration_spec/dummy/bin/rails +4 -0
  39. data/integration_spec/dummy/bin/rake +4 -0
  40. data/integration_spec/dummy/config/application.rb +28 -0
  41. data/integration_spec/dummy/config/boot.rb +4 -0
  42. data/integration_spec/dummy/config/environment.rb +5 -0
  43. data/integration_spec/dummy/config/environments/development.rb +27 -0
  44. data/integration_spec/dummy/config/environments/production.rb +80 -0
  45. data/integration_spec/dummy/config/environments/test.rb +36 -0
  46. data/integration_spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  47. data/integration_spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  48. data/integration_spec/dummy/config/initializers/inflections.rb +16 -0
  49. data/integration_spec/dummy/config/initializers/mime_types.rb +5 -0
  50. data/integration_spec/dummy/config/initializers/secret_token.rb +12 -0
  51. data/integration_spec/dummy/config/initializers/session_store.rb +3 -0
  52. data/integration_spec/dummy/config/initializers/wrap_parameters.rb +9 -0
  53. data/integration_spec/dummy/config/locales/en.yml +23 -0
  54. data/integration_spec/dummy/config/routes.rb +57 -0
  55. data/integration_spec/dummy/config.ru +4 -0
  56. data/integration_spec/dummy/db/seeds.rb +7 -0
  57. data/integration_spec/dummy/lib/assets/.keep +0 -0
  58. data/integration_spec/dummy/lib/tasks/.keep +0 -0
  59. data/integration_spec/dummy/log/.keep +0 -0
  60. data/integration_spec/dummy/public/404.html +58 -0
  61. data/integration_spec/dummy/public/422.html +58 -0
  62. data/integration_spec/dummy/public/500.html +57 -0
  63. data/integration_spec/dummy/public/favicon.ico +0 -0
  64. data/integration_spec/dummy/public/robots.txt +5 -0
  65. data/integration_spec/dummy/spec/controllers/home_controller_spec.rb +51 -0
  66. data/integration_spec/dummy/spec/spec_helper.rb +22 -0
  67. data/integration_spec/dummy/vendor/assets/javascripts/.keep +0 -0
  68. data/integration_spec/dummy/vendor/assets/stylesheets/.keep +0 -0
  69. data/lib/fierce/config.rb +15 -0
  70. data/lib/fierce/delegate_generator/controller.rb +39 -0
  71. data/lib/fierce/handler.rb +7 -0
  72. data/lib/fierce/master_of_ceremonies.rb +56 -0
  73. data/lib/fierce/partial_finder.rb +50 -0
  74. data/lib/fierce/presenter_finder.rb +39 -0
  75. data/lib/fierce/railtie.rb +13 -0
  76. data/lib/fierce/renderer.rb +13 -0
  77. data/lib/fierce/stage_manager.rb +23 -0
  78. data/lib/fierce/version.rb +3 -0
  79. data/lib/fierce/view_model.rb +23 -0
  80. data/lib/fierce.rb +14 -0
  81. data/spec/config_spec.rb +16 -0
  82. data/spec/custom_presenters/home/index.rb +9 -0
  83. data/spec/delegate_generator/controller_spec.rb +19 -0
  84. data/spec/master_of_ceremonies_spec.rb +50 -0
  85. data/spec/presenter_finder_spec.rb +21 -0
  86. data/spec/spec_helper.rb +22 -0
  87. data/spec/support/stubs.rb +36 -0
  88. data/spec/support/view_model_spec.rb +0 -0
  89. data/spec/view_model_spec.rb +20 -0
  90. metadata +225 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3c03f28d4d92a16a4dbf0ebbae31c8e32e03a65b
4
+ data.tar.gz: 72627f2c9a1e2913fe38c687810f29fb5a47be76
5
+ SHA512:
6
+ metadata.gz: a8c9ef3d7c6fa31b02f38f2615381c010de03552c59dff6055e9527eeb05cbe16d6d59898735e15f7b09a70a5971a91e9dcbf885c1035f7f31444c488eda8ba7
7
+ data.tar.gz: 3ee6232ef77cba1625943a50b26520aa8a4548a2dc8cd9b12d38d8412fbbb82e191921ff0ef44ed1a2e34c5ae85d09d2c223ed206d7df76399a96f2122faf239
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format progress
data/.rvmrc ADDED
@@ -0,0 +1,6 @@
1
+ rvm_install_on_use_flag=1
2
+ rvm_trust_rvmrcs_flag=1
3
+ rvm_gemset_create_on_use_flag=1
4
+
5
+ rvm use 2.0.0@fierce --create
6
+
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in fierce.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 SocialChorus, Inc.
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,144 @@
1
+ # Fierce
2
+
3
+ Fierce is opinionate view logic for Rails. Templates are written in HTML and tucked into the views directory. View logic is handled by presenters, that have their own top level app directory. These presenters are plain old Ruby objects, not some special subclass of Fierceness.
4
+
5
+ ![Fierce Conchita Wurst](http://eurovisionireland.files.wordpress.com/2013/10/conchita-wurst-internal-selection.jpg)
6
+ ###### Fierce image brought to you by Conchita Wurst: http://eurovisionireland.files.wordpress.com/2013/10/conchita-wurst-internal-selection.jpg.
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ gem 'fierce'
13
+
14
+ And then execute:
15
+
16
+ $ bundle
17
+
18
+ Or install it yourself as:
19
+
20
+ $ gem install fierce
21
+
22
+ ## Usage
23
+
24
+ Install the gem and you will be ready to start writing mustache templates. These templates get tucked into the appropriate place in your views directory, just like an ERB or HAML view. As with other view pre-processors, the file name usually includes the ultimate format, for example: show.html.mustache.
25
+
26
+ When Rails goes to find the view logic to marry with the mustache, it will look the presenters directory. So, go make a presenters directory!
27
+
28
+ `mkdir app/presenters`
29
+
30
+ If there a presenter is not found, the mustache gets rendered from the logic it can find.
31
+
32
+ Given a mustache template like this:
33
+
34
+ <h1>Be Fierce</h1>
35
+ <p>{{from_instance_variables}}</p>
36
+ <p>{{from_helpers}}</p>
37
+ <p>{{from_your_presenter}}</p>
38
+
39
+ And a controller that exposes an instance variable like so:
40
+
41
+ # some controller
42
+ def show
43
+ @from_instance_variable = 'Expose your instance variables sparingly. Sandi Metz will love you for just using one.'
44
+ end
45
+
46
+ And a helper somewhere that has this logic:
47
+
48
+ def from_helpers
49
+ "Don't use a helper; it's just bad form ... but if you must, you must."
50
+ end
51
+
52
+ And a presenter with a little something too:
53
+
54
+ class Presenters::Home::Index
55
+ def from_your_presenters
56
+ "Use your presenters. It is a pure Ruby class of your own. Mixins and inheritance just work. One presenter per view. Go!"
57
+ end
58
+ end
59
+
60
+ Will all go together to render some excellent HTML:
61
+
62
+ <h1>Be Fierce</h1>
63
+ <p>Expose your instance variables sparingly. Sandi Metz will love you for just using one.</p>
64
+ <p>Don't use a helper; it's just bad form ... but if you must, you must.</p>
65
+ <p>Use your presenters. It is a pure Ruby class of your own. Mixins and inheritance just work. One presenter per view. Go!</p>
66
+
67
+ #### Presenter Classes
68
+
69
+ Presenter classes should be put in the same directory structure as the view they are logic-ing:
70
+
71
+ app/
72
+ views/
73
+ home/
74
+ index.html.mustache
75
+
76
+ presenters/
77
+ home/
78
+ index.rb
79
+
80
+ If you don't follow this pattern, no custom presenter will be used. Instead the mustache will be rendered with whatever it can find in controller instance variable and helpers.
81
+
82
+ Classes that initialize with a single argument will be passed a default presenter. It will have accessors to those instance variable exposed in the controller. It will also have access to locals and helper methods where appropriate.
83
+
84
+ Given the setup previously described, helpers, controllers and all:
85
+
86
+ class Presenters::Home::Index
87
+ attr_reader :default_presenter
88
+
89
+ def initialize(default_presenter)
90
+ @default_presenter = default_presenter
91
+ end
92
+
93
+ def contatenated_stuff
94
+ default_presenter.from_instance_variables + ' '
95
+ default_presenter.from_helpers + ' '
96
+ " some other stuff"
97
+ end
98
+ end
99
+
100
+ #### What about Layouts?
101
+
102
+ Layouts can be mustache too, with a presenter of their own. This is how to yield the layout content, in a very ERB-styled way:
103
+
104
+ <!DOCTYPE html>
105
+ <html>
106
+ <head>
107
+ <title>Fierce Layout</title>
108
+ </head>
109
+ <body>
110
+ {{{yield}}}
111
+ </body>
112
+ </html>
113
+
114
+ Notice the triple curlies: `{{{yield}}}`. They allow the html to be dumped directly into the layout without being escaped in such a way that all the tags show up as text. That's the only trick.
115
+
116
+ What about using yield with an argument, you ask? Well that seems like a terrible practice, but is should work ok too: `{{{yield.head}}}`.
117
+
118
+ #### Partials
119
+
120
+ Mustache views are logicless and cleans. What that means for partials is that a name, not a path needs to be passed in the template:
121
+
122
+ {{> my_partial}}
123
+
124
+ For partials in the same directory as the view being rendered, this nameing works great.
125
+
126
+ The most powerful partials are shared amongst different templates and are not located in the current view directory. In your custom presenter, you can create a #partials method that returns a hash, mapping names to paths.
127
+
128
+ def partials
129
+ {
130
+ my_partial: '/reports/show',
131
+ something_tiny: 'here'
132
+ }
133
+ end
134
+
135
+ Fierce will find the partials given a map to the paths. What is more, presenters are pure ruby objects and can share this logic amongst views.
136
+
137
+
138
+ ## Contributing
139
+
140
+ 1. Fork it
141
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
142
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
143
+ 4. Push to the branch (`git push origin my-new-feature`)
144
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,15 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ desc "uses rails dummy app to integration test gem"
4
+ task :integration_test do
5
+ Dir.chdir(File.dirname(__FILE__) + "/integration_spec/dummy") do
6
+ system('rspec')
7
+ end
8
+ end
9
+
10
+ desc "runs local specs"
11
+ task :spec do
12
+ system('rspec')
13
+ end
14
+
15
+ task :default => [:spec, :integration_test]
data/fierce.gemspec ADDED
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'fierce/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "fierce"
8
+ spec.version = Fierce::VERSION
9
+ spec.authors = ["Kane Baccigalupi"]
10
+ spec.email = ["developers@socialchorus.com"]
11
+ spec.description = %q{Fierce, opinionate view logic for Rails}
12
+ spec.summary = %q{Fierce, opinionate view logic for Rails}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency "mustache"
22
+ spec.add_dependency 'activesupport'
23
+
24
+ spec.add_development_dependency "bundler", "~> 1.3"
25
+ spec.add_development_dependency "rake"
26
+ spec.add_development_dependency 'rspec'
27
+ spec.add_development_dependency 'rails'
28
+ end
@@ -0,0 +1,16 @@
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore the default SQLite database.
11
+ /db/*.sqlite3
12
+ /db/*.sqlite3-journal
13
+
14
+ # Ignore all logfiles and tempfiles.
15
+ /log/*.log
16
+ /tmp
@@ -0,0 +1 @@
1
+ --color
@@ -0,0 +1,8 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
4
+ gem 'rails', '4.0.1'
5
+
6
+ gem 'fierce', path: '../../'
7
+ gem 'haml'
8
+ gem 'rspec-rails'
@@ -0,0 +1,28 @@
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
+ <tt>rake doc:app</tt>.
@@ -0,0 +1,6 @@
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
+ Dummy::Application.load_tasks
File without changes
@@ -0,0 +1,13 @@
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 .
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,13 @@
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 top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require_tree .
13
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,5 @@
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
@@ -0,0 +1,9 @@
1
+ class HomeController < ApplicationController
2
+ def index
3
+ @from_the_ivars = 'Hello from the controller ivars'
4
+ end
5
+
6
+ def show
7
+ @loop_it = params[:id].to_i
8
+ end
9
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,5 @@
1
+ module HomeHelper
2
+ def from_the_helper
3
+ 'Hello from the helpers'
4
+ end
5
+ end
File without changes
File without changes
File without changes
@@ -0,0 +1,15 @@
1
+ module Presenters
2
+ module Home
3
+ class Index
4
+ def from_the_presenter
5
+ 'Hello from the presenter'
6
+ end
7
+
8
+ def partials
9
+ {
10
+ far_away: '/layouts/far_away'
11
+ }
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,22 @@
1
+ module Presenters
2
+ module Home
3
+ class Show
4
+ attr_reader :view_model
5
+
6
+ def initialize(view_model)
7
+ @view_model = view_model
8
+ end
9
+
10
+ def loop_count
11
+ view_model.loop_it
12
+ end
13
+
14
+ def loops
15
+ (1..loop_count).to_a.map{|n| Looplet.new(n) }
16
+ end
17
+
18
+ class Looplet < Struct.new(:n)
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,19 @@
1
+ module Presenters
2
+ module Layouts
3
+ class Application
4
+ attr_reader :view_model
5
+
6
+ def initialize(view_model)
7
+ @view_model = view_model
8
+ end
9
+
10
+ def stylesheets
11
+ view_model.stylesheet_link_tag('application', media: 'all')
12
+ end
13
+
14
+ def javascripts
15
+ view_model.javascript_include_tag('application')
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1 @@
1
+ %p Hello from haml-dom
@@ -0,0 +1 @@
1
+ <p>Hello from a local partial</p>
@@ -0,0 +1 @@
1
+ <p>loop {{n}}</p>
@@ -0,0 +1,8 @@
1
+ <h1>Hello World</h1>
2
+
3
+ <p>{{from_the_helper}}</p>
4
+ <p>{{from_the_ivars}}</p>
5
+ <p>{{from_the_presenter}}</p>
6
+ {{> local}}
7
+ {{> far_away}}
8
+ {{> hamlton}}
@@ -0,0 +1,4 @@
1
+ <h1>I will loop</h1>
2
+ {{#loops}}
3
+ {{> looplet}}
4
+ {{/loops}}
@@ -0,0 +1 @@
1
+ <p>Hello from a partial far, far away</p>
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Fierce Dummy</title>
5
+ {{! anywhere we are generating html and inserting, we need to use triple curlies}}
6
+
7
+ {{{csrf_meta_tags}}}
8
+ {{{stylesheets}}}
9
+ {{{javascripts}}}
10
+ </head>
11
+ <body>
12
+ {{{yield}}}
13
+ </body>
14
+ </html>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -0,0 +1,28 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ # Pick the frameworks you want:
4
+ # require "active_record/railtie"
5
+ require "action_controller/railtie"
6
+ require "action_mailer/railtie"
7
+ require "sprockets/railtie"
8
+ # require "rails/test_unit/railtie"
9
+
10
+ # Require the gems listed in Gemfile, including any gems
11
+ # you've limited to :test, :development, or :production.
12
+ Bundler.require(:default, Rails.env)
13
+
14
+ module Dummy
15
+ class Application < Rails::Application
16
+ # Settings in config/environments/* take precedence over those specified here.
17
+ # Application configuration should go into files in config/initializers
18
+ # -- all .rb files in that directory are automatically loaded.
19
+
20
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
21
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
22
+ # config.time_zone = 'Central Time (US & Canada)'
23
+
24
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
25
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
26
+ # config.i18n.default_locale = :de
27
+ end
28
+ end
@@ -0,0 +1,4 @@
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+
4
+ require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the Rails application.
5
+ Dummy::Application.initialize!
@@ -0,0 +1,27 @@
1
+ Dummy::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
+
23
+ # Debug mode disables concatenation and preprocessing of assets.
24
+ # This option may cause significant delays in view rendering with a large
25
+ # number of complex assets.
26
+ config.assets.debug = true
27
+ end