Class: Jive::Issue
- Inherits:
-
Object
- Object
- Jive::Issue
- Defined in:
- lib/jive/issue.rb
Class Method Summary collapse
- .create!(name:, type:, repo: Repo.current) ⇒ Object
- .dir_for(type, repo: Repo.current) ⇒ Object
- .for(type, repo: Repo.current) ⇒ Object
- .what_type? ⇒ Boolean
Instance Method Summary collapse
- #edit(editor: ENV["EDITOR"]) ⇒ Object
- #file_name ⇒ Object
-
#initialize(name:, type:, repo: Repo.current) ⇒ Issue
constructor
A new instance of Issue.
Constructor Details
Class Method Details
.create!(name:, type:, repo: Repo.current) ⇒ Object
15 16 17 |
# File 'lib/jive/issue.rb', line 15 def create!(name:, type:, repo: Repo.current) new(repo: repo, name: name, type: type) end |
.dir_for(type, repo: Repo.current) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/jive/issue.rb', line 26 def dir_for(type, repo: Repo.current) Jive.home .join(repo.uri.host) .join(repo.nwo) .join(type) end |
Instance Method Details
#edit(editor: ENV["EDITOR"]) ⇒ Object
44 45 46 |
# File 'lib/jive/issue.rb', line 44 def edit(editor: ENV["EDITOR"]) Jive.shell.execute([editor, issue.to_s]) end |
#file_name ⇒ Object
40 41 42 |
# File 'lib/jive/issue.rb', line 40 def file_name "#{name.gsub(/[^a-z0-9\-_]+/i, "-").downcase}.md" end |