bones 2.5.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. data/History.txt +2 -0
  2. data/README.rdoc +54 -306
  3. data/Rakefile +28 -37
  4. data/bin/bones +10 -3
  5. data/{spec/data/data → default}/.bnsignore +3 -1
  6. data/{data → default}/History.txt.bns +0 -0
  7. data/{data → default}/README.txt.bns +0 -0
  8. data/default/Rakefile.bns +21 -0
  9. data/{data → default}/bin/NAME.bns +0 -0
  10. data/{data → default}/lib/NAME.rb.bns +0 -0
  11. data/{data → default}/spec/NAME_spec.rb.bns +0 -0
  12. data/{data → default}/spec/spec_helper.rb.bns +0 -0
  13. data/{data → default}/test/test_NAME.rb +0 -0
  14. data/lib/bones.rb +73 -31
  15. data/lib/bones/annotation_extractor.rb +16 -26
  16. data/lib/bones/app.rb +87 -58
  17. data/lib/bones/app/command.rb +143 -64
  18. data/lib/bones/app/create.rb +93 -0
  19. data/lib/bones/app/file_manager.rb +7 -8
  20. data/lib/bones/app/freeze.rb +59 -0
  21. data/lib/bones/app/info.rb +39 -0
  22. data/lib/bones/app/unfreeze.rb +44 -0
  23. data/lib/bones/colors.rb +54 -0
  24. data/lib/bones/gem_package_task.rb +71 -0
  25. data/lib/bones/helpers.rb +93 -0
  26. data/lib/bones/plugins/ann.rb +166 -0
  27. data/lib/bones/plugins/bones_plugin.rb +193 -0
  28. data/lib/bones/plugins/gem.rb +274 -0
  29. data/lib/bones/plugins/notes.rb +45 -0
  30. data/lib/bones/plugins/rdoc.rb +93 -0
  31. data/lib/bones/plugins/test.rb +57 -0
  32. data/lib/bones/smtp_tls.rb +1 -0
  33. data/spec/bones/app/file_manager_spec.rb +6 -6
  34. data/spec/bones/app_spec.rb +14 -18
  35. data/spec/bones_spec.rb +9 -4
  36. data/{data → spec/data/default}/.bnsignore +0 -0
  37. data/spec/data/{data → default}/History +0 -0
  38. data/spec/data/{data → default}/NAME/NAME.rb.bns +0 -0
  39. data/spec/data/{data → default}/README.txt.bns +0 -0
  40. data/{data → spec/data/default}/Rakefile.bns +0 -0
  41. data/spec/data/{data → default}/lib/NAME.rb.bns +0 -0
  42. metadata +94 -68
  43. data/lib/bones/app/create_command.rb +0 -86
  44. data/lib/bones/app/freeze_command.rb +0 -73
  45. data/lib/bones/app/info_command.rb +0 -58
  46. data/lib/bones/app/unfreeze_command.rb +0 -53
  47. data/lib/bones/app/update_command.rb +0 -47
  48. data/lib/bones/debug.rb +0 -72
  49. data/lib/bones/tasks/ann.rake +0 -80
  50. data/lib/bones/tasks/bones.rake +0 -20
  51. data/lib/bones/tasks/gem.rake +0 -201
  52. data/lib/bones/tasks/git.rake +0 -40
  53. data/lib/bones/tasks/notes.rake +0 -27
  54. data/lib/bones/tasks/post_load.rake +0 -34
  55. data/lib/bones/tasks/rdoc.rake +0 -51
  56. data/lib/bones/tasks/rubyforge.rake +0 -55
  57. data/lib/bones/tasks/setup.rb +0 -292
  58. data/lib/bones/tasks/spec.rake +0 -54
  59. data/lib/bones/tasks/svn.rake +0 -47
  60. data/lib/bones/tasks/test.rake +0 -40
  61. data/lib/bones/tasks/zentest.rake +0 -36
  62. data/spec/data/data/Rakefile.bns +0 -30
  63. data/tasks/ann.rake +0 -80
  64. data/tasks/bones.rake +0 -20
  65. data/tasks/gem.rake +0 -201
  66. data/tasks/git.rake +0 -40
  67. data/tasks/notes.rake +0 -27
  68. data/tasks/post_load.rake +0 -34
  69. data/tasks/rdoc.rake +0 -51
  70. data/tasks/rubyforge.rake +0 -55
  71. data/tasks/setup.rb +0 -292
  72. data/tasks/spec.rake +0 -54
  73. data/tasks/svn.rake +0 -47
  74. data/tasks/test.rake +0 -40
  75. data/tasks/zentest.rake +0 -36
data/History.txt CHANGED
@@ -1,3 +1,5 @@
1
+ == 3.0.0 / 2009-10-
2
+
1
3
  == 2.5.1 / 2009-05-12
2
4
 
3
5
  * 1 bug fix
data/README.rdoc CHANGED
@@ -1,60 +1,14 @@
1
1
  Mr Bones
2
2
  by Tim Pease
3
- http://codeforpeople.rubyforge.org/bones
3
+ http://gemcutter.org/gems/bones
4
4
 
5
5
  == DESCRIPTION:
6
6
 
7
- Mr Bones is a handy tool that builds a skeleton for your new Ruby projects.
8
- The skeleton contains some starter code and a collection of rake tasks to
9
- ease the management and deployment of your source code. Mr Bones is not
10
- viral -- all the code your project needs is included in the skeleton (no
11
- gem dependency required).
12
-
13
- == FEATURES:
14
-
15
- Mr Bones provides the following rake tasks:
16
-
17
- ann # Alias to ann:announcement
18
- ann:announcement # Create an announcement file
19
- ann:email # Send an email announcement
20
- autotest # Run the autotest loop
21
- bones:debug # Show the PROJ open struct
22
- clean # Remove any temporary products.
23
- clobber # Remove any generated file.
24
- doc # Alias to doc:rdoc
25
- doc:rdoc # Build the rdoc HTML Files
26
- doc:release # Publish RDoc to RubyForge
27
- doc:rerdoc # Force a rebuild of the RDOC files
28
- doc:ri # Generate ri locally for testing
29
- gem # Alias to gem:package
30
- gem:cleanup # Cleanup the gem
31
- gem:debug # Show information about the gem
32
- gem:install # Install the gem
33
- gem:package # Build all the packages
34
- gem:reinstall # Reinstall the gem
35
- gem:release # Package and upload to RubyForge
36
- gem:repackage # Force a rebuild of the package files
37
- gem:spec # Write the gemspec
38
- gem:uninstall # Uninstall the gem
39
- git:create_tag # Create a new tag in the Git repository
40
- git:show_tags # Show tags from the Git repository
41
- notes # Enumerate all annotations
42
- notes:fixme # Enumerate all FIXME annotations
43
- notes:optimize # Enumerate all OPTIMIZE annotations
44
- notes:todo # Enumerate all TODO annotations
45
- spec # Alias to spec:run
46
- spec:rcov # Run all specs with RCov
47
- spec:run # Run all specs with basic output
48
- spec:specdoc # Run all specs with text output
49
- spec:verify # Verify that rcov coverage is at least 90.0%
50
- svn:create_tag # Create a new tag in the SVN repository
51
- svn:show_tags # Show tags from the SVN repository
52
- test # Alias to test:run
53
- test:rcov # Run rcov on the unit tests
54
- test:run # Run tests for run
55
-
56
- The rake tasks in the Mr Bones framework can be found in the "tasks"
57
- directory. Add your own tasks there when you need more functionality.
7
+ Mr Bones is a handy tool that creates new Ruby projects from a code
8
+ skeleton. The skeleton contains some starter code and a collection of rake
9
+ tasks to ease the management and deployment of your source code. Several Mr
10
+ Bones plugins are available for creating git repositories, creating GitHub
11
+ projects, running various test suites and source code analysis tools.
58
12
 
59
13
  == SYNOPSIS:
60
14
 
@@ -66,181 +20,71 @@ If you ever get confused about what Mr Bones can do:
66
20
 
67
21
  bones --help
68
22
 
69
- == REQUIREMENTS:
70
-
71
- Mr Bones does not have any "requirements", but if you do not have the
72
- following gems installed you will not get all that Mr Bones has to offer.
73
-
74
- * rubyforge - for easy gem publishing to rubyforge.org
75
- * rcov - for code coverage testing
76
- * rspec - if that's the way you roll
77
- * facets - for pretty colors
78
-
79
- Actually, you will need at least version 1.2.0 of rubygems installed to use
80
- Mr Bones.
81
-
82
- == INSTALL:
83
-
84
- * sudo gem install bones
85
-
86
- == MANUAL:
87
-
88
- The +bones+ command line tool is used to create a skeleton for a Ruby
89
- project. In that skeleton is a "tasks" directory that contains the Mr Bones
90
- rake files. These files are quite generic, and their functionality is
91
- controlled by options configured in the top-level Rakefile. Take a look at
92
- the Rakefile for the Mr Bones gem itself:
93
-
94
- begin
95
- require 'bones'
96
- Bones.setup
97
- rescue LoadError
98
- load 'tasks/setup.rb'
99
- end
100
-
101
- ensure_in_path 'lib'
102
- require 'bones'
103
-
104
- task :default => 'spec:run'
105
-
106
- PROJ.name = 'bones'
107
- PROJ.authors = 'Tim Pease'
108
- PROJ.email = 'not.real@fake.com'
109
- PROJ.url = 'http://codeforpeople.rubyforge.org/bones'
110
- PROJ.version = Bones::VERSION
111
- PROJ.rubyforge.name = 'codeforpeople'
112
-
113
- PROJ.rdoc.remote_dir = 'bones'
114
- PROJ.rdoc.exclude << '^data'
115
-
116
- PROJ.notes.exclude = %w(^README\.txt$ ^data/)
117
-
118
- PROJ.svn.path = 'bones'
119
-
120
- PROJ.spec_opts << '--color'
121
-
122
- # EOF
123
-
124
- The +PROJ+ constant is an open struct that contains all the configuration
125
- options for the project. The open struct is created in the "tasks/setup.rb"
126
- file, and that is also where all the configurable options are defined. Take
127
- a look in the "setup.rb" file to see what options are available, but always
128
- make your changes in the Rakefile itself.
129
-
130
- The Mr Bones rake system is based on a "Manifest.txt" file that contains a
131
- list of all the files that will be used in the project. If a file does not
132
- appear in the manifest, it will not be included in the gem. Use the
133
- +manifest+ rake tasks to create and update the manifest as needed.
134
-
135
- You can exclude files from being seen by the manifest -- the files are
136
- invisible to the Mr Bones rake tasks. You would do this for any subversion
137
- directories, backup files, or anything else you don't want gumming up the
138
- works. The files to exclude are given as an array of regular expression
139
- patterns; a file is excluded if it matches any of the patterns.
140
-
141
- PROJ.exclude = %w(tmp$ bak$ ~$ CVS \.svn ^pkg ^doc)
142
- PROJ.exclude << '^tags$'
143
-
144
- If your project depends on other gems, use the +depend_on+ command in your
145
- Rakefile to declare the dependency. If you do not specify a version, the
146
- most current version number for the installed gem is used.
147
-
148
- depend_on 'logging'
149
- depend_on 'rake', '0.8.2'
150
-
151
- === Freezing a Skeleton
152
-
153
- Freezing allows you to define your own project skeleton to instantiate with Mr
154
- Bones when you create a new project. The default Mr Bones project skeleton is
155
- copied to the ".mrbones" directory in your home directory. From there, the
156
- skeleton can be modified however you like (add new files and tasks, add new
157
- directories, etc).
158
-
159
- bones freeze
160
-
161
- Typical uses of this feature would be to fill in user specific data like the
162
- author, e-mail address, etc. You can also add more default code to the skeleton
163
- project or your own ".rake" task files.
164
-
165
- You can have multiple skeletons with different names. Your projects can be
166
- instantiated from any of these skeletons. Just supply a name when freezing:
167
-
168
- bones freeze foo
23
+ After your project is created, you can view all the available configuration
24
+ options:
169
25
 
170
- You can instantiate a project from the "foo" skeleton:
26
+ rake bones:options
171
27
 
172
- bones create --skeleton foo get_fuzzy
28
+ Detailed information about the options (or a subset of options) can also be
29
+ displayed:
173
30
 
174
- The default skeleton name is "data". If no skeleton name is provided, then this
175
- is the skeleton that will be used.
31
+ rake bones:help #=> for all options
32
+ rake bones:help gem #=> for the "gem" subset
176
33
 
177
- ==== Unfreezing a Skeleton
178
-
179
- Unfreezing a skeleton will remove your customized project skeleton from the
180
- ".mrbones" directory. The default Mr Bones project skeleton will be used
181
- instead. A copy of your custom skeleton is stored in an archive directory of
182
- the ".mrbones" directory before it is removed.
183
-
184
- bones unfreeze
185
-
186
- You can unfreeze named skeletons, too:
187
-
188
- bones unfreeze foo
189
-
190
- ==== Repository Skeletons
191
-
192
- You can instantiate a new project from a git or svn repository. For example,
193
- if you would like to use the "bort" rails template from github, you can type
194
- in the following:
34
+ == FEATURES:
195
35
 
196
- bones create --repository git://github.com/fudgestudios/bort.git foo
36
+ Mr Bones is configurable, helpful, and it simplifies project development.
197
37
 
198
- Typing in the full path to the repository each time is tedious. You can
199
- create an alias by freezing the repository and giving it an easy to remember
200
- name.
38
+ Mr Bones simplifies project creation by using a code template for generating
39
+ a new working area for your code. This skeleton is customizable, and you can
40
+ have multiple skeletons for various types of projects you work on - ruby
41
+ libraries, web applications, or even writing projects.
201
42
 
202
- bones freeze --repository git://github.com/fudgestudios/bort.git bort
43
+ When working with Rake, Mr Bones provides a set of tasks that help simplify
44
+ common development tasks. These tasks include ...
203
45
 
204
- This does not checkout a copy of the repository; it give us an easy to use
205
- alias when we want to create a new proejct based on the repository. The
206
- following command will use our new alias to instantiate a new project called
207
- "foo":
46
+ * release announcements
47
+ * gem packaging and management
48
+ * releasing to gemcutter and rubyforge
49
+ * documentation
50
+ * annotation listing (TODO, FIXME, etc)
51
+ * testing
208
52
 
209
- bones create --skeleton bort foo
53
+ The provided rake tasks are configured using a "Bones" configuration block in
54
+ the Rakefile. You can obtain a list of the available options and descriptive
55
+ help for each option by running the various "bones" tasks (use "rake -T" to
56
+ list the available tasks). Although there are many configuration options, the
57
+ vast majority of them have sensible defaults; tailor to suit your needs in the
58
+ Bones configuration block.
210
59
 
211
- If the repository contains '.bns' files they will be filtered through the
212
- ERb templating system. All the custom modifications described in the next
213
- section apply to repository based skeletons as well.
60
+ Mr Bones can be extended via plugins. The plugins provide new rake tasks and
61
+ configuration options for those tasks. Other developers can release plugins to
62
+ automate the use of their libraries in a bones enabled system.
214
63
 
215
- ==== Custom Modifications
64
+ Currently there are a "bones-git" plugin for interacting with github and git
65
+ repositories and a "bones-extras" plugin for working with Rcov, RubyForge,
66
+ and Rspec.
216
67
 
217
- Mr Bones will perform a limited set of substitutions on the files in the
218
- skeleton when it generates a new project. ERB is used to insert the project
219
- name and the derived class name into template files. The file must end in an
220
- ".bns" suffix for ERB substitutions to take place. The ".bns" suffix is
221
- stripped from the file during project generation.
68
+ There is far more information available in the Mr Bones manual.
69
+ http://wiki.github.com/TwP/bones/manual
222
70
 
223
- Only two values can be substituted into files using ERB -- the project name and
224
- the derived class name.
71
+ == INSTALL:
225
72
 
226
- <%= name %>
227
- <%= classname %>
73
+ * gem install bones
228
74
 
229
- The project +name+ is passed in from the command line and used "as is" (with
230
- the exception that spaces are converted to underscores). The +classname+ is
231
- generated by camel casing the project name where the underscores occur.
75
+ If you would like some extra functinoality the following plugins can be
76
+ installed:
232
77
 
233
- get fuzzy => GetFuzzy
234
- foo_bar => FooBar
78
+ * gem install bones-git
79
+ * gem install bones-extras
235
80
 
236
- Finally, file names can be modified by substituting in the project name. If a
237
- file name contains the string "NAME" it is replaced with the project name. If
238
- our project is call "get fuzzy" then the following transformations will take
239
- place.
81
+ The 'bones-git' gem provides command line options for generating a git
82
+ repository and pushing to github upon creation. Rake tasks for working with
83
+ the git repository are also provided.
240
84
 
241
- NAME.rb => get_fuzzy.rb
242
- test_NAME.rb => test_get_fuzzy.rb
243
- NAME_spec.rb => get_fuzzy_spec.rb
85
+ The 'bones-extras' gem provides rake tasks for running Rspec tests, running
86
+ Rcov on your source code, and pushing releases to RubyForge. You will need to
87
+ have the corresponding gems installed for these tasks to be loaded.
244
88
 
245
89
  == ACKNOWLEDGEMENTS:
246
90
 
@@ -252,7 +96,7 @@ Howard for letting me squat in the codeforpeople rubyforge project.
252
96
  == LICENSE:
253
97
 
254
98
  MIT License
255
- Copyright (c) 2007 - 2008
99
+ Copyright (c) 2007 - 2009
256
100
 
257
101
  Permission is hereby granted, free of charge, to any person obtaining
258
102
  a copy of this software and associated documentation files (the
@@ -273,99 +117,3 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
273
117
  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
274
118
  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
275
119
 
276
-
277
- == VERSION 2.0.0 CHANGES:
278
-
279
- Version 2.0.0 of Mr Bones introduces backwards incompatibilities. Here is
280
- what you need to update in order for your current projects to work with
281
- this latest release.
282
-
283
- Perform an update the tasks in your project directory:
284
-
285
- bones -u your/project/directory
286
-
287
- The following .rake files have been renamed in Mr Bones 2.0.0 (the old
288
- name is on the left and the new name is on the right). You will need to
289
- delete the old version and use only the new version.
290
-
291
- doc.rake => rdoc.rake
292
- annotations.rake => notes.rake
293
-
294
- The PROJ openstruct has been amended to contain a collection of nested
295
- openstructs. This will affect any settings you might have in the
296
- top-level Rakefile for your project. Here is the translation key (old
297
- names on the left and new names on the right).
298
-
299
- rubyforge_name => rubyforge.name
300
-
301
- specs => spec.files
302
- spec_opts => spec.opts
303
-
304
- tests => test.files
305
- test_file => test.file
306
- test_opts => test.opts
307
-
308
- rcov_dir => rcov.dir
309
- rcov_opts => rcov.opts
310
- rcov_threshold => rcov.threshold
311
- rcov_threshold_exact => rcov.threshold_exact
312
-
313
- rdoc_opts => rdoc.opts
314
- rdoc_include => rdoc.include
315
- rdoc_exclude => rdoc.exclude
316
- rdoc_main => rdoc.main
317
- rdoc_dir => rdoc.dir
318
- rdoc_remote_dir => rdoc.remote_dir
319
-
320
- dependencies => gem.dependencies
321
- executables => gem.executables
322
- extensions => gem.extensions
323
- files => gem.files
324
- need_tar => gem.need_tar
325
- need_zip => gem.need_zip
326
- post_install_message => gem.extras['post_install_message']
327
-
328
- annotation_exclude => notes.exclude
329
- annotation_extensions => notes.extensions
330
- annotation_tags => notes.tags
331
-
332
- svn => svn.path
333
- svn_root => svn.root
334
- svn_trunk => svn.trunk
335
- svn_tags => svn.tags
336
- svn_branches => svn.branches
337
-
338
- ann_file => ann.file
339
- ann_text => ann.text
340
- ann_paragraphs => ann.paragraphs
341
- ann_email => ann.email
342
-
343
- And of course, each name should be prepended with PROJ in your Rakefile.
344
-
345
- == VERSION 2.1.0 CHANGES:
346
-
347
- With my Mr Bones projects, I found myself constantly updating the tasks as new
348
- versions of Mr Bones were released. This quickly became annoying. Why not use
349
- the tasks from the Mr Bones gem and only copy those tasks to my own projects
350
- when they are packaged and released? That is the goal of this release of Mr
351
- Bones.
352
-
353
- Version 2.1.0 of Mr Bones allows your projects to use the rake tasks found
354
- in the Mr Bones gem but still remain independent from Mr Bones when
355
- deployed. This is accomplished by copying the rake tasks into your project
356
- only when it is packaged into a gem (or zip file or tarball).
357
-
358
- You still have the option of copy the tasks to your local project when it is
359
- created. Or you can add tasks to your project at a later time.
360
-
361
- So, if you have an exsiting project and you want to use the Mr Bones tasks,
362
- simply delete your "tasks" folder and put the following at the top of your
363
- Rakefile:
364
-
365
- begin
366
- require 'bones'
367
- Bones.setup
368
- rescue LoadError
369
- load 'tasks/setup.rb' # this line should already be there
370
- end
371
-
data/Rakefile CHANGED
@@ -1,48 +1,39 @@
1
1
 
2
2
  $:.unshift('lib')
3
-
4
3
  require 'bones'
5
- Bones.setup
6
-
7
- PROJ.name = 'bones'
8
- PROJ.authors = 'Tim Pease'
9
- PROJ.email = 'tim.pease@gmail.com'
10
- PROJ.url = 'http://codeforpeople.rubyforge.org/bones'
11
- PROJ.version = Bones::VERSION
12
- PROJ.release_name = 'Maxilla'
13
- PROJ.ruby_opts = %w[-W0]
14
- PROJ.readme_file = 'README.rdoc'
15
- PROJ.ignore_file = '.gitignore'
16
- PROJ.exclude << 'bones.gemspec'
17
-
18
- PROJ.rubyforge.name = 'codeforpeople'
19
-
20
- PROJ.rdoc.remote_dir = 'bones'
21
- PROJ.rdoc.exclude << '^data/'
22
- PROJ.notes.exclude = %w(^README\.txt$ ^data/ ^tasks/setup.rb$)
23
-
24
- PROJ.spec.opts << '--color'
25
4
 
26
- PROJ.ann.email[:server] = 'smtp.gmail.com'
27
- PROJ.ann.email[:port] = 587
28
- PROJ.ann.email[:from] = 'Tim Pease'
29
-
30
- PROJ.gem.extras[:post_install_message] = <<-MSG
5
+ task :default => 'spec:specdoc'
6
+ task 'gem:release' => 'spec:run'
7
+
8
+ Bones {
9
+ name 'bones'
10
+ authors 'Tim Pease'
11
+ email 'tim.pease@gmail.com'
12
+ url 'http://gemcutter.org/gems/bones'
13
+ version Bones::VERSION
14
+ ruby_opts %w[-W0]
15
+ readme_file 'README.rdoc'
16
+ ignore_file '.gitignore'
17
+
18
+ spec.opts << '--color'
19
+ notes.exclude %w[^README\.rdoc$ ^data/]
20
+ gem.extras[:post_install_message] = <<-MSG
31
21
  --------------------------
32
22
  Keep rattlin' dem bones!
33
23
  --------------------------
34
- MSG
24
+ MSG
35
25
 
36
- PROJ.ann.paragraphs = %w[install synopsis features requirements]
37
- PROJ.ann.text = PROJ.gem.extras[:post_install_message]
38
-
39
- task :default => 'spec:specdoc'
40
- task 'ann:prereqs' do
41
- PROJ.name = 'Mr Bones'
42
- end
26
+ ann.paragraphs = %w[install synopsis features]
27
+ ann.text = gem.extras[:post_install_message]
43
28
 
44
- PROJ.gem.development_dependencies.clear
29
+ use_gmail
30
+ enable_sudo
45
31
 
46
- depend_on 'rake'
32
+ depend_on 'rake'
33
+ depend_on 'little-plugger'
34
+ depend_on 'loquacious'
47
35
 
48
- # EOF
36
+ gem.development_dependencies.clear
37
+ depend_on 'rspec', :development => true
38
+ depend_on 'bones-extras', :development => true
39
+ }