Skip to content
This repository
Newer
Older
100644 83 lines (68 sloc) 2.171 kb
fef31be2 » jeremy
2010-04-29 Add missing deprecation requires
1 require 'active_support/deprecation'
da62a7c5 » Yehuda Katz + Carl Lerche
2009-10-27 Duplicate AS code no longer needed
2 require 'active_support/ordered_options'
a5311ee8 » drogus
2010-10-28 Make deep copy of application generators on engine initialization.
3 require 'active_support/core_ext/hash/deep_dup'
b17e358e » josevalim
2010-01-23 Move configuration to subfolders.
4 require 'rails/paths'
5 require 'rails/rack'
ff8be66f » Carl Lerche
2009-10-08 Finish porting over the initializers to the app object and fix all th…
6
3aad4d7f » Yehuda Katz + Carl Lerche
2009-06-23 Separate Rails module methods, the config object, and the initializer…
7 module Rails
b17e358e » josevalim
2010-01-23 Move configuration to subfolders.
8 module Configuration
99b38f37 » josevalim
2010-05-16 Move AD::Cascade to the bottom of the middleware stack.
9 class MiddlewareStackProxy #:nodoc:
10 def initialize
11 @operations = []
12 end
13
14 def insert_before(*args, &block)
15 @operations << [:insert_before, args, block]
16 end
17
18 alias :insert :insert_before
19
20 def insert_after(*args, &block)
21 @operations << [:insert_after, args, block]
22 end
23
24 def swap(*args, &block)
25 @operations << [:swap, args, block]
26 end
27
28 def use(*args, &block)
29 @operations << [:use, args, block]
30 end
31
a210aff2 » josevalim
2010-06-07 Add delete to middleware stack proxy.
32 def delete(*args, &block)
33 @operations << [:delete, args, block]
34 end
35
99b38f37 » josevalim
2010-05-16 Move AD::Cascade to the bottom of the middleware stack.
36 def merge_into(other)
37 @operations.each do |operation, args, block|
38 other.send(operation, *args, &block)
39 end
40 other
41 end
42 end
43
b17e358e » josevalim
2010-01-23 Move configuration to subfolders.
44 class Generators #:nodoc:
6958eac1 » josevalim
2010-02-06 Add config.generators.templates to provide alternative paths for temp…
45 attr_accessor :aliases, :options, :templates, :fallbacks, :colorize_logging
98240c49 » josevalim
2010-01-23 Get rid of initializers global and create i18n railtie.
46
47 def initialize
48 @aliases = Hash.new { |h,k| h[k] = {} }
49 @options = Hash.new { |h,k| h[k] = {} }
a8c5d22c » josevalim
2010-02-01 Add config.generators.fallbacks.
50 @fallbacks = {}
6958eac1 » josevalim
2010-02-06 Add config.generators.templates to provide alternative paths for temp…
51 @templates = []
98240c49 » josevalim
2010-01-23 Get rid of initializers global and create i18n railtie.
52 @colorize_logging = true
53 end
54
a5311ee8 » drogus
2010-10-28 Make deep copy of application generators on engine initialization.
55 def initialize_copy(source)
56 @aliases = @aliases.deep_dup
57 @options = @options.deep_dup
58 @fallbacks = @fallbacks.deep_dup
59 @templates = @templates.dup
60 end
61
98240c49 » josevalim
2010-01-23 Get rid of initializers global and create i18n railtie.
62 def method_missing(method, *args)
63 method = method.to_s.sub(/=$/, '').to_sym
64
6268fcdc » Carl Lerche
2010-01-28 Fix the test_framework generator tests
65 return @options[method] if args.empty?
66
79d6f314 » spastorino
2010-07-21 We are doing the same in this conditions
67 if method == :rails || args.first.is_a?(Hash)
98240c49 » josevalim
2010-01-23 Get rid of initializers global and create i18n railtie.
68 namespace, configuration = method, args.shift
69 else
70 namespace, configuration = args.shift, args.shift
e107c208 » spastorino
2010-07-21 Make config.generators accept string namespaces, you can do now confi…
71 namespace = namespace.to_sym if namespace.respond_to?(:to_sym)
98240c49 » josevalim
2010-01-23 Get rid of initializers global and create i18n railtie.
72 @options[:rails][method] = namespace
73 end
74
75 if configuration
76 aliases = configuration.delete(:aliases)
77 @aliases[namespace].merge!(aliases) if aliases
78 @options[namespace].merge!(configuration)
79 end
80 end
7fcf8590 » josevalim
2010-01-21 Massive cleanup in Railties and load stack.
81 end
3aad4d7f » Yehuda Katz + Carl Lerche
2009-06-23 Separate Rails module methods, the config object, and the initializer…
82 end
2699e9c2 » josevalim
2009-07-08 Added config.generators with tests.
83 end
Something went wrong with that request. Please try again.