# File lib/bones/plugins/bones_plugin.rb, line 163
163: def define_tasks
164: config = ::Bones.config
165:
166: namespace :bones do
167: desc 'Show the current Mr Bones configuration'
168: task :debug do |t|
169: atr = if t.application.top_level_tasks.length == 2
170: t.application.top_level_tasks.pop
171: end
172:
173: ::Bones.help.show(atr, :descriptions => false, :values => true)
174: end
175:
176: desc 'Show descriptions for the various Mr Bones configuration options'
177: task :help do |t|
178: atr = if t.application.top_level_tasks.length == 2
179: t.application.top_level_tasks.pop
180: end
181:
182: ::Bones.help.show(atr, :descriptions => true, :values => true)
183: end
184:
185: desc 'Show the available Mr Bones configuration options'
186: task :options do |t|
187: atr = if t.application.top_level_tasks.length == 2
188: t.application.top_level_tasks.pop
189: end
190:
191: ::Bones.help.show(atr, :descriptions => false, :values => false)
192: end
193:
194: end # namespace :bones
195: end
# File lib/bones/plugins/bones_plugin.rb, line 12
12: def initialize_bones_plugin
13: ::Bones.config {
14: # ==== Project Defaults
15: name nil, :desc => The project name that will be used for packaging and distributing your Ruby code as a gem.
16:
17: summary nil, :desc => A short summary of your project. This summary is required in the gemspec, and it is used by the rubygem framework when searching for gems. If a summary is not given, then the first sentence from the project's README description is used as the summary.
18:
19: description nil, :desc => A longer description of your project. The description is used in the gemspec, but it is not required to build a gem. If a description is not given then the first paragraph from the project's README description is used as the description.
20:
21: changes nil, :desc => The list of notable changes in your project since the last release. The changes are automatically filled in by reading the list of changes from the project's History file. Only the changes for the most current release are included.
22:
23: authors nil, :desc => This can be a single author (as a string) or an array of authors if more than one person is working on the project.
24:
25: email nil, :desc => An email address so others can contact you with questions, bug reports, compliments, large quantities of cash, etc.
26:
27: url "\0000", :desc => The canonical URL for your project. This should be a location where others can go to find out more information about the project such as links to source code, bug trackers, wikis, generated documentation, etc. A good recommendation would be to point to your gem on rubygems.org.
28:
29: version nil, :desc => Version number to use when creating the gem. This can be set either in the Rakefile or on the command line by setting the VERSION flag to the desired value. | | rake gem VERSION=0.4.2 | The VERSION flag must be explicitly set on the command line when releasing a gem. This is just a safety measure to prevent premature gem release.
30:
31: release_name ENV['RELEASE'], :desc => And optional release name to be associated with your gem. This is used only when creating a release announcement.
32:
33: exclude %(tmp$ bak$ ~$ CVS \.svn/ ^\.git/ ^pkg/), :desc => A list of regular expression patterns that will be used to exclude certain files from the gem packaging process. Each pattern is given as a string, and they are all combined using the regular expression or "|" operator.
34:
35: # ==== System Defaults
36: ruby_opts %(-w), :desc => Default options to pass to the Ruby interpreter when executing tests and specs. The default is to enable all warnings. Since this is an array, the current options can be cleared and new options can be added using the standard array operations | | ruby_opts.clear | ruby_opts << '-Ilib' << '-rubygems' |
37:
38: libs Array.new, :desc => This is an array of directories to automatically include in the LOAD_PATH of your project. These directories are use for tests and specs, and the gem system sets the "require_paths" for the gem from these directories. If no libs are given, then the "lib" and "ext" directories are automatically added if they are present in your project.
39:
40: history_file 'History.txt', :desc => The name of your project's History file. The default is 'History.txt' but you are free to change it to whatever you choose.
41:
42: readme_file 'README.txt', :desc => The name of your project's README file. The default is 'README.txt' but you are free to change it to whatever you choose. Since GitHub understand various markup languages, you can change the README file to support your markup language of choice.
43:
44: ignore_file '.bnsignore', :desc => Mr Bones does not use a manifest to determine which fiels should be included in your project. All files are included unless they appear in the ignore file or in the "exclude" configruation option. The ignore file defaults to '.bnsignore'; however, if you are using git as your version control system you can just as easily set the ignore file to your '.gitignore' file.
45:
46: colorize true, :desc => When set to true, various output from Mr Bones will be colorized using terminal ANSI codes. Set to false if your terminal does not support colors.
47:
48: use_sudo false, :desc => When set to true gem commands will be run using sudo. A convenience method is provided to enable sudo for gem commands | | enable_sudo | This is equivalent to 'use_sudo true', but it reads a little nicer.
49: }
50: end
# File lib/bones/plugins/bones_plugin.rb, line 142
142: def post_load
143: config = ::Bones.config
144:
145: config.exclude << "^#{Regexp.escape(config.ignore_file)}$"
146: config.changes ||= paragraphs_of(config.history_file, 0..1).join("\n\n")
147: config.description ||= paragraphs_of(config.readme_file, 'description').join("\n\n")
148: config.summary ||= config.description.split('.').first
149:
150: config.version ||= ENV['VERSION']
151: if test(ff, 'version.txt') and !config.version
152: config.version = File.read('version.txt').strip
153: end
154: config.version ||= '0.0.0'
155:
156: if config.libs.empty?
157: %(lib ext).each { |dir| config.libs << dir if test dd, dir }
158: end
159:
160: ::Bones::Helpers::SUDO.replace('') unless config.use_sudo
161: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.