bones 3.5.2 → 3.5.3
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 +5 -0
- data/Rakefile +1 -4
- data/lib/bones/helpers.rb +10 -0
- data/lib/bones/plugins/bones_plugin.rb +11 -4
- data/spec/bones/helpers_spec.rb +12 -0
- data/version.txt +1 -1
- metadata +8 -24
data/History.txt
CHANGED
data/Rakefile
CHANGED
@@ -11,8 +11,6 @@ Bones {
|
|
11
11
|
email 'tim.pease@gmail.com'
|
12
12
|
url 'http://rubygems.org/gems/bones'
|
13
13
|
ruby_opts %w[-W0]
|
14
|
-
readme_file 'README.rdoc'
|
15
|
-
ignore_file '.gitignore'
|
16
14
|
|
17
15
|
spec.opts.concat %w[--color --format specdoc]
|
18
16
|
notes.exclude %w[^README\.rdoc$ ^data/]
|
@@ -31,8 +29,7 @@ Bones {
|
|
31
29
|
depend_on 'little-plugger'
|
32
30
|
depend_on 'loquacious'
|
33
31
|
|
34
|
-
depend_on '
|
35
|
-
depend_on 'bones-git', :development => true
|
32
|
+
depend_on 'bones-git', :development => true
|
36
33
|
depend_on 'bones-rspec', :development => true
|
37
34
|
}
|
38
35
|
|
data/lib/bones/helpers.rb
CHANGED
@@ -82,6 +82,16 @@ module Bones::Helpers
|
|
82
82
|
end
|
83
83
|
end
|
84
84
|
|
85
|
+
# Given a list of filenames, return the first one that resolves to an
|
86
|
+
# existing file on the filesystem. This allows us to specify a list of valid
|
87
|
+
# files for the README and HISTORY files then pick the one that actually
|
88
|
+
# exists on the user's filesystem.
|
89
|
+
#
|
90
|
+
def find_file( *args )
|
91
|
+
args.each {|fn| return fn if test(?f, fn)}
|
92
|
+
args.first
|
93
|
+
end
|
94
|
+
|
85
95
|
end # module Bones::Helpers
|
86
96
|
|
87
97
|
# We need a "valid" method thtat determines if a string is suitable for use
|
@@ -10,7 +10,7 @@ module Bones::Plugins::BonesPlugin
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def initialize_bones_plugin
|
13
|
-
::Bones.config {
|
13
|
+
config = ::Bones.config {
|
14
14
|
# ==== Project Defaults
|
15
15
|
name nil, :desc => <<-__
|
16
16
|
The project name that will be used for packaging and distributing
|
@@ -101,19 +101,19 @@ module Bones::Plugins::BonesPlugin
|
|
101
101
|
project.
|
102
102
|
__
|
103
103
|
|
104
|
-
history_file
|
104
|
+
history_file nil, :desc => <<-__
|
105
105
|
The name of your project's History file. The default is 'History.txt'
|
106
106
|
but you are free to change it to whatever you choose.
|
107
107
|
__
|
108
108
|
|
109
|
-
readme_file
|
109
|
+
readme_file nil, :desc => <<-__
|
110
110
|
The name of your project's README file. The default is 'README.md'
|
111
111
|
but you are free to change it to whatever you choose. Since GitHub
|
112
112
|
understand various markup languages, you can change the README
|
113
113
|
file to support your markup language of choice.
|
114
114
|
__
|
115
115
|
|
116
|
-
ignore_file
|
116
|
+
ignore_file nil, :desc => <<-__
|
117
117
|
Mr Bones does not use a manifest to determine which fiels should be
|
118
118
|
included in your project. All files are included unless they appear
|
119
119
|
in the ignore file or in the "exclude" configruation option. The
|
@@ -137,6 +137,13 @@ module Bones::Plugins::BonesPlugin
|
|
137
137
|
This is equivalent to 'use_sudo true', but it reads a little nicer.
|
138
138
|
__
|
139
139
|
}
|
140
|
+
|
141
|
+
config.history_file = Proc.new { find_file(*%w[History.txt History HISTORY.txt HISTORY]) }
|
142
|
+
config.ignore_file = Proc.new { find_file(*%w[.gitignore .bnsignore]) }
|
143
|
+
config.readme_file = Proc.new { find_file(*%w[
|
144
|
+
README.txt README.rdoc README.md README
|
145
|
+
Readme.txt Readme.rdoc Readme.md Readme
|
146
|
+
]) }
|
140
147
|
end
|
141
148
|
|
142
149
|
def post_load
|
data/spec/bones/helpers_spec.rb
CHANGED
@@ -7,6 +7,18 @@ describe Bones::Helpers do
|
|
7
7
|
Bones::Helpers::HAVE.clear
|
8
8
|
end
|
9
9
|
|
10
|
+
describe 'when given a list of files' do
|
11
|
+
it 'finds the one that exists on the filesystem' do
|
12
|
+
filename = Bones::Helpers.find_file(*%w[foo.txt bar.txt README History.txt baz buz])
|
13
|
+
filename.should == 'History.txt'
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'returns the first file if none exist' do
|
17
|
+
filename = Bones::Helpers.find_file(*%w[foo.txt bar.txt README History baz buz])
|
18
|
+
filename.should == 'foo.txt'
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
10
22
|
describe 'when extracting paragraphs' do
|
11
23
|
it 'recognizes RDoc headers by title' do
|
12
24
|
filename = Bones.path %w[spec data rdoc.txt]
|
data/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.5.
|
1
|
+
3.5.3
|
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: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 3.5.
|
9
|
+
- 3
|
10
|
+
version: 3.5.3
|
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: 2010-11-
|
18
|
+
date: 2010-11-26 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -66,26 +66,10 @@ dependencies:
|
|
66
66
|
version: 1.7.0
|
67
67
|
type: :runtime
|
68
68
|
version_requirements: *id003
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rspec
|
71
|
-
prerelease: false
|
72
|
-
requirement: &id004 !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
|
-
requirements:
|
75
|
-
- - ">="
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
hash: 25
|
78
|
-
segments:
|
79
|
-
- 1
|
80
|
-
- 3
|
81
|
-
- 1
|
82
|
-
version: 1.3.1
|
83
|
-
type: :development
|
84
|
-
version_requirements: *id004
|
85
69
|
- !ruby/object:Gem::Dependency
|
86
70
|
name: bones-git
|
87
71
|
prerelease: false
|
88
|
-
requirement: &
|
72
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
89
73
|
none: false
|
90
74
|
requirements:
|
91
75
|
- - ">="
|
@@ -97,11 +81,11 @@ dependencies:
|
|
97
81
|
- 0
|
98
82
|
version: 1.2.0
|
99
83
|
type: :development
|
100
|
-
version_requirements: *
|
84
|
+
version_requirements: *id004
|
101
85
|
- !ruby/object:Gem::Dependency
|
102
86
|
name: bones-rspec
|
103
87
|
prerelease: false
|
104
|
-
requirement: &
|
88
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
105
89
|
none: false
|
106
90
|
requirements:
|
107
91
|
- - ">="
|
@@ -113,7 +97,7 @@ dependencies:
|
|
113
97
|
- 0
|
114
98
|
version: 1.1.0
|
115
99
|
type: :development
|
116
|
-
version_requirements: *
|
100
|
+
version_requirements: *id005
|
117
101
|
description: |-
|
118
102
|
Mr Bones is a handy tool that creates new Ruby projects from a code
|
119
103
|
skeleton. The skeleton contains some starter code and a collection of rake
|