detroit 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +7 -0
  2. data/.index +59 -0
  3. data/EXAMPLE.md +66 -64
  4. data/{HISTORY.rdoc → HISTORY.md} +32 -5
  5. data/{COPYING.rdoc → LICENSE.txt} +0 -0
  6. data/README.md +142 -0
  7. data/bin/detroit +1 -1
  8. data/lib/detroit.rb +112 -40
  9. data/lib/detroit.yml +44 -29
  10. data/lib/detroit/assembly.rb +49 -193
  11. data/lib/detroit/basic_tool.rb +200 -0
  12. data/lib/detroit/basic_utils.rb +66 -0
  13. data/lib/detroit/core_ext.rb +2 -136
  14. data/lib/detroit/{tool/core_ext → core_ext}/facets.rb +3 -0
  15. data/lib/detroit/{tool/core_ext → core_ext}/filetest.rb +0 -0
  16. data/lib/detroit/{tool/core_ext → core_ext}/shell_extensions.rb +0 -0
  17. data/lib/detroit/{tool/core_ext → core_ext}/to_actual_filename.rb +0 -0
  18. data/lib/detroit/{tool/core_ext → core_ext}/to_console.rb +1 -0
  19. data/lib/detroit/{tool/core_ext → core_ext}/to_list.rb +0 -0
  20. data/lib/detroit/{tool/core_ext → core_ext}/to_yamlfrag.rb +0 -0
  21. data/lib/detroit/{tool/core_ext → core_ext}/unfold_paragraphs.rb +0 -0
  22. data/lib/detroit/{tool/email_utils.rb → email_utils.rb} +3 -1
  23. data/lib/detroit/exec.rb +55 -0
  24. data/lib/detroit/project.rb +134 -0
  25. data/lib/detroit/ruby_utils.rb +29 -0
  26. data/lib/detroit/{tool/shell_utils.rb → shell_utils.rb} +10 -5
  27. data/lib/detroit/toolchain.rb +6 -0
  28. data/lib/detroit/toolchain/cli.rb +320 -0
  29. data/lib/detroit/toolchain/config.rb +223 -0
  30. data/lib/detroit/toolchain/runner.rb +678 -0
  31. data/lib/detroit/toolchain/script.rb +248 -0
  32. data/lib/detroit/toolchain/worker.rb +84 -0
  33. data/man/detroit.1 +116 -0
  34. data/man/detroit.1.html +171 -0
  35. data/man/detroit.1.ronn +99 -0
  36. metadata +90 -51
  37. data/.ruby +0 -44
  38. data/README.rdoc +0 -132
  39. data/lib/detroit/application.rb +0 -463
  40. data/lib/detroit/assembly_system.rb +0 -80
  41. data/lib/detroit/config.rb +0 -203
  42. data/lib/detroit/control.rb +0 -129
  43. data/lib/detroit/custom.rb +0 -102
  44. data/lib/detroit/dsl.rb +0 -55
  45. data/lib/detroit/service.rb +0 -78
  46. data/lib/detroit/standard_assembly.rb +0 -51
  47. data/lib/detroit/tool.rb +0 -295
  48. data/lib/detroit/tool/core_ext.rb +0 -3
  49. data/lib/detroit/tool/project_utils.rb +0 -41
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c01bd1c2e302f1b33ce1ba7b8bb1dca2642bb511
4
+ data.tar.gz: 5a228a2c40736081f686157d33e189b4c74e15a5
5
+ SHA512:
6
+ metadata.gz: 660dc433b88953988335c2bee9f7d3ac141b1c139b2e63ac43fc0842ad3d8adc3b7cc6e097cb2217c8504a370176815c52487c216d324fb3fc46d34bd9d57d27
7
+ data.tar.gz: 832de78b8b278321c31196f13dc0540c4ed26c83360c47d92c84add56b6122074999041b17d6718d8a99c117a7e02658bd64b7ac414a712e3560ac0f349ae6e7
data/.index ADDED
@@ -0,0 +1,59 @@
1
+ ---
2
+ revision: 2013
3
+ type: ruby
4
+ sources:
5
+ - var
6
+ authors:
7
+ - name: Trans
8
+ email: transfire@gmail.com
9
+ organizations: []
10
+ requirements:
11
+ - name: facets
12
+ - name: indexer
13
+ - groups:
14
+ - test
15
+ development: true
16
+ name: qed
17
+ - groups:
18
+ - build
19
+ development: true
20
+ name: detroit-yard
21
+ - groups:
22
+ - build
23
+ development: true
24
+ name: detroit-gem
25
+ conflicts: []
26
+ alternatives: []
27
+ resources:
28
+ - type: home
29
+ uri: http://rubyworks.github.com/detroit
30
+ label: Homepage
31
+ - type: code
32
+ uri: http://github.com/rubyworks/detroit
33
+ label: Source Code
34
+ - type: mail
35
+ uri: http://groups.google.com/rubyworks-mailinglist
36
+ label: Mailing List
37
+ repositories:
38
+ - name: upstream
39
+ scm: git
40
+ uri: http://github.com/proutils/detroit.git
41
+ categories: []
42
+ copyrights:
43
+ - holder: Rubyworks
44
+ year: '2007'
45
+ license: GPL-3.0
46
+ customs: []
47
+ paths:
48
+ lib:
49
+ - lib
50
+ name: detroit
51
+ title: Detroit
52
+ summary: Software Production Mangement
53
+ created: '2007-10-10'
54
+ description: Detroit is an advanced lifecycle build system. With Detroit, build tasks
55
+ are user defined service instances tied to stops along a track. Whenever the detroit
56
+ console command is run, a track is followed from beginning to designated destination.
57
+ suite: detroit
58
+ version: 0.4.0
59
+ date: '2014-01-13'
data/EXAMPLE.md CHANGED
@@ -1,58 +1,60 @@
1
1
  # Detroit
2
2
 
3
- Detroit's main configuration file is called an *assembly*. Assemblies define the
4
- <i>service instances</i> that a project will utilize.
3
+ Detroit's main configuration file is called *toolchain*. Toolchains define
4
+ the specific *tool instances* that a project will utilize. Toolchains can
5
+ be written in a few different formats thanks to the flexibility of Ruby. All
6
+ formats are equivalent. Which format you use is strictly a regard of your
7
+ personal preference.
5
8
 
6
- Assemblies can be written in a few different formats thanks to the flexibility
7
- of Ruby. All formats are equivalent. Which format you use is strictly a regard
8
- of your personal preference.
9
+ ## Ruby-based Toolchain Scripts
9
10
 
10
- ## Ruby-based Detroit
11
+ ### Tool Method Notation
11
12
 
12
- ### Service Method Notation
13
-
14
- Traditionally a Ruby-based assembly file is dominated by calls to the `service`
15
- method with an optional service instance name and a setter block.
13
+ Traditionally a Ruby-based toolchain script is dominated by calls to the `tool`
14
+ method with an optional instance name and a setter block.
16
15
 
17
16
  ```ruby
18
- service :myself do |s|
19
- s.service = :Announce
20
- s.mailto = "transfire@gmail.com"
21
- s.active = true
17
+ tool :myself do |s|
18
+ s.class = :Announce
19
+ s.mailto = "transfire@gmail.com"
20
+ s.active = true
22
21
  end
23
22
 
24
- service :rdoc do |r|
23
+ tool :rdoc do |r|
25
24
  r.include = [ 'lib', '[A-Z]*' ]
26
- r.exclude = [ 'Schedule' ]
25
+ r.exclude = [ 'Gemfile' ]
27
26
  end
28
27
  ```
29
28
 
30
- If no `service` setting is given, it is assumed to be same as the service instance name.
31
- In the above example `rdoc` is taken to be both the service desired and the name of
32
- this particular instance.
29
+ In the first example the tool is given an arbitrary *tool name* and the
30
+ *tool type* is given via the `class` setting. (This setting can also be
31
+ called just `tool`, they are synonymous, but `class` reads better when used
32
+ with the tool method.) If the tool type is not specified, it is assumed to
33
+ be same as the tool instance name. In the above example `rdoc` is taken to
34
+ be both the type of tool and the name of the particular instance.
33
35
 
34
- A few years ago, Sinatra came along and popularized the use of the `#set` method.
35
- A simple addition to Detroit's assembly file parser now allows for the slightly
36
- cleaner notation:
36
+ A few years ago, Sinatra came along and popularized the use of the `#set`
37
+ method. A simple addition to Detroit's toolchain evaluator allows for this
38
+ arguably cleaner notation:
37
39
 
38
40
  ```ruby
39
- service :myself do
40
- set :service, :Announce
41
+ tool :myself do
42
+ set :tooltype, :Announce
41
43
  set :mailto, "transfire@gmail.com"
42
44
  set :priority, -1
43
45
  set :active, true
44
46
  end
45
47
 
46
- service :rdoc do
48
+ tool :rdoc do
47
49
  set :include, [ 'lib', '[A-Z]*' ]
48
- set :exclude, [ 'Schedule' ]
50
+ set :exclude, [ 'Gemfile' ]
49
51
  end
50
52
  ```
51
53
 
52
54
  The `#set` method also allows for nested set blocks to define hash values.
53
55
 
54
56
  ```ruby
55
- service :rubyforge do
57
+ tool :rubyforge do
56
58
  set :sitemap do
57
59
  set :site, name
58
60
  end
@@ -61,23 +63,23 @@ The `#set` method also allows for nested set blocks to define hash values.
61
63
  ```
62
64
 
63
65
  The setting `active` defaults to `true` if not given, so is not strictly
64
- needed in the above examples, but it is convenient to have in case you
65
- ever need to deactivate a service temporarily --more convenient than
66
- remarking out a whole section.
66
+ needed in the above examples, but it is convenient to have if a tool ever
67
+ needs to be deactivate temporarily --more convenient than remarking out a
68
+ whole tool entry.
67
69
 
68
- Almost all options have standard defaults so it is often possible for a service
69
- definition to be written as simply as:
70
+ Almost all options have standard defaults so it is sometimes possible for
71
+ a tool entry to be written as simply as:
70
72
 
71
73
  ```ruby
72
- service :rdoc
74
+ tool :rdoc
73
75
  ```
74
76
 
75
- ### Service Name Notation
77
+ ### Tool Name Notation
76
78
 
77
- Thanks to some straight-forward meta-programming, a Ruby-based assembly file can
78
- be written in a more concise notation by using the name of the service class as a
79
- method. This can be followed by a settings block, as with the above examples,
80
- or passed a <i>settings hash</i>. In which case an assembly file can look like this:
79
+ Thanks to some straight-forward meta-programming, a Ruby-based toolchain can
80
+ also be written in a more concise notation by using the name of the tool's class
81
+ as a method. This can be followed by a settings block, as with the above examples,
82
+ or passed a *settings hash*. In which case an toolchain script can look like:
81
83
 
82
84
  ```ruby
83
85
  Announce :mailto => "ruby-talk@ruby-lang.org",
@@ -88,8 +90,7 @@ or passed a <i>settings hash</i>. In which case an assembly file can look like t
88
90
  :priority => -1
89
91
  :active => true
90
92
 
91
- Gem :types => ['gem'],
92
- :spec => false,
93
+ Gem :spec => false,
93
94
  :active => true
94
95
 
95
96
  DNote :priority => -1,
@@ -99,53 +100,50 @@ or passed a <i>settings hash</i>. In which case an assembly file can look like t
99
100
  :active => true
100
101
 
101
102
  RDoc :include => [ 'lib', '[A-Z]*' ],
102
- :exclude => [ 'Schedule' ]
103
+ :exclude => [ 'Gemfile' ]
103
104
 
104
105
  Testrb :active => true
105
106
 
106
107
  Rubyforge :sitemap => {
107
108
  :site => name
108
- }
109
+ },
109
110
  :active => false
110
111
  ```
111
112
 
112
- This format is convenient in that it reduced the amount of extraneous syntax
113
- need to define service instances. With Ruby 1.9 it can be even more conisce
113
+ This format is convenient in that it reduces the amount of extraneous syntax
114
+ needed to define tool instances. With Ruby 1.9+ it can be even more conisce
114
115
  using the new Hash syntax.
115
116
 
116
117
  ```ruby
117
118
  Announce :myself,
118
- mailto: "transfire@gmail.com",
119
- priority: -1
120
- active: true
119
+ mailto: "transfire@gmail.com",
120
+ priority: -1,
121
+ active: true
121
122
  ```
122
123
 
123
- But you might want to hold off on that a couple of years until Ruby 1.8 is pretty
124
- much shot and buried ;)
125
124
 
126
- ## YAML-based Assembly Files
125
+ ## YAML-based Toolchain Scripts
127
126
 
128
127
  We have saved the most concise notation for last. The YAML format is
129
- essentially the same as the traditional Ruby format except that
130
- the main key provides the service instance name and the service is a
131
- setting which defaults to the name. Also, notice the start document indicator
132
- (<code>---</code>). The indicator is NECESSARY for the Detroit to be
133
- recognized as YAML, rather than Ruby.
128
+ essentially the same as the traditional Ruby format except that the
129
+ main key provides the tool instance name and the type is a setting
130
+ which defaults to the name. Also, notice the start document indicator
131
+ (`---`). This indicator MUST BE USED for the file to be recognized
132
+ as YAML, rather than Ruby.
134
133
 
135
134
  ```yaml
136
135
  ---
137
136
 
138
137
  announce:
139
- mailto: "transfire@gmail.com"
138
+ mailto: transfire@gmail.com
140
139
  active: true
141
140
 
142
141
  myself:
143
- service: Announce
144
- mailto: "transfire@gmail.com"
145
- active: true
142
+ tool: Announce
143
+ mailto: transfire@gmail.com
144
+ active: true
146
145
 
147
146
  gem:
148
- types: ['gem']
149
147
  autospec: false
150
148
  active: true
151
149
 
@@ -154,8 +152,8 @@ recognized as YAML, rather than Ruby.
154
152
  active: true
155
153
 
156
154
  rdoc:
157
- include: [ lib, '[A-Z]*' ]
158
- exclude: [ Schedule ]
155
+ include: [ "lib", "[A-Z]*" ]
156
+ exclude: [ "Gemfile" ]
159
157
 
160
158
  ri:
161
159
  exclude: []
@@ -169,12 +167,16 @@ recognized as YAML, rather than Ruby.
169
167
  active: true
170
168
 
171
169
  rubyforge:
172
- service: forge
170
+ type: forge
173
171
  sitemap:
174
172
  site: <% name %>
175
173
  active: false
174
+ ```
175
+
176
+ Notice we used the the alternate setting `tool` instead of `class` for the
177
+ `myself` announce tool instance. The effect is exactly the same.
176
178
 
177
- As we can see in the last entry, the YAML format also supports ERB and provides
179
+ Also notice the last entry, the YAML format supports ERB and provides
178
180
  access to project metadata via the ERB's binding.
179
181
 
180
182
  With the Ruby format it is easy enough to load external library using
@@ -1,6 +1,33 @@
1
- = RELEASE HISTORY
1
+ # RELEASE HISTORY
2
2
 
3
- == 0.3.0 / 2012-04-02
3
+ ## 0.4.0 / 2014-01-14
4
+
5
+ The big change of this release is the swapping of terminology of
6
+ `assembly` and `toolchain`. What was once called an "Assembly" is
7
+ now called a "Toolchain" and vice-versa. This, when thought through,
8
+ makes much more sense. But it has a big effect on every project that
9
+ uses Detroit in that a project's `Assembly` file must be renamed
10
+ to `Toolchain`.
11
+
12
+ This release also modifies the interface change of the previous release
13
+ slightly, such that the `assemble` methods do not have to be manually
14
+ defined, although it is still recommended. By default the base class
15
+ definition will look to see if a method of the same name as a station
16
+ is defined in the tool class. Note this differs from using `respond_to?`
17
+ which will return `true` if the method was defined in any part of the
18
+ class hierarchy. Instead the method must be defined directly in the class.
19
+ This helps ensure there are no accidental name clashes between support
20
+ code and assembly stations (which was the purpose of the original
21
+ `station_` that was deprecated in the last release).
22
+
23
+ Changes:
24
+
25
+ * Rename `assembly` to `toolchain` and vice-versa.
26
+ * No longer *requires* custom `assemble` methods for each tool.
27
+ * Improved code organization and plenty of bug fixes.
28
+
29
+
30
+ ## 0.3.0 / 2012-04-02
4
31
 
5
32
  This significant release changes the interface for tools to tap
6
33
  into the assembly line. Where as before specially named methods
@@ -13,10 +40,10 @@ Changes:
13
40
 
14
41
  * Simplify the assembly interface for tools.
15
42
  * Tool classes ending in Base are abstract base class.
16
- * Add #on as alias from #track.
43
+ * Add #on as alias for #track.
17
44
 
18
45
 
19
- == 0.2.0 / 2011-10-19
46
+ ## 0.2.0 / 2011-10-19
20
47
 
21
48
  The big news here is that Detroit configuration files are now
22
49
  called _assembly_ files, and no longer _schedule_ files. The
@@ -36,7 +63,7 @@ Changes:
36
63
  * Fix --config output.
37
64
 
38
65
 
39
- == 0.1.0 / 2011-06-29
66
+ ## 0.1.0 / 2011-06-29
40
67
 
41
68
  Detroit is a lifecycle build system for Ruby. Detroit was originally
42
69
  called Syckle, and was developed and used in house for Rubyworks projects
File without changes
@@ -0,0 +1,142 @@
1
+ # Detroit
2
+
3
+ [Website](http://rubyworks.github.io/detroit) /
4
+ [Report Issue](http://github.com/rubyworks/detroit/issues) /
5
+ [Development](http://github.com/rubyworks/detroit)
6
+
7
+ [![Build Status](http://travis-ci.org/rubyworks/detroit.png)](http://travis-ci.org/rubyworks/detroit)
8
+ [![Gem Version](https://badge.fury.io/rb/detroit.png)](http://badge.fury.io/rb/detroit) &nbsp; &nbsp;
9
+ [![Flattr Me](http://api.flattr.com/button/flattr-badge-large.png)](http://flattr.com/thing/324911/Rubyworks-Ruby-Development-Fund)
10
+
11
+
12
+ ## About
13
+
14
+ Detroit is a software production management aid, aka a *build tool*.
15
+ Detroit utilizes a life-cycle methodology to help developers
16
+ prepare and release software in a clear, repeatable, and linear fashion.
17
+ While written in, and therefore well-suited to Ruby development, Detroit
18
+ can be used for any language and production requirements.
19
+
20
+
21
+ ## How It Works
22
+
23
+ Detroit defines development processions call *assemblies* which consist of
24
+ a set of production *lines* each with a series of named *stations*, or *stops*.
25
+ Developers attach work elements to stations by creating configuring tool
26
+ instances in a project's Toolchain file. Toolchain files are written
27
+ in either YAML or a Ruby DSL.
28
+
29
+ For example, a RubyForge tool can be configured:
30
+
31
+ rubyforge:
32
+ tool: Rubyforge
33
+ sitemap:
34
+ site: <%= name %>
35
+ active: true
36
+
37
+ As this example demonstrates, tool configurations can draw on project
38
+ metadata via ERB embedded tags. Detroit gathers this information using
39
+ [.index](http://dotruby.github.com/indexer) file, but the data source
40
+ can be customized to meet the needs of different projects. (For instance,
41
+ for Ruby projects, if no .index file is found, Detroit will attempt get the
42
+ information from a .gemspec file.)
43
+
44
+ With tool configuration and metadata in place, using Detroit is simply
45
+ a matter of passing a stop to the `detroit` command.
46
+
47
+ $ detroit document
48
+
49
+ The use of lines may seem constrictive to users of tools like Rake, but
50
+ there is a benefit to this approach. It helps ensure a project is
51
+ always up-to-date and in-sync --that no necessary steps are missed.
52
+ Detroit standard asembly has two lines. The most significant of which is
53
+ main line which entails a route with ordred stops:
54
+
55
+ prepare # prepare services and ensure requirements
56
+ generate # code generation
57
+ compile # compile source code
58
+ test # run tests and/or specifications
59
+ analyze # run code analysis
60
+ document # generate documentation
61
+ package # create packages
62
+ verify # post package verification (eg. integration tests)
63
+ install # install package locally
64
+ publish # publish website/documentation
65
+ release # release packages
66
+ deploy # deply system to servers
67
+ promote # tell the world about you awesome work
68
+
69
+ The second line is maintainence line which consits of three stops:
70
+
71
+ reset # mark build files as out-of-date
72
+ clean # remove minor build files
73
+ purge # remove all build files
74
+
75
+ Where reset marks generated files out-of-date, clean removes temporary
76
+ products and purge removes all generated prodcuts.
77
+
78
+ To refine control over the build process, tool instances can be grouped into
79
+ different *tracks*. For example, a Github gh-pages tool might be configured
80
+ to be on a `site` track, so publishing a project's website only occurs if
81
+ the `site` track is specified along with `publish` stop.
82
+
83
+ $ detroit site:publish
84
+
85
+ Please see http://rubyworks.github.com/detroit for more details on how to
86
+ use Detroit, including the creation of tracks, stops and tool plugins.
87
+ Also try the `--help` option to see the detroit command's help
88
+ information.
89
+
90
+
91
+ ## Install
92
+
93
+ Detroit can, of course, be installed via RubyGems:
94
+
95
+ $ gem install detroit
96
+
97
+ Once installed, developers need to also install the specific plugins
98
+ for the tools to be used. For example,
99
+
100
+ $ gem install detroit-github
101
+ $ gem install detroit-minitest
102
+ $ gem install detroit-yard
103
+
104
+ If using Bundler, just add these to the project's Gemfile instead.
105
+
106
+
107
+ ## Issues
108
+
109
+ All in all, Detroit works well. There are some rough edges with regards
110
+ to the plugins, so from time to time you might run into an odd error.
111
+ Ususally it just means a tool confirguraiton needs adjustment.
112
+
113
+ Please note, Windows support has not been considered at all. While we see
114
+ no specific reason it should not work, there may well be issues we have not
115
+ considered since we do not use Windows. If you are Windows user and give
116
+ Detroit a try please let us know of any issues you encounter.
117
+
118
+
119
+ ## History
120
+
121
+ Detroit is actaully a fork of Reap v10, and was called Syckle for a number
122
+ of years as it matured. It represents many years of design considerations
123
+ (and reconsiderations) that evolved Reap from its simple Rake extension
124
+ origins (which pre-date Hoe) to the life-cycle system it is today.
125
+
126
+
127
+ ## Legal
128
+
129
+ Copyright (c) 2007 Rubyworks (GPL-3.0 License)
130
+
131
+ This program is free software: you can redistribute it and/or modify
132
+ it under the terms of the GNU General Public License as published by
133
+ the Free Software Foundation, either version 3 of the License, or
134
+ (at your option) any later version.
135
+
136
+ This program is distributed in the hope that it will be useful,
137
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
138
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
139
+ GNU General Public License for more details.
140
+
141
+ See LICENSE.txt for details.
142
+