Class: Bueller

Inherits:
Object
  • Object
show all
Defined in:
lib/bueller.rb,
lib/bueller/errors.rb,
lib/bueller/version.rb,
lib/bueller/commands.rb,
lib/bueller/generator.rb,
lib/bueller/gemspec_helper.rb,
lib/bueller/version_helper.rb,
lib/bueller/rubyforge_tasks.rb,
lib/bueller/generator/options.rb,
lib/bueller/generator/rdoc_mixin.rb,
lib/bueller/generator/riot_mixin.rb,
lib/bueller/generator/yard_mixin.rb,
lib/bueller/commands/version/base.rb,
lib/bueller/generator/application.rb,
lib/bueller/generator/bacon_mixin.rb,
lib/bueller/generator/rspec_mixin.rb,
lib/bueller/commands/version/write.rb,
lib/bueller/commands/write_gemspec.rb,
lib/bueller/generator/github_mixin.rb,
lib/bueller/generator/shindo_mixin.rb,
lib/bueller/generator/shoulda_mixin.rb,
lib/bueller/generator/minitest_mixin.rb,
lib/bueller/generator/testspec_mixin.rb,
lib/bueller/generator/testunit_mixin.rb,
lib/bueller/generator/micronaut_mixin.rb,
lib/bueller/commands/version/bump_major.rb,
lib/bueller/commands/version/bump_minor.rb,
lib/bueller/commands/version/bump_patch.rb,
lib/bueller/tasks.rb

Overview

Bueller helps you craft the perfect Rubygem. Give him a gemspec, and he takes care of the rest.

See Bueller::Tasks for examples of how to get started.

Defined Under Namespace

Modules: Commands Classes: FileInTheWay, GemSpecHelper, GemspecError, Generator, GitInitFailed, NoGitHubRepoNameGiven, NoGitHubToken, NoGitHubUser, NoGitUserEmail, NoGitUserName, RubyforgeTasks, Tasks, VersionHelper, VersionYmlError

Constant Summary collapse

VERSION =
"0.0.9"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_dir = '.') ⇒ Bueller

Returns a new instance of Bueller.



23
24
25
# File 'lib/bueller.rb', line 23

def initialize(base_dir = '.')
  self.base_dir = base_dir
end

Instance Attribute Details

#base_dirObject

Returns the value of attribute base_dir.



21
22
23
# File 'lib/bueller.rb', line 21

def base_dir
  @base_dir
end

#commitObject

Returns the value of attribute commit.



21
22
23
# File 'lib/bueller.rb', line 21

def commit
  @commit
end

#gemspec_helperObject

Returns the value of attribute gemspec_helper.



21
22
23
# File 'lib/bueller.rb', line 21

def gemspec_helper
  @gemspec_helper
end

#outputObject

Returns the value of attribute output.



21
22
23
# File 'lib/bueller.rb', line 21

def output
  @output
end

#repoObject

Returns the value of attribute repo.



21
22
23
# File 'lib/bueller.rb', line 21

def repo
  @repo
end

#version_helperObject

Returns the value of attribute version_helper.



21
22
23
# File 'lib/bueller.rb', line 21

def version_helper
  @version_helper
end

Instance Method Details

#bump_major_versionObject

Bumps the major version.

1.5.1 -> 2.0.0



92
93
94
# File 'lib/bueller.rb', line 92

def bump_major_version
  Bueller::Commands::Version::BumpMajor.run_for self
end

#bump_minor_versionObject

Bumps the minor version.

1.5.1 -> 1.6.0



85
86
87
# File 'lib/bueller.rb', line 85

def bump_minor_version
  Bueller::Commands::Version::BumpMinor.run_for self
end

#bump_patch_versionObject

Bumps the patch version.

1.5.1 -> 1.5.2



78
79
80
# File 'lib/bueller.rb', line 78

def bump_patch_version
  Bueller::Commands::Version::BumpPatch.run_for self
end

#git_base_dir(base_dir = nil) ⇒ Object



101
102
103
104
105
106
107
108
109
110
# File 'lib/bueller.rb', line 101

def git_base_dir(base_dir = nil)
  if base_dir
    base_dir = File.dirname(base_dir)
  else
    base_dir = File.expand_path(self.base_dir || ".")
  end
  return nil if base_dir==File.dirname("/")
  return base_dir if File.exists?(File.join(base_dir, '.git'))
  git_base_dir(base_dir)
end

#in_git_repo?Boolean

Returns:

  • (Boolean)


112
113
114
# File 'lib/bueller.rb', line 112

def in_git_repo?
  !git_base_dir.nil?
end

#major_versionObject

Major version, as defined by the gemspec’s Version module. For 1.5.3, this would return 1.



49
50
51
# File 'lib/bueller.rb', line 49

def major_version
  @version_helper.major
end

#minor_versionObject

Minor version, as defined by the gemspec’s Version module. For 1.5.3, this would return 5.



55
56
57
# File 'lib/bueller.rb', line 55

def minor_version
  @version_helper.minor
end

#patch_versionObject

Patch version, as defined by the gemspec’s Version module. For 1.5.3, this would return 5.



61
62
63
# File 'lib/bueller.rb', line 61

def patch_version
  @version_helper.patch
end

#versionObject

Human readable version, which is used in the gemspec.



66
67
68
# File 'lib/bueller.rb', line 66

def version
  version_helper.to_s
end

#write_gemspecObject

Writes out the gemspec



71
72
73
# File 'lib/bueller.rb', line 71

def write_gemspec
  Bueller::Commands::WriteGemspec.run_for self
end

#write_version(major, minor, patch, build) ⇒ Object

Bumps the version, to the specific major/minor/patch version, writing out the appropriate version.rb, and then reloads it.



97
98
99
# File 'lib/bueller.rb', line 97

def write_version(major, minor, patch, build)
  Bueller::Commands::Version::Write.run_for self, major, minor, patch, build
end