Parent

Class Index [+]

Quicksearch

Jeweler

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:

Attributes

gemspec[R]
gemspec_helper[R]
version_helper[R]
base_dir[RW]
output[RW]
repo[RW]
commit[RW]

Public Class Methods

new(gemspec, base_dir = '.') click to toggle source
    # 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

Public Instance Methods

build_gem() click to toggle source

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
bump_major_version() click to toggle source

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
bump_minor_version() click to toggle source

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
bump_patch_version() click to toggle source

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
check_dependencies(type = nil) click to toggle source
     # 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
expects_version_file?() click to toggle source
     # File lib/jeweler.rb, line 170
170:   def expects_version_file?
171:     gemspec.version.nil?
172:   end
git_base_dir(base_dir = nil) click to toggle source
     # 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
in_git_repo?() click to toggle source
     # File lib/jeweler.rb, line 162
162:   def in_git_repo?
163:     git_base_dir
164:   end
install_gem() click to toggle source

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() click to toggle source

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() click to toggle source

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() click to toggle source

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
release_gem_to_gemcutter() click to toggle source
     # File lib/jeweler.rb, line 132
132:   def release_gem_to_gemcutter
133:     Jeweler::Commands::ReleaseToGemcutter.build_for(self).run
134:   end
release_gem_to_github() click to toggle source
     # File lib/jeweler.rb, line 124
124:   def release_gem_to_github
125:     Jeweler::Commands::ReleaseToGithub.build_for(self).run
126:   end
release_gem_to_rubyforge() click to toggle source
     # File lib/jeweler.rb, line 136
136:   def release_gem_to_rubyforge
137:     Jeweler::Commands::ReleaseToRubyforge.build_for(self).run
138:   end
release_to_git() click to toggle source
     # File lib/jeweler.rb, line 128
128:   def release_to_git
129:     Jeweler::Commands::ReleaseToGit.build_for(self).run
130:   end
setup_rubyforge() click to toggle source
     # File lib/jeweler.rb, line 140
140:   def setup_rubyforge
141:     Jeweler::Commands::SetupRubyforge.build_for(self).run
142:   end
valid_gemspec?() click to toggle source

is the project’s gemspec from disk valid?

    # File lib/jeweler.rb, line 78
78:   def valid_gemspec?
79:     gemspec_helper.valid?
80:   end
validate_gemspec() click to toggle source

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
version() click to toggle source

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
version_file_exists?() click to toggle source
     # 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
write_gemspec() click to toggle source

Writes out the gemspec

    # File lib/jeweler.rb, line 67
67:   def write_gemspec
68:     Jeweler::Commands::WriteGemspec.build_for(self).run
69:   end
write_version(major, minor, patch, build, options = {}) click to toggle source

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.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.