Class: Jeweler
- Inherits:
-
Object
- Object
- Jeweler
- Defined in:
- lib/jeweler.rb,
lib/jeweler/tasks.rb,
lib/jeweler/errors.rb,
lib/jeweler/generator.rb,
lib/jeweler/gemspec_helper.rb,
lib/jeweler/version_helper.rb,
lib/jeweler/commands/release.rb,
lib/jeweler/generator/options.rb,
lib/jeweler/commands/build_gem.rb,
lib/jeweler/commands/install_gem.rb,
lib/jeweler/commands/version/base.rb,
lib/jeweler/generator/application.rb,
lib/jeweler/commands/version/write.rb,
lib/jeweler/commands/write_gemspec.rb,
lib/jeweler/commands/setup_rubyforge.rb,
lib/jeweler/commands/validate_gemspec.rb,
lib/jeweler/commands/version/bump_major.rb,
lib/jeweler/commands/version/bump_minor.rb,
lib/jeweler/commands/version/bump_patch.rb,
lib/jeweler/commands/release_to_rubyforge.rb
Overview
A Jeweler helps you craft the perfect Rubygem. Give him a gemspec, and he takes care of the rest.
Defined Under Namespace
Modules: Commands Classes: FileInTheWay, GemSpecHelper, GemspecError, Generator, GitInitFailed, MissingRubyForgePackageError, NoGitHubRepoNameGiven, NoGitHubToken, NoGitHubUser, NoGitUserEmail, NoGitUserName, NoRubyForgeProjectInGemspecError, RubyForgeProjectNotConfiguredError, Tasks, VersionHelper, VersionYmlError
Instance Attribute Summary collapse
-
#base_dir ⇒ Object
Returns the value of attribute base_dir.
-
#commit ⇒ Object
Returns the value of attribute commit.
-
#gemspec ⇒ Object
readonly
Returns the value of attribute gemspec.
-
#gemspec_helper ⇒ Object
readonly
Returns the value of attribute gemspec_helper.
-
#output ⇒ Object
Returns the value of attribute output.
-
#repo ⇒ Object
Returns the value of attribute repo.
-
#rubyforge ⇒ Object
Returns the value of attribute rubyforge.
-
#version_helper ⇒ Object
readonly
Returns the value of attribute version_helper.
Instance Method Summary collapse
- #build_gem ⇒ Object
-
#bump_major_version ⇒ Object
Bumps the major version.
-
#bump_minor_version ⇒ Object
Bumps the minor version.
-
#bump_patch_version ⇒ Object
Bumps the patch version.
- #in_git_repo? ⇒ Boolean
-
#initialize(gemspec, base_dir = '.') ⇒ Jeweler
constructor
A new instance of Jeweler.
- #install_gem ⇒ Object
-
#major_version ⇒ Object
Major version, as defined by the gemspec’s Version module.
-
#minor_version ⇒ Object
Minor version, as defined by the gemspec’s Version module.
-
#patch_version ⇒ Object
Patch version, as defined by the gemspec’s Version module.
- #release ⇒ Object
- #release_gem_to_rubyforge ⇒ Object
- #setup_rubyforge ⇒ Object
-
#valid_gemspec? ⇒ Boolean
is the project’s gemspec from disk valid?.
-
#validate_gemspec ⇒ Object
Validates the project’s gemspec from disk in an environment similar to how GitHub would build from it.
-
#version ⇒ Object
Human readable version, which is used in the gemspec.
-
#write_gemspec ⇒ Object
Writes out the gemspec.
-
#write_version(major, minor, patch, options = {}) ⇒ Object
Bumps the version, to the specific major/minor/patch version, writing out the appropriate version.rb, and then reloads it.
Constructor Details
#initialize(gemspec, base_dir = '.') ⇒ Jeweler
Returns a new instance of Jeweler.
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/jeweler.rb', line 23 def initialize(gemspec, base_dir = '.') raise(GemspecError, "Can't create a Jeweler with a nil gemspec") if gemspec.nil? @base_dir = base_dir @gemspec = fill_in_gemspec_defaults(gemspec) @repo = Git.open(base_dir) if in_git_repo? @version_helper = Jeweler::VersionHelper.new(@base_dir) @output = $stdout @commit = true @gemspec_helper = GemSpecHelper.new(@gemspec, base_dir) @rubyforge = RubyForge.new end |
Instance Attribute Details
#base_dir ⇒ Object
Returns the value of attribute base_dir.
21 22 23 |
# File 'lib/jeweler.rb', line 21 def base_dir @base_dir end |
#commit ⇒ Object
Returns the value of attribute commit.
21 22 23 |
# File 'lib/jeweler.rb', line 21 def commit @commit end |
#gemspec ⇒ Object (readonly)
Returns the value of attribute gemspec.
20 21 22 |
# File 'lib/jeweler.rb', line 20 def gemspec @gemspec end |
#gemspec_helper ⇒ Object (readonly)
Returns the value of attribute gemspec_helper.
20 21 22 |
# File 'lib/jeweler.rb', line 20 def gemspec_helper @gemspec_helper end |
#output ⇒ Object
Returns the value of attribute output.
21 22 23 |
# File 'lib/jeweler.rb', line 21 def output @output end |
#repo ⇒ Object
Returns the value of attribute repo.
21 22 23 |
# File 'lib/jeweler.rb', line 21 def repo @repo end |
#rubyforge ⇒ Object
Returns the value of attribute rubyforge.
21 22 23 |
# File 'lib/jeweler.rb', line 21 def rubyforge @rubyforge end |
#version_helper ⇒ Object (readonly)
Returns the value of attribute version_helper.
20 21 22 |
# File 'lib/jeweler.rb', line 20 def version_helper @version_helper end |
Instance Method Details
#build_gem ⇒ Object
75 76 77 |
# File 'lib/jeweler.rb', line 75 def build_gem Jeweler::Commands::BuildGem.build_for(self).run end |
#bump_major_version ⇒ Object
Bumps the major version.
1.5.1 -> 2.0.0
100 101 102 |
# File 'lib/jeweler.rb', line 100 def bump_major_version() Jeweler::Commands::Version::BumpMajor.build_for(self).run end |
#bump_minor_version ⇒ Object
Bumps the minor version.
1.5.1 -> 1.6.0
93 94 95 |
# File 'lib/jeweler.rb', line 93 def bump_minor_version() Jeweler::Commands::Version::BumpMinor.build_for(self).run end |
#bump_patch_version ⇒ Object
Bumps the patch version.
1.5.1 -> 1.5.2
86 87 88 |
# File 'lib/jeweler.rb', line 86 def bump_patch_version() Jeweler::Commands::Version::BumpPatch.build_for(self).run end |
#in_git_repo? ⇒ Boolean
127 128 129 |
# File 'lib/jeweler.rb', line 127 def in_git_repo? File.exists?(File.join(self.base_dir, '.git')) end |
#install_gem ⇒ Object
79 80 81 |
# File 'lib/jeweler.rb', line 79 def install_gem Jeweler::Commands::InstallGem.build_for(self).run end |
#major_version ⇒ Object
Major version, as defined by the gemspec’s Version module. For 1.5.3, this would return 1.
38 39 40 |
# File 'lib/jeweler.rb', line 38 def major_version @version_helper.major end |
#minor_version ⇒ Object
Minor version, as defined by the gemspec’s Version module. For 1.5.3, this would return 5.
44 45 46 |
# File 'lib/jeweler.rb', line 44 def minor_version @version_helper.minor end |
#patch_version ⇒ Object
Patch version, as defined by the gemspec’s Version module. For 1.5.3, this would return 5.
50 51 52 |
# File 'lib/jeweler.rb', line 50 def patch_version @version_helper.patch end |
#release ⇒ Object
114 115 116 |
# File 'lib/jeweler.rb', line 114 def release Jeweler::Commands::Release.build_for(self).run end |
#release_gem_to_rubyforge ⇒ Object
118 119 120 |
# File 'lib/jeweler.rb', line 118 def release_gem_to_rubyforge Jeweler::Commands::ReleaseToRubyforge.build_for(self).run end |
#setup_rubyforge ⇒ Object
122 123 124 |
# File 'lib/jeweler.rb', line 122 def setup_rubyforge Jeweler::Commands::SetupRubyforge.build_for(self).run end |
#valid_gemspec? ⇒ Boolean
is the project’s gemspec from disk valid?
71 72 73 |
# File 'lib/jeweler.rb', line 71 def valid_gemspec? gemspec_helper.valid? end |
#validate_gemspec ⇒ Object
Validates the project’s gemspec from disk in an environment similar to how GitHub would build from it. See gist.github.com/16215
66 67 68 |
# File 'lib/jeweler.rb', line 66 def validate_gemspec Jeweler::Commands::ValidateGemspec.build_for(self).run end |
#version ⇒ Object
Human readable version, which is used in the gemspec.
55 56 57 |
# File 'lib/jeweler.rb', line 55 def version @version_helper.to_s end |
#write_gemspec ⇒ Object
Writes out the gemspec
60 61 62 |
# File 'lib/jeweler.rb', line 60 def write_gemspec Jeweler::Commands::WriteGemspec.build_for(self).run end |
#write_version(major, minor, patch, options = {}) ⇒ Object
Bumps the version, to the specific major/minor/patch version, writing out the appropriate version.rb, and then reloads it.
105 106 107 108 109 110 111 112 |
# File 'lib/jeweler.rb', line 105 def write_version(major, minor, patch, = {}) command = Jeweler::Commands::Version::Write.build_for(self) command.major = major command.minor = minor command.patch = patch command.run end |