Class: Toolshed::Git
- Inherits:
-
Object
- Object
- Toolshed::Git
- Defined in:
- lib/toolshed/git.rb,
lib/toolshed/git/branch.rb,
lib/toolshed/git/github.rb,
lib/toolshed/git/validator.rb
Defined Under Namespace
Classes: Branch, Github, Validator
Constant Summary collapse
- DEFAULT_GIT_TOOL =
'github'
- DEFAULT_BRANCH_FROM =
'master'
Instance Attribute Summary collapse
-
#force ⇒ Object
Returns the value of attribute force.
-
#from_remote_branch_name ⇒ Object
Returns the value of attribute from_remote_branch_name.
-
#from_remote_name ⇒ Object
Returns the value of attribute from_remote_name.
-
#passed_branch_name ⇒ Object
Returns the value of attribute passed_branch_name.
-
#to_remote_branch_name ⇒ Object
Returns the value of attribute to_remote_branch_name.
-
#to_remote_name ⇒ Object
Returns the value of attribute to_remote_name.
-
#validator ⇒ Object
Returns the value of attribute validator.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Git
constructor
A new instance of Git.
- #remote_update ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Git
Returns a new instance of Git.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/toolshed/git.rb', line 14 def initialize( = {}) # options with defaults self.from_remote_name = Toolshed::Client.instance.pull_from_remote_name unless ([:from_remote_name].nil?) self.from_remote_name = [:from_remote_name] end self.to_remote_name = Toolshed::Client.instance.push_to_remote_name unless ([:to_remote_name].nil?) self.to_remote_name = [:to_remote_name] end # options that do not have a default unless ([:from_remote_branch_name].nil?) self.from_remote_branch_name = [:from_remote_branch_name] end unless ([:to_remote_branch_name].nil?) self.to_remote_branch_name = [:to_remote_branch_name] end self.validator = ::Toolshed::Git::Validator.new self.passed_branch_name = [:branch_name] || '' self.force = (.key?(:force_command)) ? '--force' : '' end |
Instance Attribute Details
#force ⇒ Object
Returns the value of attribute force.
12 13 14 |
# File 'lib/toolshed/git.rb', line 12 def force @force end |
#from_remote_branch_name ⇒ Object
Returns the value of attribute from_remote_branch_name.
12 13 14 |
# File 'lib/toolshed/git.rb', line 12 def from_remote_branch_name @from_remote_branch_name end |
#from_remote_name ⇒ Object
Returns the value of attribute from_remote_name.
12 13 14 |
# File 'lib/toolshed/git.rb', line 12 def from_remote_name @from_remote_name end |
#passed_branch_name ⇒ Object
Returns the value of attribute passed_branch_name.
12 13 14 |
# File 'lib/toolshed/git.rb', line 12 def passed_branch_name @passed_branch_name end |
#to_remote_branch_name ⇒ Object
Returns the value of attribute to_remote_branch_name.
12 13 14 |
# File 'lib/toolshed/git.rb', line 12 def to_remote_branch_name @to_remote_branch_name end |
#to_remote_name ⇒ Object
Returns the value of attribute to_remote_name.
12 13 14 |
# File 'lib/toolshed/git.rb', line 12 def to_remote_name @to_remote_name end |
#validator ⇒ Object
Returns the value of attribute validator.
12 13 14 |
# File 'lib/toolshed/git.rb', line 12 def validator @validator end |