bones 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ == 1.0.0 / 2007-12-28
2
+
3
+ * 1 major enhancement
4
+ * Birthday!
@@ -0,0 +1,30 @@
1
+ History.txt
2
+ Manifest.txt
3
+ README.txt
4
+ Rakefile
5
+ bin/bones
6
+ data/History.txt.erb
7
+ data/Manifest.txt
8
+ data/README.txt.erb
9
+ data/Rakefile.erb
10
+ data/bin/NAME.erb
11
+ data/lib/NAME.rb.erb
12
+ data/spec/NAME_spec.rb
13
+ data/tasks/annotations.rake
14
+ data/tasks/doc.rake
15
+ data/tasks/gem.rake
16
+ data/tasks/manifest.rake
17
+ data/tasks/rubyforge.rake
18
+ data/tasks/setup.rb
19
+ data/tasks/spec.rake
20
+ data/tasks/test.rake
21
+ data/test/test_NAME.rb
22
+ lib/bones.rb
23
+ tasks/annotations.rake
24
+ tasks/doc.rake
25
+ tasks/gem.rake
26
+ tasks/manifest.rake
27
+ tasks/rubyforge.rake
28
+ tasks/setup.rb
29
+ tasks/spec.rake
30
+ tasks/test.rake
@@ -0,0 +1,157 @@
1
+ Mr Bones
2
+ by Tim Pease
3
+ http://codeforpeople.rubyforge.org/bones
4
+
5
+ == DESCRIPTION:
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/PROBLEMS:
14
+
15
+ Mr Bones provides the following rake tasks:
16
+
17
+ clobber # Remove all build products
18
+ doc # Alias to doc:rdoc
19
+ doc:rdoc # Build the rdoc HTML Files
20
+ doc:release # Publish RDoc to RubyForge
21
+ doc:rerdoc # Force a rebuild of the RDOC files
22
+ doc:ri # Generate ri locally for testing
23
+ gem # Alias to gem:package
24
+ gem:debug # Show information about the gem
25
+ gem:gem # Build the gem file
26
+ gem:install # Install the gem
27
+ gem:package # Build all the packages
28
+ gem:release # Package and upload to RubyForge
29
+ gem:repackage # Force a rebuild of the package files
30
+ gem:uninstall # Uninstall the gem
31
+ manifest:check # Verify the manifest
32
+ manifest:create # Create a new manifest
33
+ notes # Enumerate all annotations
34
+ notes:fixme # Enumerate all FIXME annotations
35
+ notes:optimize # Enumerate all OPTIMIZE annotations
36
+ notes:todo # Enumerate all TODO annotations
37
+ spec:rcov # Run all specs with RCov
38
+ spec:run # Run all specs with basic output
39
+ spec:specdoc # Run all specs with text output
40
+ test:rcov # Run rcov on the unit tests
41
+ test:run # Run tests for run
42
+
43
+ The rake tasks in the Mr Bones framework can be found in the "tasks"
44
+ directory. Add your own tasks there when you need more functionality.
45
+
46
+ == SYNOPSIS:
47
+
48
+ To create a new "Get Fuzzy" project:
49
+
50
+ bones get_fuzzy
51
+
52
+ If a new release of Mr Bones comes out with better features the "Get Fuzzy"
53
+ project will need to be updated:
54
+
55
+ bones --update get_fuzzy
56
+
57
+ And if you ever get confused about what Mr Bones can do:
58
+
59
+ bones --help
60
+
61
+ == REQUIREMENTS:
62
+
63
+ Mr Bones does not have any "requirements", but if you do not have the
64
+ following gems installed you will not get all that Mr Bones has to offer.
65
+
66
+ * rubyforge - for easy gem publishing to rubyforge.org
67
+ * rcov - for code coverage testing
68
+ * rspec - if that's the way you roll
69
+ * rails - for source annotation extractor (notes)
70
+
71
+ == INSTALL:
72
+
73
+ * sudo gem install bones
74
+
75
+ == MANUAL:
76
+
77
+ The +bones+ command line tool is used to create a skeleton for a Ruby
78
+ project. In that skeleton is a "tasks" directory that contains the Mr Bones
79
+ rake files. These files are quite generic, and their functionality is
80
+ controlled by options configured in the top-level Rakefile. Take a look at
81
+ the Rakefile for the Mr Bones gem itself:
82
+
83
+ load 'tasks/setup.rb'
84
+
85
+ ensure_in_path 'lib'
86
+ require 'bones'
87
+
88
+ task :default => 'spec:run'
89
+
90
+ PROJ.name = 'bones'
91
+ PROJ.summary = 'Mr Bones is a handy tool that builds a skeleton for your new Ruby projects'
92
+ PROJ.authors = 'Tim Pease'
93
+ PROJ.email = 'not.real@fake.com'
94
+ PROJ.url = 'http://codeforpeople.rubyforge.org/bones'
95
+ PROJ.description = paragraphs_of('README.txt', 3).join("\n\n")
96
+ PROJ.changes = paragraphs_of('History.txt', 0..1).join("\n\n")
97
+ PROJ.rubyforge_name = 'codeforpeople'
98
+ PROJ.rdoc_remote_dir = 'bones'
99
+ PROJ.version = Bones::VERSION
100
+
101
+ PROJ.exclude << '^doc'
102
+ PROJ.rdoc_exclude << '^data'
103
+
104
+ PROJ.spec_opts << '--color'
105
+
106
+ # EOF
107
+
108
+ The +PROJ+ constant is an open struct that contains all the configuration
109
+ options for the project. The open struct is created in the "tasks/setup.rb"
110
+ file, and that is also where all the configurable options are defined. Take
111
+ a look in the "setup.rb" file to see what options are available, but always
112
+ make your changes in the Rakefile itself.
113
+
114
+ The Mr Bones rake system is based on a "Manifest.txt" file that contains a
115
+ list of all the files that will be used in the project. If a file does not
116
+ appear in the manifest, it will not be included in the gem. Use the
117
+ +manifest+ rake tasks to create and update the manifest as needed.
118
+
119
+ You can exclude files from being seen by the manifest -- the files are
120
+ invisible to the Mr Bones rake tasks. You would do this for any subversion
121
+ directories, backup files, or anything else you don't want gumming up the
122
+ works. The files to exclude are given as an array of regular expression
123
+ patterns.
124
+
125
+ PROJ.exclude = %w(tmp$ bak$ ~$ CVS \.svn)
126
+ PROJ.exclude << '^doc'
127
+
128
+ If your project depends on other gems, use the +depend_on+ command in your
129
+ Rakefile to declare the dependency. If you do not specify a version, the
130
+ most current version number for the installed gem is used.
131
+
132
+ depend_on 'logging'
133
+ depend_on 'rake', '0.7.3'
134
+
135
+ == LICENSE:
136
+
137
+ MIT License
138
+ Copyright (c) 2007 - 2008
139
+
140
+ Permission is hereby granted, free of charge, to any person obtaining
141
+ a copy of this software and associated documentation files (the
142
+ 'Software'), to deal in the Software without restriction, including
143
+ without limitation the rights to use, copy, modify, merge, publish,
144
+ distribute, sub-license, and/or sell copies of the Software, and to
145
+ permit persons to whom the Software is furnished to do so, subject to
146
+ the following conditions:
147
+
148
+ The above copyright notice and this permission notice shall be
149
+ included in all copies or substantial portions of the Software.
150
+
151
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
152
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
153
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
154
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
155
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
156
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
157
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,26 @@
1
+ # $Id$
2
+
3
+ load 'tasks/setup.rb'
4
+
5
+ ensure_in_path 'lib'
6
+ require 'bones'
7
+
8
+ task :default => 'spec:run'
9
+
10
+ PROJ.name = 'bones'
11
+ PROJ.summary = 'Mr Bones is a handy tool that builds a skeleton for your new Ruby projects'
12
+ PROJ.authors = 'Tim Pease'
13
+ PROJ.email = 'tim.pease@gmail.com'
14
+ PROJ.url = 'http://codeforpeople.rubyforge.org/bones'
15
+ PROJ.description = paragraphs_of('README.txt', 3).join("\n\n")
16
+ PROJ.changes = paragraphs_of('History.txt', 0..1).join("\n\n")
17
+ PROJ.rubyforge_name = 'codeforpeople'
18
+ PROJ.rdoc_remote_dir = 'bones'
19
+ PROJ.version = Bones::VERSION
20
+
21
+ PROJ.exclude << '^doc'
22
+ PROJ.rdoc_exclude << '^data'
23
+
24
+ PROJ.spec_opts << '--color'
25
+
26
+ # EOF
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.expand_path(
4
+ File.join(File.dirname(__FILE__), '..', 'lib', 'bones'))
5
+ Bones::Main.run ARGV
6
+
7
+ # EOF
@@ -0,0 +1,4 @@
1
+ == 1.0.0 / <%= Time.now.strftime("%Y-%m-%d") %>
2
+
3
+ * 1 major enhancement
4
+ * Birthday!
File without changes
@@ -0,0 +1,48 @@
1
+ <%= name %>
2
+ by FIX (your name)
3
+ FIX (url)
4
+
5
+ == DESCRIPTION:
6
+
7
+ FIX (describe your package)
8
+
9
+ == FEATURES/PROBLEMS:
10
+
11
+ * FIX (list of features or problems)
12
+
13
+ == SYNOPSIS:
14
+
15
+ FIX (code sample of usage)
16
+
17
+ == REQUIREMENTS:
18
+
19
+ * FIX (list of requirements)
20
+
21
+ == INSTALL:
22
+
23
+ * FIX (sudo gem install, anything else)
24
+
25
+ == LICENSE:
26
+
27
+ (The MIT License)
28
+
29
+ Copyright (c) 2007 FIX
30
+
31
+ Permission is hereby granted, free of charge, to any person obtaining
32
+ a copy of this software and associated documentation files (the
33
+ 'Software'), to deal in the Software without restriction, including
34
+ without limitation the rights to use, copy, modify, merge, publish,
35
+ distribute, sublicense, and/or sell copies of the Software, and to
36
+ permit persons to whom the Software is furnished to do so, subject to
37
+ the following conditions:
38
+
39
+ The above copyright notice and this permission notice shall be
40
+ included in all copies or substantial portions of the Software.
41
+
42
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
43
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
44
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
45
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
46
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
47
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
48
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,23 @@
1
+ # Look in the tasks/setup.rb file for the various options that can be
2
+ # configured in this Rakefile. The .rake files in the tasks directory
3
+ # are where the options are used.
4
+
5
+ load 'tasks/setup.rb'
6
+
7
+ ensure_in_path 'lib'
8
+ require '<%= name %>'
9
+
10
+ task :default => 'spec:run'
11
+
12
+ PROJ.name = '<%= name %>'
13
+ PROJ.summary = 'FIX'
14
+ PROJ.authors = 'FIX'
15
+ PROJ.email = 'FIX'
16
+ PROJ.url = 'FIX'
17
+ PROJ.description = paragraphs_of('README.txt', 3).join("\n\n")
18
+ PROJ.changes = paragraphs_of('History.txt', 0..1).join("\n\n")
19
+ PROJ.rubyforge_name = '<%= name %>'
20
+
21
+ PROJ.spec_opts << '--color'
22
+
23
+ # EOF
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.expand_path(
4
+ File.join(File.dirname(__FILE__), '..', 'lib', '<%= name %>'))
5
+
6
+ # Put your code here
7
+
8
+ # EOF
@@ -0,0 +1,7 @@
1
+ # $Id$
2
+
3
+ class <%= classname %>
4
+ VERSION = '1.0.0'
5
+ end
6
+
7
+ # EOF
File without changes
@@ -0,0 +1,29 @@
1
+ # $Id$
2
+
3
+ if HAVE_SOURCE_ANNOTATION_EXTRACTOR
4
+
5
+ desc "Enumerate all annotations"
6
+ task :notes do
7
+ SourceAnnotationExtractor.enumerate "OPTIMIZE|FIXME|TODO", :tag => true
8
+ end
9
+
10
+ namespace :notes do
11
+ desc "Enumerate all OPTIMIZE annotations"
12
+ task :optimize do
13
+ SourceAnnotationExtractor.enumerate "OPTIMIZE"
14
+ end
15
+
16
+ desc "Enumerate all FIXME annotations"
17
+ task :fixme do
18
+ SourceAnnotationExtractor.enumerate "FIXME"
19
+ end
20
+
21
+ desc "Enumerate all TODO annotations"
22
+ task :todo do
23
+ SourceAnnotationExtractor.enumerate "TODO"
24
+ end
25
+ end
26
+
27
+ end # if HAVE_SOURCE_ANNOTATION_EXTRACTOR
28
+
29
+ # EOF
@@ -0,0 +1,47 @@
1
+ # $Id$
2
+
3
+ require 'rake/rdoctask'
4
+
5
+ namespace :doc do
6
+
7
+ desc 'Generate RDoc documentation'
8
+ Rake::RDocTask.new do |rd|
9
+ rd.main = PROJ.rdoc_main
10
+ rd.options << '-d' if !WIN32 and `which dot` =~ %r/\/dot/
11
+ rd.rdoc_dir = PROJ.rdoc_dir
12
+
13
+ incl = Regexp.new(PROJ.rdoc_include.join('|'))
14
+ excl = Regexp.new(PROJ.rdoc_exclude.join('|'))
15
+ files = PROJ.files.find_all do |fn|
16
+ case fn
17
+ when excl; false
18
+ when incl; true
19
+ else false end
20
+ end
21
+ rd.rdoc_files.push(*files)
22
+
23
+ title = "#{PROJ.name}-#{PROJ.version} Documentation"
24
+ title = "#{PROJ.rubyforge_name}'s " + title if PROJ.rubyforge_name != title
25
+
26
+ rd.options << "-t #{title}"
27
+ end
28
+
29
+ desc 'Generate ri locally for testing'
30
+ task :ri => :clobber_ri do
31
+ sh "#{RDOC} --ri -o ri ."
32
+ end
33
+
34
+ desc 'Remove ri products'
35
+ task :clobber_ri do
36
+ rm_r 'ri' rescue nil
37
+ end
38
+
39
+ end # namespace :doc
40
+
41
+ desc 'Alias to doc:rdoc'
42
+ task :doc => 'doc:rdoc'
43
+
44
+ desc 'Remove all build products'
45
+ task :clobber => %w(doc:clobber_rdoc doc:clobber_ri)
46
+
47
+ # EOF
@@ -0,0 +1,87 @@
1
+ # $Id$
2
+
3
+ require 'rake/gempackagetask'
4
+
5
+ namespace :gem do
6
+
7
+ PROJ.spec = Gem::Specification.new do |s|
8
+ s.name = PROJ.name
9
+ s.version = PROJ.version
10
+ s.summary = PROJ.summary
11
+ s.authors = Array(PROJ.authors)
12
+ s.email = PROJ.email
13
+ s.homepage = Array(PROJ.url).first
14
+ s.rubyforge_project = PROJ.rubyforge_name
15
+
16
+ s.description = PROJ.description
17
+
18
+ PROJ.dependencies.each do |dep|
19
+ s.add_dependency(*dep)
20
+ end
21
+
22
+ s.files = PROJ.files
23
+ s.executables = PROJ.executables.map {|fn| File.basename(fn)}
24
+ s.extensions = PROJ.files.grep %r/extconf\.rb$/
25
+
26
+ s.bindir = 'bin'
27
+ dirs = Dir["{#{PROJ.libs.join(',')}}"]
28
+ s.require_paths = dirs unless dirs.empty?
29
+
30
+ incl = Regexp.new(PROJ.rdoc_include.join('|'))
31
+ excl = PROJ.rdoc_exclude.dup.concat %w[\.rb$ ^(\.\/|\/)?ext]
32
+ excl = Regexp.new(excl.join('|'))
33
+ rdoc_files = PROJ.files.find_all do |fn|
34
+ case fn
35
+ when excl; false
36
+ when incl; true
37
+ else false end
38
+ end
39
+ s.rdoc_options = PROJ.rdoc_opts + ['--main', PROJ.rdoc_main]
40
+ s.extra_rdoc_files = rdoc_files
41
+ s.has_rdoc = true
42
+
43
+ if test ?f, PROJ.test_file
44
+ s.test_file = PROJ.test_file
45
+ else
46
+ s.test_files = PROJ.tests.to_a
47
+ end
48
+
49
+ # Do any extra stuff the user wants
50
+ # spec_extras.each do |msg, val|
51
+ # case val
52
+ # when Proc
53
+ # val.call(s.send(msg))
54
+ # else
55
+ # s.send "#{msg}=", val
56
+ # end
57
+ # end
58
+ end
59
+
60
+ desc 'Show information about the gem'
61
+ task :debug do
62
+ puts PROJ.spec.to_ruby
63
+ end
64
+
65
+ Rake::GemPackageTask.new(PROJ.spec) do |pkg|
66
+ pkg.need_tar = PROJ.need_tar
67
+ pkg.need_zip = PROJ.need_zip
68
+ end
69
+
70
+ desc 'Install the gem'
71
+ task :install => [:clobber, :package] do
72
+ sh "#{SUDO} #{GEM} install pkg/#{PROJ.spec.file_name}"
73
+ end
74
+
75
+ desc 'Uninstall the gem'
76
+ task :uninstall do
77
+ sh "#{SUDO} #{GEM} uninstall -v '#{PROJ.version}' #{PROJ.name}"
78
+ end
79
+
80
+ end # namespace :gem
81
+
82
+ desc 'Alias to gem:package'
83
+ task :gem => 'gem:package'
84
+
85
+ task :clobber => 'gem:clobber_package'
86
+
87
+ # EOF