detroit-gem 0.2.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 301e20e702f9ac259db80d528b3e768dc6ccf4f4
4
+ data.tar.gz: 356e2798bb368fd4acd1e7f3580397c1dcf55c60
5
+ SHA512:
6
+ metadata.gz: 493ed715d92be0db6849926d29ab17e369a0f766b30d3e895614d8730837ca0e568e6bce77233931b15f7132229984f79de0417c9f45103100a41f55cb16d1f4
7
+ data.tar.gz: b424c0647a58e654d5620b9d75e87497e57efea066ec98bbbd9d901b7fbef6fb8c6be918ca51506c5fca5775181b326885e9e0756bac57a93493fcf01000acf1
@@ -0,0 +1,17 @@
1
+ Detroit RubyGems (http://detroit.github.com)
2
+
3
+ Copyright (c) 2011 Rubyworks
4
+
5
+ This program is free software: you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation, either version 3 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+
@@ -0,0 +1,43 @@
1
+ # Detroit Gem Tool
2
+
3
+ [Website](http://rubyworks.github.com/detroit-gem) /
4
+ [Report Issue](http://gem.com/rubyworks/detroit-gem/issues) /
5
+ [Development](http://gem.com/rubyworks/detroit-gem)
6
+
7
+ [![Build Status](https://secure.travis-ci.org/rubyworks/detroit-gem.png)](http://travis-ci.org/rubyworks/detroit-gem)
8
+ [![Gem Version](https://badge.fury.io/rb/detroit-gem.png)](http://badge.fury.io/rb/detroit-gem) &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
+ Create `.gem` package for your Ruby project.
15
+
16
+
17
+ ## Install
18
+
19
+ ### With RubyGems
20
+
21
+ Per the usual gem install process.
22
+
23
+ $ gem install detroit-rubygems
24
+
25
+
26
+ ## Legal
27
+
28
+ Detroit Gem
29
+
30
+ Copyright (c) 2011 Rubyworks
31
+
32
+ This program is free software: you can redistribute it and/or modify
33
+ it under the terms of the GNU General Public License as published by
34
+ the Free Software Foundation, either version 3 of the License, or
35
+ (at your option) any later version.
36
+
37
+ This program is distributed in the hope that it will be useful,
38
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
39
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40
+ GNU General Public License for more details.
41
+
42
+ See LICENSE.txt for details.
43
+
@@ -1,15 +1,40 @@
1
- require 'detroit/tool'
1
+ require 'detroit-standard'
2
2
 
3
3
  module Detroit
4
4
 
5
- # Create new Gem tool with the specified +options+.
6
- def Gem(options={})
7
- Gem.new(options)
8
- end
9
-
10
- # The Gem tool is used to generate gemspec and gem packages.
5
+ # The Gem tool is used to generate gemspec and gem packages
6
+ # for ruby projects.
7
+ #
8
+ # This tool was designed for the standard toolchain supporting
9
+ # the following stations:
10
+ #
11
+ # * package
12
+ # * install
13
+ # * release
14
+ # * reset
15
+ # * purge
16
+ #
11
17
  class Gem < Tool
12
18
 
19
+ # Designed for the Standard assembly.
20
+ #
21
+ # @!parse
22
+ # include Standard
23
+ #
24
+ assembly Standard
25
+
26
+ # RubyGems is a tool for packaging Ruby projects.
27
+ include RubyUtils
28
+
29
+ # Location of man_page for tool.
30
+ MANPAGE = File.dirname(__FILE__) + '/../man/detroit-gem.5'
31
+
32
+ #
33
+ def prerequisite
34
+ require 'rubygems'
35
+ require 'rubygems/package'
36
+ end
37
+
13
38
  # The .gemspec filename (default looks-up `.gemspec` or `name.gemspec` file).
14
39
  attr_accessor :gemspec
15
40
 
@@ -37,34 +62,6 @@ module Detroit
37
62
  # Additional options to pass to gem command.
38
63
  #attr :options
39
64
 
40
-
41
- # A S S E M B L Y
42
-
43
- #
44
- def assemble?(station, options={})
45
- case station
46
- when :install then install?
47
- when :package then true
48
- when :release then true
49
- when :reset then true
50
- when :purge then true
51
- end
52
- end
53
-
54
- # Attach to `package`, `install` and `release`, `reset` and `purge`.
55
- def assemble(station, options={})
56
- case station
57
- when :package then package
58
- when :install then install
59
- when :release then release
60
- when :reset then reset
61
- when :purge then purge
62
- end
63
- end
64
-
65
-
66
- # S E R V I C E M E T H O D S
67
-
68
65
  # Write gemspec if +autospec+ is +true+ and then build the gem.
69
66
  def package
70
67
  create_gemspec if autospec # TODO: should autospec be a generate phase?
@@ -74,18 +71,18 @@ module Detroit
74
71
  # Create a gem package.
75
72
  def build
76
73
  trace "gem build #{gemspec}"
77
- spec = load_gemspec
78
- builder = ::Gem::Builder.new(spec)
79
- package = builder.build
80
- mkdir_p(pkgdir)
74
+ spec = load_gemspec
75
+ package = ::Gem::Package.build(spec)
76
+ mkdir_p(pkgdir) unless File.directory?(pkgdir)
81
77
  mv(package, pkgdir)
82
78
  end
83
79
 
84
80
  # Convert metadata to a gemspec and write to +file+.
85
81
  #
86
- # file - name of gemspec file (defaults to value of #gemspec).
82
+ # @param [String] file
83
+ # Name of gemspec file (defaults to value of #gemspec).
87
84
  #
88
- # Returns [String] file name.
85
+ # @return [String] The file name.
89
86
  def spec(file=nil)
90
87
  create_gemspec(file)
91
88
  end
@@ -96,7 +93,7 @@ module Detroit
96
93
  package_files.each do |file|
97
94
  sh "gem install --no-rdoc --no-ri #{file}"
98
95
  end
99
- end
96
+ end
100
97
 
101
98
  # TODO: Gem push programatically instead of shelling out.
102
99
 
@@ -111,8 +108,10 @@ module Detroit
111
108
  end
112
109
  end
113
110
 
114
- #
115
- alias_method :release, :push
111
+ # Same as #push.
112
+ def release
113
+ push
114
+ end
116
115
 
117
116
  # Mark package files as outdated.
118
117
  def reset
@@ -123,10 +122,10 @@ module Detroit
123
122
  end
124
123
 
125
124
  # Remove package file(s).
126
- #--
127
- # TODO: This is a little loose. Can we be more specific about which
128
- # gem file(s) to remove?
129
- #++
125
+ #
126
+ # @todo This code is a little loose. Can it be more specific about which
127
+ # gem file(s) to remove?
128
+ #
130
129
  def purge
131
130
  package_files.each do |f|
132
131
  rm(f)
@@ -134,13 +133,25 @@ module Detroit
134
133
  end
135
134
  end
136
135
 
136
+ #
137
+ def assemble?(station, options={})
138
+ return true if station == :package
139
+ return true if station == :install
140
+ return true if station == :release
141
+ return true if station == :reset
142
+ return true if station == :purge
143
+ return false
144
+ end
145
+
137
146
  private
138
147
 
139
- #
148
+ # Initialize attribute defaults.
140
149
  def initialize_defaults
150
+ super
151
+
141
152
  @autospec = false
142
153
 
143
- @pkgdir ||= project.pkg
154
+ @pkgdir ||= (root + 'pkg').to_s #|| project.pkg
144
155
  @gemspec ||= lookup_gemspec
145
156
 
146
157
  @version = project.metadata.version
@@ -159,7 +170,7 @@ module Detroit
159
170
  # Create a gemspec file from project metadata.
160
171
  def create_gemspec(file=nil)
161
172
  file = gemspec if !file
162
- require 'pom/gemspec'
173
+ #require 'gemdo/gemspec'
163
174
  yaml = project.to_gemspec.to_yaml
164
175
  File.open(file, 'w') do |f|
165
176
  f << yaml
@@ -198,17 +209,6 @@ module Detroit
198
209
  line.index "!ruby/object:Gem::Specification"
199
210
  end
200
211
 
201
- # TODO: Should we be rescuing this?
202
- def initialize_requires
203
- begin
204
- require 'rubygems'
205
- rescue LoadError
206
- $stderr.puts "Could not load `rubygems'."
207
- end
208
- # can't do this b/c options not set yet
209
- #require 'pom/gemspec' if autospec
210
- end
211
-
212
212
  ## Require rubygems library
213
213
  #def require_rubygems
214
214
  # begin
@@ -219,12 +219,6 @@ module Detroit
219
219
  # end
220
220
  #end
221
221
 
222
- public
223
-
224
- def self.man_page
225
- File.dirname(__FILE__)+'/../man/detroit-gem.5'
226
- end
227
-
228
222
  end
229
223
 
230
224
  end
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "DETROIT\-GEM" "5" "October 2011" "" ""
4
+ .TH "DETROIT\-GEM" "5" "January 2014" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBdetroit\-gem\fR \- build gem package with detroit
@@ -10,7 +10,7 @@
10
10
  The Gem plug\-in for Detroit utilizes the \fBgem\fR command line tool to build a \fB\.gem\fR package for a project during the standard \fBpackage\fR phase\.
11
11
  .
12
12
  .SH "OPTIONS"
13
- The following options can be used in the Detroit assembly file for defining a Gem service\.
13
+ The following options can be used in the Detroit toolchain file for defining a Gem tool instance\.
14
14
  .
15
15
  .IP "\(bu" 4
16
16
  \fBgemspec\fR \- The \.gemspec file\. The default is the first \fB\.gemspec\fR file found\.
@@ -27,7 +27,7 @@ The following options can be used in the Detroit assembly file for defining a Ge
27
27
  .IP "" 0
28
28
  .
29
29
  .SH "EXAMPLES"
30
- Becuase the default options are all that is likely to be need the common exmaple something like:
30
+ Because the default options are all that is likely to be need the common example something like:
31
31
  .
32
32
  .IP "" 4
33
33
  .
@@ -56,7 +56,7 @@ A fuller example might look something like this\.
56
56
  .IP "" 0
57
57
  .
58
58
  .P
59
- The above examples use the YAML\-base assembly format\. Assembly files can also be Ruby\-based\. See Detroit documentation for more details\.
59
+ The above examples use the YAML\-based toolchain format\. Toolchain files can also be Ruby\-based\. See Detroit documentation for more details\.
60
60
  .
61
61
  .SH "RESOURCES"
62
62
  For more information:
@@ -70,10 +70,10 @@ Development Site \fIhttp://github\.com/detroit/detroit\-rubygems\fR
70
70
  .IP "" 0
71
71
  .
72
72
  .SH "COPYRIGHT"
73
- Copyright (c) 2010 Thomas Sawyer, Rubyworks
73
+ Copyright (c) 2010 Rubyworks
74
74
  .
75
75
  .P
76
76
  Detroit RubyGems is distributable in accordance with the GPLv3 license\.
77
77
  .
78
78
  .SH "SEE ALSO"
79
- dnote(1), gem(1)
79
+ detroit(1), gem(1)
@@ -60,7 +60,7 @@
60
60
  <a href="#RESOURCES">RESOURCES</a>
61
61
  <a href="#COPYRIGHT">COPYRIGHT</a>
62
62
  <a href="#SEE-ALSO">SEE ALSO</a>
63
- </div>
63
+ </div>
64
64
 
65
65
  <ol class='man-decor man-head man head'>
66
66
  <li class='tl'>detroit-gem(5)</li>
@@ -81,8 +81,8 @@ phase.</p>
81
81
 
82
82
  <h2 id="OPTIONS">OPTIONS</h2>
83
83
 
84
- <p>The following options can be used in the Detroit assembly file
85
- for defining a Gem service.</p>
84
+ <p>The following options can be used in the Detroit toolchain file
85
+ for defining a Gem tool instance.</p>
86
86
 
87
87
  <ul>
88
88
  <li><p><code>gemspec</code> - The .gemspec file. The default is the first <code>.gemspec</code>
@@ -97,8 +97,8 @@ for defining a Gem service.</p>
97
97
 
98
98
  <h2 id="EXAMPLES">EXAMPLES</h2>
99
99
 
100
- <p>Becuase the default options are all that is likely to be need the
101
- common exmaple something like:</p>
100
+ <p>Because the default options are all that is likely to be need the
101
+ common example something like:</p>
102
102
 
103
103
  <pre><code>gem:
104
104
  active: true
@@ -111,7 +111,7 @@ common exmaple something like:</p>
111
111
  install: true
112
112
  </code></pre>
113
113
 
114
- <p>The above examples use the YAML-base assembly format. Assembly
114
+ <p>The above examples use the YAML-based toolchain format. Toolchain
115
115
  files can also be Ruby-based. See Detroit documentation for more
116
116
  details.</p>
117
117
 
@@ -127,18 +127,18 @@ details.</p>
127
127
 
128
128
  <h2 id="COPYRIGHT">COPYRIGHT</h2>
129
129
 
130
- <p>Copyright (c) 2010 Thomas Sawyer, Rubyworks</p>
130
+ <p>Copyright (c) 2010 Rubyworks</p>
131
131
 
132
132
  <p>Detroit RubyGems is distributable in accordance with the GPLv3 license.</p>
133
133
 
134
134
  <h2 id="SEE-ALSO">SEE ALSO</h2>
135
135
 
136
- <p><span class="man-ref">dnote<span class="s">(1)</span></span>, <span class="man-ref">gem<span class="s">(1)</span></span></p>
136
+ <p><span class="man-ref">detroit<span class="s">(1)</span></span>, <span class="man-ref">gem<span class="s">(1)</span></span></p>
137
137
 
138
138
 
139
139
  <ol class='man-decor man-foot man foot'>
140
140
  <li class='tl'></li>
141
- <li class='tc'>October 2011</li>
141
+ <li class='tc'>January 2014</li>
142
142
  <li class='tr'>detroit-gem(5)</li>
143
143
  </ol>
144
144
 
@@ -10,8 +10,8 @@ phase.
10
10
 
11
11
  ## OPTIONS
12
12
 
13
- The following options can be used in the Detroit assembly file
14
- for defining a Gem service.
13
+ The following options can be used in the Detroit toolchain file
14
+ for defining a Gem tool instance.
15
15
 
16
16
  * `gemspec` - The .gemspec file. The default is the first `.gemspec`
17
17
  file found.
@@ -39,7 +39,7 @@ A fuller example might look something like this.
39
39
  gemspec: myapp-extra.gemspec
40
40
  install: true
41
41
 
42
- The above examples use the YAML-base assembly format. Assembly
42
+ The above examples use the YAML-based toolchain format. Toolchain
43
43
  files can also be Ruby-based. See Detroit documentation for more
44
44
  details.
45
45
 
@@ -55,7 +55,7 @@ For more information:
55
55
 
56
56
  ## COPYRIGHT
57
57
 
58
- Copyright (c) 2010 Thomas Sawyer, Rubyworks
58
+ Copyright (c) 2010 Rubyworks
59
59
 
60
60
  Detroit RubyGems is distributable in accordance with the GPLv3 license.
61
61
 
metadata CHANGED
@@ -1,38 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: detroit-gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
5
- prerelease:
4
+ version: 0.4.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - T. Sawyer
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-04-02 00:00:00.000000000 Z
11
+ date: 2014-01-14 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: detroit
16
- requirement: &23212160 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
- version: 0.3.0
19
+ version: '0.4'
22
20
  type: :runtime
23
21
  prerelease: false
24
- version_requirements: *23212160
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0.4'
25
27
  - !ruby/object:Gem::Dependency
26
- name: rubygems
27
- requirement: &23211680 !ruby/object:Gem::Requirement
28
- none: false
28
+ name: detroit-standard
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
- - - ! '>='
31
+ - - '>='
31
32
  - !ruby/object:Gem::Version
32
33
  version: '0'
33
34
  type: :runtime
34
35
  prerelease: false
35
- version_requirements: *23211680
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
36
41
  description: The Gem plugin for the Detroit build system will build a gem during the
37
42
  package phase and releases it to rubygems.org (or other gem source) during the release
38
43
  phase.
@@ -41,41 +46,40 @@ email:
41
46
  executables: []
42
47
  extensions: []
43
48
  extra_rdoc_files:
49
+ - NOTICE.txt
44
50
  - LICENSE.txt
45
- - README.rdoc
46
- - COPYING.rdoc
51
+ - README.md
47
52
  files:
48
- - .ruby
49
53
  - lib/detroit-gem.rb
50
54
  - man/detroit-gem.5
51
55
  - man/detroit-gem.5.html
52
56
  - man/detroit-gem.5.ronn
57
+ - README.md
58
+ - NOTICE.txt
53
59
  - LICENSE.txt
54
- - README.rdoc
55
- - COPYING.rdoc
56
60
  homepage: http://detroit.github.com/
57
61
  licenses:
58
- - GPL-3
62
+ - GPL-3.0
63
+ metadata: {}
59
64
  post_install_message:
60
65
  rdoc_options: []
61
66
  require_paths:
62
67
  - lib
63
68
  required_ruby_version: !ruby/object:Gem::Requirement
64
- none: false
65
69
  requirements:
66
- - - ! '>='
70
+ - - '>='
67
71
  - !ruby/object:Gem::Version
68
72
  version: '0'
69
73
  required_rubygems_version: !ruby/object:Gem::Requirement
70
- none: false
71
74
  requirements:
72
- - - ! '>='
75
+ - - '>='
73
76
  - !ruby/object:Gem::Version
74
77
  version: '0'
75
78
  requirements: []
76
79
  rubyforge_project:
77
- rubygems_version: 1.8.11
80
+ rubygems_version: 2.0.3
78
81
  signing_key:
79
- specification_version: 3
82
+ specification_version: 4
80
83
  summary: Gem plugin for Detroit
81
84
  test_files: []
85
+ has_rdoc:
data/.ruby DELETED
@@ -1,37 +0,0 @@
1
- ---
2
- source:
3
- - meta
4
- authors:
5
- - name: T. Sawyer
6
- email: transfire@gmail.com
7
- copyrights:
8
- - holder: Thomas Sawyer
9
- year: '2011'
10
- license: GPL-3
11
- requirements:
12
- - name: detroit
13
- version: 0.3.0+
14
- - name: rubygems
15
- dependencies: []
16
- alternatives: []
17
- conflicts: []
18
- repositories: []
19
- resources:
20
- home: http://detroit.github.com/
21
- code: http://github.com/detroit/detroit-rubygems
22
- mail: http://groups.google.com/groups/rubyworks-mailinglist
23
- extra: {}
24
- load_path:
25
- - lib
26
- revision: 0
27
- created: '2011-10-16'
28
- summary: Gem plugin for Detroit
29
- title: Detroit Gem
30
- version: 0.2.0
31
- name: detroit-gem
32
- suite: detroit
33
- description: The Gem plugin for the Detroit build system will build a gem during the
34
- package phase and releases it to rubygems.org (or other gem source) during the release
35
- phase.
36
- organization: rubyworks
37
- date: '2012-04-01'
@@ -1,24 +0,0 @@
1
- = COPYRIGHT NOTICES
2
-
3
- == Detroit RubyGems
4
-
5
- Copyright:: (c) 2011 Thomas Sawyer
6
- License:: GPL-3
7
- Website:: http://detroit.github.com
8
-
9
- Copyright (c) 2011 Thomas Sawyer
10
-
11
- This program is free software: you can redistribute it and/or modify
12
- it under the terms of the GNU General Public License as published by
13
- the Free Software Foundation, either version 3 of the License, or
14
- (at your option) any later version.
15
-
16
- This program is distributed in the hope that it will be useful,
17
- but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
- GNU General Public License for more details.
20
-
21
- You should have received a copy of the GNU General Public License
22
- along with this program. If not, see <http://www.gnu.org/licenses/>.
23
-
24
-
@@ -1,27 +0,0 @@
1
- = Detroit Gem Tool
2
-
3
- {Website}[http://rubyworks.github.com/detroit-gem] /
4
- {Report Issue}[http://github.com/rubyworks/detroit-gem/issues] /
5
- {Repository}[http://github.com/rubyworks/detroit-gem]
6
-
7
-
8
- == Description
9
-
10
- Create `.gem` package for your Ruby project.
11
-
12
-
13
- == Installation
14
-
15
- Per the usual gem install process:
16
-
17
- $ gem install detroit-rubygems
18
-
19
-
20
- == Copyrights
21
-
22
- Copyright (c) 2011 Thomas Sawyer
23
-
24
- Detroit Gem is licensed via the terms of the GPL version 3 or greater.
25
-
26
- See COPYING.rdoc and LICENSE.txt files for details.
27
-