Object
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:
# File lib/jeweler.rb, line 28 28: def initialize(gemspec, base_dir = '.') 29: raise(GemspecError, "Can't create a Jeweler with a nil gemspec") if gemspec.nil? 30: 31: @gemspec = gemspec 32: @gemspec.extend(Specification) 33: @gemspec.set_jeweler_defaults(base_dir, git_base_dir) 34: 35: @base_dir = base_dir 36: @repo = Git.open(git_base_dir) if in_git_repo? 37: @version_helper = Jeweler::VersionHelper.new(base_dir) 38: @output = $stdout 39: @commit = true 40: @gemspec_helper = GemSpecHelper.new(gemspec, base_dir) 41: end
Build a gem using the project’s latest Gem::Specification
# File lib/jeweler.rb, line 83 83: def build_gem 84: Jeweler::Commands::BuildGem.build_for(self).run 85: end
Bumps the major version.
1.5.1 -> 2.0.0
# File lib/jeweler.rb, line 109 109: def bump_major_version() 110: Jeweler::Commands::Version::BumpMajor.build_for(self).run 111: end
Bumps the minor version.
1.5.1 -> 1.6.0
# File lib/jeweler.rb, line 102 102: def bump_minor_version() 103: Jeweler::Commands::Version::BumpMinor.build_for(self).run 104: end
Bumps the patch version.
1.5.1 -> 1.5.2
# File lib/jeweler.rb, line 95 95: def bump_patch_version() 96: Jeweler::Commands::Version::BumpPatch.build_for(self).run 97: end
# File lib/jeweler.rb, line 144 144: def check_dependencies(type = nil) 145: command = Jeweler::Commands::CheckDependencies.build_for(self) 146: command.type = type 147: 148: command.run 149: end
# File lib/jeweler.rb, line 170 170: def expects_version_file? 171: gemspec.version.nil? 172: end
# File lib/jeweler.rb, line 151 151: def git_base_dir(base_dir = nil) 152: if base_dir 153: base_dir = File.dirname(base_dir) 154: else 155: base_dir = File.expand_path(self.base_dir || ".") 156: end 157: return nil if base_dir==File.dirname("/") 158: return base_dir if File.exists?(File.join(base_dir, '.git')) 159: return git_base_dir(base_dir) 160: end
# File lib/jeweler.rb, line 162 162: def in_git_repo? 163: git_base_dir 164: end
Install a previously built gem
# File lib/jeweler.rb, line 88 88: def install_gem 89: Jeweler::Commands::InstallGem.build_for(self).run 90: end
Major version, as defined by the gemspec’s Version module. For 1.5.3, this would return 1.
# File lib/jeweler.rb, line 45 45: def major_version 46: @version_helper.major 47: end
Minor version, as defined by the gemspec’s Version module. For 1.5.3, this would return 5.
# File lib/jeweler.rb, line 51 51: def minor_version 52: @version_helper.minor 53: end
Patch version, as defined by the gemspec’s Version module. For 1.5.3, this would return 5.
# File lib/jeweler.rb, line 57 57: def patch_version 58: @version_helper.patch 59: end
# File lib/jeweler.rb, line 132 132: def release_gem_to_gemcutter 133: Jeweler::Commands::ReleaseToGemcutter.build_for(self).run 134: end
# File lib/jeweler.rb, line 124 124: def release_gem_to_github 125: Jeweler::Commands::ReleaseToGithub.build_for(self).run 126: end
# File lib/jeweler.rb, line 136 136: def release_gem_to_rubyforge 137: Jeweler::Commands::ReleaseToRubyforge.build_for(self).run 138: end
# File lib/jeweler.rb, line 128 128: def release_to_git 129: Jeweler::Commands::ReleaseToGit.build_for(self).run 130: end
# File lib/jeweler.rb, line 140 140: def setup_rubyforge 141: Jeweler::Commands::SetupRubyforge.build_for(self).run 142: end
is the project’s gemspec from disk valid?
# File lib/jeweler.rb, line 78 78: def valid_gemspec? 79: gemspec_helper.valid? 80: end
Validates the project’s gemspec from disk in an environment similar to how GitHub would build from it. See gist.github.com/16215
# File lib/jeweler.rb, line 73 73: def validate_gemspec 74: Jeweler::Commands::ValidateGemspec.build_for(self).run 75: end
Human readable version, which is used in the gemspec.
# File lib/jeweler.rb, line 62 62: def version 63: @gemspec.version || @version_helper.to_s 64: end
# File lib/jeweler.rb, line 166 166: def version_file_exists? 167: File.exists?(@version_helper.plaintext_path) || File.exists?(@version_helper.yaml_path) 168: end
Writes out the gemspec
# File lib/jeweler.rb, line 67 67: def write_gemspec 68: Jeweler::Commands::WriteGemspec.build_for(self).run 69: end
Bumps the version, to the specific major/minor/patch version, writing out the appropriate version.rb, and then reloads it.
# File lib/jeweler.rb, line 114 114: def write_version(major, minor, patch, build, options = {}) 115: command = Jeweler::Commands::Version::Write.build_for(self) 116: command.major = major 117: command.minor = minor 118: command.patch = patch 119: command.build = build 120: 121: command.run 122: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.