bones 3.4.7 → 3.5.0

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,9 @@
1
+ == 3.5.0 / 2010-10-14
2
+
3
+ 2 minor enhancements
4
+ - Adding a "plugin" command to search for Mr Bones plugins
5
+ - Gem specs are emitted in YAML format
6
+
1
7
  == 3.4.7 / 2010-06-21
2
8
 
3
9
  1 bug fix
data/Rakefile CHANGED
@@ -13,7 +13,6 @@ Bones {
13
13
  ruby_opts %w[-W0]
14
14
  readme_file 'README.rdoc'
15
15
  ignore_file '.gitignore'
16
- rubyforge.name 'codeforpeople'
17
16
 
18
17
  spec.opts << '--color'
19
18
  notes.exclude %w[^README\.rdoc$ ^data/]
@@ -34,7 +33,7 @@ Bones {
34
33
 
35
34
  depend_on 'rspec', :development => true
36
35
  depend_on 'bones-git', :development => true
37
- depend_on 'bones-extras', :development => true
36
+ depend_on 'bones-rspec', :development => true
38
37
  }
39
38
 
40
39
  # don't want to depend on ourself
data/lib/bones/app.rb CHANGED
@@ -98,7 +98,7 @@ DESCRIPTION
98
98
  end
99
99
  }
100
100
 
101
- ary = [:create, :freeze, :unfreeze, :info]
101
+ ary = [:create, :freeze, :unfreeze, :info, :plugins]
102
102
  ary.each(&fmt)
103
103
  (@plugins.keys - ary).each(&fmt)
104
104
 
@@ -0,0 +1,92 @@
1
+
2
+ module Bones::App
3
+ class Plugins < Command
4
+
5
+ def self.initialize_plugins
6
+ synopsis 'bones plugins [options]'
7
+
8
+ summary 'list available Mr Bones plugins'
9
+
10
+ description <<-__
11
+ Parse the installed gems and then search for Mr Bones plugins related to
12
+ those gems. Passing in the 'all' flag will show plugins even if the related
13
+ gems are not installed.
14
+ __
15
+
16
+ option('-a', '--all', 'Show all plugins.', lambda { config[:all] = true })
17
+ end
18
+
19
+ def run
20
+ stdout.write 'Looking up avaialble Mr Bones plugins ... '
21
+ stdout.flush
22
+ plugins = find_bones_plugins
23
+ stdout.puts 'done!'
24
+ stdout.puts
25
+
26
+ if all?
27
+ plugins.each { |name, version| show_plugin(name, version) }
28
+ else
29
+ plugins.each { |name, version|
30
+ gemspecs.each { |gem_name, gem_version|
31
+ next unless name.downcase == gem_name.downcase
32
+ next if version && version != gem_version
33
+ show_plugin(name, version)
34
+ }
35
+ }
36
+ end
37
+
38
+ stdout.puts
39
+ end
40
+
41
+ def all?
42
+ config[:all]
43
+ end
44
+
45
+ def show_plugin( name, version )
46
+ name = "bones-#{name}"
47
+ name << "-#{version}" if version
48
+
49
+ stdout.puts(" [%s] %s" % [installed?(name) ? 'installed' : 'available', name])
50
+ end
51
+
52
+ private
53
+
54
+ def gemspecs
55
+ specs = Gem.source_index.map { |_, spec| spec }
56
+
57
+ specs.map! { |s| [s.name, s.version.segments.first] }
58
+
59
+ specs.sort! { |a, b|
60
+ names = a.first <=> b.first
61
+ next names if names.nonzero?
62
+ b.last <=> a.last
63
+ }
64
+
65
+ specs.uniq!
66
+ return specs
67
+ end
68
+
69
+ def find_bones_plugins
70
+ dep = Gem::Dependency.new(%r/^bones/i, Gem::Requirement.default)
71
+
72
+ fetcher = Gem::SpecFetcher.fetcher
73
+ specs = fetcher.find_matching dep
74
+
75
+ specs.map! { |(name, version, _), _|
76
+ next unless name =~ %r/^bones-(.*?)(?:-(\d+))?$/i
77
+ $2 ? [$1, $2.to_i] : $1
78
+ }
79
+
80
+ specs.compact!
81
+ specs.uniq!
82
+ return specs
83
+ end
84
+
85
+ def installed?( name, version = Gem::Requirement.default )
86
+ dep = Gem::Dependency.new name, version
87
+ !Gem.source_index.search(dep).empty?
88
+ end
89
+
90
+ end # class Plugins
91
+ end # module Bones::App
92
+
@@ -194,8 +194,8 @@ module Bones::Plugins::Gem
194
194
 
195
195
  desc 'Write the gemspec '
196
196
  task :spec => 'gem:prereqs' do
197
- File.open("#{config.name}.gemspec", 'w') do |f|
198
- f.write config.gem._spec.to_ruby
197
+ File.open('.specification', 'w') do |f|
198
+ f.write config.gem._spec.to_yaml
199
199
  end
200
200
  end
201
201
 
data/version.txt CHANGED
@@ -1 +1 @@
1
- 3.4.7
1
+ 3.5.0
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bones
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 19
4
5
  prerelease: false
5
6
  segments:
6
7
  - 3
7
- - 4
8
- - 7
9
- version: 3.4.7
8
+ - 5
9
+ - 0
10
+ version: 3.5.0
10
11
  platform: ruby
11
12
  authors:
12
13
  - Tim Pease
@@ -14,16 +15,18 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-06-21 00:00:00 -06:00
18
+ date: 2010-10-17 00:00:00 -06:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: rake
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
24
26
  requirements:
25
27
  - - ">="
26
28
  - !ruby/object:Gem::Version
29
+ hash: 49
27
30
  segments:
28
31
  - 0
29
32
  - 8
@@ -35,9 +38,11 @@ dependencies:
35
38
  name: little-plugger
36
39
  prerelease: false
37
40
  requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
38
42
  requirements:
39
43
  - - ">="
40
44
  - !ruby/object:Gem::Version
45
+ hash: 23
41
46
  segments:
42
47
  - 1
43
48
  - 1
@@ -49,56 +54,64 @@ dependencies:
49
54
  name: loquacious
50
55
  prerelease: false
51
56
  requirement: &id003 !ruby/object:Gem::Requirement
57
+ none: false
52
58
  requirements:
53
59
  - - ">="
54
60
  - !ruby/object:Gem::Version
61
+ hash: 11
55
62
  segments:
56
63
  - 1
57
- - 6
58
- - 4
59
- version: 1.6.4
64
+ - 7
65
+ - 0
66
+ version: 1.7.0
60
67
  type: :runtime
61
68
  version_requirements: *id003
62
69
  - !ruby/object:Gem::Dependency
63
70
  name: rspec
64
71
  prerelease: false
65
72
  requirement: &id004 !ruby/object:Gem::Requirement
73
+ none: false
66
74
  requirements:
67
75
  - - ">="
68
76
  - !ruby/object:Gem::Version
77
+ hash: 25
69
78
  segments:
70
79
  - 1
71
80
  - 3
72
- - 0
73
- version: 1.3.0
81
+ - 1
82
+ version: 1.3.1
74
83
  type: :development
75
84
  version_requirements: *id004
76
85
  - !ruby/object:Gem::Dependency
77
86
  name: bones-git
78
87
  prerelease: false
79
88
  requirement: &id005 !ruby/object:Gem::Requirement
89
+ none: false
80
90
  requirements:
81
91
  - - ">="
82
92
  - !ruby/object:Gem::Version
93
+ hash: 31
83
94
  segments:
84
95
  - 1
85
- - 1
86
96
  - 2
87
- version: 1.1.2
97
+ - 0
98
+ version: 1.2.0
88
99
  type: :development
89
100
  version_requirements: *id005
90
101
  - !ruby/object:Gem::Dependency
91
- name: bones-extras
102
+ name: bones-rspec
92
103
  prerelease: false
93
104
  requirement: &id006 !ruby/object:Gem::Requirement
105
+ none: false
94
106
  requirements:
95
107
  - - ">="
96
108
  - !ruby/object:Gem::Version
109
+ hash: 21
97
110
  segments:
98
111
  - 1
99
- - 2
100
- - 4
101
- version: 1.2.4
112
+ - 0
113
+ - 1
114
+ version: 1.0.1
102
115
  type: :development
103
116
  version_requirements: *id006
104
117
  description: |-
@@ -143,6 +156,7 @@ files:
143
156
  - lib/bones/app/file_manager.rb
144
157
  - lib/bones/app/freeze.rb
145
158
  - lib/bones/app/info.rb
159
+ - lib/bones/app/plugins.rb
146
160
  - lib/bones/app/unfreeze.rb
147
161
  - lib/bones/colors.rb
148
162
  - lib/bones/gem_package_task.rb
@@ -153,7 +167,6 @@ files:
153
167
  - lib/bones/plugins/notes.rb
154
168
  - lib/bones/plugins/rdoc.rb
155
169
  - lib/bones/plugins/test.rb
156
- - lib/bones/plugins/yard.rb
157
170
  - lib/bones/smtp_tls.rb
158
171
  - spec/bones/app/file_manager_spec.rb
159
172
  - spec/bones/app_spec.rb
@@ -184,23 +197,27 @@ rdoc_options:
184
197
  require_paths:
185
198
  - lib
186
199
  required_ruby_version: !ruby/object:Gem::Requirement
200
+ none: false
187
201
  requirements:
188
202
  - - ">="
189
203
  - !ruby/object:Gem::Version
204
+ hash: 3
190
205
  segments:
191
206
  - 0
192
207
  version: "0"
193
208
  required_rubygems_version: !ruby/object:Gem::Requirement
209
+ none: false
194
210
  requirements:
195
211
  - - ">="
196
212
  - !ruby/object:Gem::Version
213
+ hash: 3
197
214
  segments:
198
215
  - 0
199
216
  version: "0"
200
217
  requirements: []
201
218
 
202
- rubyforge_project: codeforpeople
203
- rubygems_version: 1.3.6
219
+ rubyforge_project: bones
220
+ rubygems_version: 1.3.7
204
221
  signing_key:
205
222
  specification_version: 3
206
223
  summary: Mr Bones is a handy tool that creates new Ruby projects from a code skeleton
@@ -1,86 +0,0 @@
1
-
2
- module Bones::Plugins::Yard
3
- include ::Bones::Helpers
4
- extend self
5
-
6
- def initialize_yard
7
- require 'yard'
8
- require 'yard/rake/yardoc_task'
9
- have?(:yard) { true }
10
-
11
- ::Bones.config {
12
- desc 'Configuration settings for yard'
13
- yard {
14
- opts [], :desc => 'Array of yard options to use when generating documentation.'
15
-
16
- include %w(^lib/ ^bin/ ^ext/ \.txt$ \.rdoc$), :desc => <<-__
17
- An array of patterns that will be used to find the files for which
18
- documentation should be generated. This is an array of strings that
19
- will be converted in regular expressions.
20
- __
21
-
22
- exclude %w(extconf\.rb$), :desc => <<-__
23
- An array of patterns that will be used to exclude files from yard
24
- processing. This is an array of strings that will be converted in
25
- regular expressions.
26
- __
27
-
28
- main nil, :desc => <<-__
29
- The main yard file for the project. This defaults to the project's
30
- README file.
31
- __
32
-
33
- dir 'doc', :desc => 'Output directory for generated documentation.'
34
- }
35
- }
36
- rescue LoadError
37
- have?(:yard) { false }
38
- end
39
-
40
- def post_load
41
- return unless have? :yard
42
- config = ::Bones.config
43
-
44
- config.exclude << "^#{Regexp.escape(config.yard.dir)}/"
45
- config.yard.main ||= config.readme_file
46
- end
47
-
48
- def define_tasks
49
- return unless have?(:yard)
50
- config = ::Bones.config
51
-
52
- namespace :doc do
53
- desc 'Generate Yard documentation'
54
- YARD::Rake::YardocTask.new(:yard) do |yd|
55
- yard = config.yard
56
-
57
- incl = Regexp.new(yard.include.join('|'))
58
- excl = Regexp.new(yard.exclude.join('|'))
59
- yd.files = config.gem.files.find_all do |fn|
60
- case fn
61
- when excl; false
62
- when incl; true
63
- else false end
64
- end
65
-
66
- yd.options << '--main' << yard.main
67
- yd.options << '--output-dir' << yard.dir
68
- yd.options << '--title' << "#{config.name}-#{config.version} Documentation"
69
-
70
- yd.options.concat(yard.opts)
71
- end
72
-
73
- task :clobber_yard do
74
- rm_r config.yard.dir rescue nil
75
- end
76
- end # namespace :doc
77
-
78
- desc 'Alias to doc:yard'
79
- task :doc => 'doc:yard'
80
-
81
- task :clobber => %w(doc:clobber_yard)
82
- end
83
-
84
- end
85
-
86
- # EOF