Class: Appleseed
- Inherits:
-
Object
- Object
- Appleseed
- Defined in:
- lib/appleseed.rb,
lib/appleseed/errors.rb,
lib/appleseed/options.rb,
lib/appleseed/generator.rb,
lib/appleseed/application.rb,
lib/appleseed/generator/github_mixin.rb
Defined Under Namespace
Classes: FileInTheWay, GemspecError, Generator, GitInitFailed, NoGitHubRepoNameGiven, NoGitHubToken, NoGitHubUser, NoGitUserEmail, NoGitUserName, 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.
-
#version_helper ⇒ Object
readonly
Returns the value of attribute version_helper.
Instance Method Summary collapse
- #git_base_dir(base_dir = nil) ⇒ Object
- #in_git_repo? ⇒ Boolean
-
#initialize(base_dir = '.') ⇒ Appleseed
constructor
A new instance of Appleseed.
Constructor Details
#initialize(base_dir = '.') ⇒ Appleseed
Returns a new instance of Appleseed.
13 14 15 16 17 18 19 |
# File 'lib/appleseed.rb', line 13 def initialize(base_dir = '.') @base_dir = base_dir @repo = Git.open(git_base_dir) if in_git_repo? @output = $stdout @commit = true end |
Instance Attribute Details
#base_dir ⇒ Object
Returns the value of attribute base_dir.
11 12 13 |
# File 'lib/appleseed.rb', line 11 def base_dir @base_dir end |
#commit ⇒ Object
Returns the value of attribute commit.
11 12 13 |
# File 'lib/appleseed.rb', line 11 def commit @commit end |
#gemspec ⇒ Object (readonly)
Returns the value of attribute gemspec.
10 11 12 |
# File 'lib/appleseed.rb', line 10 def gemspec @gemspec end |
#gemspec_helper ⇒ Object (readonly)
Returns the value of attribute gemspec_helper.
10 11 12 |
# File 'lib/appleseed.rb', line 10 def gemspec_helper @gemspec_helper end |
#output ⇒ Object
Returns the value of attribute output.
11 12 13 |
# File 'lib/appleseed.rb', line 11 def output @output end |
#repo ⇒ Object
Returns the value of attribute repo.
11 12 13 |
# File 'lib/appleseed.rb', line 11 def repo @repo end |
#version_helper ⇒ Object (readonly)
Returns the value of attribute version_helper.
10 11 12 |
# File 'lib/appleseed.rb', line 10 def version_helper @version_helper end |
Instance Method Details
#git_base_dir(base_dir = nil) ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/appleseed.rb', line 21 def git_base_dir(base_dir = nil) if base_dir base_dir = File.dirname(base_dir) else base_dir = File.(self.base_dir || ".") end return nil if base_dir==File.dirname("/") return base_dir if File.exists?(File.join(base_dir, '.git')) return git_base_dir(base_dir) end |
#in_git_repo? ⇒ Boolean
32 33 34 |
# File 'lib/appleseed.rb', line 32 def in_git_repo? git_base_dir end |