bones 3.6.5 → 3.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +9 -0
- data/README.rdoc +2 -2
- data/Rakefile +1 -1
- data/lib/bones/helpers.rb +25 -17
- data/lib/bones/plugins/bones_plugin.rb +4 -2
- data/lib/bones/plugins/gem.rb +22 -4
- data/spec/bones/helpers_spec.rb +1 -1
- data/version.txt +1 -1
- metadata +5 -7
- data/gem-development.txt +0 -1
data/History.txt
CHANGED
data/README.rdoc
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Mr Bones
|
2
2
|
by Tim Pease
|
3
|
-
|
3
|
+
https://rubygems.org/gems/bones
|
4
4
|
|
5
5
|
== DESCRIPTION:
|
6
6
|
|
@@ -45,7 +45,7 @@ common development tasks. These tasks include ...
|
|
45
45
|
|
46
46
|
* release announcements
|
47
47
|
* gem packaging and management
|
48
|
-
* releasing to
|
48
|
+
* releasing to rubygems.org and rubyforge.org
|
49
49
|
* documentation
|
50
50
|
* annotation listing (TODO, FIXME, etc)
|
51
51
|
* testing
|
data/Rakefile
CHANGED
data/lib/bones/helpers.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
|
2
2
|
module Bones::Helpers
|
3
|
+
include Rake::DSL if defined?(Rake::DSL)
|
3
4
|
extend self
|
4
5
|
|
5
6
|
DEV_NULL = File.exist?('/dev/null') ? '/dev/null' : 'NUL:'
|
@@ -47,25 +48,32 @@ module Bones::Helpers
|
|
47
48
|
paragraphs = File.read(path).delete("\r").split(%r/\n\n+/)
|
48
49
|
|
49
50
|
if title.nil? then
|
50
|
-
|
51
|
-
|
51
|
+
title = '.+'
|
52
|
+
single_section = false
|
52
53
|
else
|
53
|
-
title = Regexp.escape
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
54
|
+
title = Regexp.escape(title)
|
55
|
+
single_section = true
|
56
|
+
end
|
57
|
+
|
58
|
+
start_rgxp = [%r/\A=+\s*#{title}/i, %r/\A#{title}\n[=-]+\s*\Z/i]
|
59
|
+
end_rgxp = [%r/\A=+/i, %r/\A.+\n[=-]+\s*\Z/i]
|
60
|
+
|
61
|
+
result = []
|
62
|
+
matching = false
|
63
|
+
rgxp = start_rgxp
|
64
|
+
|
65
|
+
paragraphs.each do |p|
|
66
|
+
if rgxp.any? { |r| p =~ r }
|
67
|
+
if matching && single_section
|
68
|
+
break
|
68
69
|
end
|
70
|
+
matching = true
|
71
|
+
rgxp = end_rgxp
|
72
|
+
next
|
73
|
+
end
|
74
|
+
|
75
|
+
if matching
|
76
|
+
result << p
|
69
77
|
end
|
70
78
|
end
|
71
79
|
|
@@ -151,11 +151,13 @@ module Bones::Plugins::BonesPlugin
|
|
151
151
|
|
152
152
|
config.exclude << "^#{Regexp.escape(config.ignore_file)}$"
|
153
153
|
config.changes ||= paragraphs_of(config.history_file, 0..1).join("\n\n")
|
154
|
+
|
155
|
+
first_readme_para = paragraphs_of(config.readme_file, 0..0).first.to_s
|
156
|
+
config.summary ||= first_readme_para[%r/^[^.]*\.?/]
|
154
157
|
config.description ||= paragraphs_of(config.readme_file, 'description').join("\n\n")
|
155
158
|
if config.description.empty?
|
156
|
-
config.description =
|
159
|
+
config.description = first_readme_para
|
157
160
|
end
|
158
|
-
config.summary ||= config.description[%r/^[^.]*\.?/]
|
159
161
|
|
160
162
|
config.version ||= (ENV['VERSION'] ? ENV['VERSION'].dup : nil)
|
161
163
|
if test(?f, 'version.txt') and !config.version
|
data/lib/bones/plugins/gem.rb
CHANGED
@@ -17,7 +17,17 @@ module Bones::Plugins::Gem
|
|
17
17
|
version = args.first || opts[:version]
|
18
18
|
development = opts.key?(:development) ? opts[:development] : opts.key?(:dev) ? opts[:dev] : false
|
19
19
|
|
20
|
-
spec =
|
20
|
+
spec = nil
|
21
|
+
# FIXME: check for rubygems version 1.8.X
|
22
|
+
if Gem::Specification.respond_to? :find_by_name
|
23
|
+
begin
|
24
|
+
spec = Gem::Specification.find_by_name(name)
|
25
|
+
rescue Gem::LoadError => err
|
26
|
+
end
|
27
|
+
else
|
28
|
+
spec = Gem.source_index.find_name(name).last
|
29
|
+
end
|
30
|
+
|
21
31
|
version = ">= #{spec.version.to_s}" if version.nil? and !spec.nil?
|
22
32
|
|
23
33
|
dep = case version
|
@@ -176,7 +186,6 @@ module Bones::Plugins::Gem
|
|
176
186
|
end
|
177
187
|
s.rdoc_options = config.rdoc.opts + ['--main', config.rdoc.main]
|
178
188
|
s.extra_rdoc_files = rdoc_files
|
179
|
-
s.has_rdoc = true
|
180
189
|
end
|
181
190
|
|
182
191
|
if config.test
|
@@ -246,7 +255,11 @@ module Bones::Plugins::Gem
|
|
246
255
|
|
247
256
|
desc 'Uninstall the gem'
|
248
257
|
task :uninstall do
|
249
|
-
|
258
|
+
# FIXME: check for rubygems version 1.8.X
|
259
|
+
installed_list = Gem::Specification.respond_to?(:find_all_by_name) ?
|
260
|
+
Gem::Specification.find_all_by_name(config.name) :
|
261
|
+
Gem.source_index.find_name(config.name)
|
262
|
+
|
250
263
|
if installed_list and installed_list.collect { |s| s.version.to_s}.include?(config.version) then
|
251
264
|
sh "#{SUDO} #{GEM} uninstall --version '#{config.version}' --ignore-dependencies --executables #{config.name}"
|
252
265
|
end
|
@@ -264,7 +277,12 @@ module Bones::Plugins::Gem
|
|
264
277
|
task :install_dependencies => 'gem:prereqs' do
|
265
278
|
installer = Gem::DependencyInstaller.new
|
266
279
|
config.gem._spec.dependencies.each {|dep|
|
267
|
-
|
280
|
+
# FIXME: check for rubygems version 1.8.X
|
281
|
+
if dep.respond_to? :matching_specs
|
282
|
+
next unless dep.matching_specs(true).empty?
|
283
|
+
else
|
284
|
+
next if Gem.available? dep
|
285
|
+
end
|
268
286
|
|
269
287
|
$stdout.puts "Installing #{dep.name}"
|
270
288
|
installer.install dep
|
data/spec/bones/helpers_spec.rb
CHANGED
@@ -53,7 +53,7 @@ describe Bones::Helpers do
|
|
53
53
|
it 'uses paragraph numbers' do
|
54
54
|
filename = Bones.path %w[spec data markdown.txt]
|
55
55
|
|
56
|
-
ary = Bones::Helpers.paragraphs_of(filename,
|
56
|
+
ary = Bones::Helpers.paragraphs_of(filename, 0, 1..3)
|
57
57
|
ary.length.should == 4
|
58
58
|
ary.first.should == %Q{Mr Bones is a handy tool that creates new Ruby projects from a code\nskeleton. The skeleton contains some starter code and a collection of rake\ntasks to ease the management and deployment of your source code. Several Mr\nBones plugins are available for creating git repositories, creating GitHub\nprojects, running various test suites and source code analysis tools.}
|
59
59
|
ary.last.should == %Q{When working with Rake, Mr Bones provides a set of tasks that help simplify\ncommon development tasks. These tasks include ...}
|
data/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.7.0
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bones
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 3.
|
8
|
+
- 7
|
9
|
+
- 0
|
10
|
+
version: 3.7.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tim Pease
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-06-01 00:00:00 -06:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -98,7 +98,6 @@ extra_rdoc_files:
|
|
98
98
|
- README.rdoc
|
99
99
|
- bin/bones
|
100
100
|
- default/version.txt
|
101
|
-
- gem-development.txt
|
102
101
|
- spec/data/markdown.txt
|
103
102
|
- spec/data/rdoc.txt
|
104
103
|
files:
|
@@ -118,7 +117,6 @@ files:
|
|
118
117
|
- default/spec/spec_helper.rb.bns
|
119
118
|
- default/test/test_NAME.rb
|
120
119
|
- default/version.txt
|
121
|
-
- gem-development.txt
|
122
120
|
- lib/bones.rb
|
123
121
|
- lib/bones/annotation_extractor.rb
|
124
122
|
- lib/bones/app.rb
|
data/gem-development.txt
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
https://github.com/radar/guides/blob/master/gem-development.md
|