Class: Give::Project
Overview
Give::Project
Wraps a remote repository
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#owner ⇒ Object
Returns the value of attribute owner.
-
#reference ⇒ Object
Returns the value of attribute reference.
-
#target_branch ⇒ Object
Returns the value of attribute target_branch.
-
#title ⇒ Object
Returns the value of attribute title.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
- #fork ⇒ Object
-
#initialize(owner, title, target_branch = 'master') ⇒ Project
constructor
A new instance of Project.
- #send_pull_request(repo) ⇒ Object
Methods included from Commands
Constructor Details
#initialize(owner, title, target_branch = 'master') ⇒ Project
Returns a new instance of Project.
54 55 56 57 58 59 |
# File 'lib/give.rb', line 54 def initialize(owner, title, target_branch='master') @owner, @title = owner, title @target_branch = target_branch @user = User.new @client = Octokit::Client.new end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
53 54 55 |
# File 'lib/give.rb', line 53 def client @client end |
#owner ⇒ Object
Returns the value of attribute owner.
53 54 55 |
# File 'lib/give.rb', line 53 def owner @owner end |
#reference ⇒ Object
Returns the value of attribute reference.
53 54 55 |
# File 'lib/give.rb', line 53 def reference @reference end |
#target_branch ⇒ Object
Returns the value of attribute target_branch.
53 54 55 |
# File 'lib/give.rb', line 53 def target_branch @target_branch end |
#title ⇒ Object
Returns the value of attribute title.
53 54 55 |
# File 'lib/give.rb', line 53 def title @title end |
#user ⇒ Object
Returns the value of attribute user.
53 54 55 |
# File 'lib/give.rb', line 53 def user @user end |
Instance Method Details
#fork ⇒ Object
65 66 67 68 69 |
# File 'lib/give.rb', line 65 def fork client.fork!(reference) git("clone #{master}") sh("cd #{title};git remote add upstream #{upstream}") end |
#send_pull_request(repo) ⇒ Object
71 72 73 74 |
# File 'lib/give.rb', line 71 def send_pull_request(repo) client.create_pull_request(reference, target_branch, head(repo), request_title, request_body) end |