echoe 1.4 → 2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (8) hide show
  1. data/CHANGELOG +10 -5
  2. data/MIT-LICENSE +21 -0
  3. data/Manifest +8 -8
  4. data/README +56 -80
  5. data/Rakefile +6 -9
  6. data/lib/echoe.rb +175 -261
  7. metadata +28 -16
  8. data/bin/echoe +0 -71
data/CHANGELOG CHANGED
@@ -1,7 +1,12 @@
1
1
 
2
- 1.4. auto-detect readme file; make rdoc default pattern compatible with manifest generator; fix publish_docs task; use env var for rdoc template if available
3
- 1.3. avoid rubyforge gem multi-activation conflict
4
- 1.2. build_manifest Rake task
5
- 1.1. sane error messages on releasing new or duplicate gems; allow Manifest to not end in .txt
6
- 1.0.0. fork from Hoe
2
+ v2. support documentation hosts other than rubyforge, switch to Snax-style gem versioning; auto-load CHANGELOG contents; remove bin/echoe which doesn't work anyway
7
3
 
4
+ v1.4. auto-detect readme file; make rdoc default pattern compatible with manifest generator; fix publish_docs task
5
+
6
+ v1.3. avoid rubyforge gem multi-activation conflict
7
+
8
+ v1.2. build_manifest Rake task
9
+
10
+ v1.1. sane error messages on releasing new or duplicate gems; allow Manifest to not end in .txt
11
+
12
+ v1.0.0. fork from Hoe
@@ -0,0 +1,21 @@
1
+
2
+ Copyright (c) 2006 Ryan Davis, Zen Spider Software
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining
5
+ a copy of this software and associated documentation files (the
6
+ "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish,
8
+ distribute, sublicense, and/or sell copies of the Software, and to
9
+ permit persons to whom the Software is furnished to do so, subject to
10
+ the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Manifest CHANGED
@@ -1,8 +1,8 @@
1
- ./CHANGELOG
2
- ./LICENSE
3
- ./README
4
- ./Rakefile
5
- ./bin/echoe
6
- ./lib/echoe.rb
7
- ./test/test_echoe.rb
8
- ./Manifest
1
+ test/test_echoe.rb
2
+ lib/echoe.rb
3
+ Rakefile
4
+ README
5
+ Manifest
6
+ MIT-LICENSE
7
+ LICENSE
8
+ CHANGELOG
data/README CHANGED
@@ -1,98 +1,74 @@
1
+
1
2
  echoe
2
- http://rubyforge.org/projects/fauna/
3
- Evan Weaver
4
-
5
- == DESCRIPTION:
6
-
7
- Echoe is a simple packaging tool for working with rubygems. It
8
- generates all the usual tasks for projects including rdoc generation,
9
- testing, packaging, and deployment.
10
-
11
- Tasks Provided:
12
-
13
- * announce - Generate email announcement file and post to rubyforge.
14
- * audit - Run ZenTest against the package
15
- * check_manifest - Verify the manifest
16
- * clean - Clean up all the extras
17
- * debug_gem - Show information about the gem.
18
- * default - Run the default tasks
19
- * docs - Build the docs HTML Files
20
- * email - Generate email announcement file.
21
- * install - Install the package. Uses PREFIX and RUBYLIB
22
- * install_gem - Install the package as a gem
23
- * multi - Run the test suite using multiruby
24
- * package - Build all the packages
25
- * post_news - Post announcement to rubyforge.
26
- * publish_docs - Publish RDoc to RubyForge
27
- * release - Package and upload the release to rubyforge.
28
- * ridocs - Generate ri locally for testing
29
- * test - Run the test suite. Use FILTER to add to the command line.
30
- * test_deps - Show which test files fail when run alone.
31
- * uninstall - Uninstall the package.
32
-
33
- First, see the Rakefile used to distribute Echoe itself. Also see the class rdoc for
34
- help.
35
-
36
- == DIFFERENCES FROM HOE:
37
-
38
- * Removes unnecessary meta-dependency on self in created gems
39
- * Better error reporting
40
- * Can auto-generate the Manifest
41
-
42
- == FEATURES/PROBLEMS:
43
-
44
- * Provides 'echoe' command line tool for quick project directory creation.
45
- * Make making and maintaining Rakefiles fun and easy.
46
3
 
47
- == SYNOPSYS:
4
+ Echoe is a simple tool for working with Rubygems. It generates Rake tasks for documentation, testing, packaging, and deployment.
5
+
6
+ == License
7
+
8
+ Copyright 2007 Cloudburst, LLC. See included LICENSE file. Portions copyright 2006 Ryan Davis, Zen Spider Software, and used with permission. See included MIT-LICENSE file.
48
9
 
49
- % sow [group] project
10
+ == Usage
50
11
 
51
- or
12
+ First, organize your gem according to the usual structure:
52
13
 
53
- require 'echoe'
14
+ lib/
15
+ bin/
16
+ ext/
17
+ README
18
+ LICENSE
19
+ CHANGELOG
20
+ Rakefile
21
+
22
+ Your <tt>CHANGELOG</tt> should be formatted as follows (including newlines):
23
+
24
+ v2.1. newest change
25
+
26
+ v2. older change
54
27
 
55
- Echoe.new(projectname, version) do |p|
56
- # ... project specific data ...
57
- end
28
+ v1.9. oldest change
29
+
30
+ This way Echoe can parse the latest version and changeset message automatically.
31
+
32
+ Your <tt>Rakefile</tt> needs the following minimal contents:
33
+
34
+ require "rubygems"
35
+ require "echoe"
36
+ Echoe.new("gem_name")
37
+
38
+ More advanced configuration is described in the Echoe class.
39
+
40
+ == Deploying your gem
41
+
42
+ Now, to build your documentation and deploy the gem:
58
43
 
59
- # ... project specific tasks ...
44
+ rake build_manifest
45
+ rake publish_docs
46
+ rake release
60
47
 
61
- == REQUIREMENTS:
48
+ == All Rake tasks
62
49
 
63
- * rake
64
- * rubyforge
65
- * rubygems
50
+ The following tasks are made available to your gem.
66
51
 
67
- == INSTALL:
52
+ Packaging:
68
53
 
69
- * sudo gem install echoe
54
+ * <tt>build_manifest</tt> - Build a Manifest list.
55
+ * <tt>docs</tt> - Build the documentation.
56
+ * <tt>package</tt> - Build all the packages.
70
57
 
71
- == LICENSE:
58
+ Testing:
72
59
 
73
- Copyright 2007 Evan Weaver.
74
- Licensed under the Academic Free License 3.0. See LICENSE.txt, included.
75
- The following license also applies to portions of the software:
60
+ * <tt>test</tt> - Run the test suite.
61
+ * <tt>install</tt> - Install the gem locally.
62
+ * <tt>uninstall</tt> - Uninstall the gem.
76
63
 
77
- (The MIT License)
64
+ Upload:
78
65
 
79
- Copyright (c) 2006 Ryan Davis, Zen Spider Software
66
+ * <tt>publish_docs</tt> - Publish documentation to the web.
67
+ * <tt>release</tt> - Package and upload the latest release to Rubyforge.
80
68
 
81
- Permission is hereby granted, free of charge, to any person obtaining
82
- a copy of this software and associated documentation files (the
83
- "Software"), to deal in the Software without restriction, including
84
- without limitation the rights to use, copy, modify, merge, publish,
85
- distribute, sublicense, and/or sell copies of the Software, and to
86
- permit persons to whom the Software is furnished to do so, subject to
87
- the following conditions:
69
+ Cleaning:
88
70
 
89
- The above copyright notice and this permission notice shall be
90
- included in all copies or substantial portions of the Software.
71
+ * <tt>clean</tt> - Delete all the generated documentation and packages.
72
+ * <tt>redocs</tt> - Force a rebuild of the Rdoc files.
73
+ * <tt>repackage</tt> - Force a rebuild of the package files.
91
74
 
92
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
93
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
94
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
95
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
96
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
97
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
98
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile CHANGED
@@ -1,15 +1,12 @@
1
1
 
2
2
  require 'lib/echoe'
3
3
 
4
- Echoe.new("echoe", `cat CHANGELOG`[/^([\d\.]+)\. /, 1]) do |p|
5
- p.name = "echoe"
4
+ Echoe.new('echoe') do |p|
6
5
  p.rubyforge_name = "fauna"
7
- p.summary = "Echoe is a simple packaging tool for working with rubygems."
8
- p.description = "Echoe is a simple packaging tool for working with rubygems. It
9
- generates all the usual tasks for projects including rdoc generation,
10
- testing, packaging, and deployment."
11
- p.url = "http://blog.evanweaver.com/articles/2007/01/10/if-you-dont-want-to-hoe-echoe"
12
- p.changes = `cat CHANGELOG`[/^([\d\.]+\. .*)/, 1]
13
- p.extra_deps = [['rake'], ['rubyforge', '>= 0.4.0']]
6
+ p.author = "Evan Weaver"
7
+ p.summary = "Echoe is a simple packaging tool for Ruby gems."
8
+ p.url = "http://blog.evanweaver.com/pages/code#echoe"
9
+ p.docs_host = "blog.evanweaver.com:~/www/snax/public/files/doc/"
10
+ p.extra_deps = ['rake', 'rubyforge >= 0.4.0', 'highline']
14
11
  end
15
12
 
@@ -1,4 +1,3 @@
1
- # -*- ruby -*-
2
1
 
3
2
  require 'rubygems'
4
3
  require 'rake'
@@ -7,88 +6,59 @@ require 'rake/gempackagetask'
7
6
  require 'rake/rdoctask'
8
7
  require 'rake/testtask'
9
8
  require 'rbconfig'
9
+ require 'highline/import'
10
+ gem 'rubyforge', '>= 0.4.0'
11
+ require 'rubyforge'
10
12
 
11
- ##
12
- # echoe - a tool to help rake
13
- #
14
- # echoe is a simple rake/rubygems helper for project Rakefiles. It
15
- # generates all the usual tasks for projects including rdoc generation,
16
- # testing, packaging, and deployment.
17
- #
18
- # == Using echoe
19
- #
20
- # === Basics
21
- #
22
- # Use this as a minimal starting point:
23
- #
24
- # require 'echoe'
25
- #
26
- # Echoe.new("project_name", '1.0.0') do |p|
27
- # p.rubyforge_name = "rf_project"
28
- # # add other details here
29
- # end
30
- #
31
- # # add other tasks here
32
- #
33
- # === Tasks Provided:
34
- #
35
- # * announce - Generate email announcement file and post to rubyforge.
36
- # * audit - Run ZenTest against the package
37
- # * check_manifest - Verify the manifest
38
- # * build_manifest - Build a manifest from your current tree
39
- # * clean - Clean up all the extras
40
- # * debug_gem - Show information about the gem.
41
- # * default - Run the default tasks
42
- # * docs - Build the docs HTML Files
43
- # * email - Generate email announcement file.
44
- # * install - Install the package. Uses PREFIX and RUBYLIB
45
- # * install_gem - Install the package as a gem
46
- # * multi - Run the test suite using multiruby
47
- # * package - Build all the packages
48
- # * post_news - Post announcement to rubyforge.
49
- # * publish_docs - Publish RDoc to RubyForge
50
- # * release - Package and upload the release to rubyforge.
51
- # * ridocs - Generate ri locally for testing
52
- # * test - Run the test suite. Use FILTER to add to the command line.
53
- # * test_deps - Show which test files fail when run alone.
54
- # * uninstall - Uninstall the package.
55
- #
56
- # === Attributes
57
- #
58
- # The attributes that you can provide inside the new block above are:
59
- #
60
- # ==== Mandatory
61
- #
62
- # * name - The name of the release.
63
- # * version - The version. Don't hardcode! use a constant in the project.
64
- #
65
- # ==== Good to Set
66
- #
67
- # * author - The author of the package.
68
- # * changes - A description of the release's latest changes.
69
- # * description - A description of the project.
70
- # * email - The author's email address.
71
- # * summary - A short summary of the project.
72
- # * url - The url of the project.
73
- #
74
- # ==== Optional
75
- #
76
- # * clean_globs - An array of file patterns to delete on clean.
77
- # * extra_deps - An array of rubygem dependencies.
78
- # * need_tar - Should package create a tarball? [default: true]
79
- # * need_zip - Should package create a zipfile? [default: false]
80
- # * rdoc_pattern - A regexp to match documentation files against the manifest.
81
- # * rdoc_template - Path to an external rdoc template file
82
- # * rubyforge_name - The name of the rubyforge project. [default: name.downcase]
83
- # * spec_extras - A hash of extra values to set in the gemspec.
84
- # * test_globs - An array of test file patterns [default: test/**/test_*.rb]
85
- #
86
- # === Environment Variables
87
- #
88
- # * FILTER - Used to add flags to test_unit (e.g., -n test_borked)
89
- # * PREFIX - Used to specify a custom install location (for rake install).
90
- # * RUBY_DEBUG - Used to add extra flags to RUBY_FLAGS.
91
- # * RUBY_FLAGS - Used to specify flags to ruby [has smart default].
13
+ =begin rdoc
14
+
15
+ Echoe includes some optional accessors for more advanced gem configuration.
16
+
17
+ For example, Echoe's own <tt>Rakefile</tt> looks like this:
18
+
19
+ Echoe.new('echoe') do |p|
20
+ p.rubyforge_name = "fauna"
21
+ p.author = "Evan Weaver"
22
+ p.summary = "Echoe is a simple tool for packaging Rubygems."
23
+ p.url = "http://blog.evanweaver.com/pages/code#echoe"
24
+ p.docs_host = "blog.evanweaver.com:~/www/snax/public/files/doc/"
25
+ p.extra_deps = ['rake', 'rubyforge >= 0.4.0', 'highline']
26
+ end
27
+
28
+ == Available options
29
+
30
+ Descriptive options:
31
+
32
+ * <tt>author</tt> - Your name.
33
+ * <tt>email</tt> - Your email address.
34
+ * <tt>description</tt> - A more detailed description of the library.
35
+ * <tt>summary</tt> - A shorter description of the library.
36
+ * <tt>url</tt> - A url for the library.
37
+
38
+ Version options:
39
+
40
+ * <tt>version</tt> - A string for the version number. Parsed from CHANGELOG otherwise.
41
+ * <tt>changes</tt> - A string describing the most recent changes. Parsed from CHANGELOG otherwise.
42
+
43
+ Packaging options:
44
+
45
+ * <tt>extra_deps</tt> - An array of dependencies for this gem, in 'gem_name [= version]' format.
46
+ * <tt>manifest_name</tt> - The name of the manifest file (defaults to <tt>Manifest</tt>).
47
+ * <tt>need_tar</tt> - Whether to generate a <tt>.tgz</tt> package (default <tt>false</tt>).
48
+ * <tt>need_tar_gz</tt> - Whether to generate a <tt>.tar.gz</tt> package (default <tt>true</tt>).
49
+ * <tt>need_zip</tt> - Whether to generate a <tt>.zip</tt> package (default <tt>false</tt>).
50
+
51
+ Publishing options:
52
+
53
+ * <tt>rubyforge_name</tt> - The name of the Rubyforge project to upload to (defaults to the name of the gem).
54
+ * <tt>docs_host</tt> - A host and path to publish the documentation to (defaults to the Rubyforge project).
55
+
56
+ Documentation options:
57
+
58
+ * <tt>rdoc_pattern</tt> - A regex for filenames that should be passed to RDoc.
59
+ * <tt>rdoc_template</tt> - A path to an RDoc template (defaults to the generic template).
60
+
61
+ =end
92
62
 
93
63
  class Echoe
94
64
 
@@ -106,30 +76,47 @@ class Echoe
106
76
  "-w -I#{%w(lib ext bin test).join(File::PATH_SEPARATOR)}" +
107
77
  (RUBY_DEBUG ? " #{RUBY_DEBUG}" : '')
108
78
  FILTER = ENV['FILTER'] # for tests (eg FILTER="-n test_blah")
109
- attr_accessor :author, :bin_files, :changes, :clean_globs, :description, :email, :extra_deps, :lib_files, :name, :need_tar, :need_tar_gz, :need_zip, :rdoc_pattern, :rubyforge_name, :spec, :spec_extras, :summary, :test_files, :test_globs, :url, :version, :tar_extension, :rdoc_template #, :tar_separator, :zip_separator
79
+
80
+ # user-configurable
81
+ attr_accessor :author, :changes, :clean_pattern, :description, :email, :extra_deps, :name, :need_tar, :need_tar_gz, :need_zip, :rdoc_pattern, :rubyforge_name, :summary, :test_patterns, :url, :version, :docs_host, :rdoc_template, :manifest_name
82
+
83
+ # best left alone
84
+ attr_accessor :lib_files, :test_files, :bin_files, :spec
85
+
86
+ def initialize(name, version = nil)
87
+ # Defaults
110
88
 
111
- def initialize(name, version)
112
89
  self.name = name
113
- self.version = version
114
-
115
- # Defaults
116
90
  self.rubyforge_name = name.downcase
117
91
  self.url = ""
118
92
  self.author = ""
119
93
  self.email = ""
120
- self.clean_globs = %w(diff diff.txt email.txt ri *.gem **/*~)
121
- self.test_globs = ['test/**/test_*.rb']
122
- self.changes = ""
94
+ self.clean_pattern = %w(diff diff.txt email.txt ri *.gem **/*~)
95
+ self.test_patterns = ['test/**/test_*.rb']
96
+
97
+ self.version = if version
98
+ version
99
+ elsif File.exist? "CHANGELOG"
100
+ open("CHANGELOG").read[/^\s*v([\d\.]+)\. /, 1]
101
+ else
102
+ raise "No version supplied in Rakefile"
103
+ end
104
+
105
+ self.changes = if File.exist? "CHANGELOG"
106
+ open("CHANGELOG").read[/^\s*v([\d\.]+\. .*)/, 1]
107
+ else
108
+ ""
109
+ end
110
+
123
111
  self.description = ""
124
112
  self.summary = ""
125
- self.rdoc_pattern = /^(\.\/|)(lib|bin|tasks)|README|CHANGELOG|LICENSE|txt$/
113
+ self.rdoc_pattern = /^(lib|bin|tasks)|README|CHANGELOG|LICENSE|txt$/
126
114
  self.extra_deps = []
127
- self.spec_extras = {}
128
- self.need_tar = true
129
- self.need_tar_gz = false
115
+ self.manifest_name = "Manifest"
116
+
117
+ self.need_tar = false
118
+ self.need_tar_gz = true
130
119
  self.need_zip = false
131
- # self.tar_separator = "." # separator choice is buried in rake/packagetask, bah
132
- # self.zip_separator = "."
133
120
 
134
121
  yield self if block_given?
135
122
 
@@ -137,30 +124,13 @@ class Echoe
137
124
  end
138
125
 
139
126
  def define_tasks
140
- desc 'Run the default tasks'
141
127
  task :default => :test
142
128
 
143
- desc 'Run the test suite. Use FILTER to add to the command line.'
129
+ desc 'Run the test suite'
144
130
  task :test do
145
131
  run_tests
146
132
  end
147
133
 
148
- desc 'Show which test files fail when run alone.'
149
- task :test_deps do
150
- tests = Dir["test/**/test_*.rb"] + Dir["test/**/*_test.rb"]
151
-
152
- tests.each do |test|
153
- if not system "ruby -Ibin:lib:test #{test} &> /dev/null" then
154
- puts "Dependency Issues: #{test}"
155
- end
156
- end
157
- end
158
-
159
- desc 'Run the test suite using multiruby'
160
- task :multi do
161
- run_tests :multi
162
- end
163
-
164
134
  ############################################################
165
135
  # Packaging and Installing
166
136
 
@@ -170,20 +140,20 @@ class Echoe
170
140
  s.summary = summary
171
141
  s.author = Array(author).join(", ")
172
142
  s.email = email
173
- s.homepage = Array(url).first
143
+ s.homepage = url
174
144
  s.rubyforge_project = rubyforge_name
175
145
 
176
146
  s.description = description
177
147
 
178
148
  extra_deps.each do |dep|
149
+ dep = dep.split(" ") if dep.is_a? String
179
150
  s.add_dependency(*dep)
180
151
  end
181
152
 
182
- manifest = File.exist?('Manifest.txt') ? 'Manifest.txt' : 'Manifest'
183
153
  begin
184
- s.files = File.read(manifest).split
154
+ s.files = File.read(manifest_name).split
185
155
  rescue Errno::ENOENT
186
- $stderr.puts "Missing Manifest. You can build one with\n$ rake build_manifest"
156
+ $stderr.puts "Missing Manifest. You can build one with\n$ rake build_manifest."
187
157
  end
188
158
  s.executables = s.files.grep(/bin/) { |f| File.basename(f) }
189
159
 
@@ -195,23 +165,9 @@ class Echoe
195
165
  if File.exist? "test/test_all.rb"
196
166
  s.test_file = "test/test_all.rb"
197
167
  else
198
- s.test_files = Dir[*test_globs]
168
+ s.test_files = Dir[*test_patterns]
199
169
  end
200
170
 
201
- # Do any extra stuff the user wants
202
- spec_extras.each do |msg, val|
203
- case val
204
- when Proc
205
- val.call(s.send(msg))
206
- else
207
- s.send "#{msg}=", val
208
- end
209
- end
210
- end
211
-
212
- desc 'Show information about the gem.'
213
- task :debug_gem do
214
- puts spec.to_ruby
215
171
  end
216
172
 
217
173
  self.lib_files = spec.files.grep(/^lib/)
@@ -224,74 +180,58 @@ class Echoe
224
180
  pkg.need_zip = @need_zip
225
181
  end
226
182
 
227
- desc 'Install the package as a gem'
183
+ desc 'Install the gem'
228
184
  task :install => [:clean, :package] do
229
185
  sh "sudo gem install pkg/*.gem"
230
186
  end
231
187
 
232
- desc 'Uninstall the package.'
188
+ desc 'Uninstall the gem'
233
189
  task :uninstall do
234
- Dir.chdir RUBYLIB do
235
- rm_f((lib_files + test_files).map { |f| File.basename f })
236
- end
237
- Dir.chdir File.join(PREFIX, 'bin') do
238
- rm_f bin_files.map { |f| File.basename f }
239
- end
190
+ sh "sudo gem uninstall #{name}"
240
191
  end
241
192
 
242
- desc 'Package and upload the release to rubyforge.'
243
- task :release => [:clean, :package] do |t|
244
- v = ENV["VERSION"] or abort "Must supply VERSION=x"
245
- abort "Versions don't match #{v} vs #{version}" if v != version
246
-
247
- gem 'rubyforge', '>= 0.4.0'
248
- require 'rubyforge'
249
-
250
- pkg = "pkg/#{name}-#{version}"
251
- pkg_gem = pkg + ".gem"
252
- pkg_tar = pkg + ".tgz"
253
- pkg_tar_gz = pkg + ".tar.gz"
254
- pkg_zip = pkg + ".zip"
193
+ desc 'Package and upload the release to Rubyforge'
194
+ task :release => [:clean, :package] do |t|
255
195
 
256
- if $DEBUG then
257
- puts "release_id = rf.add_release #{rubyforge_name.inspect}, #{name.inspect}, #{version.inspect}, \"#{pkg_tar}\""
258
- puts "rf.add_file #{rubyforge_name.inspect}, #{name.inspect}, release_id, \"#{pkg_gem}\""
259
- end
260
-
261
- rf = RubyForge.new
262
- puts "Logging in"
263
- rf.login
264
-
265
- c = rf.userconfig
266
- c["release_notes"] = description if description
267
- c["release_changes"] = changes if changes
268
- c["preformatted"] = false
269
-
270
- files = [(@need_tar ? pkg_tar : nil),
271
- (@need_tar_gz ? pkg_tar_gz : nil),
272
- (@need_zip ? pkg_zip : nil),
273
- pkg_gem].compact
274
-
275
- puts "Releasing #{name} v. #{version}"
276
- self.version = self.version.ljust(3)
277
-
278
- begin
279
- rf.add_release rubyforge_name, name, version, *files
280
- rescue NoMethodError => boom
281
- # be silent
196
+ say "\n"
197
+ if agree "Release #{name}-#{version} to Rubyforge? "
198
+ pkg = "pkg/#{name}-#{version}"
199
+ pkg_gem = pkg + ".gem"
200
+ pkg_tar = pkg + ".tgz"
201
+ pkg_tar_gz = pkg + ".tar.gz"
202
+ pkg_zip = pkg + ".zip"
203
+
204
+ rf = RubyForge.new
205
+ puts "Logging in"
206
+ rf.login
207
+
208
+ c = rf.userconfig
209
+ c["release_notes"] = description if description
210
+ c["release_changes"] = changes if changes
211
+ c["preformatted"] = false
212
+
213
+ files = [(@need_tar ? pkg_tar : nil),
214
+ (@need_tar_gz ? pkg_tar_gz : nil),
215
+ (@need_zip ? pkg_zip : nil),
216
+ pkg_gem].compact
217
+
218
+ puts "Releasing #{name} v. #{version}"
219
+ self.version = self.version.ljust(3)
220
+
221
+ begin
222
+ rf.add_release rubyforge_name, name, version, *files
223
+ rescue NoMethodError
224
+ end
282
225
  end
226
+
283
227
  end
284
228
 
285
- ############################################################
286
- # Doco
287
-
288
229
  Rake::RDocTask.new(:docs) do |rd|
289
230
  rd.main = Dir['*'].detect {|f| f =~ /^readme/i}
290
- rd.options << '-d' if RUBY_PLATFORM !~ /win32/ and `which dot` =~ /\/dot/
291
231
  rd.options << '--line-numbers' << '--inline-source'
292
232
  rd.rdoc_dir = 'doc'
293
- files = spec.files.grep(rdoc_pattern)
294
- files -= ['Manifest.txt', 'Manifest']
233
+
234
+ files = (spec.files.grep(rdoc_pattern) - [manifest_name]).uniq
295
235
  rd.rdoc_files.push *files
296
236
 
297
237
  if rdoc_template
@@ -300,96 +240,75 @@ class Echoe
300
240
  rd.template = ENV['RDOC_TEMPLATE']
301
241
  end
302
242
 
303
- title = name.capitalize if name.downcase == name
243
+ title = name.downcase == name ? name.capitalize : name
304
244
  rd.options << "-t #{title}"
305
245
  end
306
246
 
307
- desc "Generate ri locally for testing"
308
- task :ridocs => :clean do
309
- sh %q{ rdoc --ri -o ri . }
310
- end
311
-
312
- desc 'Publish RDoc to RubyForge'
247
+ desc "Publish documentation to #{docs_host ? "'#{docs_host}'" : "rubyforge"}"
313
248
  task :publish_docs => [:clean, :docs] do
314
- config = YAML.load(File.read(File.expand_path("~/.rubyforge/user-config.yml")))
315
- user = "#{config["username"]}@rubyforge.org"
316
- project = "/var/www/gforge-projects/#{rubyforge_name}"
317
- project += "/#{name}" if rubyforge_name != name
249
+
318
250
  local_dir = 'doc'
319
- pub = Rake::SshDirPublisher.new user, project, local_dir
320
- if rubyforge_name != name then
321
- def pub.upload
322
- begin
323
- super
324
- rescue
325
- # project directory probably doesn't exist, transfer as a whole
326
- sh %{scp -qr #{local_dir} #{host}:#{remote_dir}}
251
+ remote_dir_name = rubyforge_name
252
+ remote_dir_name += "/#{name}" if rubyforge_name != name
253
+
254
+ unless docs_host
255
+ config = YAML.load(File.read(File.expand_path("~/.rubyforge/user-config.yml")))
256
+ pub = Rake::SshDirPublisher.new "#{config["username"]}@rubyforge.org",
257
+ "/var/www/gforge-projects/#{remote_dir_name}",
258
+ local_dir
259
+ if rubyforge_name != name then
260
+ def pub.upload
261
+ begin
262
+ super
263
+ rescue
264
+ # project directory probably doesn't exist, transfer as a whole
265
+ sh("scp -qr #{local_dir} #{host}:#{remote_dir}")
266
+ end
327
267
  end
328
268
  end
329
- end
330
- pub.upload
269
+ pub.upload
270
+ else
271
+ # you may need ssh keys configured for this to work
272
+ host, dir = docs_host.split(":")
273
+ dir.chomp!("/")
274
+ sh("ssh #{host} 'rm -rf #{dir}/#{remote_dir_name}'") # XXX too dangerous?
275
+ sh("scp -qr #{local_dir} #{host}:#{dir}/#{remote_dir_name}")
276
+ end
331
277
  end
332
-
333
- task :doc => [:docs]
278
+
279
+ task :doc => [:redocs]
334
280
 
335
- ############################################################
336
- # Misc/Maintenance:
337
-
338
- desc 'Clean up all the extras'
281
+ desc 'Delete the generated documentation and packages'
339
282
  task :clean => [ :clobber_docs, :clobber_package ] do
340
- clean_globs.each do |pattern|
283
+ clean_pattern.each do |pattern|
341
284
  files = Dir[pattern]
342
285
  rm_rf files unless files.empty?
343
286
  end
344
287
  end
345
288
 
346
- desc "Verify the manifest"
347
- task :check_manifest => :clean do
348
- f = "Manifest.tmp"
349
- require 'find'
350
- files = []
351
- Find.find '.' do |path|
352
- next unless File.file? path
353
- next if path =~ /svn|tmp$/
354
- files << path[2..-1]
355
- end
356
- files = files.sort.join "\n"
357
- File.open f, 'w' do |fp| fp.puts files end
358
-
359
- manifest = "Manifest"
360
- manifest += ".txt" if File.exist? "Manifest.txt"
361
-
362
- system "diff -du #{manifest}.txt #{f}"
363
- rm f
364
- end
365
-
366
- desc "Build a Manifest from your current tree"
289
+ desc "Build a Manifest list"
367
290
  task :build_manifest do
368
291
  files = []
369
- find_files = proc { |dir|
370
- Dir["#{dir}/**"].each do |file|
371
- File.directory?(file) ? find_files[file] : files << file
292
+ Find.find '.' do |file|
293
+ file = file[2..-1]
294
+ unless !file or file =~ /^(pkg|doc)|\.svn|CVS|\.bzr/ or File.directory? file
295
+ files << file
372
296
  end
373
- }
374
- manifest = File.exist?("./Manifest.txt") ? "./Manifest.txt" : "./Manifest"
375
- find_files['.']
376
- files = (files << manifest).uniq
377
- File.open(manifest, 'w').puts files
297
+ end
298
+ files = (files << manifest_name).uniq
299
+ File.open(manifest_name, 'w').puts files
378
300
  puts files
379
301
  end
380
- end # end define
381
-
382
- def run_tests(multi=false) # :nodoc:
383
- msg = multi ? :sh : :ruby
384
- cmd = if test ?f, 'test/test_all.rb' then
385
- "#{RUBY_FLAGS} test/test_all.rb #{FILTER}"
386
- else
387
- tests = test_globs.map { |g| Dir.glob(g) }.flatten << 'test/unit'
388
- tests.map! {|f| %Q(require "#{f}")}
389
- "#{RUBY_FLAGS} -e '#{tests.join("; ")}' #{FILTER}"
390
- end
391
- cmd = "multiruby #{cmd}" if multi
392
- send msg, cmd
302
+ end
303
+
304
+ def run_tests # :nodoc:
305
+ ruby(if File.exist? 'test/test_all.rb'
306
+ "#{RUBY_FLAGS} test/test_all.rb #{FILTER}"
307
+ else
308
+ tests = test_patterns.map { |g| Dir.glob(g) }.flatten << 'test/unit'
309
+ tests.map! {|f| %Q(require "#{f}")}
310
+ "#{RUBY_FLAGS} -e '#{tests.join("; ")}' #{FILTER}"
311
+ end)
393
312
  end
394
313
 
395
314
  end
@@ -397,8 +316,3 @@ end
397
316
  class ::Rake::SshDirPublisher # :nodoc:
398
317
  attr_reader :host, :remote_dir, :local_dir
399
318
  end
400
-
401
- if $0 == __FILE__ then
402
- out = `rake -T | egrep -v "redocs|repackage|clobber|trunk"`
403
- puts out.gsub(/\#/, '-').gsub(/^rake /, '# * ')
404
- end
metadata CHANGED
@@ -3,15 +3,15 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: echoe
5
5
  version: !ruby/object:Gem::Version
6
- version: "1.4"
7
- date: 2007-08-02 00:00:00 -04:00
8
- summary: Echoe is a simple packaging tool for working with rubygems.
6
+ version: "2"
7
+ date: 2007-08-03 00:00:00 -04:00
8
+ summary: Echoe is a simple packaging tool for Ruby gems.
9
9
  require_paths:
10
10
  - lib
11
11
  email: ""
12
- homepage: http://blog.evanweaver.com/articles/2007/01/10/if-you-dont-want-to-hoe-echoe
12
+ homepage: http://blog.evanweaver.com/pages/code#echoe
13
13
  rubyforge_project: fauna
14
- description: Echoe is a simple packaging tool for working with rubygems. It generates all the usual tasks for projects including rdoc generation, testing, packaging, and deployment.
14
+ description: ""
15
15
  autorequire:
16
16
  default_executable:
17
17
  bindir: bin
@@ -27,24 +27,24 @@ signing_key:
27
27
  cert_chain:
28
28
  post_install_message:
29
29
  authors:
30
- - ""
30
+ - Evan Weaver
31
31
  files:
32
- - ./CHANGELOG
33
- - ./LICENSE
34
- - ./README
35
- - ./Rakefile
36
- - ./bin/echoe
37
- - ./lib/echoe.rb
38
- - ./test/test_echoe.rb
39
- - ./Manifest
32
+ - test/test_echoe.rb
33
+ - lib/echoe.rb
34
+ - Rakefile
35
+ - README
36
+ - Manifest
37
+ - MIT-LICENSE
38
+ - LICENSE
39
+ - CHANGELOG
40
40
  test_files:
41
41
  - test/test_echoe.rb
42
42
  rdoc_options: []
43
43
 
44
44
  extra_rdoc_files: []
45
45
 
46
- executables:
47
- - echoe
46
+ executables: []
47
+
48
48
  extensions: []
49
49
 
50
50
  requirements: []
@@ -65,6 +65,18 @@ dependencies:
65
65
  version_requirements: !ruby/object:Gem::Version::Requirement
66
66
  requirements:
67
67
  - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: "0"
70
+ - - "="
68
71
  - !ruby/object:Gem::Version
69
72
  version: 0.4.0
70
73
  version:
74
+ - !ruby/object:Gem::Dependency
75
+ name: highline
76
+ version_requirement:
77
+ version_requirements: !ruby/object:Gem::Version::Requirement
78
+ requirements:
79
+ - - ">"
80
+ - !ruby/object:Gem::Version
81
+ version: 0.0.0
82
+ version:
data/bin/echoe DELETED
@@ -1,71 +0,0 @@
1
- #!/usr/bin/env ruby -ws
2
-
3
- $t ||= false
4
- $d ||= false
5
-
6
- if defined? $h then
7
- puts "usage: #{File.dirname($0)} [-d|-t] [group] project"
8
- puts " -t = add project to subdir under 'trunk'"
9
- puts " -d = add project to subdir under 'dev'"
10
- end
11
-
12
- abort "You must specify only one of -t or -d" if $t and $d
13
-
14
- group = ARGV.shift
15
- project = ARGV.shift
16
-
17
- project ||= group
18
-
19
- # prevents false positives on my tag reporter
20
- X = 'FI' + 'X'
21
-
22
- abort "You must supply a project name on the commandline" unless project
23
- abort "Project #{project} seems to exist" if test ?d, project
24
- puts "creating project #{project}"
25
-
26
- case project
27
- when /_/ then
28
- file_name = project
29
- project = project.capitalize.gsub(/_([a-z])/) {$1.upcase}
30
- klass = project
31
- else
32
- file_name = project.gsub(/([A-Z])/, '_\1').downcase.sub(/^_/, '')
33
- klass = project.capitalize.gsub(/_([a-z])/) {$1.upcase}
34
- end
35
-
36
- Dir.mkdir project
37
- Dir.chdir project do
38
-
39
- if $d then
40
- Dir.mkdir "dev"
41
- Dir.chdir "dev"
42
- elsif $t then
43
- Dir.mkdir "trunk"
44
- Dir.chdir "trunk"
45
- end
46
-
47
- %w(bin lib test).each do |path|
48
- Dir.mkdir path
49
- end
50
-
51
- files = {
52
- "History.txt" => "== 1.0.0 / #{Time.new.strftime("%Y-%m-%d")}\n\n* 1 major enhancement\n * Birthday!\n\n",
53
- "README.txt" => "#{project}\n by #{X} (your name)\n #{X} (url)\n\n== DESCRIPTION:\n \n#{X} (describe your package)\n\n== FEATURES/PROBLEMS:\n \n* #{X} (list of features or problems)\n\n== SYNOPSYS:\n\n #{X} (code sample of usage)\n\n== REQUIREMENTS:\n\n* #{X} (list of requirements)\n\n== INSTALL:\n\n* #{X} (sudo gem install, anything else)\n\n== LICENSE:\n\n(The MIT License)\n\nCopyright (c) #{Time.new.strftime("%Y")} #{X}\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n",
54
- "Manifest.txt" => "",
55
- "bin/#{file_name}" => "",
56
- "lib/#{file_name}.rb" => "class #{klass}\n VERSION = '1.0.0'\nend",
57
- "test/test_#{file_name}.rb" => "",
58
- "Rakefile" => "# -*- ruby -*-\n\nrequire 'rubygems'\nrequire 'echoe'\nrequire './lib/#{file_name}.rb'\n\nechoe.new('#{project}', #{klass}::VERSION) do |p|\n p.rubyforge_name = \'#{group}\'\n # p.summary = '#{X}'\n # p.description = p.paragraphs_of('README.txt', 2..5).join(\"\\n\\n\")\n # p.url = p.paragraphs_of('README.txt', 0).first.split(/\\n/)[1..-1]\n p.changes = p.paragraphs_of('History.txt', 0..1).join(\"\\n\\n\")\nend\n\n# vim: syntax=Ruby\n"
59
- }
60
-
61
- files["Manifest.txt"] = files.keys.sort.join("\n")
62
-
63
- files.each do |file, content|
64
- File.open(file, "w") do |f|
65
- f.write content
66
- end
67
- end
68
- end
69
-
70
- puts "... done, now go fix all occurances of '#{X}'"
71
- puts `find #{project} -type f | xargs grep -n #{X}`.gsub(/\A|\n/, "\n ")