Class: Flow::Build::Service::Git
- Defined in:
- lib/flow/build/service/git.rb,
lib/flow/build/service/git/clone.rb,
lib/flow/build/service/git/ssh_key.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#branch ⇒ Object
readonly
Returns the value of attribute branch.
-
#git_url ⇒ Object
readonly
Returns the value of attribute git_url.
-
#repo_dir ⇒ Object
readonly
Returns the value of attribute repo_dir.
-
#repo_name ⇒ Object
readonly
Returns the value of attribute repo_name.
-
#script ⇒ Object
Returns the value of attribute script.
-
#ssh_key ⇒ Object
readonly
Returns the value of attribute ssh_key.
Instance Method Summary collapse
- #apply ⇒ Object
- #git_host ⇒ Object
-
#initialize(options = {}) ⇒ Git
constructor
A new instance of Git.
Methods included from SshKey
Methods included from Clone
Constructor Details
#initialize(options = {}) ⇒ Git
Returns a new instance of Git.
16 17 18 19 20 21 22 23 |
# File 'lib/flow/build/service/git.rb', line 16 def initialize( = {}) @git_url = .fetch(:git_url, '') @ssh_key = .fetch(:ssh_key, '') @repo_dir = .fetch(:repo_dir, '') @repo_name = .fetch(:repo_name, '') @branch = .fetch(:branch, 'master') @script = [] end |
Instance Attribute Details
#branch ⇒ Object (readonly)
Returns the value of attribute branch.
13 14 15 |
# File 'lib/flow/build/service/git.rb', line 13 def branch @branch end |
#git_url ⇒ Object (readonly)
Returns the value of attribute git_url.
13 14 15 |
# File 'lib/flow/build/service/git.rb', line 13 def git_url @git_url end |
#repo_dir ⇒ Object (readonly)
Returns the value of attribute repo_dir.
13 14 15 |
# File 'lib/flow/build/service/git.rb', line 13 def repo_dir @repo_dir end |
#repo_name ⇒ Object (readonly)
Returns the value of attribute repo_name.
13 14 15 |
# File 'lib/flow/build/service/git.rb', line 13 def repo_name @repo_name end |
#script ⇒ Object
Returns the value of attribute script.
14 15 16 |
# File 'lib/flow/build/service/git.rb', line 14 def script @script end |
#ssh_key ⇒ Object (readonly)
Returns the value of attribute ssh_key.
13 14 15 |
# File 'lib/flow/build/service/git.rb', line 13 def ssh_key @ssh_key end |
Instance Method Details
#apply ⇒ Object
29 30 31 32 33 |
# File 'lib/flow/build/service/git.rb', line 29 def apply install_ssh_key git_clone script.join("\n") end |
#git_host ⇒ Object
25 26 27 |
# File 'lib/flow/build/service/git.rb', line 25 def git_host git_url =~ %r(^(?:https?|git)(?:://|@)([^/]*?)(?:/|:)) && $1.split('@').last end |