mack 0.8.0.101 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +29 -0
- data/bin/mackery-console +6 -5
- data/bin/mackery-server +23 -7
- data/lib/mack.rb +0 -3
- data/lib/mack/application.rb +161 -0
- data/lib/mack/assets/asset_helpers.rb +8 -0
- data/lib/mack/assets/assets_mgr.rb +0 -10
- data/lib/mack/boot/app.rb +46 -0
- data/lib/mack/boot/assets.rb +10 -0
- data/lib/mack/boot/configuration.rb +87 -0
- data/lib/mack/boot/console.rb +36 -0
- data/lib/mack/boot/core.rb +21 -0
- data/lib/mack/boot/environment.rb +22 -0
- data/lib/mack/boot/extensions.rb +13 -0
- data/lib/mack/boot/gem_tasks.rb +20 -0
- data/lib/mack/boot/gems.rb +18 -0
- data/lib/mack/boot/hello.rb +11 -0
- data/lib/mack/{initialization → boot}/helpers.rb +8 -3
- data/lib/mack/boot/initializers.rb +17 -0
- data/lib/mack/boot/lib.rb +19 -0
- data/lib/mack/{initialization → boot}/logging.rb +16 -9
- data/lib/mack/{initialization → boot}/logging/basic_layout.rb +0 -0
- data/lib/mack/{initialization → boot}/logging/color_layout.rb +1 -1
- data/lib/mack/{initialization → boot}/logging/filter.rb +0 -0
- data/lib/mack/boot/paths.rb +234 -0
- data/lib/mack/boot/plugins.rb +26 -0
- data/lib/mack/boot/portlets.rb +20 -0
- data/lib/mack/boot/routes.rb +15 -0
- data/lib/mack/boot/version.rb +7 -0
- data/lib/mack/controller/request.rb +5 -2
- data/lib/mack/controller/uploaded_file.rb +4 -0
- data/lib/mack/core_extensions/kernel.rb +26 -0
- data/lib/mack/core_extensions/object.rb +16 -0
- data/lib/mack/generators/mack_application_generator/manifest.yml +5 -3
- data/lib/mack/generators/mack_application_generator/templates/config/initializers/portlets.rb.template +9 -0
- data/lib/mack/generators/mack_application_generator/templates/public/stylesheets/scaffold.css.template +4 -0
- data/lib/mack/generators/portlet_generator/portlet_generator.rb +2 -0
- data/lib/mack/generators/portlet_generator/templates/README.template +3 -0
- data/lib/mack/generators/portlet_generator/templates/portlet_config/portlet.spec.template +28 -0
- data/lib/mack/portlets/manager.rb +27 -0
- data/lib/mack/portlets/portlet.rb +93 -0
- data/lib/mack/portlets/unpacker.rb +34 -0
- data/lib/mack/rendering/engine/erubis.rb +2 -2
- data/lib/mack/rendering/type/file_base.rb +8 -4
- data/lib/mack/rendering/type/public.rb +4 -2
- data/lib/mack/routing/resource_proxy.rb +30 -4
- data/lib/mack/routing/route_map.rb +28 -15
- data/lib/mack/routing/route_object.rb +57 -24
- data/lib/mack/routing/urls.rb +12 -2
- data/lib/mack/runner.rb +6 -154
- data/lib/mack/sessions/cookie_session_store.rb +2 -1
- data/lib/mack/tasks/mack_dump_tasks.rake +62 -18
- data/lib/mack/tasks/mack_tasks.rake +1 -15
- data/lib/mack/tasks/portlet_tasks.rake +33 -0
- data/lib/mack/tasks/rake_rules.rake +6 -0
- data/lib/mack/tasks/test_tasks.rake +4 -6
- data/lib/mack/testing/helpers.rb +12 -4
- data/lib/mack/utils/server.rb +7 -1
- data/lib/mack/utils/static.rb +19 -0
- data/lib/mack/version.rb +1 -1
- data/lib/mack/view_helpers/all_helpers.rb +0 -8
- data/lib/mack/view_helpers/date_time_helpers.rb +18 -12
- data/lib/mack/view_helpers/form_helpers.rb +9 -0
- data/lib/mack/view_helpers/html_helpers.rb +18 -7
- data/lib/mack/view_helpers/link_helpers.rb +2 -1
- data/lib/mack/view_helpers/object_helpers.rb +1 -1
- data/lib/mack_app.rb +26 -14
- data/lib/mack_core.rb +50 -39
- data/lib/mack_tasks.rb +46 -19
- metadata +37 -18
- data/lib/mack/initialization/application.rb +0 -53
- data/lib/mack/initialization/boot_loader.rb +0 -72
- data/lib/mack/initialization/configuration.rb +0 -101
- data/lib/mack/initialization/console.rb +0 -29
- data/lib/mack/initialization/environment.rb +0 -16
- data/lib/mack/initialization/plugins.rb +0 -16
- data/lib/mack/initialization/server/simple_server.rb +0 -19
- data/lib/mack/tasks/mack_server_tasks.rake +0 -24
- data/lib/mack/utils/paths.rb +0 -154
data/lib/mack_tasks.rb
CHANGED
@@ -6,31 +6,26 @@ require 'rubygems'
|
|
6
6
|
require 'mack-facets'
|
7
7
|
require 'configatron'
|
8
8
|
|
9
|
-
fl = File.
|
9
|
+
fl = File.join_from_here('mack')
|
10
10
|
|
11
11
|
f_tasks = File.join(FileUtils.pwd, 'vendor', 'framework', 'mack', 'lib', 'mack_tasks.rb')
|
12
12
|
if File.exists?(f_tasks) && f_tasks != __FILE__
|
13
13
|
# puts "Run from the local copy"
|
14
14
|
require f_tasks
|
15
15
|
else
|
16
|
-
|
17
|
-
require File.join(
|
18
|
-
|
19
|
-
require File.join(fl, '
|
20
|
-
require File.join(fl, '
|
21
|
-
require File.join(fl, '
|
22
|
-
|
23
|
-
require File.join(fl, '
|
24
|
-
require File.join(fl, '
|
25
|
-
|
26
|
-
|
27
|
-
require File.join(fl, 'utils', 'gem_manager')
|
28
|
-
|
29
|
-
require Mack::Paths.initializers("gems.rb")
|
30
|
-
Mack::Utils::GemManager.instance.do_task_requires
|
31
|
-
|
16
|
+
require File.join_from_here('..', 'bin', 'gem_load_path.rb')
|
17
|
+
require File.join(fl, 'tasks', 'rake_helpers.rb')
|
18
|
+
|
19
|
+
require File.join(fl, 'boot', 'version.rb')
|
20
|
+
require File.join(fl, 'boot', 'extensions.rb')
|
21
|
+
require File.join(fl, 'boot', 'paths.rb')
|
22
|
+
require File.join(fl, 'boot', 'portlets.rb')
|
23
|
+
require File.join(fl, 'boot', 'configuration.rb')
|
24
|
+
require File.join(fl, 'boot', 'environment.rb')
|
25
|
+
require File.join(fl, 'boot', 'gem_tasks.rb')
|
26
|
+
|
32
27
|
# Requires all rake tasks that ship with the Mack framework.
|
33
|
-
[fl, Mack
|
28
|
+
[fl, Mack.search_path(:lib), Mack.search_path(:plugins)].flatten.each do |dir|
|
34
29
|
begin
|
35
30
|
require File.join(dir, "tasks", "rake_helpers.rb")
|
36
31
|
rescue Exception => e
|
@@ -42,6 +37,38 @@ else
|
|
42
37
|
load f
|
43
38
|
end
|
44
39
|
end
|
45
|
-
end
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
# # puts "running mack_tasks from: #{fl}"
|
44
|
+
# require File.join(File.dirname(__FILE__), '..', 'bin', 'gem_load_path')
|
45
|
+
#
|
46
|
+
# require File.join(fl, 'tasks', 'rake_helpers')
|
47
|
+
# require File.join(fl, 'core_extensions', 'kernel')
|
48
|
+
# require File.join(fl, 'utils', 'paths')
|
49
|
+
#
|
50
|
+
# require File.join(fl, 'initialization', 'boot_loader')
|
51
|
+
# require File.join(fl, 'initialization', 'configuration')
|
52
|
+
#
|
53
|
+
# Mack::BootLoader.run(:configuration)
|
54
|
+
# require File.join(fl, 'utils', 'gem_manager')
|
55
|
+
#
|
56
|
+
# require Mack::Paths.initializers("gems.rb")
|
57
|
+
# Mack::Utils::GemManager.instance.do_task_requires
|
58
|
+
#
|
59
|
+
# # Requires all rake tasks that ship with the Mack framework.
|
60
|
+
# [fl, Mack::Paths.lib, Mack::Paths.plugins].each do |dir|
|
61
|
+
# begin
|
62
|
+
# require File.join(dir, "tasks", "rake_helpers.rb")
|
63
|
+
# rescue Exception => e
|
64
|
+
# # raise e
|
65
|
+
# end
|
66
|
+
# files = Dir.glob(File.join(dir, "**/*.rake"))
|
67
|
+
# files.each do |f|
|
68
|
+
# unless f == __FILE__
|
69
|
+
# load f
|
70
|
+
# end
|
71
|
+
# end
|
72
|
+
# end
|
46
73
|
|
47
74
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- markbates
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-10-
|
12
|
+
date: 2008-10-26 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.8.
|
33
|
+
version: 0.8.1
|
34
34
|
version:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: configatron
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
requirements:
|
41
41
|
- - "="
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 2.1.
|
43
|
+
version: 2.1.5
|
44
44
|
version:
|
45
45
|
- !ruby/object:Gem::Dependency
|
46
46
|
name: logging
|
@@ -136,8 +136,31 @@ extra_rdoc_files:
|
|
136
136
|
- CHANGELOG
|
137
137
|
files:
|
138
138
|
- README
|
139
|
+
- lib/mack/application.rb
|
139
140
|
- lib/mack/assets/asset_helpers.rb
|
140
141
|
- lib/mack/assets/assets_mgr.rb
|
142
|
+
- lib/mack/boot/app.rb
|
143
|
+
- lib/mack/boot/assets.rb
|
144
|
+
- lib/mack/boot/configuration.rb
|
145
|
+
- lib/mack/boot/console.rb
|
146
|
+
- lib/mack/boot/core.rb
|
147
|
+
- lib/mack/boot/environment.rb
|
148
|
+
- lib/mack/boot/extensions.rb
|
149
|
+
- lib/mack/boot/gem_tasks.rb
|
150
|
+
- lib/mack/boot/gems.rb
|
151
|
+
- lib/mack/boot/hello.rb
|
152
|
+
- lib/mack/boot/helpers.rb
|
153
|
+
- lib/mack/boot/initializers.rb
|
154
|
+
- lib/mack/boot/lib.rb
|
155
|
+
- lib/mack/boot/logging/basic_layout.rb
|
156
|
+
- lib/mack/boot/logging/color_layout.rb
|
157
|
+
- lib/mack/boot/logging/filter.rb
|
158
|
+
- lib/mack/boot/logging.rb
|
159
|
+
- lib/mack/boot/paths.rb
|
160
|
+
- lib/mack/boot/plugins.rb
|
161
|
+
- lib/mack/boot/portlets.rb
|
162
|
+
- lib/mack/boot/routes.rb
|
163
|
+
- lib/mack/boot/version.rb
|
141
164
|
- lib/mack/controller/all_helpers.rb
|
142
165
|
- lib/mack/controller/controller.rb
|
143
166
|
- lib/mack/controller/cookie_jar.rb
|
@@ -147,6 +170,7 @@ files:
|
|
147
170
|
- lib/mack/controller/tell.rb
|
148
171
|
- lib/mack/controller/uploaded_file.rb
|
149
172
|
- lib/mack/core_extensions/kernel.rb
|
173
|
+
- lib/mack/core_extensions/object.rb
|
150
174
|
- lib/mack/core_extensions/symbol.rb
|
151
175
|
- lib/mack/errors/errors.rb
|
152
176
|
- lib/mack/generators/controller_generator/controller_generator.rb
|
@@ -174,6 +198,7 @@ files:
|
|
174
198
|
- lib/mack/generators/mack_application_generator/templates/config/initializers/gems.rb.template
|
175
199
|
- lib/mack/generators/mack_application_generator/templates/config/initializers/inflections.rb.template
|
176
200
|
- lib/mack/generators/mack_application_generator/templates/config/initializers/mime_types.rb.template
|
201
|
+
- lib/mack/generators/mack_application_generator/templates/config/initializers/portlets.rb.template
|
177
202
|
- lib/mack/generators/mack_application_generator/templates/config/routes.rb.template
|
178
203
|
- lib/mack/generators/mack_application_generator/templates/public/404.html.template
|
179
204
|
- lib/mack/generators/mack_application_generator/templates/public/500.html.template
|
@@ -197,23 +222,17 @@ files:
|
|
197
222
|
- lib/mack/generators/plugin_generator/templates/vendor/plugins/%=@plugin_name%/init.rb.template
|
198
223
|
- lib/mack/generators/plugin_generator/templates/vendor/plugins/%=@plugin_name%/lib/%=@plugin_name%.rb.template
|
199
224
|
- lib/mack/generators/plugin_generator/templates/vendor/plugins/%=@plugin_name%/lib/tasks/%=@plugin_name%_tasks.rake.template
|
225
|
+
- lib/mack/generators/portlet_generator/portlet_generator.rb
|
226
|
+
- lib/mack/generators/portlet_generator/templates/portlet_config/portlet.spec.template
|
227
|
+
- lib/mack/generators/portlet_generator/templates/README.template
|
200
228
|
- lib/mack/generators/view_helper_generator/manifest.yml
|
201
229
|
- lib/mack/generators/view_helper_generator/templates/app/helpers/views/helper.rb.template
|
202
230
|
- lib/mack/generators/view_helper_generator/templates/test/helpers/views/rspec.rb.template
|
203
231
|
- lib/mack/generators/view_helper_generator/templates/test/helpers/views/test_case.rb.template
|
204
232
|
- lib/mack/generators/view_helper_generator/view_helper_generator.rb
|
205
|
-
- lib/mack/
|
206
|
-
- lib/mack/
|
207
|
-
- lib/mack/
|
208
|
-
- lib/mack/initialization/console.rb
|
209
|
-
- lib/mack/initialization/environment.rb
|
210
|
-
- lib/mack/initialization/helpers.rb
|
211
|
-
- lib/mack/initialization/logging/basic_layout.rb
|
212
|
-
- lib/mack/initialization/logging/color_layout.rb
|
213
|
-
- lib/mack/initialization/logging/filter.rb
|
214
|
-
- lib/mack/initialization/logging.rb
|
215
|
-
- lib/mack/initialization/plugins.rb
|
216
|
-
- lib/mack/initialization/server/simple_server.rb
|
233
|
+
- lib/mack/portlets/manager.rb
|
234
|
+
- lib/mack/portlets/portlet.rb
|
235
|
+
- lib/mack/portlets/unpacker.rb
|
217
236
|
- lib/mack/rendering/engine/base.rb
|
218
237
|
- lib/mack/rendering/engine/builder.rb
|
219
238
|
- lib/mack/rendering/engine/erubis.rb
|
@@ -248,9 +267,9 @@ files:
|
|
248
267
|
- lib/mack/tasks/generator_tasks.rake
|
249
268
|
- lib/mack/tasks/log_tasks.rake
|
250
269
|
- lib/mack/tasks/mack_dump_tasks.rake
|
251
|
-
- lib/mack/tasks/mack_server_tasks.rake
|
252
270
|
- lib/mack/tasks/mack_tasks.rake
|
253
271
|
- lib/mack/tasks/mack_update_tasks.rake
|
272
|
+
- lib/mack/tasks/portlet_tasks.rake
|
254
273
|
- lib/mack/tasks/rake_helpers.rb
|
255
274
|
- lib/mack/tasks/rake_rules.rake
|
256
275
|
- lib/mack/tasks/test_tasks.rake
|
@@ -269,9 +288,9 @@ files:
|
|
269
288
|
- lib/mack/utils/http_status_codes.yml
|
270
289
|
- lib/mack/utils/mime_types.rb
|
271
290
|
- lib/mack/utils/mime_types.yml
|
272
|
-
- lib/mack/utils/paths.rb
|
273
291
|
- lib/mack/utils/reloader.rb
|
274
292
|
- lib/mack/utils/server.rb
|
293
|
+
- lib/mack/utils/static.rb
|
275
294
|
- lib/mack/version.rb
|
276
295
|
- lib/mack/view_helpers/all_helpers.rb
|
277
296
|
- lib/mack/view_helpers/date_time_helpers.rb
|
@@ -1,53 +0,0 @@
|
|
1
|
-
boot_load(:initializers) do
|
2
|
-
Mack.logger.debug "Initializing custom initializers..." unless configatron.mack.log.disable_initialization_logging
|
3
|
-
Dir.glob(Mack::Paths.initializers("**/*.rb")) do |d|
|
4
|
-
require d
|
5
|
-
end
|
6
|
-
end
|
7
|
-
|
8
|
-
boot_load(:lib, :plugins, :gems) do
|
9
|
-
# require 'lib' files:
|
10
|
-
Mack.logger.debug "Initializing lib classes..." unless configatron.mack.log.disable_initialization_logging
|
11
|
-
Dir.glob(Mack::Paths.lib("**/*.rb")).each do |d|
|
12
|
-
require d
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
boot_load(:default_controller, :lib) do
|
17
|
-
# make sure that default_controller is available to other controllers
|
18
|
-
path = Mack::Paths.controllers("default_controller.rb")
|
19
|
-
require path if File.exists?(path)
|
20
|
-
end
|
21
|
-
|
22
|
-
boot_load(:routes) do
|
23
|
-
# set up routes:
|
24
|
-
Mack.logger.debug "Initializing routes..." unless configatron.mack.log.disable_initialization_logging
|
25
|
-
require Mack::Paths.config("routes")
|
26
|
-
end
|
27
|
-
|
28
|
-
boot_load(:app_files, :default_controller) do
|
29
|
-
# require 'app' files:
|
30
|
-
Mack.logger.debug "Initializing 'app' classes..." unless configatron.mack.log.disable_initialization_logging
|
31
|
-
Dir.glob(Mack::Paths.app("**/*.rb")).each do |d|
|
32
|
-
begin
|
33
|
-
require d
|
34
|
-
rescue NameError => e
|
35
|
-
if e.message.match("uninitialized constant")
|
36
|
-
mod = e.message.gsub("uninitialized constant ", "")
|
37
|
-
x =%{
|
38
|
-
module ::#{mod}
|
39
|
-
end
|
40
|
-
}
|
41
|
-
eval(x)
|
42
|
-
require d
|
43
|
-
else
|
44
|
-
raise e
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
# Add default assets
|
50
|
-
assets_mgr.defaults do |a|
|
51
|
-
a.add_css "scaffold" if File.exists?Mack::Paths.stylesheets("scaffold.css")
|
52
|
-
end
|
53
|
-
end
|
@@ -1,72 +0,0 @@
|
|
1
|
-
module Kernel
|
2
|
-
|
3
|
-
def boot_load(name, *dependencies, &block)
|
4
|
-
Mack::BootLoader.instance.add(name, *dependencies, &block)
|
5
|
-
end
|
6
|
-
|
7
|
-
end
|
8
|
-
|
9
|
-
|
10
|
-
module Mack
|
11
|
-
class BootLoader
|
12
|
-
include Singleton
|
13
|
-
|
14
|
-
attr_accessor :sequences
|
15
|
-
|
16
|
-
def initialize
|
17
|
-
self.sequences = {}
|
18
|
-
end
|
19
|
-
|
20
|
-
def add(name, *dependencies, &block)
|
21
|
-
self.sequences[name.to_sym] = Mack::BootLoader::Loader.new(name.to_sym, *dependencies, &block)
|
22
|
-
end
|
23
|
-
|
24
|
-
def self.run(*args)
|
25
|
-
args.each do |a|
|
26
|
-
begin
|
27
|
-
Mack::BootLoader.instance.sequences[a.to_sym].run
|
28
|
-
rescue Exception => e
|
29
|
-
raise e
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
def self.run!(*args)
|
35
|
-
args.each do |a|
|
36
|
-
Mack::BootLoader.instance.sequences[a.to_sym].run!
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
private
|
41
|
-
class Loader
|
42
|
-
|
43
|
-
attr_accessor :name
|
44
|
-
attr_accessor :dependencies
|
45
|
-
attr_accessor :sequence
|
46
|
-
|
47
|
-
def initialize(name, *dependencies, &block)
|
48
|
-
self.name = name.to_sym
|
49
|
-
self.dependencies = dependencies
|
50
|
-
self.sequence = block
|
51
|
-
@run = false
|
52
|
-
end
|
53
|
-
|
54
|
-
def run
|
55
|
-
return if @run
|
56
|
-
self.dependencies.each do |dep|
|
57
|
-
Mack::BootLoader.run(dep)
|
58
|
-
end
|
59
|
-
self.sequence.call
|
60
|
-
@run = true
|
61
|
-
end
|
62
|
-
|
63
|
-
def run!
|
64
|
-
self.dependencies.each do |dep|
|
65
|
-
Mack::BootLoader.run!(dep)
|
66
|
-
end
|
67
|
-
self.sequence.call
|
68
|
-
end
|
69
|
-
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
@@ -1,101 +0,0 @@
|
|
1
|
-
require 'mack-facets'
|
2
|
-
require 'configatron'
|
3
|
-
require File.join(File.dirname(__FILE__), 'boot_loader')
|
4
|
-
require File.join(File.dirname(__FILE__), '..', 'core_extensions', 'kernel')
|
5
|
-
require File.join(File.dirname(__FILE__), '..', 'utils', 'paths')
|
6
|
-
boot_load(:configuration) do
|
7
|
-
module Mack
|
8
|
-
|
9
|
-
# Returns the root of the current Mack application
|
10
|
-
def self.root
|
11
|
-
ENV["MACK_ROOT"] ||= FileUtils.pwd
|
12
|
-
end
|
13
|
-
|
14
|
-
# Returns the environment of the current Mack application
|
15
|
-
def self.env
|
16
|
-
ENV["MACK_ENV"] ||= "development"
|
17
|
-
end
|
18
|
-
|
19
|
-
# Returns true/false based on whether the specified environment
|
20
|
-
# is the current environment
|
21
|
-
def self.env?(env)
|
22
|
-
self.env == env.to_s
|
23
|
-
end
|
24
|
-
|
25
|
-
# All configuration for the Mack subsystem happens here. Each of the default environments,
|
26
|
-
# production, development, and test have their own default configuration options. These
|
27
|
-
# get merged with overall default options.
|
28
|
-
module Configuration # :nodoc:
|
29
|
-
unless const_defined?("LOADED")
|
30
|
-
configatron.mack.render_url_timeout = 5
|
31
|
-
configatron.mack.cache_classes = true
|
32
|
-
configatron.mack.reload_classes = 1
|
33
|
-
configatron.mack.deep_class_reload = false
|
34
|
-
configatron.mack.use_lint = true
|
35
|
-
configatron.mack.show_exceptions = true
|
36
|
-
configatron.mack.use_sessions = true
|
37
|
-
configatron.mack.session_id = '_mack_session_id'
|
38
|
-
configatron.mack.cookie_values = {:path => '/'}
|
39
|
-
configatron.mack.site_domain = 'http://localhost:3000'
|
40
|
-
configatron.mack.testing_framework = :rspec
|
41
|
-
configatron.mack.rspec_file_pattern = 'test/**/*_spec.rb'
|
42
|
-
configatron.mack.test_case_file_pattern = 'test/**/*_test.rb'
|
43
|
-
configatron.mack.session_store = :cookie
|
44
|
-
configatron.mack.disable_forgery_detector = false
|
45
|
-
configatron.mack.assets.max_distribution = 4
|
46
|
-
configatron.mack.assets.hosts = ''
|
47
|
-
configatron.mack.assets.stamp = Time.now.to_i
|
48
|
-
configatron.mack.cookie_session_store.expiry_time = 4.hours
|
49
|
-
|
50
|
-
configatron.mack.log.level = :info
|
51
|
-
configatron.mack.log.detailed_requests = true
|
52
|
-
configatron.mack.log.disable_initialization_logging = false
|
53
|
-
configatron.mack.log.root = Mack::Paths.log
|
54
|
-
configatron.mack.log.colors.db = :cyan
|
55
|
-
configatron.mack.log.colors.error = :red
|
56
|
-
configatron.mack.log.colors.fatal = :red
|
57
|
-
configatron.mack.log.colors.warn = :yellow
|
58
|
-
configatron.mack.log.colors.completed = :purple
|
59
|
-
configatron.mack.log.use_colors = true
|
60
|
-
configatron.mack.log.time_format = '%Y-%m-%d %H:%M:%S'
|
61
|
-
|
62
|
-
if Mack.env?(:production)
|
63
|
-
configatron.mack.use_lint = false
|
64
|
-
configatron.mack.show_exceptions = false
|
65
|
-
configatron.mack.log.level = :info
|
66
|
-
configatron.mack.log.detailed_requests = true
|
67
|
-
configatron.mack.log.use_colors = false
|
68
|
-
end
|
69
|
-
|
70
|
-
if Mack.env?(:development)
|
71
|
-
configatron.mack.cache_classes = false
|
72
|
-
configatron.mack.log.level = :debug
|
73
|
-
end
|
74
|
-
|
75
|
-
if Mack.env?(:test)
|
76
|
-
configatron.mack.cookie_values = {}
|
77
|
-
configatron.mack.session_store = :test
|
78
|
-
configatron.mack.disable_forgery_detector = true
|
79
|
-
configatron.mack.run_remote_tests = true
|
80
|
-
configatron.mack.log.level = :error
|
81
|
-
end
|
82
|
-
|
83
|
-
if File.exists?(Mack::Paths.configatron('default.rb'))
|
84
|
-
require Mack::Paths.configatron('default.rb')
|
85
|
-
end
|
86
|
-
|
87
|
-
if File.exists?(Mack::Paths.configatron("#{Mack.env}.rb"))
|
88
|
-
require Mack::Paths.configatron("#{Mack.env}.rb")
|
89
|
-
end
|
90
|
-
|
91
|
-
def self.dump
|
92
|
-
configatron.inspect
|
93
|
-
end
|
94
|
-
|
95
|
-
LOADED = true
|
96
|
-
|
97
|
-
end
|
98
|
-
|
99
|
-
end
|
100
|
-
end
|
101
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# This file gets loaded when you run:
|
2
|
-
# rake console
|
3
|
-
# It loads the following classes to make using the application via the console easier:
|
4
|
-
#
|
5
|
-
# * Mack::TestHelpers
|
6
|
-
# * Mack::Routes::Urls
|
7
|
-
|
8
|
-
fl = File.join(File.dirname(__FILE__), "..")
|
9
|
-
|
10
|
-
require File.join(fl, "..", "..", "bin", "gem_load_path")
|
11
|
-
|
12
|
-
require File.join(fl, "..", "mack")
|
13
|
-
|
14
|
-
require File.join(fl, "testing", "helpers")
|
15
|
-
|
16
|
-
# self.send(:include, Mack::TestHelpers)
|
17
|
-
self.send(:include, Mack::Routes::Urls)
|
18
|
-
|
19
|
-
# When using the Mack console if you edit any files
|
20
|
-
# you can reload them in the console using this method
|
21
|
-
# without having to exit the console and start again.
|
22
|
-
def reload!
|
23
|
-
ivar_cache("_rack_reloader") do
|
24
|
-
Mack::Reloader.new(nil)
|
25
|
-
end.reload!
|
26
|
-
end
|
27
|
-
|
28
|
-
# Prevent AutoRunner from getting executed when user exits out of console
|
29
|
-
Test::Unit.run = true
|