bones 1.3.4 → 1.3.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,12 @@
1
+ == 1.3.5 / 2008-02
2
+
3
+ * 2 minor enhancements
4
+ - Added a bones:debug task to inspect the PROJ open struct or
5
+ a single attribute of the PROJ open struct
6
+ - Small adjustments to the gem and spec tasks
7
+ * 1 bug fix
8
+ - Project names can now contain dahes (my-proj)
9
+
1
10
  == 1.3.4 / 2008-02-20
2
11
 
3
12
  * 4 minor enhancements
@@ -13,6 +13,7 @@ data/spec/NAME_spec.rb.erb
13
13
  data/spec/spec_helper.rb.erb
14
14
  data/tasks/ann.rake
15
15
  data/tasks/annotations.rake
16
+ data/tasks/bones.rake
16
17
  data/tasks/doc.rake
17
18
  data/tasks/gem.rake
18
19
  data/tasks/manifest.rake
@@ -29,6 +30,7 @@ lib/bones/main.rb
29
30
  lib/bones/smtp_tls.rb
30
31
  tasks/ann.rake
31
32
  tasks/annotations.rake
33
+ tasks/bones.rake
32
34
  tasks/doc.rake
33
35
  tasks/gem.rake
34
36
  tasks/manifest.rake
data/README.txt CHANGED
@@ -17,6 +17,7 @@ Mr Bones provides the following rake tasks:
17
17
  ann # Alias to ann:announcement
18
18
  ann:announcement # Create an announcement file
19
19
  ann:email # Send an email announcement
20
+ bones:debug # Show the PROJ open struct
20
21
  clean # Remove any temporary products.
21
22
  clobber # Remove any generated file.
22
23
  doc # Alias to doc:rdoc
data/Rakefile CHANGED
@@ -1,4 +1,4 @@
1
- # $Id: Rakefile 547 2008-02-20 20:30:47Z tim_pease $
1
+ # $Id: Rakefile 562 2008-02-28 04:36:33Z tim_pease $
2
2
 
3
3
  $:.unshift('lib')
4
4
 
@@ -12,7 +12,7 @@ PROJ.url = 'http://codeforpeople.rubyforge.org/bones'
12
12
  PROJ.rubyforge_name = 'codeforpeople'
13
13
  PROJ.rdoc_remote_dir = 'bones'
14
14
  PROJ.version = Bones::VERSION
15
- PROJ.release_name = 'Finite State Puppy'
15
+ PROJ.release_name = 'Skeletor'
16
16
 
17
17
  PROJ.rdoc_exclude << '^data/'
18
18
  PROJ.annotation_exclude = %w(^README\.txt$ ^data/ ^tasks/setup.rb$)
@@ -33,17 +33,13 @@ PROJ.ann_paragraphs = %w[install synopsis features requirements]
33
33
  PROJ.ann_text = <<-ANN
34
34
  == FUN FACT
35
35
 
36
- A 'jiffy' is an actual unit of time for 1/100th of a second.
36
+ 90% of New York City cab drivers are recently arrived immigrants.
37
37
 
38
38
  == POST SCRIPT
39
39
 
40
40
  Blessings,
41
41
  TwP
42
42
 
43
- == POST POST SCRIPT
44
-
45
- The "Finite State Puppy" is the only known pet that is Touring complete.
46
-
47
43
  #{PROJ.post_install_message}
48
44
  ANN
49
45
 
@@ -52,4 +48,6 @@ task 'gem:package' => 'manifest:assert'
52
48
  task(:titlize) {PROJ.name = 'Mr Bones'}
53
49
  task 'ann:announcement' => :titlize
54
50
 
51
+ depend_on 'rake'
52
+
55
53
  # EOF
@@ -0,0 +1,40 @@
1
+ # $Id$
2
+
3
+ require 'pp'
4
+ require 'stringio'
5
+
6
+ namespace :bones do
7
+
8
+ desc 'Show the PROJ open struct'
9
+ task :debug do |t|
10
+ atr = if ARGV.length == 2
11
+ t.application.top_level_tasks.pop
12
+ end
13
+ sio = StringIO.new
14
+ sep = "\n" + ' '*27
15
+ fmt = "%23s => %s"
16
+
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
36
+ end
37
+
38
+ end # namespace :bones
39
+
40
+ # EOF
@@ -95,9 +95,15 @@ namespace :gem do
95
95
 
96
96
  desc 'Uninstall the gem'
97
97
  task :uninstall do
98
- sh "#{SUDO} #{GEM} uninstall -v '#{PROJ.version}' -x #{PROJ.name}"
98
+ installed_list = Gem.source_index.find_name(PROJ.name)
99
+ 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}"
101
+ end
99
102
  end
100
103
 
104
+ desc 'Reinstall the gem'
105
+ task :reinstall => [:uninstall, :install]
106
+
101
107
  end # namespace :gem
102
108
 
103
109
  desc 'Alias to gem:package'
@@ -6,6 +6,12 @@
6
6
  PROJ.rdoc_exclude << "^#{Regexp.escape(PROJ.manifest_file)}$"
7
7
  PROJ.exclude << "^#{Regexp.escape(PROJ.ann_file)}$"
8
8
 
9
+ PROJ.instance_variable_get(:@table).each do |key,val|
10
+ next unless val.instance_of? Array
11
+ next if key == :dependencies
12
+ val.flatten!
13
+ end
14
+
9
15
  PROJ.changes ||= paragraphs_of(PROJ.history_file, 0..1).join("\n\n")
10
16
 
11
17
  PROJ.description ||= paragraphs_of(PROJ.readme_file, 'description').join("\n\n")
@@ -34,7 +34,7 @@ PROJ.test_opts = []
34
34
 
35
35
  # Rcov
36
36
  PROJ.rcov_dir = 'coverage'
37
- PROJ.rcov_opts = ['--sort', 'coverage', '-T']
37
+ PROJ.rcov_opts = %w[--sort coverage -T]
38
38
  PROJ.rcov_threshold = 90.0
39
39
  PROJ.rcov_threshold_exact = false
40
40
 
@@ -38,6 +38,8 @@ namespace :spec do
38
38
  t.index_html = File.join(PROJ.rcov_dir, 'index.html')
39
39
  t.require_exact_threshold = PROJ.rcov_threshold_exact
40
40
  end
41
+
42
+ task :verify => :rcov
41
43
  end
42
44
 
43
45
  end # namespace :spec
@@ -1,9 +1,9 @@
1
- # $Id: bones.rb 542 2008-02-20 00:03:45Z tim_pease $
1
+ # $Id: bones.rb 558 2008-02-27 19:46:32Z tim_pease $
2
2
 
3
3
  module Bones
4
4
 
5
5
  # :stopdoc:
6
- VERSION = '1.3.4'
6
+ VERSION = '1.3.5'
7
7
  PATH = File.expand_path(File.join(File.dirname(__FILE__), '..'))
8
8
  WIN32 = %r/win32/ =~ RUBY_PLATFORM
9
9
  DEV_NULL = WIN32 ? 'NUL:' : '/dev/null'
@@ -1,4 +1,4 @@
1
- # $Id: main.rb 543 2008-02-20 04:36:46Z tim_pease $
1
+ # $Id: main.rb 561 2008-02-27 23:28:19Z tim_pease $
2
2
 
3
3
  require 'fileutils'
4
4
  require 'optparse'
@@ -39,7 +39,8 @@ class Main
39
39
  opts.on('-v', '--verbose',
40
40
  'enable verbose output') {self.verbose = true}
41
41
  opts.on('-d', '--directory DIRECTORY', String,
42
- 'project directory to create') {|dir| self.output_dir = dir}
42
+ 'project directory to create',
43
+ '(defaults to project_name)') {|dir| self.output_dir = dir}
43
44
 
44
45
  opts.separator ''
45
46
  opts.on('--freeze', 'freeze the project skeleton') {freeze; exit}
@@ -85,7 +86,7 @@ class Main
85
86
  # name.
86
87
  #
87
88
  def classname
88
- name.split('_').map {|x| x.capitalize}.join
89
+ name.tr('-','_').split('_').map {|x| x.capitalize}.join
89
90
  end
90
91
 
91
92
  # Create a new project from the bones/data project template.
@@ -0,0 +1,40 @@
1
+ # $Id$
2
+
3
+ require 'pp'
4
+ require 'stringio'
5
+
6
+ namespace :bones do
7
+
8
+ desc 'Show the PROJ open struct'
9
+ task :debug do |t|
10
+ atr = if ARGV.length == 2
11
+ t.application.top_level_tasks.pop
12
+ end
13
+ sio = StringIO.new
14
+ sep = "\n" + ' '*27
15
+ fmt = "%23s => %s"
16
+
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
36
+ end
37
+
38
+ end # namespace :bones
39
+
40
+ # EOF
@@ -95,9 +95,15 @@ namespace :gem do
95
95
 
96
96
  desc 'Uninstall the gem'
97
97
  task :uninstall do
98
- sh "#{SUDO} #{GEM} uninstall -v '#{PROJ.version}' -x #{PROJ.name}"
98
+ installed_list = Gem.source_index.find_name(PROJ.name)
99
+ 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}"
101
+ end
99
102
  end
100
103
 
104
+ desc 'Reinstall the gem'
105
+ task :reinstall => [:uninstall, :install]
106
+
101
107
  end # namespace :gem
102
108
 
103
109
  desc 'Alias to gem:package'
@@ -6,6 +6,12 @@
6
6
  PROJ.rdoc_exclude << "^#{Regexp.escape(PROJ.manifest_file)}$"
7
7
  PROJ.exclude << "^#{Regexp.escape(PROJ.ann_file)}$"
8
8
 
9
+ PROJ.instance_variable_get(:@table).each do |key,val|
10
+ next unless val.instance_of? Array
11
+ next if key == :dependencies
12
+ val.flatten!
13
+ end
14
+
9
15
  PROJ.changes ||= paragraphs_of(PROJ.history_file, 0..1).join("\n\n")
10
16
 
11
17
  PROJ.description ||= paragraphs_of(PROJ.readme_file, 'description').join("\n\n")
@@ -34,7 +34,7 @@ PROJ.test_opts = []
34
34
 
35
35
  # Rcov
36
36
  PROJ.rcov_dir = 'coverage'
37
- PROJ.rcov_opts = ['--sort', 'coverage', '-T']
37
+ PROJ.rcov_opts = %w[--sort coverage -T]
38
38
  PROJ.rcov_threshold = 90.0
39
39
  PROJ.rcov_threshold_exact = false
40
40
 
@@ -38,6 +38,8 @@ namespace :spec do
38
38
  t.index_html = File.join(PROJ.rcov_dir, 'index.html')
39
39
  t.require_exact_threshold = PROJ.rcov_threshold_exact
40
40
  end
41
+
42
+ task :verify => :rcov
41
43
  end
42
44
 
43
45
  end # namespace :spec
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bones
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 1.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Pease
@@ -9,10 +9,18 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-02-21 00:00:00 -07:00
12
+ date: 2008-02-27 00:00:00 -07:00
13
13
  default_executable:
14
- dependencies: []
15
-
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rake
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 0.8.1
23
+ version:
16
24
  description: Mr Bones is a handy tool that builds a skeleton for your new Ruby projects. The skeleton contains some starter code and a collection of rake tasks to ease the management and deployment of your source code. Mr Bones is not viral -- all the code your project needs is included in the skeleton (no gem dependency required).
17
25
  email: tim.pease@gmail.com
18
26
  executables:
@@ -39,6 +47,7 @@ files:
39
47
  - data/spec/spec_helper.rb.erb
40
48
  - data/tasks/ann.rake
41
49
  - data/tasks/annotations.rake
50
+ - data/tasks/bones.rake
42
51
  - data/tasks/doc.rake
43
52
  - data/tasks/gem.rake
44
53
  - data/tasks/manifest.rake
@@ -55,6 +64,7 @@ files:
55
64
  - lib/bones/smtp_tls.rb
56
65
  - tasks/ann.rake
57
66
  - tasks/annotations.rake
67
+ - tasks/bones.rake
58
68
  - tasks/doc.rake
59
69
  - tasks/gem.rake
60
70
  - tasks/manifest.rake