detroit 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
metadata CHANGED
@@ -1,69 +1,75 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: detroit
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
4
5
  prerelease:
5
- version: 0.1.0
6
6
  platform: ruby
7
- authors:
8
- - Thomas Sawyer
7
+ authors:
8
+ - Trans
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-06-30 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
12
+ date: 2011-10-18 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
16
15
  name: facets
17
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &20449000 !ruby/object:Gem::Requirement
19
17
  none: false
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
24
22
  type: :runtime
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
27
- name: pom
28
23
  prerelease: false
29
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *20449000
25
+ - !ruby/object:Gem::Dependency
26
+ name: pom
27
+ requirement: &20448440 !ruby/object:Gem::Requirement
30
28
  none: false
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: "0"
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
35
33
  type: :runtime
36
- version_requirements: *id002
37
- - !ruby/object:Gem::Dependency
38
- name: qed
39
34
  prerelease: false
40
- requirement: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *20448440
36
+ - !ruby/object:Gem::Dependency
37
+ name: qed
38
+ requirement: &20447860 !ruby/object:Gem::Requirement
41
39
  none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- version: "0"
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
46
44
  type: :development
47
- version_requirements: *id003
48
- description: Detroit is an advanced lifecycle build system. With Detroit, build tasks are user defined service instances tied to stops along a track. Whenever the detroit console command is run, a track is followed from beginning to designated destination.
49
- email: transfire@gmail.com
50
- executables:
45
+ prerelease: false
46
+ version_requirements: *20447860
47
+ description: Detroit is an advanced lifecycle build system. With Detroit, build tasks
48
+ are user defined service instances tied to stops along a track. Whenever the detroit
49
+ console command is run, a track is followed from beginning to designated destination.
50
+ email:
51
+ - transfire@gmail.com
52
+ executables:
51
53
  - detroit
52
54
  extensions: []
53
-
54
- extra_rdoc_files:
55
+ extra_rdoc_files:
56
+ - GPL3.txt
57
+ - HISTORY.rdoc
55
58
  - README.rdoc
56
- files:
59
+ - QED.rdoc
60
+ - COPYING.rdoc
61
+ - EXAMPLE.md
62
+ files:
57
63
  - .ruby
58
64
  - bin/detroit
59
65
  - lib/detroit/application.rb
60
66
  - lib/detroit/assembly.rb
67
+ - lib/detroit/assembly_system.rb
61
68
  - lib/detroit/config.rb
62
69
  - lib/detroit/control.rb
63
70
  - lib/detroit/core_ext.rb
64
71
  - lib/detroit/custom.rb
65
72
  - lib/detroit/dsl.rb
66
- - lib/detroit/schedule.rb
67
73
  - lib/detroit/service.rb
68
74
  - lib/detroit/standard_assembly.rb
69
75
  - lib/detroit/tool/core_ext/facets.rb
@@ -81,7 +87,7 @@ files:
81
87
  - lib/detroit/tool.rb
82
88
  - lib/detroit.rb
83
89
  - lib/detroit.yml
84
- - qed/01_schedule/02_initialize.md
90
+ - qed/01_assembly/02_initialize.md
85
91
  - qed/99_plugins/rdoc/rdoc-plugin.rdoc
86
92
  - qed/99_plugins/rdoc/sample/Syckfile
87
93
  - qed/99_plugins/rdoc/sample/lib/sandbox/.xxx
@@ -102,38 +108,31 @@ files:
102
108
  - HISTORY.rdoc
103
109
  - README.rdoc
104
110
  - GPL3.txt
111
+ - QED.rdoc
105
112
  - COPYING.rdoc
106
113
  - EXAMPLE.md
107
114
  homepage: http://rubyworks.github.com/detroit
108
- licenses:
109
- - GPL3
110
- - GPL3
115
+ licenses: []
111
116
  post_install_message:
112
- rdoc_options:
113
- - --title
114
- - Detroit API
115
- - --main
116
- - README.rdoc
117
- require_paths:
117
+ rdoc_options: []
118
+ require_paths:
118
119
  - lib
119
- required_ruby_version: !ruby/object:Gem::Requirement
120
+ required_ruby_version: !ruby/object:Gem::Requirement
120
121
  none: false
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: "0"
125
- required_rubygems_version: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ required_rubygems_version: !ruby/object:Gem::Requirement
126
127
  none: false
127
- requirements:
128
- - - ">="
129
- - !ruby/object:Gem::Version
130
- version: "0"
128
+ requirements:
129
+ - - ! '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
131
132
  requirements: []
132
-
133
- rubyforge_project: detroit
134
- rubygems_version: 1.8.2
133
+ rubyforge_project:
134
+ rubygems_version: 1.8.5
135
135
  signing_key:
136
136
  specification_version: 3
137
137
  summary: Software Production Mangement
138
138
  test_files: []
139
-
@@ -1,187 +0,0 @@
1
- module Detroit
2
-
3
- # Schedule encapsulates a `Schedule` file and it's service instance
4
- # configurations.
5
- class Schedule
6
-
7
- # Load Scedule file.
8
- def self.load(input)
9
- new(input)
10
- end
11
-
12
- # Hash table of services.
13
- attr :services
14
-
15
- private
16
-
17
- # Initialize new Schedule instance.
18
- def initialize(file, options={})
19
- @project = options[:project]
20
-
21
- @services = {}
22
-
23
- @file = (String === file ? File.new(file) : file)
24
-
25
- case File.extname(@file.path)
26
- when '.rb'
27
- instance_eval(@file.read, @file.path)
28
- when '.yml', '.yaml'
29
- @services = YAML.load(erb(@file.read))
30
- else
31
- text = @file.read
32
- if /^---/ =~ text
33
- @services = YAML.load(erb(text))
34
- else
35
- instance_eval(text, @file.path)
36
- end
37
- end
38
- end
39
-
40
- # Define a service.
41
- def service(name, settings={}, &block)
42
- if block
43
- block_context = BlockContext.new(&block)
44
- settings = block_context.settings
45
- end
46
- @services[name.to_s] = settings.rekey(&:to_s)
47
- end
48
-
49
- # Access to project data.
50
- #
51
- # NOTE: Thinking that the project should be relative
52
- # to the Routine file itself, unless a `project` is passed
53
- # in manually through the initializer. In the mean time,
54
- # the project is just relative to the current working directory.
55
- #
56
- # TODO: Make configurable and use .ruby by default ?
57
- def project
58
- @project ||= POM::Project.find #(file_directory)
59
- end
60
-
61
- # Capitalized service names called as methods
62
- # can also define a service.
63
- def method_missing(sym, *args, &block)
64
- service_class = sym.to_s
65
- case service_class
66
- when /^[A-Z]/
67
- if Hash === args.last
68
- args.last[:service] = service_class
69
- else
70
- args << {:services=>service_class}
71
- end
72
- case args.first
73
- when String, Symbol
74
- name = args.first
75
- else
76
- name = service_class.to_s.downcase
77
- end
78
- service(name, *args, &block)
79
- else
80
- super(sym, *args, &block)
81
- end
82
- end
83
-
84
- private
85
-
86
- # Process Routine document via ERB.
87
- def erb(text)
88
- context = ERBContext.new(project)
89
- ERB.new(text).result(context.__binding__)
90
- end
91
-
92
- # ERBContext provides the clean context to process a Routine
93
- # as an ERB template.
94
- class ERBContext
95
- #
96
- def initialize(project)
97
- @project = project
98
- end
99
-
100
- # Access to a clean binding.
101
- def __binding__
102
- binding
103
- end
104
-
105
- # Provide access to project data.
106
- def project
107
- @project
108
- end
109
-
110
- #
111
- def method_missing(name, *args)
112
- if project.respond_to?(name)
113
- project.__send__(name, *args)
114
- elsif project.metadata.respond_to?(name)
115
- project.metadata.__send__(name, *args)
116
- else
117
- super(name, *args)
118
- end
119
- end
120
- end
121
-
122
- #
123
- class BlockContext
124
- #
125
- attr :settings
126
-
127
- #
128
- def initialize(&block)
129
- @settings = {}
130
- if block.arity == 0
131
- instance_eval(&block)
132
- else
133
- block.call(self)
134
- end
135
- end
136
-
137
- #
138
- def set(name, value=nil, &block)
139
- if block
140
- block_context = BlockContext.new
141
- block.call(block_context)
142
- @settings[name.to_s] = block_context.settings
143
- else
144
- @settings[name.to_s] = value
145
- end
146
- end
147
-
148
- #
149
- def method_missing(symbol, value=nil, *args)
150
- case name = symbol.to_s
151
- when /=$/
152
- @settings[name.chomp('=')] = value
153
- else
154
- super(symbol, value=nil, *args)
155
- end
156
- end
157
- end
158
-
159
- end
160
-
161
- # NOTE: This is problematic, because a Scheudle file should really know from
162
- # what file it was derived.
163
-
164
- #
165
- DOMAIN = "rubyworks.github.com/detroit,2011-05-27"
166
-
167
- # TODO: If using Psych rather than Syck, then define a domain type.
168
-
169
- #if defined?(Psych) #RUBY_VERSION >= '1.9'
170
- # YAML::add_domain_type(DOMAIN, "schedule") do |type, hash|
171
- # Schedule.load(hash)
172
- # end
173
- #else
174
- YAML::add_builtin_type("schedule") do |type, value|
175
- value
176
- #case value
177
- #when String
178
- # Schedule.eval(value)
179
- #when Hash
180
- # Schedule.new(value)
181
- #else
182
- # raise "ERROR: Invalid Schedule"
183
- #end
184
- end
185
- #end
186
-
187
- end