bones 1.3.5 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,25 @@
1
- == 1.3.5 / 2008-02
1
+ == 2.0.0 / 2008-03-
2
+
3
+ * 2 major enhancements
4
+ - Reworked the PROJ open struct to use nested open struct
5
+ objects
6
+ - Renamed a few of the .rake files to match the namespaces
7
+ they define
8
+ * 4 minor enhancements
9
+ - Selectable project skeleton when creating a new project
10
+ - Added an empty 'prereqs' task to several of the namespaces
11
+ (can be used for running code before any of the
12
+ tasks in that namespace are invoked)
13
+ - Extra refinement on notes
14
+ rake notes TwP #=> all notes for TwP
15
+ rake notes:todo TwP #=> all todos for TwP
16
+ - Insalling a gem will no longer try to update the gem
17
+ sources from RubyForge
18
+ * 1 bug fix
19
+ - On some systems, the quiet method was not reopening
20
+ stdout and stderr correctly
21
+
22
+ == 1.3.5 / 2008-02-27
2
23
 
3
24
  * 2 minor enhancements
4
25
  - Added a bones:debug task to inspect the PROJ open struct or
@@ -12,12 +12,12 @@ data/lib/NAME.rb.erb
12
12
  data/spec/NAME_spec.rb.erb
13
13
  data/spec/spec_helper.rb.erb
14
14
  data/tasks/ann.rake
15
- data/tasks/annotations.rake
16
15
  data/tasks/bones.rake
17
- data/tasks/doc.rake
18
16
  data/tasks/gem.rake
19
17
  data/tasks/manifest.rake
18
+ data/tasks/notes.rake
20
19
  data/tasks/post_load.rake
20
+ data/tasks/rdoc.rake
21
21
  data/tasks/rubyforge.rake
22
22
  data/tasks/setup.rb
23
23
  data/tasks/spec.rake
@@ -26,15 +26,16 @@ data/tasks/test.rake
26
26
  data/test/test_NAME.rb
27
27
  lib/bones.rb
28
28
  lib/bones/annotation_extractor.rb
29
+ lib/bones/debug.rb
29
30
  lib/bones/main.rb
30
31
  lib/bones/smtp_tls.rb
31
32
  tasks/ann.rake
32
- tasks/annotations.rake
33
33
  tasks/bones.rake
34
- tasks/doc.rake
35
34
  tasks/gem.rake
36
35
  tasks/manifest.rake
36
+ tasks/notes.rake
37
37
  tasks/post_load.rake
38
+ tasks/rdoc.rake
38
39
  tasks/rubyforge.rake
39
40
  tasks/setup.rb
40
41
  tasks/spec.rake
data/README.txt CHANGED
@@ -10,7 +10,75 @@ ease the management and deployment of your source code. Mr Bones is not
10
10
  viral -- all the code your project needs is included in the skeleton (no
11
11
  gem dependency required).
12
12
 
13
- == FEATURES/PROBLEMS:
13
+ == VERSION 2.0.0 CHANGES:
14
+
15
+ Version 2.0.0 of Mr Bones introduces backwards incompatibilities. Here is
16
+ what you need to update in order for your current projects to work with
17
+ this latest release.
18
+
19
+ Perform an update the tasks in your project directory:
20
+
21
+ bones -u your/project/directory
22
+
23
+ The following .rake files have been renamed in Mr Bones 2.0.0 (the old
24
+ name is on the left and the new name is on the right). You will need to
25
+ delete the old version and use only the new version.
26
+
27
+ doc.rake => rdoc.rake
28
+ annotations.rake => notes.rake
29
+
30
+ The PROJ openstruct has been amended to contain a collection of nested
31
+ openstructs. This will affect any settings you might have in the
32
+ top-level Rakefile for your project. Here is the translation key (old
33
+ names on the left and new names on the right).
34
+
35
+ rubyforge_name => rubyforge.name
36
+
37
+ specs => spec.files
38
+ spec_opts => spec.opts
39
+
40
+ tests => test.files
41
+ test_file => test.file
42
+ test_opts => test.opts
43
+
44
+ rcov_dir => rcov.dir
45
+ rcov_opts => rcov.opts
46
+ rcov_threshold => rcov.threshold
47
+ rcov_threshold_exact => rcov.threshold_exact
48
+
49
+ rdoc_opts => rdoc.opts
50
+ rdoc_include => rdoc.include
51
+ rdoc_exclude => rdoc.exclude
52
+ rdoc_main => rdoc.main
53
+ rdoc_dir => rdoc.dir
54
+ rdoc_remote_dir => rdoc.remote_dir
55
+
56
+ dependencies => gem.dependencies
57
+ executables => gem.executables
58
+ extensions => gem.extensions
59
+ files => gem.files
60
+ need_tar => gem.need_tar
61
+ need_zip => gem.need_zip
62
+ post_install_message => gem.extras['post_install_message']
63
+
64
+ annotation_exclude => notes.exclude
65
+ annotation_extensions => notes.extensions
66
+ annotation_tags => notes.tags
67
+
68
+ svn => svn.path
69
+ svn_root => svn.root
70
+ svn_trunk => svn.trunk
71
+ svn_tags => svn.tags
72
+ svn_branches => svn.branches
73
+
74
+ ann_file => ann.file
75
+ ann_text => ann.text
76
+ ann_paragraphs => ann.paragraphs
77
+ ann_email => ann.email
78
+
79
+ And of course, each name should be prepended with PROJ in your Rakefile.
80
+
81
+ == FEATURES:
14
82
 
15
83
  Mr Bones provides the following rake tasks:
16
84
 
@@ -101,13 +169,15 @@ the Rakefile for the Mr Bones gem itself:
101
169
  PROJ.authors = 'Tim Pease'
102
170
  PROJ.email = 'not.real@fake.com'
103
171
  PROJ.url = 'http://codeforpeople.rubyforge.org/bones'
104
- PROJ.rubyforge_name = 'codeforpeople'
105
- PROJ.rdoc_remote_dir = 'bones'
106
172
  PROJ.version = Bones::VERSION
173
+ PROJ.rubyforge.name = 'codeforpeople'
174
+
175
+ PROJ.rdoc.remote_dir = 'bones'
176
+ PROJ.rdoc.exclude << '^data'
177
+
178
+ PROJ.notes.exclude = %w(^README\.txt$ ^data/)
107
179
 
108
- PROJ.rdoc_exclude << '^data'
109
- PROJ.annotation_exclude = %w(^README\.txt$ ^data/)
110
- PROJ.svn = 'bones'
180
+ PROJ.svn.path = 'bones'
111
181
 
112
182
  PROJ.spec_opts << '--color'
113
183
 
data/Rakefile CHANGED
@@ -1,4 +1,4 @@
1
- # $Id: Rakefile 562 2008-02-28 04:36:33Z tim_pease $
1
+ # $Id: Rakefile 587 2008-04-07 20:28:43Z tim_pease $
2
2
 
3
3
  $:.unshift('lib')
4
4
 
@@ -9,44 +9,48 @@ PROJ.name = 'bones'
9
9
  PROJ.authors = 'Tim Pease'
10
10
  PROJ.email = 'tim.pease@gmail.com'
11
11
  PROJ.url = 'http://codeforpeople.rubyforge.org/bones'
12
- PROJ.rubyforge_name = 'codeforpeople'
13
- PROJ.rdoc_remote_dir = 'bones'
14
12
  PROJ.version = Bones::VERSION
15
- PROJ.release_name = 'Skeletor'
13
+ PROJ.release_name = 'Pygmy Orchestra'
16
14
 
17
- PROJ.rdoc_exclude << '^data/'
18
- PROJ.annotation_exclude = %w(^README\.txt$ ^data/ ^tasks/setup.rb$)
19
- PROJ.svn = 'bones'
15
+ PROJ.rubyforge.name = 'codeforpeople'
20
16
 
21
- PROJ.spec_opts << '--color'
17
+ PROJ.rdoc.remote_dir = 'bones'
18
+ PROJ.rdoc.exclude << '^data/'
19
+ PROJ.notes.exclude = %w(^README\.txt$ ^data/ ^tasks/setup.rb$)
20
+ PROJ.svn.path = 'bones'
22
21
 
23
- PROJ.ann_email[:server] = 'smtp.gmail.com'
24
- PROJ.ann_email[:port] = 587
22
+ PROJ.spec.opts << '--color'
25
23
 
26
- PROJ.post_install_message = <<-MSG
24
+ PROJ.ann.email[:server] = 'smtp.gmail.com'
25
+ PROJ.ann.email[:port] = 587
26
+
27
+ PROJ.gem.extras[:required_rubygems_version] = '>= 1.1.0'
28
+ PROJ.gem.extras[:post_install_message] = <<-MSG
27
29
  --------------------------
28
30
  Keep rattlin' dem bones!
29
31
  --------------------------
30
32
  MSG
31
33
 
32
- PROJ.ann_paragraphs = %w[install synopsis features requirements]
33
- PROJ.ann_text = <<-ANN
34
+ PROJ.ann.paragraphs = %w[install synopsis].unshift('version 2.0.0 changes')
35
+ #PROJ.ann.paragraphs = %w[install synopsis features requirements].unshift('version 2.0.0 changes')
36
+ PROJ.ann.text = <<-ANN
34
37
  == FUN FACT
35
38
 
36
- 90% of New York City cab drivers are recently arrived immigrants.
39
+ The number of left-handed men is double that of left-handed women.
37
40
 
38
41
  == POST SCRIPT
39
42
 
40
43
  Blessings,
41
44
  TwP
42
45
 
43
- #{PROJ.post_install_message}
46
+ #{PROJ.gem.extras[:post_install_message]}
44
47
  ANN
45
48
 
46
49
  task :default => 'spec:run'
47
50
  task 'gem:package' => 'manifest:assert'
48
- task(:titlize) {PROJ.name = 'Mr Bones'}
49
- task 'ann:announcement' => :titlize
51
+ task 'ann:prereqs' do
52
+ PROJ.name = 'Mr Bones'
53
+ end
50
54
 
51
55
  depend_on 'rake'
52
56
 
data/bin/bones CHANGED
File without changes
@@ -13,8 +13,8 @@ PROJ.name = '<%= name %>'
13
13
  PROJ.authors = 'FIXME (who is writing this software)'
14
14
  PROJ.email = 'FIXME (your e-mail)'
15
15
  PROJ.url = 'FIXME (project homepage)'
16
- PROJ.rubyforge_name = '<%= name %>'
16
+ PROJ.rubyforge.name = '<%= name %>'
17
17
 
18
- PROJ.spec_opts << '--color'
18
+ PROJ.spec.opts << '--color'
19
19
 
20
20
  # EOF
File without changes
@@ -9,12 +9,16 @@ require 'time'
9
9
 
10
10
  namespace :ann do
11
11
 
12
- file PROJ.ann_file do
13
- puts "Generating #{PROJ.ann_file}"
14
- File.open(PROJ.ann_file,'w') do |fd|
12
+ # A prerequisites task that all other tasks depend upon
13
+ task :prereqs
14
+
15
+ file PROJ.ann.file do
16
+ ann = PROJ.ann
17
+ puts "Generating #{ann.file}"
18
+ File.open(ann.file,'w') do |fd|
15
19
  fd.puts("#{PROJ.name} version #{PROJ.version}")
16
20
  fd.puts(" by #{Array(PROJ.authors).first}") if PROJ.authors
17
- fd.puts(" #{PROJ.url}") if PROJ.url
21
+ fd.puts(" #{PROJ.url}") if PROJ.url.valid?
18
22
  fd.puts(" (the \"#{PROJ.release_name}\" release)") if PROJ.release_name
19
23
  fd.puts
20
24
  fd.puts("== DESCRIPTION")
@@ -23,23 +27,24 @@ namespace :ann do
23
27
  fd.puts
24
28
  fd.puts(PROJ.changes.sub(%r/^.*$/, '== CHANGES'))
25
29
  fd.puts
26
- PROJ.ann_paragraphs.each do |p|
30
+ ann.paragraphs.each do |p|
27
31
  fd.puts "== #{p.upcase}"
28
32
  fd.puts
29
33
  fd.puts paragraphs_of(PROJ.readme_file, p).join("\n\n")
30
34
  fd.puts
31
35
  end
32
- fd.puts PROJ.ann_text if PROJ.ann_text
36
+ fd.puts ann.text if ann.text
33
37
  end
34
38
  end
35
39
 
36
40
  desc "Create an announcement file"
37
- task :announcement => PROJ.ann_file
41
+ task :announcement => ['ann:prereqs', PROJ.ann.file]
38
42
 
39
43
  desc "Send an email announcement"
40
- task :email => PROJ.ann_file do
41
- from = PROJ.ann_email[:from] || PROJ.email
42
- to = Array(PROJ.ann_email[:to])
44
+ task :email => ['ann:prereqs', PROJ.ann.file] do
45
+ ann = PROJ.ann
46
+ from = ann.email[:from] || PROJ.email
47
+ to = Array(ann.email[:to])
43
48
 
44
49
  ### build a mail header for RFC 822
45
50
  rfc822msg = "From: #{from}\n"
@@ -49,11 +54,11 @@ namespace :ann do
49
54
  rfc822msg << "\n"
50
55
  rfc822msg << "Date: #{Time.new.rfc822}\n"
51
56
  rfc822msg << "Message-Id: "
52
- rfc822msg << "<#{"%.8f" % Time.now.to_f}@#{PROJ.ann_email[:domain]}>\n\n"
53
- rfc822msg << File.read(PROJ.ann_file)
57
+ rfc822msg << "<#{"%.8f" % Time.now.to_f}@#{ann.email[:domain]}>\n\n"
58
+ rfc822msg << File.read(ann.file)
54
59
 
55
60
  params = [:server, :port, :domain, :acct, :passwd, :authtype].map do |key|
56
- PROJ.ann_email[key]
61
+ ann.email[key]
57
62
  end
58
63
 
59
64
  params[3] = PROJ.email if params[3].nil?
@@ -71,6 +76,6 @@ end # namespace :ann
71
76
  desc 'Alias to ann:announcement'
72
77
  task :ann => 'ann:announcement'
73
78
 
74
- CLOBBER << PROJ.ann_file
79
+ CLOBBER << PROJ.ann.file
75
80
 
76
81
  # EOF
@@ -1,7 +1,6 @@
1
1
  # $Id$
2
2
 
3
- require 'pp'
4
- require 'stringio'
3
+ if HAVE_BONES
5
4
 
6
5
  namespace :bones do
7
6
 
@@ -10,31 +9,13 @@ namespace :bones do
10
9
  atr = if ARGV.length == 2
11
10
  t.application.top_level_tasks.pop
12
11
  end
13
- sio = StringIO.new
14
- sep = "\n" + ' '*27
15
- fmt = "%23s => %s"
16
12
 
17
- if atr
18
- PP.pp(PROJ.send(atr.to_sym), sio, 49)
19
- sio.seek 0
20
- val = sio.read
21
- val = val.split("\n").join(sep)
22
-
23
- puts fmt % [atr, val]
24
- else
25
- h = PROJ.instance_variable_get(:@table)
26
- h.keys.map {|k| k.to_s}.sort.each do |k|
27
- sio.truncate 0
28
- PP.pp(h[k.to_sym], sio, 49)
29
- sio.seek 0
30
- val = sio.read
31
- val = val.split("\n").join(sep)
32
-
33
- puts fmt % [k, val]
34
- end
35
- end
13
+ if atr then Bones::Debug.show_attr(PROJ, atr)
14
+ else Bones::Debug.show PROJ end
36
15
  end
37
16
 
38
17
  end # namespace :bones
39
18
 
19
+ end # HAVE_BONES
20
+
40
21
  # EOF
@@ -4,84 +4,86 @@ require 'rake/gempackagetask'
4
4
 
5
5
  namespace :gem do
6
6
 
7
- PROJ.spec = Gem::Specification.new do |s|
7
+ PROJ.gem._spec = Gem::Specification.new do |s|
8
8
  s.name = PROJ.name
9
9
  s.version = PROJ.version
10
10
  s.summary = PROJ.summary
11
11
  s.authors = Array(PROJ.authors)
12
12
  s.email = PROJ.email
13
13
  s.homepage = Array(PROJ.url).first
14
- s.rubyforge_project = PROJ.rubyforge_name
15
- s.post_install_message = PROJ.post_install_message
14
+ s.rubyforge_project = PROJ.rubyforge.name
16
15
 
17
16
  s.description = PROJ.description
18
17
 
19
- PROJ.dependencies.each do |dep|
18
+ PROJ.gem.dependencies.each do |dep|
20
19
  s.add_dependency(*dep)
21
20
  end
22
21
 
23
- s.files = PROJ.files
24
- s.executables = PROJ.executables.map {|fn| File.basename(fn)}
25
- s.extensions = PROJ.files.grep %r/extconf\.rb$/
22
+ s.files = PROJ.gem.files
23
+ s.executables = PROJ.gem.executables.map {|fn| File.basename(fn)}
24
+ s.extensions = PROJ.gem.files.grep %r/extconf\.rb$/
26
25
 
27
26
  s.bindir = 'bin'
28
27
  dirs = Dir["{#{PROJ.libs.join(',')}}"]
29
28
  s.require_paths = dirs unless dirs.empty?
30
29
 
31
- incl = Regexp.new(PROJ.rdoc_include.join('|'))
32
- excl = PROJ.rdoc_exclude.dup.concat %w[\.rb$ ^(\.\/|\/)?ext]
30
+ incl = Regexp.new(PROJ.rdoc.include.join('|'))
31
+ excl = PROJ.rdoc.exclude.dup.concat %w[\.rb$ ^(\.\/|\/)?ext]
33
32
  excl = Regexp.new(excl.join('|'))
34
- rdoc_files = PROJ.files.find_all do |fn|
33
+ rdoc_files = PROJ.gem.files.find_all do |fn|
35
34
  case fn
36
35
  when excl; false
37
36
  when incl; true
38
37
  else false end
39
38
  end
40
- s.rdoc_options = PROJ.rdoc_opts + ['--main', PROJ.rdoc_main]
39
+ s.rdoc_options = PROJ.rdoc.opts + ['--main', PROJ.rdoc.main]
41
40
  s.extra_rdoc_files = rdoc_files
42
41
  s.has_rdoc = true
43
42
 
44
- if test ?f, PROJ.test_file
45
- s.test_file = PROJ.test_file
43
+ if test ?f, PROJ.test.file
44
+ s.test_file = PROJ.test.file
46
45
  else
47
- s.test_files = PROJ.tests.to_a
46
+ s.test_files = PROJ.test.files.to_a
48
47
  end
49
48
 
50
49
  # Do any extra stuff the user wants
51
- # spec_extras.each do |msg, val|
52
- # case val
53
- # when Proc
54
- # val.call(s.send(msg))
55
- # else
56
- # s.send "#{msg}=", val
57
- # end
58
- # end
59
- end
50
+ PROJ.gem.extras.each do |msg, val|
51
+ case val
52
+ when Proc
53
+ val.call(s.send(msg))
54
+ else
55
+ s.send "#{msg}=", val
56
+ end
57
+ end
58
+ end # Gem::Specification.new
59
+
60
+ # A prerequisites task that all other tasks depend upon
61
+ task :prereqs
60
62
 
61
63
  desc 'Show information about the gem'
62
- task :debug do
63
- puts PROJ.spec.to_ruby
64
+ task :debug => 'gem:prereqs' do
65
+ puts PROJ.gem._spec.to_ruby
64
66
  end
65
67
 
66
68
  pkg = Rake::PackageTask.new(PROJ.name, PROJ.version) do |pkg|
67
- pkg.need_tar = PROJ.need_tar
68
- pkg.need_zip = PROJ.need_zip
69
- pkg.package_files += PROJ.spec.files
69
+ pkg.need_tar = PROJ.gem.need_tar
70
+ pkg.need_zip = PROJ.gem.need_zip
71
+ pkg.package_files += PROJ.gem._spec.files
70
72
  end
71
73
  Rake::Task['gem:package'].instance_variable_set(:@full_comment, nil)
72
74
 
73
- gem_file = if PROJ.spec.platform == Gem::Platform::RUBY
75
+ gem_file = if PROJ.gem._spec.platform == Gem::Platform::RUBY
74
76
  "#{pkg.package_name}.gem"
75
77
  else
76
- "#{pkg.package_name}-#{PROJ.spec.platform}.gem"
78
+ "#{pkg.package_name}-#{PROJ.gem._spec.platform}.gem"
77
79
  end
78
80
 
79
81
  desc "Build the gem file #{gem_file}"
80
- task :package => "#{pkg.package_dir}/#{gem_file}"
82
+ task :package => ['gem:prereqs', "#{pkg.package_dir}/#{gem_file}"]
81
83
 
82
- file "#{pkg.package_dir}/#{gem_file}" => [pkg.package_dir] + PROJ.spec.files do
84
+ file "#{pkg.package_dir}/#{gem_file}" => [pkg.package_dir] + PROJ.gem._spec.files do
83
85
  when_writing("Creating GEM") {
84
- Gem::Builder.new(PROJ.spec).build
86
+ Gem::Builder.new(PROJ.gem._spec).build
85
87
  verbose(true) {
86
88
  mv gem_file, "#{pkg.package_dir}/#{gem_file}"
87
89
  }
@@ -90,14 +92,14 @@ namespace :gem do
90
92
 
91
93
  desc 'Install the gem'
92
94
  task :install => [:clobber, :package] do
93
- sh "#{SUDO} #{GEM} install pkg/#{PROJ.spec.full_name}"
95
+ sh "#{SUDO} #{GEM} install --no-update-sources pkg/#{PROJ.gem._spec.full_name}"
94
96
  end
95
97
 
96
98
  desc 'Uninstall the gem'
97
99
  task :uninstall do
98
100
  installed_list = Gem.source_index.find_name(PROJ.name)
99
101
  if installed_list and installed_list.collect { |s| s.version.to_s}.include?(PROJ.version) then
100
- sh "#{SUDO} #{GEM} uninstall -v '#{PROJ.version}' -i -x #{PROJ.name}"
102
+ sh "#{SUDO} #{GEM} uninstall -v '#{PROJ.version}' -I -x #{PROJ.name}"
101
103
  end
102
104
  end
103
105