phenomenal_rails 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE +179 -0
- data/README.rdoc +3 -0
- data/Rakefile +5 -0
- data/app/assets/javascripts/phenomenal_rails/application.js +9 -0
- data/app/assets/stylesheets/phenomenal_rails/application.css +7 -0
- data/app/controllers/phenomenal_rails/application_controller.rb +4 -0
- data/app/views/layouts/phenomenal_rails/application.html.erb +14 -0
- data/config/routes.rb +2 -0
- data/lib/phenomenal_rails/context.rb +22 -0
- data/lib/phenomenal_rails/engine.rb +12 -0
- data/lib/phenomenal_rails/middleware.rb +15 -0
- data/lib/phenomenal_rails/resolver.rb +58 -0
- data/lib/phenomenal_rails/version.rb +3 -0
- data/lib/phenomenal_rails.rb +43 -0
- data/lib/tasks/phenomenal_rails_tasks.rake +4 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +9 -0
- data/spec/dummy/app/contexts/persistent_feature/persistent_feature.rb +12 -0
- data/spec/dummy/app/contexts/persistent_feature/test_context/test_context.rb +9 -0
- data/spec/dummy/app/contexts/persistent_feature/test_context/views/shared/_partial1.html.haml +1 -0
- data/spec/dummy/app/controllers/application_controller.rb +8 -0
- data/spec/dummy/app/helpers/application_helper.rb +5 -0
- data/spec/dummy/app/views/layouts/application.html.erb +12 -0
- data/spec/dummy/app/views/pages/home.html.haml +26 -0
- data/spec/dummy/app/views/shared/_partial1.html.haml +1 -0
- data/spec/dummy/config/application.rb +48 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +4 -0
- data/spec/dummy/config/environments/development.rb +30 -0
- data/spec/dummy/config/environments/production.rb +60 -0
- data/spec/dummy/config/environments/test.rb +39 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +11 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +5 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/production.sqlite3 +0 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +2184 -0
- data/spec/dummy/log/production.log +1135 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +26 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/spec_helper.rb +32 -0
- metadata +166 -0
data/LICENSE
ADDED
@@ -0,0 +1,179 @@
|
|
1
|
+
Copyright (C) 2011 Thibault Poncelet <thibault.poncelet@student.uclouvain.be>
|
2
|
+
Copyright (C) 2011 Loic Vigneron <loic.vigneron@student.uclouvain.be>
|
3
|
+
|
4
|
+
GNU LESSER GENERAL PUBLIC LICENSE
|
5
|
+
Version 3, 29 June 2007
|
6
|
+
|
7
|
+
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
8
|
+
Everyone is permitted to copy and distribute verbatim copies
|
9
|
+
of this license document, but changing it is not allowed.
|
10
|
+
|
11
|
+
|
12
|
+
This version of the GNU Lesser General Public License incorporates
|
13
|
+
the terms and conditions of version 3 of the GNU General Public
|
14
|
+
License, supplemented by the additional permissions listed below.
|
15
|
+
|
16
|
+
0. Additional Definitions.
|
17
|
+
|
18
|
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
19
|
+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
20
|
+
General Public License.
|
21
|
+
|
22
|
+
"The Library" refers to a covered work governed by this License,
|
23
|
+
other than an Application or a Combined Work as defined below.
|
24
|
+
|
25
|
+
An "Application" is any work that makes use of an interface provided
|
26
|
+
by the Library, but which is not otherwise based on the Library.
|
27
|
+
Defining a subclass of a class defined by the Library is deemed a mode
|
28
|
+
of using an interface provided by the Library.
|
29
|
+
|
30
|
+
A "Combined Work" is a work produced by combining or linking an
|
31
|
+
Application with the Library. The particular version of the Library
|
32
|
+
with which the Combined Work was made is also called the "Linked
|
33
|
+
Version".
|
34
|
+
|
35
|
+
The "Minimal Corresponding Source" for a Combined Work means the
|
36
|
+
Corresponding Source for the Combined Work, excluding any source code
|
37
|
+
for portions of the Combined Work that, considered in isolation, are
|
38
|
+
based on the Application, and not on the Linked Version.
|
39
|
+
|
40
|
+
The "Corresponding Application Code" for a Combined Work means the
|
41
|
+
object code and/or source code for the Application, including any data
|
42
|
+
and utility programs needed for reproducing the Combined Work from the
|
43
|
+
Application, but excluding the System Libraries of the Combined Work.
|
44
|
+
|
45
|
+
1. Exception to Section 3 of the GNU GPL.
|
46
|
+
|
47
|
+
You may convey a covered work under sections 3 and 4 of this License
|
48
|
+
without being bound by section 3 of the GNU GPL.
|
49
|
+
|
50
|
+
2. Conveying Modified Versions.
|
51
|
+
|
52
|
+
If you modify a copy of the Library, and, in your modifications, a
|
53
|
+
facility refers to a function or data to be supplied by an Application
|
54
|
+
that uses the facility (other than as an argument passed when the
|
55
|
+
facility is invoked), then you may convey a copy of the modified
|
56
|
+
version:
|
57
|
+
|
58
|
+
a) under this License, provided that you make a good faith effort to
|
59
|
+
ensure that, in the event an Application does not supply the
|
60
|
+
function or data, the facility still operates, and performs
|
61
|
+
whatever part of its purpose remains meaningful, or
|
62
|
+
|
63
|
+
b) under the GNU GPL, with none of the additional permissions of
|
64
|
+
this License applicable to that copy.
|
65
|
+
|
66
|
+
3. Object Code Incorporating Material from Library Header Files.
|
67
|
+
|
68
|
+
The object code form of an Application may incorporate material from
|
69
|
+
a header file that is part of the Library. You may convey such object
|
70
|
+
code under terms of your choice, provided that, if the incorporated
|
71
|
+
material is not limited to numerical parameters, data structure
|
72
|
+
layouts and accessors, or small macros, inline functions and templates
|
73
|
+
(ten or fewer lines in length), you do both of the following:
|
74
|
+
|
75
|
+
a) Give prominent notice with each copy of the object code that the
|
76
|
+
Library is used in it and that the Library and its use are
|
77
|
+
covered by this License.
|
78
|
+
|
79
|
+
b) Accompany the object code with a copy of the GNU GPL and this license
|
80
|
+
document.
|
81
|
+
|
82
|
+
4. Combined Works.
|
83
|
+
|
84
|
+
You may convey a Combined Work under terms of your choice that,
|
85
|
+
taken together, effectively do not restrict modification of the
|
86
|
+
portions of the Library contained in the Combined Work and reverse
|
87
|
+
engineering for debugging such modifications, if you also do each of
|
88
|
+
the following:
|
89
|
+
|
90
|
+
a) Give prominent notice with each copy of the Combined Work that
|
91
|
+
the Library is used in it and that the Library and its use are
|
92
|
+
covered by this License.
|
93
|
+
|
94
|
+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
95
|
+
document.
|
96
|
+
|
97
|
+
c) For a Combined Work that displays copyright notices during
|
98
|
+
execution, include the copyright notice for the Library among
|
99
|
+
these notices, as well as a reference directing the user to the
|
100
|
+
copies of the GNU GPL and this license document.
|
101
|
+
|
102
|
+
d) Do one of the following:
|
103
|
+
|
104
|
+
0) Convey the Minimal Corresponding Source under the terms of this
|
105
|
+
License, and the Corresponding Application Code in a form
|
106
|
+
suitable for, and under terms that permit, the user to
|
107
|
+
recombine or relink the Application with a modified version of
|
108
|
+
the Linked Version to produce a modified Combined Work, in the
|
109
|
+
manner specified by section 6 of the GNU GPL for conveying
|
110
|
+
Corresponding Source.
|
111
|
+
|
112
|
+
1) Use a suitable shared library mechanism for linking with the
|
113
|
+
Library. A suitable mechanism is one that (a) uses at run time
|
114
|
+
a copy of the Library already present on the user's computer
|
115
|
+
system, and (b) will operate properly with a modified version
|
116
|
+
of the Library that is interface-compatible with the Linked
|
117
|
+
Version.
|
118
|
+
|
119
|
+
e) Provide Installation Information, but only if you would otherwise
|
120
|
+
be required to provide such information under section 6 of the
|
121
|
+
GNU GPL, and only to the extent that such information is
|
122
|
+
necessary to install and execute a modified version of the
|
123
|
+
Combined Work produced by recombining or relinking the
|
124
|
+
Application with a modified version of the Linked Version. (If
|
125
|
+
you use option 4d0, the Installation Information must accompany
|
126
|
+
the Minimal Corresponding Source and Corresponding Application
|
127
|
+
Code. If you use option 4d1, you must provide the Installation
|
128
|
+
Information in the manner specified by section 6 of the GNU GPL
|
129
|
+
for conveying Corresponding Source.)
|
130
|
+
|
131
|
+
5. Combined Libraries.
|
132
|
+
|
133
|
+
You may place library facilities that are a work based on the
|
134
|
+
Library side by side in a single library together with other library
|
135
|
+
facilities that are not Applications and are not covered by this
|
136
|
+
License, and convey such a combined library under terms of your
|
137
|
+
choice, if you do both of the following:
|
138
|
+
|
139
|
+
a) Accompany the combined library with a copy of the same work based
|
140
|
+
on the Library, uncombined with any other library facilities,
|
141
|
+
conveyed under the terms of this License.
|
142
|
+
|
143
|
+
b) Give prominent notice with the combined library that part of it
|
144
|
+
is a work based on the Library, and explaining where to find the
|
145
|
+
accompanying uncombined form of the same work.
|
146
|
+
|
147
|
+
6. Revised Versions of the GNU Lesser General Public License.
|
148
|
+
|
149
|
+
The Free Software Foundation may publish revised and/or new versions
|
150
|
+
of the GNU Lesser General Public License from time to time. Such new
|
151
|
+
versions will be similar in spirit to the present version, but may
|
152
|
+
differ in detail to address new problems or concerns.
|
153
|
+
|
154
|
+
Each version is given a distinguishing version number. If the
|
155
|
+
Library as you received it specifies that a certain numbered version
|
156
|
+
of the GNU Lesser General Public License "or any later version"
|
157
|
+
applies to it, you have the option of following the terms and
|
158
|
+
conditions either of that published version or of any later version
|
159
|
+
published by the Free Software Foundation. If the Library as you
|
160
|
+
received it does not specify a version number of the GNU Lesser
|
161
|
+
General Public License, you may choose any version of the GNU Lesser
|
162
|
+
General Public License ever published by the Free Software Foundation.
|
163
|
+
|
164
|
+
If the Library as you received it specifies that a proxy can decide
|
165
|
+
whether future versions of the GNU Lesser General Public License shall
|
166
|
+
apply, that proxy's public statement of acceptance of any version is
|
167
|
+
permanent authorization for you to choose that version for the
|
168
|
+
Library.
|
169
|
+
|
170
|
+
========================
|
171
|
+
|
172
|
+
Master thesis : The phenomenal gem
|
173
|
+
Prof : Kim Mens
|
174
|
+
Year : 2011-2012
|
175
|
+
Students names,sections :
|
176
|
+
- Poncelet Thibault (SINF22MS)
|
177
|
+
- Vigneron Loic (SINF22MS)
|
178
|
+
Start date : May 1, 2011
|
179
|
+
|
data/README.rdoc
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into including all the files listed below.
|
2
|
+
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
|
3
|
+
// be included in the compiled file accessible from http://example.com/assets/application.js
|
4
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
5
|
+
// the compiled file.
|
6
|
+
//
|
7
|
+
//= require jquery
|
8
|
+
//= require jquery_ujs
|
9
|
+
//= require_tree .
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll automatically include all the stylesheets available in this directory
|
3
|
+
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
|
4
|
+
* the top of the compiled file, but it's generally better to create a new file per style scope.
|
5
|
+
*= require_self
|
6
|
+
*= require_tree .
|
7
|
+
*/
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>PhenomenalRails</title>
|
5
|
+
<%= stylesheet_link_tag "phenomenal-rails/application" %>
|
6
|
+
<%= javascript_include_tag "phenomenal-rails/application" %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<%= yield %>
|
12
|
+
|
13
|
+
</body>
|
14
|
+
</html>
|
data/config/routes.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# Add persistent attribute to the context class, allowing to disable
|
2
|
+
# auto deactivation between HTTP requests
|
3
|
+
class Phenomenal::Context
|
4
|
+
attr_accessor :persistent
|
5
|
+
#DSL inside context definition
|
6
|
+
def is_persistent
|
7
|
+
@persistent = true
|
8
|
+
activate
|
9
|
+
end
|
10
|
+
|
11
|
+
def to_path
|
12
|
+
if name
|
13
|
+
name.to_s.underscore
|
14
|
+
elsif self==manager.default_context
|
15
|
+
nil
|
16
|
+
elsif manager.combined_contexts[self]
|
17
|
+
manager.combined_contexts[self].flatten.join("/").underscore
|
18
|
+
else
|
19
|
+
nil
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module PhenomenalRails
|
2
|
+
class Engine < Rails::Engine
|
3
|
+
isolate_namespace PhenomenalRails
|
4
|
+
config.app_middleware.use(PhenomenalRails::Middleware)
|
5
|
+
config.after_initialize do
|
6
|
+
ActionController::Base.view_paths.paths.insert(0,Phenomenal::Resolver.instance)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
|
12
|
+
|
@@ -0,0 +1,58 @@
|
|
1
|
+
class Phenomenal::Resolver < ActionView::FileSystemResolver
|
2
|
+
include Singleton
|
3
|
+
|
4
|
+
def find_all(name, prefix=nil, partial=false, details={}, key=nil, locals=[])
|
5
|
+
contexts = find_sorted_active_contexts
|
6
|
+
contexts.each do |context|
|
7
|
+
context_path = context.to_path
|
8
|
+
if !context_path.nil?
|
9
|
+
path = Path.build(name, "#{context_path}/views/#{prefix}", partial)
|
10
|
+
query = query(path, details, details[:formats])
|
11
|
+
locals = locals.map { |x| x.to_s }.sort!
|
12
|
+
decorate(query,[name,prefix,partial],details,locals)
|
13
|
+
return query unless query.empty?
|
14
|
+
end
|
15
|
+
end
|
16
|
+
return []
|
17
|
+
end
|
18
|
+
|
19
|
+
def query(path, details, formats)
|
20
|
+
query = build_query(path, details)
|
21
|
+
# deals with case-insensitive file systems.
|
22
|
+
sanitizer = Hash.new { |h,dir| h[dir] = Dir["#{dir}/*"] }
|
23
|
+
template_paths = Dir[query].reject { |filename|
|
24
|
+
File.directory?(filename) ||
|
25
|
+
!sanitizer[File.dirname(filename)].include?(filename)
|
26
|
+
}
|
27
|
+
template_paths.map { |template|
|
28
|
+
cached(template, path, formats) do
|
29
|
+
handler, format = extract_handler_and_format(template, formats)
|
30
|
+
contents = File.binread template
|
31
|
+
|
32
|
+
ActionView::Template.new(contents, File.expand_path(template), handler,
|
33
|
+
:virtual_path => path.virtual,
|
34
|
+
:format => format,
|
35
|
+
:updated_at => mtime(template))
|
36
|
+
end
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
def initialize()
|
42
|
+
super("app/contexts")
|
43
|
+
@cached={}
|
44
|
+
end
|
45
|
+
|
46
|
+
def cached(template, path, formats)
|
47
|
+
if caching?
|
48
|
+
@cached[template]||=yield
|
49
|
+
else
|
50
|
+
yield
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def find_sorted_active_contexts
|
55
|
+
contexts = phen_defined_contexts.find_all{|c| c.active?}
|
56
|
+
contexts.sort!{|a,b| Phenomenal::Manager.instance.conflict_policy(a,b)}
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require "phenomenal"
|
2
|
+
require "phenomenal_rails/context"
|
3
|
+
require "phenomenal_rails/middleware"
|
4
|
+
require "phenomenal_rails/engine"
|
5
|
+
require "singleton"
|
6
|
+
require "phenomenal_rails/resolver"
|
7
|
+
|
8
|
+
# Set default context as persistent
|
9
|
+
phen_default_context.persistent=true
|
10
|
+
|
11
|
+
module PhenomenalRails
|
12
|
+
def self.load_dir(path)
|
13
|
+
if Dir.exist? path
|
14
|
+
Dir.entries(path).each do |entry|
|
15
|
+
if entry!="." && entry !=".."
|
16
|
+
filepath=File.join(path,entry)
|
17
|
+
if File.file?(filepath) && entry.match(/.*\.rb/)
|
18
|
+
load filepath
|
19
|
+
elsif File.directory?(filepath)
|
20
|
+
load_dir(filepath)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
ActionDispatch::Callbacks.before do
|
28
|
+
phen_defined_contexts.reverse.each do |context|
|
29
|
+
if !context.forgotten && (!context.persistent || !Rails.configuration.cache_classes)
|
30
|
+
while phen_context_active?(context) do
|
31
|
+
phen_deactivate_context(context)
|
32
|
+
end
|
33
|
+
# Fix problem without page caching
|
34
|
+
if !Rails.configuration.cache_classes
|
35
|
+
phen_forget_context(context)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
if !Rails.configuration.cache_classes
|
40
|
+
PhenomenalRails.load_dir("#{Rails.root}/app/contexts")
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
data/spec/dummy/Rakefile
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
3
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
4
|
+
|
5
|
+
require File.expand_path('../config/application', __FILE__)
|
6
|
+
|
7
|
+
Dummy::Application.load_tasks
|
@@ -0,0 +1,9 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into including all the files listed below.
|
2
|
+
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
|
3
|
+
// be included in the compiled file accessible from http://example.com/assets/application.js
|
4
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
5
|
+
// the compiled file.
|
6
|
+
//
|
7
|
+
//= require jquery
|
8
|
+
//= require jquery_ujs
|
9
|
+
//= require_tree .
|
@@ -0,0 +1,12 @@
|
|
1
|
+
feature :PersistentFeature do
|
2
|
+
is_persistent
|
3
|
+
adaptations_for PhenomenalRails::Middleware
|
4
|
+
adapt_class :activation_handler do |env|
|
5
|
+
if Rack::Request.new(env).params["activated"]
|
6
|
+
activate_context :TestContext
|
7
|
+
else
|
8
|
+
deactivate_context :TestContext
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
PARTIAL 1 : ADAPTED
|
@@ -0,0 +1,26 @@
|
|
1
|
+
%h1 HOME
|
2
|
+
%p
|
3
|
+
=test
|
4
|
+
%p
|
5
|
+
=link_to "Activate", "#{root_path}?activated=true"
|
6
|
+
%br
|
7
|
+
=link_to "Deactivate", "#{root_path}"
|
8
|
+
|
9
|
+
%table
|
10
|
+
%thead
|
11
|
+
%th Context
|
12
|
+
%th Active
|
13
|
+
%tbody
|
14
|
+
-phen_defined_contexts.each do |context|
|
15
|
+
%tr
|
16
|
+
%td=context.to_s
|
17
|
+
%td=context.active?
|
18
|
+
|
19
|
+
%br
|
20
|
+
=render "shared/partial1"
|
21
|
+
%br
|
22
|
+
|
23
|
+
= ActionController::Base.view_paths.paths
|
24
|
+
%br
|
25
|
+
%br
|
26
|
+
=Rails.env
|
@@ -0,0 +1 @@
|
|
1
|
+
PARTIAL 1 : NOT ADAPTED
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require 'rails/all'
|
4
|
+
require 'haml'
|
5
|
+
|
6
|
+
Bundler.require
|
7
|
+
require "phenomenal_rails"
|
8
|
+
|
9
|
+
module Dummy
|
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
|
+
# Custom directories with classes and modules you want to be autoloadable.
|
16
|
+
# config.autoload_paths += %W(#{config.root}/extras)
|
17
|
+
config.autoload_paths += %W(#{config.root}/app/contexts )
|
18
|
+
|
19
|
+
|
20
|
+
# Only load the plugins named here, in the order given (default is alphabetical).
|
21
|
+
# :all can be used as a placeholder for all plugins not explicitly named.
|
22
|
+
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
23
|
+
|
24
|
+
# Activate observers that should always be running.
|
25
|
+
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
26
|
+
|
27
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
28
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
29
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
30
|
+
|
31
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
32
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
33
|
+
# config.i18n.default_locale = :de
|
34
|
+
|
35
|
+
# Configure the default encoding used in templates for Ruby 1.9.
|
36
|
+
config.encoding = "utf-8"
|
37
|
+
|
38
|
+
# Configure sensitive parameters which will be filtered from the log file.
|
39
|
+
config.filter_parameters += [:password]
|
40
|
+
|
41
|
+
# Enable the asset pipeline
|
42
|
+
config.assets.enabled = false
|
43
|
+
|
44
|
+
# Version of your assets, change this if you want to expire all your assets
|
45
|
+
config.assets.version = '1.0'
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
@@ -0,0 +1,25 @@
|
|
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
|
+
development:
|
7
|
+
adapter: sqlite3
|
8
|
+
database: db/development.sqlite3
|
9
|
+
pool: 5
|
10
|
+
timeout: 5000
|
11
|
+
|
12
|
+
# Warning: The database defined as "test" will be erased and
|
13
|
+
# re-generated from your development database when you run "rake".
|
14
|
+
# Do not set this db to the same as development or production.
|
15
|
+
test:
|
16
|
+
adapter: sqlite3
|
17
|
+
database: db/test.sqlite3
|
18
|
+
pool: 5
|
19
|
+
timeout: 5000
|
20
|
+
|
21
|
+
production:
|
22
|
+
adapter: sqlite3
|
23
|
+
database: db/production.sqlite3
|
24
|
+
pool: 5
|
25
|
+
timeout: 5000
|
@@ -0,0 +1,30 @@
|
|
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
|
+
# Log error messages when you accidentally call methods on nil.
|
10
|
+
config.whiny_nils = true
|
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
|
+
# Only use best-standards-support built into browsers
|
23
|
+
config.action_dispatch.best_standards_support = :builtin
|
24
|
+
|
25
|
+
# Do not compress assets
|
26
|
+
config.assets.compress = false
|
27
|
+
|
28
|
+
# Expands the lines which load the assets
|
29
|
+
config.assets.debug = true
|
30
|
+
end
|