Permalink
Browse files

Joys of documentation.

  • Loading branch information...
1 parent f63ae6a commit 29f699186819017d29b656a81c8a2c7c1484205a @technicalpickles technicalpickles committed Oct 8, 2009
View
@@ -1,6 +1,11 @@
require 'date'
# A Jeweler helps you craft the perfect Rubygem. Give him a gemspec, and he takes care of the rest.
+#
+# See Jeweler::Tasks for examples of how to get started. Additionally, resources are available on the wiki:
+#
+# * http://wiki.github.com/technicalpickles/jeweler/create-a-new-project
+# * http://wiki.github.com/technicalpickles/jeweler/configure-an-existing-project
class Jeweler
require 'jeweler/errors'
require 'rubygems/user_interaction'
@@ -74,10 +79,12 @@ def valid_gemspec?
gemspec_helper.valid?
end
+ # Build a gem using the project's latest Gem::Specification
def build_gem
Jeweler::Commands::BuildGem.build_for(self).run
end
+ # Install a previously built gem
def install_gem
Jeweler::Commands::InstallGem.build_for(self).run
end
@@ -11,7 +11,6 @@ class Jeweler
# Jeweler::Gemcutter.new
#
# Easy enough, right?
- #
class GemcutterTasks < ::Rake::TaskLib
attr_accessor :jeweler
@@ -58,16 +58,17 @@ def parse
parsed_gemspec
end
- def normalize_files(array_name)
- array = @spec.send(array_name)
+ def normalize_files(array_attribute)
+ array = @spec.send(array_attribute)
# only keep files, no directories, and sort
array = array.select do |path|
File.file? File.join(@base_dir, path)
end.sort
- @spec.send("#{array_name}=", array)
+ @spec.send("#{array_attribute}=", array)
end
+ # Adds extra space when outputting an array. This helps create better version control diffs, because otherwise it is all on the same line.
def prettyify_array(gemspec_ruby, array_name)
gemspec_ruby.gsub(/s\.#{array_name.to_s} = \[.+?\]/) do |match|
leadin, files = match[0..-2].split("[")
View
@@ -21,6 +21,7 @@ class NoGitHubToken < StandardError
class GitInitFailed < StandardError
end
+ # Generator for creating a jeweler-enabled project
class Generator
require 'jeweler/generator/options'
require 'jeweler/generator/application'
@@ -17,6 +17,7 @@ class Jeweler
# * project: the rubyforge project to operate on. This defaults to whatever you specified in your gemspec. Defaults to your gem name.
# * remote_doc_path: the place to upload docs to on Rubyforge under /var/www/gforge-projects/#{project}/
#
+ # See also http://wiki.github.com/technicalpickles/jeweler/rubyforge
class RubyforgeTasks < ::Rake::TaskLib
# The RubyForge project to interact with. Defaults to whatever is in your jeweler gemspec.
attr_accessor :project
@@ -3,6 +3,11 @@
class Jeweler
# Extend a Gem::Specification instance with this module to give it Jeweler
# super-cow powers.
+ #
+ # [files] a Rake::FileList of anything that is in git and not gitignored. You can include/exclude this default set, or override it entirely
+ # [test_files] Similar to gem.files, except it's only things under the spec, test, or examples directory.
+ # [extra_rdoc_files] a Rake::FileList including files like README*, ChangeLog*, and LICENSE*
+ # [executables] uses anything found in the bin/ directory. You can override this.
module Specification
def self.filelist_attribute(name)
View
@@ -4,6 +4,9 @@
class Rake::Application
attr_accessor :jeweler_tasks
+ # The jeweler instance that has be instantiated in the current Rakefile.
+ #
+ # This is usually useful if you want to get at info like version from other files.
def jeweler
jeweler_tasks.jeweler
end
@@ -23,15 +26,7 @@ class Jeweler
# gem.authors = ["Josh Nichols"]
# end
#
- # The block variable gem is actually a Gem::Specification, so you can do anything you would normally do with a Gem::Specification. For more details, see the official gemspec reference: http://docs.rubygems.org/read/chapter/20
- #
- # Jeweler fills in a few reasonable defaults for you:
- #
- # [gem.files] a Rake::FileList of anything that is in git and not gitignored. You can include/exclude this default set, or override it entirely
- # [gem.test_files] Similar to gem.files, except it's only things under the spec, test, or examples directory.
- # [gem.extra_rdoc_files] a Rake::FileList including files like README*, ChangeLog*, and LICENSE*
- # [gem.executables] uses anything found in the bin/ directory. You can override this.
- #
+ # The block variable gem is actually a Gem::Specification, so you can do anything you would normally do with a Gem::Specification. For more details, see the official gemspec reference: http://docs.rubygems.org/read/chapter/20 . In addition, it has a defaults set for you. See Jeweler::Specification for more details.
class Tasks < ::Rake::TaskLib
attr_accessor :gemspec, :jeweler, :gemspec_building_block

0 comments on commit 29f6991

Please sign in to comment.