echoe 2.3 → 2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (7) hide show
  1. data.tar.gz.sig +2 -0
  2. data/CHANGELOG +2 -0
  3. data/README +11 -2
  4. data/Rakefile +3 -2
  5. data/lib/echoe.rb +71 -12
  6. metadata +24 -2
  7. metadata.gz.sig +0 -0
@@ -0,0 +1,2 @@
1
+ �.k4+�5�|^4V�z�tnG͗�!��X젲�
2
+ ��-�:�,8ZzP���@2��n`җ}X>l��R�Y�kcæL0�ǰ��҄ ��m.U߾���-�p�M
data/CHANGELOG CHANGED
@@ -1,4 +1,6 @@
1
1
 
2
+ v2.4. Sign gems automatically if ENV['GEM_PRIVATE_KEY'] is present; add certificate_chain and private_key accessors.
3
+
2
4
  v2.3. Work around metadependencies issue by including gemspecs instead of Rakefiles by default; include_gemspec and include_rakefile accessors.
3
5
 
4
6
  v2.2. Need_gem option; announce task.
data/README CHANGED
@@ -7,10 +7,13 @@ Echoe is a simple tool for working with Rubygems. It generates Rake tasks for do
7
7
 
8
8
  Copyright 2007 Cloudburst, LLC. See the included LICENSE file. Portions copyright 2006 Ryan Davis/Zen Spider Software and used with permission. See the included MIT-LICENSE file.
9
9
 
10
+ The public certificate for this gem is at http://rubyforge.org/frs/download.php/25331/evan_weaver-original-public_cert.pem.
11
+
10
12
  == Features
11
13
 
12
14
  * simple configuration
13
15
  * comprehensive gem deployment
16
+ * signed gem support
14
17
  * automatic changeset parsing
15
18
  * documentation upload to any host
16
19
 
@@ -84,6 +87,7 @@ Upload:
84
87
 
85
88
  * <tt>publish_docs</tt> - Publish documentation to the web.
86
89
  * <tt>release</tt> - Package and upload the latest release to Rubyforge.
90
+ * <tt>announce</tt> - Generate a release announcement, edit it, and post it to Rubyforge.
87
91
 
88
92
  Cleaning:
89
93
 
@@ -91,7 +95,12 @@ Cleaning:
91
95
  * <tt>redocs</tt> - Force a rebuild of the Rdoc files.
92
96
  * <tt>repackage</tt> - Force a rebuild of the package files.
93
97
 
94
- == Further resources
98
+ == Reporting problems
95
99
 
96
- * http://blog.evanweaver.com/pages/code#echoe
97
100
  * http://rubyforge.org/forum/forum.php?forum_id=13986
101
+
102
+ Patches and contributions are very welcome. Please note that contributors are required to assign copyright for their additions to Cloudburst, LLC.
103
+
104
+ == Further resources
105
+
106
+ * http://blog.evanweaver.com/articles/2007/01/10/if-you-dont-want-to-hoe-echoe
data/Rakefile CHANGED
@@ -6,11 +6,12 @@ Echoe.new('echoe') do |p|
6
6
  p.author = 'Evan Weaver'
7
7
  p.summary = 'A tool for packaging Ruby gems.'
8
8
  p.url = 'http://blog.evanweaver.com/pages/code#echoe'
9
- p.docs_host = 'blog.evanweaver.com:~/www/snax/public/files/doc/'
9
+ p.docs_host = 'blog.evanweaver.com:~/www/bax/public/files/doc/'
10
10
  p.dependencies = ['rake', 'rubyforge >=0.4.3', 'highline']
11
+ p.require_signed = true
11
12
 
12
13
  # Echoe is self-dependent
13
14
  p.include_gemspec = false
14
- p.include_rakefile = true
15
+ p.include_rakefile = true
15
16
  end
16
17
 
@@ -25,6 +25,26 @@ For example, a simple <tt>Rakefile</tt> might look like this:
25
25
  p.docs_host = "uncapitalizer.com:~/www/files/doc/"
26
26
  p.dependencies = ["string_tools >=1.4.0"]
27
27
  end
28
+
29
+ == Signing gems
30
+
31
+ Echoe supports signing gems. First, create yourself a public and private key:
32
+ gem cert --build you@yourmail.com
33
+
34
+ Move them somewhere secret, and add the following environment variables in your <tt>.bash_profile</tt> or similar:
35
+ export GEM_PRIVATE_KEY='/secret/path/to/gem-private_key.pem'
36
+ export GEM_CERTIFICATE_CHAIN='/secret/path/to/gem-public_cert.pem'
37
+
38
+ Make sure your environment is up-to-date:
39
+ source ~/.bash_profile
40
+
41
+ Upload your <tt>public_cert.pem</tt> file to your website or Rubyforge project, and tell your users to add that certificate to their system via:
42
+ gem cert --add /path/to/public_cert.pem
43
+
44
+ Finally, package and release your project as normal. Now users can install your gem via:
45
+ sudo gem install gemname -P HighSecurity
46
+
47
+ Note that you can also set the key and certificate locations in the Rakefile itself. Finally, you can add <tt>p.require_signed = true</tt> to your <tt>Rakefile</tt> so that you don't accidentally release an unsigned gem if your key is missing.
28
48
 
29
49
  == Metadependencies
30
50
 
@@ -60,15 +80,20 @@ Packaging options:
60
80
  * <tt>include_gemspec</tt> - Include the generated gemspec file within the package. Default <tt>true</tt>.
61
81
  * <tt>include_rakefile</tt> - Include the Rakefile within the package. Default <tt>false</tt>.
62
82
 
83
+ Security options:
84
+
85
+ * <tt>private_key</tt> - The path to your gem private key. Defaults to ENV['GEM_PRIVATE_KEY'], if available. This accessor is not published in the resulting gemspec.
86
+ * <tt>certificate_chain</tt> - An array representing your certificate authorization chain. If no one else has signed your certificate, just set it to your own cert. Defaults to ENV['GEM_CERTIFICATE_CHAIN'], if available. This accessor is not published in the resulting gemspec.
87
+ * <tt>require_signed</tt> - Force Echoe to refuse to package your gem if it's not properly signed. Default false.
88
+
63
89
  Publishing options:
64
90
 
65
91
  * <tt>project</tt> - The name of the Rubyforge project to upload to (defaults to the name of the gem).
66
92
  * <tt>docs_host</tt> - A host and filesystem path to publish the documentation to (defaults to the Rubyforge project).
67
- * <tt>announce</tt> - Generate a release announcement, edit it, and post it to Rubyforge.
68
93
 
69
94
  Documentation options:
70
95
 
71
- * <tt>rdoc_pattern</tt> - A regex for filenames that should be passed to RDoc.
96
+ * <tt>rdoc_files</tt> - An array or regex for filenames that should be passed to RDoc.
72
97
  * <tt>rdoc_template</tt> - A path to an RDoc template (defaults to the generic template).
73
98
 
74
99
  =end
@@ -91,13 +116,13 @@ class Echoe
91
116
  FILTER = ENV['FILTER'] # for tests (eg FILTER="-n test_blah")
92
117
 
93
118
  # user-configurable
94
- attr_accessor :author, :changes, :clean_pattern, :description, :email, :dependencies, :need_tgz, :need_tar_gz, :need_gem, :need_zip, :rdoc_pattern, :project, :summary, :test_pattern, :url, :version, :docs_host, :rdoc_template, :manifest_name, :install_message, :extensions
119
+ attr_accessor :author, :changes, :clean_pattern, :description, :email, :dependencies, :need_tgz, :need_tar_gz, :need_gem, :need_zip, :rdoc_files, :project, :summary, :test_pattern, :url, :version, :docs_host, :rdoc_template, :manifest_name, :install_message, :extensions, :private_key, :certificate_chain, :require_signed
95
120
 
96
121
  # best left alone
97
- attr_accessor :name, :lib_files, :test_files, :bin_files, :spec, :rdoc_options, :rubyforge_name, :has_rdoc, :include_gemspec, :include_rakefile, :gemspec_name
122
+ attr_accessor :name, :lib_files, :test_files, :bin_files, :spec, :rdoc_options, :rubyforge_name, :has_rdoc, :include_gemspec, :include_rakefile, :gemspec_name, :eval
98
123
 
99
124
  # legacy
100
- attr_accessor :extra_deps
125
+ attr_accessor :extra_deps, :rdoc_pattern
101
126
 
102
127
  def initialize(name, version = nil)
103
128
  # Defaults
@@ -128,11 +153,14 @@ class Echoe
128
153
  self.summary = ""
129
154
  self.install_message = nil
130
155
  self.has_rdoc = true
131
- self.rdoc_pattern = /^(lib|bin|tasks)|^README|^CHANGELOG|^TODO|^LICENSE$/
156
+ self.rdoc_files = /^(lib|bin|tasks)|^README|^CHANGELOG|^TODO|^LICENSE$/
132
157
  self.rdoc_options = ['--line-numbers', '--inline-source']
133
158
  self.dependencies = []
134
159
  self.manifest_name = "Manifest"
135
160
  self.extensions = ["ext/extconf.rb"] if File.exist?("ext/extconf.rb")
161
+ self.private_key = ENV['GEM_PRIVATE_KEY']
162
+ self.require_signed = false
163
+ self.certificate_chain = ENV['GEM_CERTIFICATE_CHAIN'].to_s.split(/\,\s*/).compact
136
164
 
137
165
  self.need_gem = true
138
166
  self.need_tar_gz = true
@@ -146,12 +174,14 @@ class Echoe
146
174
  yield self if block_given?
147
175
 
148
176
  # set some post-defaults
177
+ self.certificate_chain = Array(certificate_chain)
149
178
  self.description = summary if description.empty?
150
179
  self.summary = description if summary.empty?
151
180
 
152
181
  # legacy compatibility
153
182
  self.dependencies = extra_deps if extra_deps and dependencies.empty?
154
183
  self.project = rubyforge_name if rubyforge_name
184
+ self.rdoc_files = rdoc_pattern if rdoc_pattern
155
185
 
156
186
  define_tasks
157
187
  end
@@ -169,6 +199,19 @@ class Echoe
169
199
  s.homepage = url
170
200
  s.rubyforge_project = project
171
201
  s.post_install_message = install_message if install_message
202
+
203
+ if private_key and File.exist? private_key
204
+ s.signing_key = private_key
205
+ s.cert_chain = certificate_chain
206
+ puts "Signing gem."
207
+ puts "Certificate chain is:"
208
+ certificate_chain.each do |cert|
209
+ puts " #{cert}"
210
+ end
211
+ else
212
+ puts "Missing private key; gem will not be signed."
213
+ raise "Signed gem required. Maybe you forget to set ENV['GEM_PRIVATE_KEY']." if require_signed
214
+ end
172
215
 
173
216
  s.description = description
174
217
 
@@ -199,6 +242,11 @@ class Echoe
199
242
  else
200
243
  s.test_files = Dir[*test_pattern]
201
244
  end
245
+
246
+ if eval
247
+ self.instance_eval &eval
248
+ end
249
+
202
250
  end
203
251
 
204
252
  self.lib_files = spec.files.grep(/^lib/)
@@ -216,11 +264,15 @@ class Echoe
216
264
  if include_gemspec
217
265
  File.open(gemspec_name, 'w') do |f|
218
266
  f.puts "\n# Gem::Specification for #{name.capitalize}-#{version}\n# Originally generated by Echoe\n\n"
219
- f.puts spec.to_ruby
267
+ spec.to_ruby.split("\n").each do |line|
268
+ # Don't publish any information about the private key or certificate chain
269
+ f.puts line unless line =~ /signing_key|cert_chain|\.pem/
270
+ end
220
271
 
221
272
  f.puts "\n\n# # Original Rakefile source (requires the Echoe gem):\n# \n"
222
273
  File.open("Rakefile").readlines.each do |line|
223
- f.write "# #{line}"
274
+ # Ditto
275
+ f.write "# #{line}" unless line =~ /private_key|certificate_chain|\.pem/
224
276
  end
225
277
  end
226
278
  end
@@ -244,12 +296,12 @@ class Echoe
244
296
 
245
297
  desc 'Install the gem'
246
298
  task :install => [:clean, :package] do
247
- sh "sudo gem install pkg/*.gem"
299
+ sh "sudo gem install pkg/*.gem -P MediumSecurity"
248
300
  end
249
301
 
250
302
  desc 'Uninstall the gem'
251
303
  task :uninstall do
252
- sh "sudo gem uninstall #{name}"
304
+ sh "sudo gem uninstall #{name} -a -i -x"
253
305
  end
254
306
 
255
307
  desc 'Package and upload the release to Rubyforge'
@@ -292,8 +344,15 @@ class Echoe
292
344
  rd.options += Array(rdoc_options)
293
345
 
294
346
  rd.rdoc_dir = 'doc'
295
-
296
- files = (spec.files.grep(rdoc_pattern) - [manifest_name]).uniq
347
+
348
+ files = (if rdoc_files.is_a? Array
349
+ rdoc_files
350
+ elsif rdoc_pattern.is_a? Regexp
351
+ spec.files.grep(rdoc_pattern).uniq
352
+ else
353
+ []
354
+ end) - [manifest_name]
355
+
297
356
  rd.rdoc_files.push(*files)
298
357
 
299
358
  if rdoc_template
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: echoe
5
5
  version: !ruby/object:Gem::Version
6
- version: "2.3"
7
- date: 2007-08-13 00:00:00 -04:00
6
+ version: "2.4"
7
+ date: 2007-09-16 00:00:00 -04:00
8
8
  summary: A tool for packaging Ruby gems.
9
9
  require_paths:
10
10
  - lib
@@ -25,6 +25,28 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
25
25
  platform: ruby
26
26
  signing_key:
27
27
  cert_chain:
28
+ - |
29
+ -----BEGIN CERTIFICATE-----
30
+ MIIDLjCCAhagAwIBAgIBADANBgkqhkiG9w0BAQUFADA9MQ0wCwYDVQQDDARldmFu
31
+ MRgwFgYKCZImiZPyLGQBGRYIY2xvdWRidXIxEjAQBgoJkiaJk/IsZAEZFgJzdDAe
32
+ Fw0wNzA5MTYxMDMzMDBaFw0wODA5MTUxMDMzMDBaMD0xDTALBgNVBAMMBGV2YW4x
33
+ GDAWBgoJkiaJk/IsZAEZFghjbG91ZGJ1cjESMBAGCgmSJomT8ixkARkWAnN0MIIB
34
+ IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5C0Io89nyApnr+PvbNFge9Vs
35
+ yRWAlGBUEMahpXp28VrrfXZT0rAW7JBo4PlCE3jl4nE4dzE6gAdItSycjTosrw7A
36
+ Ir5+xoyl4Vb35adv56TIQQXvNz+BzlqnkAY5JN0CSBRTQb6mxS3hFyD/h4qgDosj
37
+ R2RFVzHqSxCS8xq4Ny8uzOwOi+Xyu4w67fI5JvnPvMxqrlR1eaIQHmxnf76RzC46
38
+ QO5QhufjAYGGXd960XzbQsQyTDUYJzrvT7AdOfiyZzKQykKt8dEpDn+QPjFTnGnT
39
+ QmgJBX5WJN0lHF2l1sbv3gh4Kn1tZu+kTUqeXY6ShAoDTyvZRiFqQdwh8w2lTQID
40
+ AQABozkwNzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQU+WqJz3xQ
41
+ XSea1hRvvHWcIMgeeC4wDQYJKoZIhvcNAQEFBQADggEBAGLZ75jfOEW8Nsl26CTt
42
+ JFrWxQTcQT/UljeefVE3xYr7lc9oQjbqO3FOyued3qW7TaNEtZfSHoYeUSMYbpw1
43
+ XAwocIPuSRFDGM4B+hgQGVDx8PMGiJKom4qLXjO40UZsR7QyN/u869Vj45LURm6h
44
+ MBcPeqCASI+WNprj9+uZa2kmHiitrFqqfMBNlm5IFbn9XeYSta9AHVvs5QQqV2m5
45
+ hIPfLqCyxsn/YgOGvo6iwyQTWyTswamaAC3HRWZxIS1sfn/Ssqa7E7oQMkv5FAXr
46
+ x5rKePfXINf8XTJczkl9OBEYdE9aNdJsJpXD0asLgGVwBICS5Bjohp6mizJcDC1+
47
+ yZ0=
48
+ -----END CERTIFICATE-----
49
+
28
50
  post_install_message:
29
51
  authors:
30
52
  - Evan Weaver
Binary file