bones 3.3.0 → 3.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -0
- data/README.rdoc +1 -1
- data/Rakefile +0 -1
- data/default/Rakefile.bns +2 -7
- data/default/lib/NAME.rb.bns +1 -2
- data/default/version.txt +1 -0
- data/lib/bones.rb +28 -5
- data/lib/bones/app.rb +2 -2
- data/lib/bones/app/command.rb +1 -1
- data/lib/bones/app/freeze.rb +1 -1
- data/lib/bones/plugins/bones_plugin.rb +7 -1
- data/lib/bones/plugins/gem.rb +17 -2
- data/spec/bones/app_spec.rb +2 -2
- data/version.txt +1 -0
- metadata +65 -30
data/History.txt
CHANGED
data/README.rdoc
CHANGED
@@ -96,7 +96,7 @@ Howard for letting me squat in the codeforpeople rubyforge project.
|
|
96
96
|
== LICENSE:
|
97
97
|
|
98
98
|
MIT License
|
99
|
-
Copyright (c) 2007 -
|
99
|
+
Copyright (c) 2007 - 2010
|
100
100
|
|
101
101
|
Permission is hereby granted, free of charge, to any person obtaining
|
102
102
|
a copy of this software and associated documentation files (the
|
data/Rakefile
CHANGED
data/default/Rakefile.bns
CHANGED
@@ -5,18 +5,13 @@ rescue LoadError
|
|
5
5
|
abort '### Please install the "bones" gem ###'
|
6
6
|
end
|
7
7
|
|
8
|
-
ensure_in_path 'lib'
|
9
|
-
require '<%= name %>'
|
10
|
-
|
11
8
|
task :default => 'test:run'
|
12
9
|
task 'gem:release' => 'test:run'
|
13
10
|
|
14
11
|
Bones {
|
15
12
|
name '<%= name %>'
|
16
13
|
authors 'FIXME (who is writing this software)'
|
17
|
-
email
|
18
|
-
url
|
19
|
-
version <%= classname %>::VERSION
|
14
|
+
email 'FIXME (your e-mail)'
|
15
|
+
url 'FIXME (project homepage)'
|
20
16
|
}
|
21
17
|
|
22
|
-
# EOF
|
data/default/lib/NAME.rb.bns
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
module <%= classname %>
|
3
3
|
|
4
4
|
# :stopdoc:
|
5
|
-
VERSION = '1.0.0'
|
6
5
|
LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
|
7
6
|
PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
|
8
7
|
# :startdoc:
|
@@ -10,7 +9,7 @@ module <%= classname %>
|
|
10
9
|
# Returns the version string for the library.
|
11
10
|
#
|
12
11
|
def self.version
|
13
|
-
|
12
|
+
@version ||= File.read(path('version.txt')).strip
|
14
13
|
end
|
15
14
|
|
16
15
|
# Returns the library path for the module. If any arguments are given,
|
data/default/version.txt
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.0
|
data/lib/bones.rb
CHANGED
@@ -12,7 +12,6 @@ module Bones
|
|
12
12
|
extend LittlePlugger
|
13
13
|
|
14
14
|
# :stopdoc:
|
15
|
-
VERSION = '3.3.0'
|
16
15
|
PATH = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
17
16
|
LIBPATH = File.expand_path(File.join(PATH, 'lib'))
|
18
17
|
HOME = File.expand_path(ENV['HOME'] || ENV['USERPROFILE'])
|
@@ -24,18 +23,42 @@ module Bones
|
|
24
23
|
module Plugins; end
|
25
24
|
# :startdoc:
|
26
25
|
|
26
|
+
# Returns the version of the Mr Bones library.
|
27
|
+
#
|
28
|
+
def self.version
|
29
|
+
@version ||= File.read(path('version.txt')).strip
|
30
|
+
end
|
31
|
+
|
27
32
|
# Returns the path for Mr Bones. If any arguments are given,
|
28
33
|
# they will be joined to the end of the path using <tt>File.join</tt>.
|
29
34
|
#
|
30
|
-
def self.path( *args )
|
31
|
-
args.empty? ? PATH : File.join(PATH, args.flatten)
|
35
|
+
def self.path( *args, &block )
|
36
|
+
rv = args.empty? ? PATH : ::File.join(PATH, args.flatten)
|
37
|
+
if block
|
38
|
+
begin
|
39
|
+
$LOAD_PATH.unshift PATH
|
40
|
+
rv = block.call
|
41
|
+
ensure
|
42
|
+
$LOAD_PATH.shift
|
43
|
+
end
|
44
|
+
end
|
45
|
+
return rv
|
32
46
|
end
|
33
47
|
|
34
48
|
# Returns the lib path for Mr Bones. If any arguments are given,
|
35
49
|
# they will be joined to the end of the path using <tt>File.join</tt>.
|
36
50
|
#
|
37
|
-
def self.libpath( *args )
|
38
|
-
args.empty? ? LIBPATH : File.join(LIBPATH, args.flatten)
|
51
|
+
def self.libpath( *args, &block )
|
52
|
+
rv = args.empty? ? LIBPATH : ::File.join(LIBPATH, args.flatten)
|
53
|
+
if block
|
54
|
+
begin
|
55
|
+
$LOAD_PATH.unshift LIBPATH
|
56
|
+
rv = block.call
|
57
|
+
ensure
|
58
|
+
$LOAD_PATH.shift
|
59
|
+
end
|
60
|
+
end
|
61
|
+
return rv
|
39
62
|
end
|
40
63
|
|
41
64
|
# call-seq:
|
data/lib/bones/app.rb
CHANGED
@@ -47,7 +47,7 @@ module Bones::App
|
|
47
47
|
when nil, '-h', '--help'
|
48
48
|
help
|
49
49
|
when '-v', '--version'
|
50
|
-
stdout.puts "Mr Bones v#{::Bones
|
50
|
+
stdout.puts "Mr Bones v#{::Bones.version}"
|
51
51
|
else
|
52
52
|
raise Error, "Unknown command #{cmd_str.inspect}"
|
53
53
|
end
|
@@ -72,7 +72,7 @@ module Bones::App
|
|
72
72
|
def help
|
73
73
|
msg = <<-MSG
|
74
74
|
NAME
|
75
|
-
bones v#{::Bones
|
75
|
+
bones v#{::Bones.version}
|
76
76
|
|
77
77
|
DESCRIPTION
|
78
78
|
Mr Bones is a handy tool that builds a skeleton for your new Ruby
|
data/lib/bones/app/command.rb
CHANGED
data/lib/bones/app/freeze.rb
CHANGED
@@ -56,7 +56,7 @@ module Bones::Plugins::BonesPlugin
|
|
56
56
|
to your gem on gemcutter.org (soon to be rubygems.org).
|
57
57
|
__
|
58
58
|
|
59
|
-
version
|
59
|
+
version nil, :desc => <<-__
|
60
60
|
Version number to use when creating the gem. This can be set either
|
61
61
|
in the Rakefile or on the command line by setting the VERSION flag to
|
62
62
|
the desired value.
|
@@ -147,6 +147,12 @@ module Bones::Plugins::BonesPlugin
|
|
147
147
|
config.description ||= paragraphs_of(config.readme_file, 'description').join("\n\n")
|
148
148
|
config.summary ||= config.description.split('.').first
|
149
149
|
|
150
|
+
config.version ||= ENV['VERSION']
|
151
|
+
if test(?f, 'version.txt') and !config.version
|
152
|
+
config.version = File.read('version.txt').strip
|
153
|
+
end
|
154
|
+
config.version ||= '0.0.0'
|
155
|
+
|
150
156
|
if config.libs.empty?
|
151
157
|
%w(lib ext).each { |dir| config.libs << dir if test ?d, dir }
|
152
158
|
end
|
data/lib/bones/plugins/gem.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
|
2
|
+
require 'rubygems/dependency_installer'
|
3
|
+
|
2
4
|
module Bones::Plugins::Gem
|
3
5
|
include ::Bones::Helpers
|
4
6
|
extend self
|
@@ -98,7 +100,7 @@ module Bones::Plugins::Gem
|
|
98
100
|
|
99
101
|
config.gem.files ||= manifest
|
100
102
|
config.gem.executables ||= config.gem.files.find_all {|fn| fn =~ %r/^bin/}
|
101
|
-
config.gem.development_dependencies << ['bones', ">= #{Bones
|
103
|
+
config.gem.development_dependencies << ['bones', ">= #{Bones.version}"]
|
102
104
|
|
103
105
|
have?(:gemcutter) {
|
104
106
|
Gem.searcher.instance_variable_get(:@gemspecs).
|
@@ -223,8 +225,21 @@ module Bones::Plugins::Gem
|
|
223
225
|
task :cleanup do
|
224
226
|
sh "#{SUDO} #{GEM} cleanup #{config.gem._spec.name}"
|
225
227
|
end
|
226
|
-
end # namespace :gem
|
227
228
|
|
229
|
+
desc 'Install gem dependencies'
|
230
|
+
task :install_dependencies => 'gem:prereqs' do
|
231
|
+
installer = Gem::DependencyInstaller.new
|
232
|
+
config.gem._spec.dependencies.each {|dep|
|
233
|
+
next if Gem.available? dep
|
234
|
+
|
235
|
+
$stdout.puts "Installing #{dep.name}"
|
236
|
+
installer.install dep
|
237
|
+
installer.installed_gems.each {|spec|
|
238
|
+
$stdout.puts "Successfully installed #{spec.full_name}"
|
239
|
+
}
|
240
|
+
}
|
241
|
+
end
|
242
|
+
end # namespace :gem
|
228
243
|
|
229
244
|
desc 'Alias to gem:package'
|
230
245
|
task :gem => 'gem:package'
|
data/spec/bones/app_spec.rb
CHANGED
@@ -81,11 +81,11 @@ describe Bones::App do
|
|
81
81
|
|
82
82
|
it 'should report a version number' do
|
83
83
|
@app.run %w[--version]
|
84
|
-
@out.readline.should == "Mr Bones v#{Bones
|
84
|
+
@out.readline.should == "Mr Bones v#{Bones.version}"
|
85
85
|
@out.clear
|
86
86
|
|
87
87
|
@app.run %w[-v]
|
88
|
-
@out.readline.should == "Mr Bones v#{Bones
|
88
|
+
@out.readline.should == "Mr Bones v#{Bones.version}"
|
89
89
|
end
|
90
90
|
|
91
91
|
end # describe Bones::App
|
data/version.txt
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.4.0
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bones
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 3
|
7
|
+
- 4
|
8
|
+
- 0
|
9
|
+
version: 3.4.0
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Tim Pease
|
@@ -9,69 +14,93 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-03-
|
17
|
+
date: 2010-03-10 00:00:00 -07:00
|
13
18
|
default_executable:
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: rake
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
24
|
requirements:
|
21
25
|
- - ">="
|
22
26
|
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
- 8
|
30
|
+
- 7
|
23
31
|
version: 0.8.7
|
24
|
-
|
32
|
+
type: :runtime
|
33
|
+
version_requirements: *id001
|
25
34
|
- !ruby/object:Gem::Dependency
|
26
35
|
name: little-plugger
|
27
|
-
|
28
|
-
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
38
|
requirements:
|
31
39
|
- - ">="
|
32
40
|
- !ruby/object:Gem::Version
|
41
|
+
segments:
|
42
|
+
- 1
|
43
|
+
- 1
|
44
|
+
- 2
|
33
45
|
version: 1.1.2
|
34
|
-
|
46
|
+
type: :runtime
|
47
|
+
version_requirements: *id002
|
35
48
|
- !ruby/object:Gem::Dependency
|
36
49
|
name: loquacious
|
37
|
-
|
38
|
-
|
39
|
-
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
prerelease: false
|
51
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
40
52
|
requirements:
|
41
53
|
- - ">="
|
42
54
|
- !ruby/object:Gem::Version
|
55
|
+
segments:
|
56
|
+
- 1
|
57
|
+
- 4
|
58
|
+
- 2
|
43
59
|
version: 1.4.2
|
44
|
-
|
60
|
+
type: :runtime
|
61
|
+
version_requirements: *id003
|
45
62
|
- !ruby/object:Gem::Dependency
|
46
63
|
name: rspec
|
47
|
-
|
48
|
-
|
49
|
-
version_requirements: !ruby/object:Gem::Requirement
|
64
|
+
prerelease: false
|
65
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
50
66
|
requirements:
|
51
67
|
- - ">="
|
52
68
|
- !ruby/object:Gem::Version
|
53
|
-
|
54
|
-
|
69
|
+
segments:
|
70
|
+
- 1
|
71
|
+
- 3
|
72
|
+
- 0
|
73
|
+
version: 1.3.0
|
74
|
+
type: :development
|
75
|
+
version_requirements: *id004
|
55
76
|
- !ruby/object:Gem::Dependency
|
56
77
|
name: bones-git
|
57
|
-
|
58
|
-
|
59
|
-
version_requirements: !ruby/object:Gem::Requirement
|
78
|
+
prerelease: false
|
79
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
60
80
|
requirements:
|
61
81
|
- - ">="
|
62
82
|
- !ruby/object:Gem::Version
|
83
|
+
segments:
|
84
|
+
- 1
|
85
|
+
- 1
|
86
|
+
- 1
|
63
87
|
version: 1.1.1
|
64
|
-
|
88
|
+
type: :development
|
89
|
+
version_requirements: *id005
|
65
90
|
- !ruby/object:Gem::Dependency
|
66
91
|
name: bones-extras
|
67
|
-
|
68
|
-
|
69
|
-
version_requirements: !ruby/object:Gem::Requirement
|
92
|
+
prerelease: false
|
93
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
70
94
|
requirements:
|
71
95
|
- - ">="
|
72
96
|
- !ruby/object:Gem::Version
|
97
|
+
segments:
|
98
|
+
- 1
|
99
|
+
- 2
|
100
|
+
- 2
|
73
101
|
version: 1.2.2
|
74
|
-
|
102
|
+
type: :development
|
103
|
+
version_requirements: *id006
|
75
104
|
description: |-
|
76
105
|
Mr Bones is a handy tool that creates new Ruby projects from a code
|
77
106
|
skeleton. The skeleton contains some starter code and a collection of rake
|
@@ -87,7 +116,9 @@ extra_rdoc_files:
|
|
87
116
|
- History.txt
|
88
117
|
- README.rdoc
|
89
118
|
- bin/bones
|
119
|
+
- default/version.txt
|
90
120
|
- spec/data/foo/README.txt
|
121
|
+
- version.txt
|
91
122
|
files:
|
92
123
|
- .autotest
|
93
124
|
- History.txt
|
@@ -103,6 +134,7 @@ files:
|
|
103
134
|
- default/spec/NAME_spec.rb.bns
|
104
135
|
- default/spec/spec_helper.rb.bns
|
105
136
|
- default/test/test_NAME.rb
|
137
|
+
- default/version.txt
|
106
138
|
- lib/bones.rb
|
107
139
|
- lib/bones/annotation_extractor.rb
|
108
140
|
- lib/bones/app.rb
|
@@ -135,6 +167,7 @@ files:
|
|
135
167
|
- spec/data/foo/README.txt
|
136
168
|
- spec/data/foo/Rakefile
|
137
169
|
- spec/spec_helper.rb
|
170
|
+
- version.txt
|
138
171
|
has_rdoc: true
|
139
172
|
homepage: http://gemcutter.org/gems/bones
|
140
173
|
licenses: []
|
@@ -153,18 +186,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
153
186
|
requirements:
|
154
187
|
- - ">="
|
155
188
|
- !ruby/object:Gem::Version
|
189
|
+
segments:
|
190
|
+
- 0
|
156
191
|
version: "0"
|
157
|
-
version:
|
158
192
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
159
193
|
requirements:
|
160
194
|
- - ">="
|
161
195
|
- !ruby/object:Gem::Version
|
196
|
+
segments:
|
197
|
+
- 0
|
162
198
|
version: "0"
|
163
|
-
version:
|
164
199
|
requirements: []
|
165
200
|
|
166
201
|
rubyforge_project: codeforpeople
|
167
|
-
rubygems_version: 1.3.
|
202
|
+
rubygems_version: 1.3.6
|
168
203
|
signing_key:
|
169
204
|
specification_version: 3
|
170
205
|
summary: Mr Bones is a handy tool that creates new Ruby projects from a code skeleton
|