Class: Jive::PullRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/jive/pull_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dirObject (readonly)

Returns the value of attribute dir.



5
6
7
# File 'lib/jive/pull_request.rb', line 5

def dir
  @dir
end

#uriObject (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