fierce 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.rspec +2 -0
- data/.rvmrc +6 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +144 -0
- data/Rakefile +15 -0
- data/fierce.gemspec +28 -0
- data/integration_spec/dummy/.gitignore +16 -0
- data/integration_spec/dummy/.rspec +1 -0
- data/integration_spec/dummy/Gemfile +8 -0
- data/integration_spec/dummy/README.rdoc +28 -0
- data/integration_spec/dummy/Rakefile +6 -0
- data/integration_spec/dummy/app/assets/images/.keep +0 -0
- data/integration_spec/dummy/app/assets/javascripts/application.js +13 -0
- data/integration_spec/dummy/app/assets/javascripts/home.js +2 -0
- data/integration_spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/integration_spec/dummy/app/assets/stylesheets/home.css +4 -0
- data/integration_spec/dummy/app/controllers/application_controller.rb +5 -0
- data/integration_spec/dummy/app/controllers/home_controller.rb +9 -0
- data/integration_spec/dummy/app/helpers/application_helper.rb +2 -0
- data/integration_spec/dummy/app/helpers/home_helper.rb +5 -0
- data/integration_spec/dummy/app/mailers/.keep +0 -0
- data/integration_spec/dummy/app/models/.keep +0 -0
- data/integration_spec/dummy/app/models/concerns/.keep +0 -0
- data/integration_spec/dummy/app/presenters/home/index.rb +15 -0
- data/integration_spec/dummy/app/presenters/home/show.rb +22 -0
- data/integration_spec/dummy/app/presenters/layouts/application.rb +19 -0
- data/integration_spec/dummy/app/views/home/_hamlton.html.haml +1 -0
- data/integration_spec/dummy/app/views/home/_local.html.mustache +1 -0
- data/integration_spec/dummy/app/views/home/_looplet.html.mustache +1 -0
- data/integration_spec/dummy/app/views/home/index.html.mustache +8 -0
- data/integration_spec/dummy/app/views/home/show.html.mustache +4 -0
- data/integration_spec/dummy/app/views/layouts/_far_away.html.mustache +1 -0
- data/integration_spec/dummy/app/views/layouts/application.html.mustache +14 -0
- data/integration_spec/dummy/bin/bundle +3 -0
- data/integration_spec/dummy/bin/rails +4 -0
- data/integration_spec/dummy/bin/rake +4 -0
- data/integration_spec/dummy/config/application.rb +28 -0
- data/integration_spec/dummy/config/boot.rb +4 -0
- data/integration_spec/dummy/config/environment.rb +5 -0
- data/integration_spec/dummy/config/environments/development.rb +27 -0
- data/integration_spec/dummy/config/environments/production.rb +80 -0
- data/integration_spec/dummy/config/environments/test.rb +36 -0
- data/integration_spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/integration_spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/integration_spec/dummy/config/initializers/inflections.rb +16 -0
- data/integration_spec/dummy/config/initializers/mime_types.rb +5 -0
- data/integration_spec/dummy/config/initializers/secret_token.rb +12 -0
- data/integration_spec/dummy/config/initializers/session_store.rb +3 -0
- data/integration_spec/dummy/config/initializers/wrap_parameters.rb +9 -0
- data/integration_spec/dummy/config/locales/en.yml +23 -0
- data/integration_spec/dummy/config/routes.rb +57 -0
- data/integration_spec/dummy/config.ru +4 -0
- data/integration_spec/dummy/db/seeds.rb +7 -0
- data/integration_spec/dummy/lib/assets/.keep +0 -0
- data/integration_spec/dummy/lib/tasks/.keep +0 -0
- data/integration_spec/dummy/log/.keep +0 -0
- data/integration_spec/dummy/public/404.html +58 -0
- data/integration_spec/dummy/public/422.html +58 -0
- data/integration_spec/dummy/public/500.html +57 -0
- data/integration_spec/dummy/public/favicon.ico +0 -0
- data/integration_spec/dummy/public/robots.txt +5 -0
- data/integration_spec/dummy/spec/controllers/home_controller_spec.rb +51 -0
- data/integration_spec/dummy/spec/spec_helper.rb +22 -0
- data/integration_spec/dummy/vendor/assets/javascripts/.keep +0 -0
- data/integration_spec/dummy/vendor/assets/stylesheets/.keep +0 -0
- data/lib/fierce/config.rb +15 -0
- data/lib/fierce/delegate_generator/controller.rb +39 -0
- data/lib/fierce/handler.rb +7 -0
- data/lib/fierce/master_of_ceremonies.rb +56 -0
- data/lib/fierce/partial_finder.rb +50 -0
- data/lib/fierce/presenter_finder.rb +39 -0
- data/lib/fierce/railtie.rb +13 -0
- data/lib/fierce/renderer.rb +13 -0
- data/lib/fierce/stage_manager.rb +23 -0
- data/lib/fierce/version.rb +3 -0
- data/lib/fierce/view_model.rb +23 -0
- data/lib/fierce.rb +14 -0
- data/spec/config_spec.rb +16 -0
- data/spec/custom_presenters/home/index.rb +9 -0
- data/spec/delegate_generator/controller_spec.rb +19 -0
- data/spec/master_of_ceremonies_spec.rb +50 -0
- data/spec/presenter_finder_spec.rb +21 -0
- data/spec/spec_helper.rb +22 -0
- data/spec/support/stubs.rb +36 -0
- data/spec/support/view_model_spec.rb +0 -0
- data/spec/view_model_spec.rb +20 -0
- 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
data/.rspec
ADDED
data/.rvmrc
ADDED
data/Gemfile
ADDED
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,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>.
|
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,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
|
+
*/
|
File without changes
|
File without changes
|
File without changes
|
@@ -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 @@
|
|
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,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,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
|