Class: Jive::PullRequest
- Inherits:
-
Object
- Object
- Jive::PullRequest
- Defined in:
- lib/jive/pull_request.rb
Instance Attribute Summary collapse
-
#dir ⇒ Object
readonly
Returns the value of attribute dir.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
- #edit(editor) ⇒ Object
-
#initialize(repo: Repo.current) ⇒ PullRequest
constructor
A new instance of PullRequest.
Constructor Details
#initialize(repo: Repo.current) ⇒ PullRequest
Returns a new instance of PullRequest.
7 8 9 10 |
# File 'lib/jive/pull_request.rb', line 7 def initialize(repo: Repo.current) @dir = Jive.home.join(repo.uri.host).join(repo.branch) Jive.shell.execute([:mkdir, "-p", @dir]) unless @dir.exist? end |
Instance Attribute Details
#dir ⇒ Object (readonly)
Returns the value of attribute dir.
5 6 7 |
# File 'lib/jive/pull_request.rb', line 5 def dir @dir end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
5 6 7 |
# File 'lib/jive/pull_request.rb', line 5 def uri @uri end |
Instance Method Details
#edit(editor) ⇒ Object
12 13 14 |
# File 'lib/jive/pull_request.rb', line 12 def edit(editor) Jive.shell.execute([editor, readme.to_s]) end |