Skip to content
This repository
Browse code

Build system and versioning tweaks.

- Vendored Hoe (in lib/hoe.rb) and changed a few file names around.
- Removed a useless gem-build dependency.
- Made Johnson::VERSION contain a datestamp, at least for the moment.
- Generated an initial gemspec for Github.
- Added a gem:spec:generate task.
  • Loading branch information...
commit d881eb3eb5c534396ae5a2d272d71ef627b53336 1 parent 26d4d61
John Barnette authored June 23, 2008
0  History.txt → CHANGELOG
File renamed without changes
9  Manifest.txt → MANIFEST
... ...
@@ -1,7 +1,7 @@
1  
-History.txt
  1
+CHANGELOG
  2
+MANIFEST
2 3
 MINGW32.mk
3  
-Manifest.txt
4  
-README.txt
  4
+README.rdoc
5 5
 Rakefile
6 6
 bin/johnson
7 7
 cross-compile.txt
@@ -35,9 +35,12 @@ js/johnson/browser/env.js
35 35
 js/johnson/browser/jquery.js
36 36
 js/johnson/browser/xmlsax.js
37 37
 js/johnson/browser/xmlw3cdom.js
  38
+js/johnson/cli.js
38 39
 js/johnson/prelude.js
39 40
 js/johnson/template.js
  41
+lib/hoe.rb
40 42
 lib/johnson.rb
  43
+lib/johnson/cli.rb
41 44
 lib/johnson/cli/options.rb
42 45
 lib/johnson/error.rb
43 46
 lib/johnson/nodes.rb
0  README.txt → README.rdoc
Source Rendered
File renamed without changes
49  Rakefile
... ...
@@ -1,24 +1,24 @@
1  
-require "rubygems"
2  
-require "hoe"
3  
-require 'erb'
  1
+require "erb"
  2
+
  3
+require "./lib/hoe.rb"
4 4
 require "./lib/johnson/version.rb"
5 5
 
6 6
 # what sort of extension are we building?
7 7
 kind = Config::CONFIG["DLEXT"]
8 8
 
9  
-CROSS = ENV['CROSS']
  9
+CROSS = ENV["CROSS"]
10 10
 LIBJS = FileList["vendor/spidermonkey/#{CROSS || ''}*.OBJ/libjs.{#{kind},so}"].first || :libjs
11 11
 
12 12
 GENERATED_NODE = "ext/spidermonkey/immutable_node.c"
13 13
 
14  
-Hoe.new("johnson", Johnson::VERSION) do |p|
  14
+HOE = Hoe.new("johnson", Johnson::VERSION) do |p|
  15
+  p.author         = ["John Barnette", "Aaron Patterson", "Yehuda Katz", "Matthew Draper"]
  16
+  p.changes        = p.paragraphs_of("CHANGELOG", 0..1).join("\n\n")
  17
+  p.description    = p.paragraphs_of("README.rdoc", 2..5).join("\n\n")
  18
+  p.email          = "johnson-talk@googlegroups.com"
15 19
   p.rubyforge_name = "johnson"
16  
-  p.author = ["John Barnette" "Aaron Patterson", "Yehuda Katz", "Matthew Draper"]
17  
-  p.email = ["johnson-talk@googlegroups.com", "jbarnette@rubyforge.org"]
18  
-  p.summary = "Johnson wraps JavaScript in a loving Ruby embrace."
19  
-  p.description = p.paragraphs_of("README.txt", 2..5).join("\n\n")
20  
-  p.url = p.paragraphs_of("README.txt", 0).first.split(/\n/)[1..-1]
21  
-  p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
  20
+  p.description    = "Johnson wraps JavaScript in a loving Ruby embrace."
  21
+  p.url            = "http://github.com/jbarnette/johnson/wikis"
22 22
 
23 23
   p.clean_globs = [
24 24
     "lib/johnson/spidermonkey.#{kind}",
@@ -28,15 +28,23 @@ Hoe.new("johnson", Johnson::VERSION) do |p|
28 28
     "vendor/spidermonkey/**/*.OBJ"]
29 29
 
30 30
   p.test_globs = ["test/**/*_test.rb"]
31  
-
32 31
   p.spec_extras = { :extensions => ["Rakefile"] }
  32
+  p.extra_deps = ["rake"]
  33
+end
33 34
 
34  
-  p.extra_deps = ['rake']
  35
+namespace :gem do
  36
+  namespace :spec do
  37
+    task :generate do
  38
+      File.open("johnson.gemspec", "w") do |f|
  39
+        f.puts(HOE.spec.to_ruby)
  40
+      end
  41
+    end
  42
+  end
35 43
 end
36 44
 
37 45
 namespace :test do
38 46
   Rake::TestTask.new("todo") do |t|
39  
-    t.test_files = FileList['todo/**/*_test.rb']
  47
+    t.test_files = FileList["todo/**/*_test.rb"]
40 48
     t.verbose = true
41 49
   end
42 50
   
@@ -60,9 +68,6 @@ Rake::Task[:check_manifest].prerequisites << GENERATED_NODE
60 68
 task :build => :extensions
61 69
 task :extension => :build
62 70
 
63  
-# gem depends on the native extension actually building
64  
-Rake::Task[:gem].prerequisites << :extensions
65  
-
66 71
 task :extensions => ["lib/johnson/spidermonkey.#{kind}"]
67 72
 
68 73
 namespace :extensions do
@@ -130,7 +135,7 @@ end
130 135
 
131 136
 def jsops
132 137
   ops = []
133  
-  File.open('vendor/spidermonkey/jsopcode.tbl', 'rb') { |f|
  138
+  File.open("vendor/spidermonkey/jsopcode.tbl", "rb") { |f|
134 139
     f.each_line do |line|
135 140
       if line =~ /^OPDEF\((\w+),/
136 141
         ops << $1
@@ -142,10 +147,10 @@ end
142 147
 
143 148
 def tokens
144 149
   toks = []
145  
-  File.open('vendor/spidermonkey/jsscan.h', 'rb') { |f|
  150
+  File.open("vendor/spidermonkey/jsscan.h", "rb") { |f|
146 151
     f.each_line do |line|
147 152
       line.scan(/TOK_\w+/).each do |token|
148  
-        next if token == 'TOK_ERROR'
  153
+        next if token == "TOK_ERROR"
149 154
         toks << token
150 155
       end
151 156
     end
@@ -154,8 +159,8 @@ def tokens
154 159
 end
155 160
 
156 161
 file GENERATED_NODE => ["ext/spidermonkey/immutable_node.c.erb", "vendor/spidermonkey/jsopcode.tbl", "vendor/spidermonkey/jsscan.h"] do |t|
157  
-  template = ERB.new(File.open(t.prerequisites.first, 'rb') { |x| x.read })
158  
-  File.open(GENERATED_NODE, 'wb') { |f|
  162
+  template = ERB.new(File.open(t.prerequisites.first, "rb") { |x| x.read })
  163
+  File.open(GENERATED_NODE, "wb") { |f|
159 164
     f.write template.result(binding)
160 165
   }
161 166
 end
36  johnson.gemspec
... ...
@@ -0,0 +1,36 @@
  1
+Gem::Specification.new do |s|
  2
+  s.name = %q{johnson}
  3
+  s.version = "1.0.0.200806232237"
  4
+
  5
+  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
  6
+  s.authors = ["John Barnette", "Aaron Patterson", "Yehuda Katz", "Matthew Draper"]
  7
+  s.date = %q{2008-06-23}
  8
+  s.default_executable = %q{johnson}
  9
+  s.description = %q{Johnson wraps JavaScript in a loving Ruby embrace.}
  10
+  s.email = %q{johnson-talk@googlegroups.com}
  11
+  s.executables = ["johnson"]
  12
+  s.extensions = ["Rakefile"]
  13
+  s.extra_rdoc_files = ["README.rdoc", "cross-compile.txt"]
  14
+  s.files = ["CHANGELOG", "MANIFEST", "MINGW32.mk", "README.rdoc", "Rakefile", "bin/johnson", "cross-compile.txt", "ext/spidermonkey/context.c", "ext/spidermonkey/context.h", "ext/spidermonkey/conversions.c", "ext/spidermonkey/conversions.h", "ext/spidermonkey/debugger.c", "ext/spidermonkey/debugger.h", "ext/spidermonkey/extconf.rb", "ext/spidermonkey/extensions.c", "ext/spidermonkey/extensions.h", "ext/spidermonkey/global.c", "ext/spidermonkey/global.h", "ext/spidermonkey/idhash.c", "ext/spidermonkey/idhash.h", "ext/spidermonkey/immutable_node.c", "ext/spidermonkey/immutable_node.c.erb", "ext/spidermonkey/immutable_node.h", "ext/spidermonkey/jroot.h", "ext/spidermonkey/js_land_proxy.c", "ext/spidermonkey/js_land_proxy.h", "ext/spidermonkey/ruby_land_proxy.c", "ext/spidermonkey/ruby_land_proxy.h", "ext/spidermonkey/runtime.c", "ext/spidermonkey/runtime.h", "ext/spidermonkey/spidermonkey.c", "ext/spidermonkey/spidermonkey.h", "js/johnson/browser.js", "js/johnson/browser/env.js", "js/johnson/browser/jquery.js", "js/johnson/browser/xmlsax.js", "js/johnson/browser/xmlw3cdom.js", "js/johnson/cli.js", "js/johnson/prelude.js", "js/johnson/template.js", "lib/hoe.rb", "lib/johnson.rb", "lib/johnson/cli.rb", "lib/johnson/cli/options.rb", "lib/johnson/error.rb", "lib/johnson/nodes.rb", "lib/johnson/nodes/binary_node.rb", "lib/johnson/nodes/for.rb", "lib/johnson/nodes/for_in.rb", "lib/johnson/nodes/function.rb", "lib/johnson/nodes/list.rb", "lib/johnson/nodes/node.rb", "lib/johnson/nodes/ternary_node.rb", "lib/johnson/parser.rb", "lib/johnson/parser/syntax_error.rb", "lib/johnson/runtime.rb", "lib/johnson/spidermonkey/context.rb", "lib/johnson/spidermonkey/debugger.rb", "lib/johnson/spidermonkey/immutable_node.rb", "lib/johnson/spidermonkey/js_land_proxy.rb", "lib/johnson/spidermonkey/mutable_tree_visitor.rb", "lib/johnson/spidermonkey/ruby_land_proxy.rb", "lib/johnson/spidermonkey/runtime.rb", "lib/johnson/version.rb", "lib/johnson/visitable.rb", "lib/johnson/visitors.rb", "lib/johnson/visitors/dot_visitor.rb", "lib/johnson/visitors/ecma_visitor.rb", "lib/johnson/visitors/enumerating_visitor.rb", "lib/johnson/visitors/sexp_visitor.rb", "lib/rails/init.rb", "test/assets/index.html", "test/assets/jquery_test.html", "test/helper.rb", "test/johnson/browser_test.rb", "test/johnson/conversions/array_test.rb", "test/johnson/conversions/boolean_test.rb", "test/johnson/conversions/callable_test.rb", "test/johnson/conversions/file_test.rb", "test/johnson/conversions/nil_test.rb", "test/johnson/conversions/number_test.rb", "test/johnson/conversions/regexp_test.rb", "test/johnson/conversions/string_test.rb", "test/johnson/conversions/struct_test.rb", "test/johnson/conversions/symbol_test.rb", "test/johnson/conversions/thread_test.rb", "test/johnson/error_test.rb", "test/johnson/extensions_test.rb", "test/johnson/nodes/array_literal_test.rb", "test/johnson/nodes/array_node_test.rb", "test/johnson/nodes/binary_node_test.rb", "test/johnson/nodes/bracket_access_test.rb", "test/johnson/nodes/delete_test.rb", "test/johnson/nodes/do_while_test.rb", "test/johnson/nodes/dot_accessor_test.rb", "test/johnson/nodes/export_test.rb", "test/johnson/nodes/for_test.rb", "test/johnson/nodes/function_test.rb", "test/johnson/nodes/if_test.rb", "test/johnson/nodes/import_test.rb", "test/johnson/nodes/label_test.rb", "test/johnson/nodes/object_literal_test.rb", "test/johnson/nodes/return_test.rb", "test/johnson/nodes/semi_test.rb", "test/johnson/nodes/switch_test.rb", "test/johnson/nodes/ternary_test.rb", "test/johnson/nodes/throw_test.rb", "test/johnson/nodes/try_node_test.rb", "test/johnson/nodes/typeof_test.rb", "test/johnson/nodes/unary_node_test.rb", "test/johnson/nodes/void_test.rb", "test/johnson/nodes/while_test.rb", "test/johnson/nodes/with_test.rb", "test/johnson/prelude_test.rb", "test/johnson/runtime_test.rb", "test/johnson/spidermonkey/context_test.rb", "test/johnson/spidermonkey/immutable_node_test.rb", "test/johnson/spidermonkey/js_land_proxy_test.rb", "test/johnson/spidermonkey/ruby_land_proxy_test.rb", "test/johnson/spidermonkey/runtime_test.rb", "test/johnson/version_test.rb", "test/johnson/visitors/dot_visitor_test.rb", "test/johnson/visitors/enumerating_visitor_test.rb", "test/johnson_test.rb", "test/jquery_units/test.js", "test/jquery_units/test_helper.js", "test/jquery_units/units/ajax.js", "test/jquery_units/units/core.js", "test/jquery_units/units/event.js", "test/jquery_units/units/fx.js", "test/jquery_units/units/offset.js", "test/jquery_units/units/selector.js", "test/jspec/helper.js", "test/jspec/jspec.js", "test/jspec/simple_spec.js", "test/parser_test.rb", "todo/.keep", "vendor/spidermonkey/.cvsignore", "vendor/spidermonkey/Makefile.in", "vendor/spidermonkey/Makefile.ref", "vendor/spidermonkey/README.html", "vendor/spidermonkey/SpiderMonkey.rsp", "vendor/spidermonkey/Y.js", "vendor/spidermonkey/build.mk", "vendor/spidermonkey/config.mk", "vendor/spidermonkey/config/AIX4.1.mk", "vendor/spidermonkey/config/AIX4.2.mk", "vendor/spidermonkey/config/AIX4.3.mk", "vendor/spidermonkey/config/Darwin.mk", "vendor/spidermonkey/config/Darwin1.3.mk", "vendor/spidermonkey/config/Darwin1.4.mk", "vendor/spidermonkey/config/Darwin5.2.mk", "vendor/spidermonkey/config/Darwin5.3.mk", "vendor/spidermonkey/config/HP-UXB.10.10.mk", "vendor/spidermonkey/config/HP-UXB.10.20.mk", "vendor/spidermonkey/config/HP-UXB.11.00.mk", "vendor/spidermonkey/config/IRIX.mk", "vendor/spidermonkey/config/IRIX5.3.mk", "vendor/spidermonkey/config/IRIX6.1.mk", "vendor/spidermonkey/config/IRIX6.2.mk", "vendor/spidermonkey/config/IRIX6.3.mk", "vendor/spidermonkey/config/IRIX6.5.mk", "vendor/spidermonkey/config/Linux_All.mk", "vendor/spidermonkey/config/Mac_OS10.0.mk", "vendor/spidermonkey/config/OSF1V4.0.mk", "vendor/spidermonkey/config/OSF1V5.0.mk", "vendor/spidermonkey/config/SunOS4.1.4.mk", "vendor/spidermonkey/config/SunOS5.10.mk", "vendor/spidermonkey/config/SunOS5.3.mk", "vendor/spidermonkey/config/SunOS5.4.mk", "vendor/spidermonkey/config/SunOS5.5.1.mk", "vendor/spidermonkey/config/SunOS5.5.mk", "vendor/spidermonkey/config/SunOS5.6.mk", "vendor/spidermonkey/config/SunOS5.7.mk", "vendor/spidermonkey/config/SunOS5.8.mk", "vendor/spidermonkey/config/SunOS5.9.mk", "vendor/spidermonkey/config/WINNT4.0.mk", "vendor/spidermonkey/config/WINNT5.0.mk", "vendor/spidermonkey/config/WINNT5.1.mk", "vendor/spidermonkey/config/WINNT5.2.mk", "vendor/spidermonkey/config/WINNT6.0.mk", "vendor/spidermonkey/config/dgux.mk", "vendor/spidermonkey/editline/Makefile.ref", "vendor/spidermonkey/editline/README", "vendor/spidermonkey/editline/editline.3", "vendor/spidermonkey/editline/editline.c", "vendor/spidermonkey/editline/editline.h", "vendor/spidermonkey/editline/sysunix.c", "vendor/spidermonkey/editline/unix.h", "vendor/spidermonkey/fdlibm/.cvsignore", "vendor/spidermonkey/fdlibm/Makefile.in", "vendor/spidermonkey/fdlibm/Makefile.ref", "vendor/spidermonkey/fdlibm/e_acos.c", "vendor/spidermonkey/fdlibm/e_acosh.c", "vendor/spidermonkey/fdlibm/e_asin.c", "vendor/spidermonkey/fdlibm/e_atan2.c", "vendor/spidermonkey/fdlibm/e_atanh.c", "vendor/spidermonkey/fdlibm/e_cosh.c", "vendor/spidermonkey/fdlibm/e_exp.c", "vendor/spidermonkey/fdlibm/e_fmod.c", "vendor/spidermonkey/fdlibm/e_gamma.c", "vendor/spidermonkey/fdlibm/e_gamma_r.c", "vendor/spidermonkey/fdlibm/e_hypot.c", "vendor/spidermonkey/fdlibm/e_j0.c", "vendor/spidermonkey/fdlibm/e_j1.c", "vendor/spidermonkey/fdlibm/e_jn.c", "vendor/spidermonkey/fdlibm/e_lgamma.c", "vendor/spidermonkey/fdlibm/e_lgamma_r.c", "vendor/spidermonkey/fdlibm/e_log.c", "vendor/spidermonkey/fdlibm/e_log10.c", "vendor/spidermonkey/fdlibm/e_pow.c", "vendor/spidermonkey/fdlibm/e_rem_pio2.c", "vendor/spidermonkey/fdlibm/e_remainder.c", "vendor/spidermonkey/fdlibm/e_scalb.c", "vendor/spidermonkey/fdlibm/e_sinh.c", "vendor/spidermonkey/fdlibm/e_sqrt.c", "vendor/spidermonkey/fdlibm/fdlibm.h", "vendor/spidermonkey/fdlibm/fdlibm.mak", "vendor/spidermonkey/fdlibm/fdlibm.mdp", "vendor/spidermonkey/fdlibm/k_cos.c", "vendor/spidermonkey/fdlibm/k_rem_pio2.c", "vendor/spidermonkey/fdlibm/k_sin.c", "vendor/spidermonkey/fdlibm/k_standard.c", "vendor/spidermonkey/fdlibm/k_tan.c", "vendor/spidermonkey/fdlibm/s_asinh.c", "vendor/spidermonkey/fdlibm/s_atan.c", "vendor/spidermonkey/fdlibm/s_cbrt.c", "vendor/spidermonkey/fdlibm/s_ceil.c", "vendor/spidermonkey/fdlibm/s_copysign.c", "vendor/spidermonkey/fdlibm/s_cos.c", "vendor/spidermonkey/fdlibm/s_erf.c", "vendor/spidermonkey/fdlibm/s_expm1.c", "vendor/spidermonkey/fdlibm/s_fabs.c", "vendor/spidermonkey/fdlibm/s_finite.c", "vendor/spidermonkey/fdlibm/s_floor.c", "vendor/spidermonkey/fdlibm/s_frexp.c", "vendor/spidermonkey/fdlibm/s_ilogb.c", "vendor/spidermonkey/fdlibm/s_isnan.c", "vendor/spidermonkey/fdlibm/s_ldexp.c", "vendor/spidermonkey/fdlibm/s_lib_version.c", "vendor/spidermonkey/fdlibm/s_log1p.c", "vendor/spidermonkey/fdlibm/s_logb.c", "vendor/spidermonkey/fdlibm/s_matherr.c", "vendor/spidermonkey/fdlibm/s_modf.c", "vendor/spidermonkey/fdlibm/s_nextafter.c", "vendor/spidermonkey/fdlibm/s_rint.c", "vendor/spidermonkey/fdlibm/s_scalbn.c", "vendor/spidermonkey/fdlibm/s_signgam.c", "vendor/spidermonkey/fdlibm/s_significand.c", "vendor/spidermonkey/fdlibm/s_sin.c", "vendor/spidermonkey/fdlibm/s_tan.c", "vendor/spidermonkey/fdlibm/s_tanh.c", "vendor/spidermonkey/fdlibm/w_acos.c", "vendor/spidermonkey/fdlibm/w_acosh.c", "vendor/spidermonkey/fdlibm/w_asin.c", "vendor/spidermonkey/fdlibm/w_atan2.c", "vendor/spidermonkey/fdlibm/w_atanh.c", "vendor/spidermonkey/fdlibm/w_cosh.c", "vendor/spidermonkey/fdlibm/w_exp.c", "vendor/spidermonkey/fdlibm/w_fmod.c", "vendor/spidermonkey/fdlibm/w_gamma.c", "vendor/spidermonkey/fdlibm/w_gamma_r.c", "vendor/spidermonkey/fdlibm/w_hypot.c", "vendor/spidermonkey/fdlibm/w_j0.c", "vendor/spidermonkey/fdlibm/w_j1.c", "vendor/spidermonkey/fdlibm/w_jn.c", "vendor/spidermonkey/fdlibm/w_lgamma.c", "vendor/spidermonkey/fdlibm/w_lgamma_r.c", "vendor/spidermonkey/fdlibm/w_log.c", "vendor/spidermonkey/fdlibm/w_log10.c", "vendor/spidermonkey/fdlibm/w_pow.c", "vendor/spidermonkey/fdlibm/w_remainder.c", "vendor/spidermonkey/fdlibm/w_scalb.c", "vendor/spidermonkey/fdlibm/w_sinh.c", "vendor/spidermonkey/fdlibm/w_sqrt.c", "vendor/spidermonkey/javascript-trace.d", "vendor/spidermonkey/js.c", "vendor/spidermonkey/js.mak", "vendor/spidermonkey/js.mdp", "vendor/spidermonkey/js.msg", "vendor/spidermonkey/js.pkg", "vendor/spidermonkey/js3240.rc", "vendor/spidermonkey/jsOS240.def", "vendor/spidermonkey/jsapi.c", "vendor/spidermonkey/jsapi.h", "vendor/spidermonkey/jsarena.c", "vendor/spidermonkey/jsarena.h", "vendor/spidermonkey/jsarray.c", "vendor/spidermonkey/jsarray.h", "vendor/spidermonkey/jsatom.c", "vendor/spidermonkey/jsatom.h", "vendor/spidermonkey/jsbit.h", "vendor/spidermonkey/jsbool.c", "vendor/spidermonkey/jsbool.h", "vendor/spidermonkey/jsclist.h", "vendor/spidermonkey/jscntxt.c", "vendor/spidermonkey/jscntxt.h", "vendor/spidermonkey/jscompat.h", "vendor/spidermonkey/jsconfig.h", "vendor/spidermonkey/jsconfig.mk", "vendor/spidermonkey/jscpucfg.c", "vendor/spidermonkey/jscpucfg.h", "vendor/spidermonkey/jsdate.c", "vendor/spidermonkey/jsdate.h", "vendor/spidermonkey/jsdbgapi.c", "vendor/spidermonkey/jsdbgapi.h", "vendor/spidermonkey/jsdhash.c", "vendor/spidermonkey/jsdhash.h", "vendor/spidermonkey/jsdtoa.c", "vendor/spidermonkey/jsdtoa.h", "vendor/spidermonkey/jsdtracef.c", "vendor/spidermonkey/jsdtracef.h", "vendor/spidermonkey/jsemit.c", "vendor/spidermonkey/jsemit.h", "vendor/spidermonkey/jsexn.c", "vendor/spidermonkey/jsexn.h", "vendor/spidermonkey/jsfile.c", "vendor/spidermonkey/jsfile.h", "vendor/spidermonkey/jsfile.msg", "vendor/spidermonkey/jsfun.c", "vendor/spidermonkey/jsfun.h", "vendor/spidermonkey/jsgc.c", "vendor/spidermonkey/jsgc.h", "vendor/spidermonkey/jshash.c", "vendor/spidermonkey/jshash.h", "vendor/spidermonkey/jsify.pl", "vendor/spidermonkey/jsinterp.c", "vendor/spidermonkey/jsinterp.h", "vendor/spidermonkey/jsinvoke.c", "vendor/spidermonkey/jsiter.c", "vendor/spidermonkey/jsiter.h", "vendor/spidermonkey/jskeyword.tbl", "vendor/spidermonkey/jskwgen.c", "vendor/spidermonkey/jslibmath.h", "vendor/spidermonkey/jslock.c", "vendor/spidermonkey/jslock.h", "vendor/spidermonkey/jslocko.asm", "vendor/spidermonkey/jslog2.c", "vendor/spidermonkey/jslong.c", "vendor/spidermonkey/jslong.h", "vendor/spidermonkey/jsmath.c", "vendor/spidermonkey/jsmath.h", "vendor/spidermonkey/jsnum.c", "vendor/spidermonkey/jsnum.h", "vendor/spidermonkey/jsobj.c", "vendor/spidermonkey/jsobj.h", "vendor/spidermonkey/jsopcode.c", "vendor/spidermonkey/jsopcode.h", "vendor/spidermonkey/jsopcode.tbl", "vendor/spidermonkey/jsotypes.h", "vendor/spidermonkey/jsparse.c", "vendor/spidermonkey/jsparse.h", "vendor/spidermonkey/jsprf.c", "vendor/spidermonkey/jsprf.h", "vendor/spidermonkey/jsproto.tbl", "vendor/spidermonkey/jsprvtd.h", "vendor/spidermonkey/jspubtd.h", "vendor/spidermonkey/jsregexp.c", "vendor/spidermonkey/jsregexp.h", "vendor/spidermonkey/jsreops.tbl", "vendor/spidermonkey/jsscan.c", "vendor/spidermonkey/jsscan.h", "vendor/spidermonkey/jsscope.c", "vendor/spidermonkey/jsscope.h", "vendor/spidermonkey/jsscript.c", "vendor/spidermonkey/jsscript.h", "vendor/spidermonkey/jsshell.msg", "vendor/spidermonkey/jsstddef.h", "vendor/spidermonkey/jsstr.c", "vendor/spidermonkey/jsstr.h", "vendor/spidermonkey/jstypes.h", "vendor/spidermonkey/jsutil.c", "vendor/spidermonkey/jsutil.h", "vendor/spidermonkey/jsxdrapi.c", "vendor/spidermonkey/jsxdrapi.h", "vendor/spidermonkey/jsxml.c", "vendor/spidermonkey/jsxml.h", "vendor/spidermonkey/lock_SunOS.s", "vendor/spidermonkey/perfect.js", "vendor/spidermonkey/plify_jsdhash.sed", "vendor/spidermonkey/prmjtime.c", "vendor/spidermonkey/prmjtime.h", "vendor/spidermonkey/resource.h", "vendor/spidermonkey/rules.mk", "vendor/spidermonkey/win32.order"]
  15
+  s.has_rdoc = true
  16
+  s.homepage = %q{http://github.com/jbarnette/johnson/wikis}
  17
+  s.rdoc_options = ["--main", "README.rdoc"]
  18
+  s.require_paths = ["lib", "ext"]
  19
+  s.rubyforge_project = %q{johnson}
  20
+  s.rubygems_version = %q{1.2.0}
  21
+  s.summary = %q{Johnson wraps JavaScript in a loving Ruby embrace.}
  22
+  s.test_files = ["test/johnson/browser_test.rb", "test/johnson/conversions/array_test.rb", "test/johnson/conversions/boolean_test.rb", "test/johnson/conversions/callable_test.rb", "test/johnson/conversions/file_test.rb", "test/johnson/conversions/nil_test.rb", "test/johnson/conversions/number_test.rb", "test/johnson/conversions/regexp_test.rb", "test/johnson/conversions/string_test.rb", "test/johnson/conversions/struct_test.rb", "test/johnson/conversions/symbol_test.rb", "test/johnson/conversions/thread_test.rb", "test/johnson/error_test.rb", "test/johnson/extensions_test.rb", "test/johnson/nodes/array_literal_test.rb", "test/johnson/nodes/array_node_test.rb", "test/johnson/nodes/binary_node_test.rb", "test/johnson/nodes/bracket_access_test.rb", "test/johnson/nodes/delete_test.rb", "test/johnson/nodes/do_while_test.rb", "test/johnson/nodes/dot_accessor_test.rb", "test/johnson/nodes/export_test.rb", "test/johnson/nodes/for_test.rb", "test/johnson/nodes/function_test.rb", "test/johnson/nodes/if_test.rb", "test/johnson/nodes/import_test.rb", "test/johnson/nodes/label_test.rb", "test/johnson/nodes/object_literal_test.rb", "test/johnson/nodes/return_test.rb", "test/johnson/nodes/semi_test.rb", "test/johnson/nodes/switch_test.rb", "test/johnson/nodes/ternary_test.rb", "test/johnson/nodes/throw_test.rb", "test/johnson/nodes/try_node_test.rb", "test/johnson/nodes/typeof_test.rb", "test/johnson/nodes/unary_node_test.rb", "test/johnson/nodes/void_test.rb", "test/johnson/nodes/while_test.rb", "test/johnson/nodes/with_test.rb", "test/johnson/prelude_test.rb", "test/johnson/runtime_test.rb", "test/johnson/spidermonkey/context_test.rb", "test/johnson/spidermonkey/immutable_node_test.rb", "test/johnson/spidermonkey/js_land_proxy_test.rb", "test/johnson/spidermonkey/ruby_land_proxy_test.rb", "test/johnson/spidermonkey/runtime_test.rb", "test/johnson/version_test.rb", "test/johnson/visitors/dot_visitor_test.rb", "test/johnson/visitors/enumerating_visitor_test.rb", "test/johnson_test.rb", "test/parser_test.rb"]
  23
+
  24
+  if s.respond_to? :specification_version then
  25
+    current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
  26
+    s.specification_version = 2
  27
+
  28
+    if current_version >= 3 then
  29
+      s.add_runtime_dependency(%q<rake>, [">= 0"])
  30
+    else
  31
+      s.add_dependency(%q<rake>, [">= 0"])
  32
+    end
  33
+  else
  34
+    s.add_dependency(%q<rake>, [">= 0"])
  35
+  end
  36
+end
748  lib/hoe.rb
... ...
@@ -0,0 +1,748 @@
  1
+# -*- ruby -*-
  2
+
  3
+# Copyright (c) Ryan Davis, Zen Spider Software
  4
+# 
  5
+# Permission is hereby granted, free of charge, to any person obtaining
  6
+# a copy of this software and associated documentation files (the
  7
+# "Software"), to deal in the Software without restriction, including
  8
+# without limitation the rights to use, copy, modify, merge, publish,
  9
+# distribute, sublicense, and/or sell copies of the Software, and to
  10
+# permit persons to whom the Software is furnished to do so, subject to
  11
+# the following conditions:
  12
+# 
  13
+# The above copyright notice and this permission notice shall be
  14
+# included in all copies or substantial portions of the Software.
  15
+# 
  16
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  17
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  18
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  19
+# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  20
+# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  21
+# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  22
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  23
+
  24
+require 'rubygems'
  25
+require 'rake'
  26
+require 'rake/gempackagetask'
  27
+require 'rake/rdoctask'
  28
+require 'rake/testtask'
  29
+require 'rbconfig'
  30
+require 'rubyforge'
  31
+require 'yaml'
  32
+
  33
+class Hoe #:nodoc:
  34
+  VERSION = '1.5.3'
  35
+
  36
+  ruby_prefix = Config::CONFIG['prefix']
  37
+  sitelibdir = Config::CONFIG['sitelibdir']
  38
+
  39
+  ##
  40
+  # Used to specify a custom install location (for rake install).
  41
+
  42
+  PREFIX = ENV['PREFIX'] || ruby_prefix
  43
+
  44
+  ##
  45
+  # Used to add extra flags to RUBY_FLAGS.
  46
+
  47
+  RUBY_DEBUG = ENV['RUBY_DEBUG']
  48
+
  49
+  default_ruby_flags = "-w -I#{%w(lib ext bin test).join(File::PATH_SEPARATOR)}" +
  50
+    (RUBY_DEBUG ? " #{RUBY_DEBUG}" : '')
  51
+
  52
+  ##
  53
+  # Used to specify flags to ruby [has smart default].
  54
+
  55
+  RUBY_FLAGS = ENV['RUBY_FLAGS'] || default_ruby_flags
  56
+
  57
+  ##
  58
+  # Used to add flags to test_unit (e.g., -n test_borked).
  59
+
  60
+  FILTER = ENV['FILTER'] # for tests (eg FILTER="-n test_blah")
  61
+
  62
+  # :stopdoc:
  63
+
  64
+  RUBYLIB = if PREFIX == ruby_prefix then
  65
+              sitelibdir
  66
+            else
  67
+              File.join(PREFIX, sitelibdir[ruby_prefix.size..-1])
  68
+            end
  69
+
  70
+  DLEXT = Config::CONFIG['DLEXT']
  71
+
  72
+  WINDOZE = /djgpp|(cyg|ms|bcc)win|mingw/ =~ RUBY_PLATFORM unless defined? WINDOZE
  73
+
  74
+  DIFF = if WINDOZE
  75
+           'diff.exe'
  76
+         else
  77
+           if system("gdiff", __FILE__, __FILE__)
  78
+             'gdiff' # solaris and kin suck
  79
+           else
  80
+             'diff'
  81
+           end
  82
+         end unless defined? DIFF
  83
+
  84
+  # :startdoc:
  85
+
  86
+  ##
  87
+  # *Recommended*: The author(s) of the package. (can be array)
  88
+  # Really. Set this or we'll tease you.
  89
+
  90
+  attr_accessor :author
  91
+
  92
+  ##
  93
+  # Populated automatically from the manifest. List of executables.
  94
+
  95
+  attr_accessor :bin_files # :nodoc:
  96
+
  97
+  ##
  98
+  # Optional: A description of the release's latest changes. Auto-populates.
  99
+
  100
+  attr_accessor :changes
  101
+
  102
+  ##
  103
+  # Optional: An array of file patterns to delete on clean.
  104
+
  105
+  attr_accessor :clean_globs
  106
+
  107
+  ##
  108
+  # Optional: A description of the project. Auto-populates.
  109
+
  110
+  attr_accessor :description
  111
+
  112
+  ##
  113
+  # Optional: What sections from the readme to use for auto-description. Defaults to %w(description).
  114
+
  115
+  attr_accessor :description_sections
  116
+
  117
+  ##
  118
+  # *Recommended*: The author's email address(es). (can be array)
  119
+
  120
+  attr_accessor :email
  121
+
  122
+  ##
  123
+  # Optional: An array of rubygem dependencies.
  124
+
  125
+  attr_accessor :extra_deps
  126
+
  127
+  ##
  128
+  # Populated automatically from the manifest. List of library files.
  129
+
  130
+  attr_accessor :lib_files # :nodoc:
  131
+
  132
+  ##
  133
+  # Optional: Array of incompatible versions for multiruby filtering. Used as a regex.
  134
+
  135
+  attr_accessor :multiruby_skip
  136
+
  137
+  ##
  138
+  # *MANDATORY*: The name of the release.
  139
+
  140
+  attr_accessor :name
  141
+
  142
+  ##
  143
+  # Optional: Should package create a tarball? [default: true]
  144
+
  145
+  attr_accessor :need_tar
  146
+
  147
+  ##
  148
+  # Optional: Should package create a zipfile? [default: false]
  149
+
  150
+  attr_accessor :need_zip
  151
+
  152
+  ##
  153
+  # Optional: A post-install message to be displayed when gem is installed.
  154
+
  155
+  attr_accessor :post_install_message
  156
+
  157
+  ##
  158
+  # Optional: A regexp to match documentation files against the manifest.
  159
+
  160
+  attr_accessor :rdoc_pattern
  161
+
  162
+  ##
  163
+  # Optional: Name of RDoc destination directory on Rubyforge. [default: +name+]
  164
+
  165
+  attr_accessor :remote_rdoc_dir
  166
+
  167
+  ##
  168
+  # Optional: Flags for RDoc rsync. [default: "-av --delete"]
  169
+
  170
+  attr_accessor :rsync_args
  171
+
  172
+  ##
  173
+  # Optional: The name of the rubyforge project. [default: name.downcase]
  174
+
  175
+  attr_accessor :rubyforge_name
  176
+
  177
+  ##
  178
+  # The Gem::Specification.
  179
+
  180
+  attr_accessor :spec # :nodoc:
  181
+
  182
+  ##
  183
+  # Optional: A hash of extra values to set in the gemspec. Value may be a proc.
  184
+
  185
+  attr_accessor :spec_extras
  186
+
  187
+  ##
  188
+  # Optional: A short summary of the project. Auto-populates.
  189
+
  190
+  attr_accessor :summary
  191
+
  192
+  ##
  193
+  # Optional: Number of sentences from description for summary. Defaults to 1.
  194
+
  195
+  attr_accessor :summary_sentences
  196
+
  197
+  ##
  198
+  # Populated automatically from the manifest. List of tests.
  199
+
  200
+  attr_accessor :test_files # :nodoc:
  201
+
  202
+  ##
  203
+  # Optional: An array of test file patterns [default: test/**/test_*.rb]
  204
+
  205
+  attr_accessor :test_globs
  206
+
  207
+  ##
  208
+  # Optional: The url(s) of the project. (can be array). Auto-populates.
  209
+
  210
+  attr_accessor :url
  211
+
  212
+  ##
  213
+  # *MANDATORY*: The version. Don't hardcode! use a constant in the project.
  214
+
  215
+  attr_accessor :version
  216
+
  217
+  def initialize(name, version) # :nodoc:
  218
+    self.name = name
  219
+    self.version = version
  220
+
  221
+    # Defaults
  222
+    self.author = []
  223
+    self.clean_globs = %w(diff diff.txt email.txt ri
  224
+                          *.gem *~ **/*~ *.rbc **/*.rbc)
  225
+    self.description_sections = %w(description)
  226
+    self.email = []
  227
+    self.extra_deps = []
  228
+    self.multiruby_skip = []
  229
+    self.need_tar = true
  230
+    self.need_zip = false
  231
+    self.rdoc_pattern = /^(lib|bin|ext)|(rdoc|txt)$/
  232
+    self.remote_rdoc_dir = name
  233
+    self.rsync_args = '-av --delete'
  234
+    self.rubyforge_name = name.downcase
  235
+    self.spec_extras = {}
  236
+    self.summary_sentences = 1
  237
+    self.test_globs = ['test/**/test_*.rb']
  238
+    self.post_install_message = nil
  239
+
  240
+    yield self if block_given?
  241
+
  242
+    # Intuit values:
  243
+
  244
+    def missing name
  245
+      warn "** #{name} is missing or in the wrong format for auto-intuiting."
  246
+      warn "   run `sow blah` and look at its text files"
  247
+    end
  248
+
  249
+    readme   = File.read("README.rdoc").split(/^(=+ .*)$/)[1..-1] rescue ''
  250
+    unless readme.empty? then
  251
+      sections = readme.map { |s|
  252
+        s =~ /^=/ ? s.strip.downcase.chomp(':').split.last : s.strip
  253
+      }
  254
+      sections = Hash[*sections]
  255
+      desc = sections.values_at(*description_sections).join("\n\n")
  256
+      summ = desc.split(/\.\s+/).first(summary_sentences).join(". ")
  257
+
  258
+      self.description ||= desc
  259
+      self.summary ||= summ
  260
+      self.url ||= readme[1].gsub(/^\* /, '').split(/\n/).grep(/\S+/)
  261
+    else
  262
+      missing 'README.rdoc'
  263
+    end
  264
+
  265
+    self.changes ||= begin
  266
+                       h = File.read("CHANGELOG")
  267
+                       h.split(/^(===.*)/)[1..2].join.strip
  268
+                     rescue
  269
+                       missing 'CHANGELOG'
  270
+                       ''
  271
+                     end
  272
+
  273
+    %w(email author).each do |field|
  274
+      value = self.send(field)
  275
+      if value.nil? or value.empty? then
  276
+        if Time.now < Time.local(2008, 4, 1) then
  277
+          warn "Hoe #{field} value not set - Fix by 2008-04-01!"
  278
+          self.send "#{field}=", "doofus"
  279
+        else
  280
+          abort "Hoe #{field} value not set. aborting"
  281
+        end
  282
+      end
  283
+    end
  284
+
  285
+    self.extra_deps = Array(extra_deps).map { |o| String === o ? [o] : o }
  286
+
  287
+    define_tasks
  288
+  end
  289
+
  290
+  def developer name, email
  291
+    self.author << name
  292
+    self.email << email
  293
+  end
  294
+
  295
+  def define_tasks # :nodoc:
  296
+    def with_config # :nodoc:
  297
+      rc = File.expand_path("~/.hoerc")
  298
+      exists = File.exist? rc
  299
+      config = exists ? YAML.load_file(rc) : {}
  300
+      yield(config, rc)
  301
+    end
  302
+
  303
+    desc 'Run the default tasks.'
  304
+    task :default => :test
  305
+
  306
+    desc 'Run the test suite. Use FILTER to add to the command line.'
  307
+    task :test do
  308
+      run_tests
  309
+    end
  310
+
  311
+    desc 'Show which test files fail when run alone.'
  312
+    task :test_deps do
  313
+      tests = Dir["test/**/test_*.rb"]  +  Dir["test/**/*_test.rb"]
  314
+
  315
+      tests.each do |test|
  316
+        if not system "ruby -Ibin:lib:test #{test} &> /dev/null" then
  317
+          puts "Dependency Issues: #{test}"
  318
+        end
  319
+      end
  320
+    end
  321
+
  322
+    desc 'Run the test suite using multiruby.'
  323
+    task :multi do
  324
+      run_tests :multi
  325
+    end
  326
+
  327
+    ############################################################
  328
+    # Packaging and Installing
  329
+
  330
+    signing_key = nil
  331
+    cert_chain = []
  332
+
  333
+    with_config do |config, path|
  334
+      break unless config['signing_key_file'] and config['signing_cert_file']
  335
+      key_file = File.expand_path config['signing_key_file'].to_s
  336
+      signing_key = key_file if File.exist? key_file
  337
+
  338
+      cert_file = File.expand_path config['signing_cert_file'].to_s
  339
+      cert_chain << cert_file if File.exist? cert_file
  340
+    end
  341
+
  342
+    self.spec = Gem::Specification.new do |s|
  343
+      s.name = name
  344
+      s.version = version
  345
+      s.summary = summary
  346
+      case author
  347
+      when Array
  348
+        s.authors = author
  349
+      else
  350
+        s.author = author
  351
+      end
  352
+      s.email = email
  353
+      s.homepage = Array(url).first
  354
+      s.rubyforge_project = rubyforge_name
  355
+
  356
+      s.description = description
  357
+
  358
+      extra_deps.each do |dep|
  359
+        s.add_dependency(*dep)
  360
+      end
  361
+
  362
+      s.files = File.read("MANIFEST").delete("\r").split(/\n/)
  363
+      s.executables = s.files.grep(/^bin/) { |f| File.basename(f) }
  364
+
  365
+      s.bindir = "bin"
  366
+      dirs = Dir['{lib,ext}']
  367
+      s.require_paths = dirs unless dirs.empty?
  368
+
  369
+      s.rdoc_options = ['--main', 'README.rdoc']
  370
+      s.extra_rdoc_files = s.files.grep(/(txt|rdoc)$/)
  371
+      s.has_rdoc = true
  372
+
  373
+      s.post_install_message = post_install_message
  374
+
  375
+      if test ?f, "test/test_all.rb" then
  376
+        s.test_file = "test/test_all.rb"
  377
+      else
  378
+        s.test_files = Dir[*test_globs]
  379
+      end
  380
+
  381
+      if signing_key and cert_chain then
  382
+        s.signing_key = signing_key
  383
+        s.cert_chain = cert_chain
  384
+      end
  385
+
  386
+      ############################################################
  387
+      # Allow automatic inclusion of compiled extensions
  388
+      if ENV['INLINE'] then
  389
+        s.platform = ENV['FORCE_PLATFORM'] || Gem::Platform::CURRENT
  390
+        # name of the extension is CamelCase
  391
+        alternate_name = if name =~ /[A-Z]/ then
  392
+                           name.gsub(/([A-Z])/, '_\1').downcase.sub(/^_/, '')
  393
+                         elsif name =~ /_/ then
  394
+                           name.capitalize.gsub(/_([a-z])/) { $1.upcase }
  395
+                         end
  396
+
  397
+        # Try collecting Inline extensions for +name+
  398
+        if defined?(Inline) then
  399
+          directory 'lib/inline'
  400
+
  401
+          extensions = Dir.chdir(Inline::directory) {
  402
+            Dir["Inline_{#{name},#{alternate_name}}_*.#{DLEXT}"]
  403
+          }
  404
+          extensions.each do |ext|
  405
+            # add the inlined extension to the spec files
  406
+            s.files += ["lib/inline/#{ext}"]
  407
+
  408
+            # include the file in the tasks
  409
+            file "lib/inline/#{ext}" => ["lib/inline"] do
  410
+              cp File.join(Inline::directory, ext), "lib/inline"
  411
+            end
  412
+          end
  413
+        end
  414
+      end
  415
+
  416
+      # Do any extra stuff the user wants
  417
+      spec_extras.each do |msg, val|
  418
+        case val
  419
+        when Proc
  420
+          val.call(s.send(msg))
  421
+        else
  422
+          s.send "#{msg}=", val
  423
+        end
  424
+      end
  425
+    end
  426
+
  427
+    desc 'Show information about the gem.'
  428
+    task :debug_gem do
  429
+      puts spec.to_ruby
  430
+    end
  431
+    
  432
+    desc "Generate #{name}.gemspec"
  433
+    task :gemspec do
  434
+      File.open("#{name}.gemspec", "w") do |f|
  435
+        f.write spec.to_ruby
  436
+      end
  437
+    end
  438
+
  439
+    self.lib_files = spec.files.grep(/^(lib|ext)/)
  440
+    self.bin_files = spec.files.grep(/^bin/)
  441
+    self.test_files = spec.files.grep(/^test/)
  442
+
  443
+    Rake::GemPackageTask.new spec do |pkg|
  444
+      pkg.need_tar = @need_tar
  445
+      pkg.need_zip = @need_zip
  446
+    end
  447
+
  448
+    desc 'Install the package as a gem.'
  449
+    task :install_gem => [:clean, :package] do
  450
+      sh "#{'sudo ' unless WINDOZE}gem install --local pkg/*.gem"
  451
+    end
  452
+
  453
+    desc 'Package and upload the release to rubyforge.'
  454
+    task :release => [:clean, :package] do |t|
  455
+      v = ENV["VERSION"] or abort "Must supply VERSION=x.y.z"
  456
+      abort "Versions don't match #{v} vs #{version}" if v != version
  457
+      pkg = "pkg/#{name}-#{version}"
  458
+
  459
+      if $DEBUG then
  460
+        puts "release_id = rf.add_release #{rubyforge_name.inspect}, #{name.inspect}, #{version.inspect}, \"#{pkg}.tgz\""
  461
+        puts "rf.add_file #{rubyforge_name.inspect}, #{name.inspect}, release_id, \"#{pkg}.gem\""
  462
+      end
  463
+
  464
+      rf = RubyForge.new.configure
  465
+      puts "Logging in"
  466
+      rf.login
  467
+
  468
+      c = rf.userconfig
  469
+      c["release_notes"] = description if description
  470
+      c["release_changes"] = changes if changes
  471
+      c["preformatted"] = true
  472
+
  473
+      files = [(@need_tar ? "#{pkg}.tgz" : nil),
  474
+               (@need_zip ? "#{pkg}.zip" : nil),
  475
+               "#{pkg}.gem"].compact
  476
+
  477
+      puts "Releasing #{name} v. #{version}"
  478
+      rf.add_release rubyforge_name, name, version, *files
  479
+    end
  480
+
  481
+    ############################################################
  482
+    # Doco
  483
+
  484
+    Rake::RDocTask.new(:docs) do |rd|
  485
+      rd.main = "README.rdoc"
  486
+      rd.options << '-d' if RUBY_PLATFORM !~ /win32/ and `which dot` =~ /\/dot/ and not ENV['NODOT']
  487
+      rd.rdoc_dir = 'doc'
  488
+      files = spec.files.grep(rdoc_pattern)
  489
+      files -= ['MANIFEST', 'lib/hoe.rb']
  490
+      rd.rdoc_files.push(*files)
  491
+
  492
+      title = "#{name}-#{version} Documentation"
  493
+      title = "#{rubyforge_name}'s " + title if rubyforge_name != name
  494
+
  495
+      rd.options << "-t #{title}"
  496
+    end
  497
+
  498
+    desc 'Generate ri locally for testing.'
  499
+    task :ridocs => :clean do
  500
+      sh %q{ rdoc --ri -o ri . }
  501
+    end
  502
+
  503
+    desc 'Publish RDoc to RubyForge.'
  504
+    task :publish_docs => [:clean, :docs] do
  505
+      config = YAML.load(File.read(File.expand_path("~/.rubyforge/user-config.yml")))
  506
+      host = "#{config["username"]}@rubyforge.org"
  507
+
  508
+      remote_dir = "/var/www/gforge-projects/#{rubyforge_name}/#{remote_rdoc_dir}"
  509
+      local_dir = 'doc'
  510
+
  511
+      sh %{rsync #{rsync_args} #{local_dir}/ #{host}:#{remote_dir}}
  512
+    end
  513
+
  514
+    # no doco for this one
  515
+    task :publish_on_announce do
  516
+      with_config do |config, _|
  517
+        Rake::Task['publish_docs'].invoke if config["publish_on_announce"]
  518
+      end
  519
+    end
  520
+
  521
+    ############################################################
  522
+    # Misc/Maintenance:
  523
+
  524
+    desc 'Run ZenTest against the package.'
  525
+    task :audit do
  526
+      libs = %w(lib test ext).join(File::PATH_SEPARATOR)
  527
+      sh "zentest -I=#{libs} #{spec.files.grep(/^(lib|test)/).join(' ')}"
  528
+    end
  529
+
  530
+    desc 'Clean up all the extras.'
  531
+    task :clean => [ :clobber_docs, :clobber_package ] do
  532
+      clean_globs.each do |pattern|
  533
+        files = Dir[pattern]
  534
+        rm_rf files, :verbose => true unless files.empty?
  535
+      end
  536
+    end
  537
+
  538
+    desc 'Create a fresh ~/.hoerc file.'
  539
+    task :config_hoe do
  540
+      with_config do |config, path|
  541
+        default_config = {
  542
+          "exclude" => /tmp$|CVS|\.svn/,
  543
+          "publish_on_announce" => false,
  544
+          "signing_key_file" => "~/.gem/gem-private_key.pem",
  545
+          "signing_cert_file" => "~/.gem/gem-public_cert.pem",
  546
+          "blogs" => [ {
  547
+                         "user" => "user",
  548
+                         "url" => "url",
  549
+                         "extra_headers" => {
  550
+                           "mt_convert_breaks" => "markdown"
  551
+                         },
  552
+                         "blog_id" => "blog_id",
  553
+                         "password"=>"password",
  554
+                       } ],
  555
+        }
  556
+        File.open(path, "w") do |f|
  557
+          YAML.dump(default_config.merge(config), f)
  558
+        end
  559
+
  560
+        editor = ENV['EDITOR'] || 'vi'
  561
+        system "#{editor} #{path}" if ENV['SHOW_EDITOR'] != 'no'
  562
+      end
  563
+    end
  564
+
  565
+    desc 'Generate email announcement file.'
  566
+    task :email do
  567
+      require 'rubyforge'
  568
+      subject, title, body, urls = announcement
  569
+
  570
+      File.open("email.txt", "w") do |mail|
  571
+        mail.puts "Subject: [ANN] #{subject}"
  572
+        mail.puts
  573
+        mail.puts title
  574
+        mail.puts
  575
+        mail.puts urls
  576
+        mail.puts
  577
+        mail.puts body
  578
+        mail.puts
  579
+        mail.puts urls
  580
+      end
  581
+      puts "Created email.txt"
  582
+    end
  583
+
  584
+    desc 'Post announcement to blog.'
  585
+    task :post_blog do
  586
+      require 'xmlrpc/client'
  587
+
  588
+      with_config do |config, path|
  589
+        break unless config['blogs']
  590
+
  591
+        subject, title, body, urls = announcement
  592
+        body += "\n\n#{urls}"
  593
+
  594
+        config['blogs'].each do |site|
  595
+          server = XMLRPC::Client.new2(site['url'])
  596
+          content = site['extra_headers'].merge(:title => title,
  597
+                                                :description => body)
  598
+          result = server.call('metaWeblog.newPost',
  599
+                               site['blog_id'],
  600
+                               site['user'],
  601
+                               site['password'],
  602
+                               content,
  603
+                               true)
  604
+        end
  605
+      end
  606
+    end
  607
+
  608
+    desc 'Post announcement to rubyforge.'
  609
+    task :post_news do
  610
+      require 'rubyforge'
  611
+      subject, title, body, urls = announcement
  612
+
  613
+      rf = RubyForge.new.configure
  614
+      rf.login
  615
+      rf.post_news(rubyforge_name, subject, "#{title}\n\n#{body}")
  616
+      puts "Posted to rubyforge"
  617
+    end
  618
+
  619
+    desc 'Create news email file and post to rubyforge.'
  620
+    task :announce => [:email, :post_news, :post_blog, :publish_on_announce ]
  621
+
  622
+    desc 'Verify the manifest.'
  623
+    task :check_manifest => :clean do
  624
+      f = "Manifest.tmp"
  625
+      require 'find'
  626
+      files = []
  627
+      with_config do |config, _|
  628
+        exclusions = config["exclude"]
  629
+        abort "exclude entry missing from .hoerc. Aborting." if exclusions.nil?
  630
+        Find.find '.' do |path|
  631
+          next unless File.file? path
  632
+          next if path =~ exclusions
  633
+          files << path[2..-1]
  634
+        end
  635
+        files = files.sort.join "\n"
  636
+        File.open f, 'w' do |fp| fp.puts files end
  637
+        system "#{DIFF} -du MANIFEST #{f}"
  638
+        rm f
  639
+      end
  640
+    end
  641
+
  642
+    desc 'Generate a key for signing your gems.'
  643
+    task :generate_key do
  644
+      email = spec.email
  645
+      abort "No email in your gemspec" if email.nil? or email.empty?
  646
+
  647
+      key_file = with_config { |config, _| config['signing_key_file'] }
  648
+      cert_file = with_config { |config, _| config['signing_cert_file'] }
  649
+
  650
+      if key_file.nil? or cert_file.nil? then
  651
+        ENV['SHOW_EDITOR'] ||= 'no'
  652
+        Rake::Task['config_hoe'].invoke
  653
+
  654
+        key_file = with_config { |config, _| config['signing_key_file'] }
  655
+        cert_file = with_config { |config, _| config['signing_cert_file'] }
  656
+      end
  657
+
  658
+      key_file = File.expand_path key_file
  659
+      cert_file = File.expand_path cert_file
  660
+
  661
+      unless File.exist? key_file or File.exist? cert_file then
  662
+        sh "gem cert --build #{email}"
  663
+        mv "gem-private_key.pem", key_file, :verbose => true
  664
+        mv "gem-public_cert.pem", cert_file, :verbose => true
  665
+
  666
+        puts "Installed key and certificate."
  667
+
  668
+        rf = RubyForge.new.configure
  669
+        rf.login
  670
+
  671
+        cert_package = "#{rubyforge_name}-certificates"
  672
+
  673
+        begin
  674
+          rf.lookup 'package', cert_package
  675
+        rescue
  676
+          rf.create_package rubyforge_name, cert_package
  677
+        end
  678
+
  679
+        begin
  680
+          rf.lookup('release', cert_package)['certificates']
  681
+          rf.add_file rubyforge_name, cert_package, 'certificates', cert_file
  682
+        rescue
  683
+          rf.add_release rubyforge_name, cert_package, 'certificates', cert_file
  684
+        end
  685
+
  686
+        puts "Uploaded certificate to release \"certificates\" in package #{cert_package}"
  687
+      else
  688
+        puts "Keys already exist."
  689
+      end
  690
+    end
  691
+
  692
+  end # end define
  693
+
  694
+  def announcement # :nodoc:
  695
+    changes = self.changes.rdoc_to_markdown
  696
+
  697
+    subject = "#{name} #{version} Released"
  698
+    title = "#{name} version #{version} has been released!"
  699
+    body = "#{description}\n\nChanges:\n\n#{changes}".rdoc_to_markdown
  700
+    urls = Array(url).map { |s| "* <#{s.strip.rdoc_to_markdown}>" }.join("\n")
  701
+
  702
+    return subject, title, body, urls
  703
+  end
  704
+
  705
+  def run_tests(multi=false) # :nodoc:
  706
+    msg = multi ? :sh : :ruby
  707
+    cmd = if test ?f, 'test/test_all.rb' then
  708
+            "#{RUBY_FLAGS} test/test_all.rb #{FILTER}"
  709
+          else
  710
+            tests = ['test/unit'] + test_globs.map { |g| Dir.glob(g) }.flatten
  711
+            tests.map! {|f| %Q(require "#{f}")}
  712
+            "#{RUBY_FLAGS} -e '#{tests.join("; ")}' #{FILTER}"
  713
+          end
  714
+
  715
+    excludes = multiruby_skip.join(":")
  716
+    ENV['EXCLUDED_VERSIONS'] = excludes
  717
+    cmd = "multiruby #{cmd}" if multi
  718
+
  719
+    send msg, cmd
  720
+  end
  721
+
  722
+  ##
  723
+  # Reads a file at +path+ and spits out an array of the +paragraphs+ specified.
  724
+  #
  725
+  #   changes = p.paragraphs_of('CHANGELOG', 0..1).join("\n\n")
  726
+  #   summary, *description = p.paragraphs_of('README.rdoc', 3, 3..8)
  727
+
  728
+  def paragraphs_of(path, *paragraphs)
  729
+    File.read(path).delete("\r").split(/\n\n+/).values_at(*paragraphs)
  730
+  end
  731
+end
  732
+
  733
+# :enddoc:
  734
+
  735
+class ::Rake::SshDirPublisher # :nodoc:
  736
+  attr_reader :host, :remote_dir, :local_dir
  737
+end
  738
+
  739
+class String
  740
+  def rdoc_to_markdown
  741
+    self.gsub(/^mailto:/, '').gsub(/^(=+)/) { "#" * $1.size }
  742
+  end
  743
+end
  744
+
  745
+if $0 == __FILE__ then
  746
+  out = `rake -T | egrep -v "redocs|repackage|clobber|trunk"`
  747
+  puts out.gsub(/\#/, '-').gsub(/^rake /, '# * ')
  748
+end
3  lib/johnson/version.rb
... ...
@@ -1,3 +1,4 @@
1 1
 module Johnson #:nodoc:
2  
-  VERSION = "1.0.0"
  2
+  # FIXME: Don't add the timestamp for "release" versions
  3
+  VERSION = "1.0.0.#{Time.now.strftime("%Y%m%d%H%M")}".freeze
3 4
 end

0 notes on commit d881eb3

Please sign in to comment.
Something went wrong with that request. Please try again.