bones 2.4.0 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ == 2.4.1 / 2009-03-02
2
+
3
+ * 1 minor enhancement
4
+ - jruby 1.2 compatability
5
+
1
6
  == 2.4.0 / 2009-02-01
2
7
 
3
8
  * 1 minor enhancement
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ PROJ.authors = 'Tim Pease'
9
9
  PROJ.email = 'tim.pease@gmail.com'
10
10
  PROJ.url = 'http://codeforpeople.rubyforge.org/bones'
11
11
  PROJ.version = Bones::VERSION
12
- PROJ.release_name = 'Zygomatic'
12
+ PROJ.release_name = 'Lacrimal'
13
13
  PROJ.ruby_opts = %w[-W0]
14
14
  PROJ.readme_file = 'README.rdoc'
15
15
  PROJ.ignore_file = '.gitignore'
data/lib/bones.rb CHANGED
@@ -1,11 +1,17 @@
1
1
 
2
+ require 'rbconfig'
3
+
2
4
  module Bones
3
5
 
4
6
  # :stopdoc:
5
- VERSION = '2.4.0'
7
+ VERSION = '2.4.1'
6
8
  PATH = File.expand_path(File.join(File.dirname(__FILE__), '..'))
7
- WIN32 = %r/win32/ =~ RUBY_PLATFORM
8
- DEV_NULL = WIN32 ? 'NUL:' : '/dev/null'
9
+ HOME = File.expand_path(ENV['HOME'] || ENV['USERPROFILE'])
10
+ DEV_NULL = File.exist?('/dev/null') ? '/dev/null' : 'NUL:'
11
+
12
+ # Ruby Interpreter location - taken from Rake source code
13
+ RUBY = File.join(Config::CONFIG['bindir'],
14
+ Config::CONFIG['ruby_install_name']).sub(/.*\s.*/m, '"\&"')
9
15
  # :startdoc:
10
16
 
11
17
  # Returns the path for Mr Bones. If any arguments are given,
@@ -48,7 +54,7 @@ module Bones
48
54
  load bones_setup
49
55
 
50
56
  rakefiles = Dir.glob(File.join(Dir.pwd, %w[tasks *.rake])).sort
51
- import(*rakefiles)
57
+ import(*rakefiles) unless rakefiles.empty?
52
58
  end
53
59
 
54
60
  # TODO: fix file lists for Test::Unit and RSpec
@@ -81,8 +81,7 @@ class Command
81
81
  def mrbones_dir
82
82
  return @mrbones_dir if defined? @mrbones_dir
83
83
 
84
- path = (::Bones::WIN32 ? ENV['HOMEPATH'].tr("\\", "/") : ENV['HOME'])
85
- path = File.join(path, '.mrbones')
84
+ path = File.join(::Bones::HOME, '.mrbones')
86
85
  @mrbones_dir = File.expand_path(path)
87
86
  end
88
87
 
@@ -30,7 +30,7 @@ class CreateCommand < Command
30
30
  begin
31
31
  FileUtils.cd output_dir
32
32
  @out.puts "Now you need to fix these files"
33
- system "rake notes"
33
+ system "#{::Bones::RUBY} -S rake notes"
34
34
  ensure
35
35
  FileUtils.cd pwd
36
36
  end
data/lib/bones/debug.rb CHANGED
@@ -24,6 +24,7 @@ module Debug
24
24
 
25
25
  h = ostruct.instance_variable_get(:@table)
26
26
  h.keys.map {|k| k.to_s}.sort.each do |k|
27
+ sio.seek 0
27
28
  sio.truncate 0
28
29
  next if k =~ %r/^_/o
29
30
 
@@ -6,7 +6,7 @@ require 'fileutils'
6
6
  require 'ostruct'
7
7
  require 'find'
8
8
 
9
- class OpenStruct; undef :gem; end
9
+ class OpenStruct; undef :gem if defined? :gem; end
10
10
 
11
11
  # TODO: make my own openstruct type object that includes descriptions
12
12
  # TODO: use the descriptions to output help on the available bones options
@@ -124,9 +124,7 @@ import(*rakefiles)
124
124
  %w(lib ext).each {|dir| PROJ.libs << dir if test ?d, dir}
125
125
 
126
126
  # Setup some constants
127
- WIN32 = %r/djgpp|(cyg|ms|bcc)win|mingw/ =~ RUBY_PLATFORM unless defined? WIN32
128
-
129
- DEV_NULL = WIN32 ? 'NUL:' : '/dev/null'
127
+ DEV_NULL = File.exist?('/dev/null') ? '/dev/null' : 'NUL:'
130
128
 
131
129
  def quiet( &block )
132
130
  io = [STDOUT.dup, STDERR.dup]
@@ -139,21 +137,15 @@ ensure
139
137
  $stdout, $stderr = STDOUT, STDERR
140
138
  end
141
139
 
142
- DIFF = if WIN32 then 'diff.exe'
143
- else
144
- if quiet {system "gdiff", __FILE__, __FILE__} then 'gdiff'
145
- else 'diff' end
146
- end unless defined? DIFF
147
-
148
- SUDO = if WIN32 then ''
149
- else
150
- if quiet {system 'which sudo'} then 'sudo'
151
- else '' end
152
- end
153
-
154
- RCOV = WIN32 ? 'rcov.bat' : 'rcov'
155
- RDOC = WIN32 ? 'rdoc.bat' : 'rdoc'
156
- GEM = WIN32 ? 'gem.bat' : 'gem'
140
+ DIFF = if system("gdiff '#{__FILE__}' '#{__FILE__}' > #{DEV_NULL} 2>&1") then 'gdiff'
141
+ else 'diff' end unless defined? DIFF
142
+
143
+ SUDO = if system("which sudo > #{DEV_NULL} 2>&1") then 'sudo'
144
+ else '' end unless defined? SUDO
145
+
146
+ RCOV = "#{RUBY} -S rcov"
147
+ RDOC = "#{RUBY} -S rdoc"
148
+ GEM = "#{RUBY} -S gem"
157
149
 
158
150
  %w(rcov spec/rake/spectask rubyforge bones facets/ansicode).each do |lib|
159
151
  begin
data/tasks/setup.rb CHANGED
@@ -6,7 +6,7 @@ require 'fileutils'
6
6
  require 'ostruct'
7
7
  require 'find'
8
8
 
9
- class OpenStruct; undef :gem; end
9
+ class OpenStruct; undef :gem if defined? :gem; end
10
10
 
11
11
  # TODO: make my own openstruct type object that includes descriptions
12
12
  # TODO: use the descriptions to output help on the available bones options
@@ -124,9 +124,7 @@ import(*rakefiles)
124
124
  %w(lib ext).each {|dir| PROJ.libs << dir if test ?d, dir}
125
125
 
126
126
  # Setup some constants
127
- WIN32 = %r/djgpp|(cyg|ms|bcc)win|mingw/ =~ RUBY_PLATFORM unless defined? WIN32
128
-
129
- DEV_NULL = WIN32 ? 'NUL:' : '/dev/null'
127
+ DEV_NULL = File.exist?('/dev/null') ? '/dev/null' : 'NUL:'
130
128
 
131
129
  def quiet( &block )
132
130
  io = [STDOUT.dup, STDERR.dup]
@@ -139,21 +137,15 @@ ensure
139
137
  $stdout, $stderr = STDOUT, STDERR
140
138
  end
141
139
 
142
- DIFF = if WIN32 then 'diff.exe'
143
- else
144
- if quiet {system "gdiff", __FILE__, __FILE__} then 'gdiff'
145
- else 'diff' end
146
- end unless defined? DIFF
147
-
148
- SUDO = if WIN32 then ''
149
- else
150
- if quiet {system 'which sudo'} then 'sudo'
151
- else '' end
152
- end
153
-
154
- RCOV = WIN32 ? 'rcov.bat' : 'rcov'
155
- RDOC = WIN32 ? 'rdoc.bat' : 'rdoc'
156
- GEM = WIN32 ? 'gem.bat' : 'gem'
140
+ DIFF = if system("gdiff '#{__FILE__}' '#{__FILE__}' > #{DEV_NULL} 2>&1") then 'gdiff'
141
+ else 'diff' end unless defined? DIFF
142
+
143
+ SUDO = if system("which sudo > #{DEV_NULL} 2>&1") then 'sudo'
144
+ else '' end unless defined? SUDO
145
+
146
+ RCOV = "#{RUBY} -S rcov"
147
+ RDOC = "#{RUBY} -S rdoc"
148
+ GEM = "#{RUBY} -S gem"
157
149
 
158
150
  %w(rcov spec/rake/spectask rubyforge bones facets/ansicode).each do |lib|
159
151
  begin
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: 2.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Pease
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-01 00:00:00 -07:00
12
+ date: 2009-03-02 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency