Class: Michael::Commands::Repos::Edit

Inherits:
Object
  • Object
show all
Defined in:
lib/michael/commands/repos/edit.rb

Instance Method Summary collapse

Constructor Details

#initialize(repos_filepath, cfg, editor, options) ⇒ Edit

Returns a new instance of Edit.



7
8
9
10
11
12
13
14
# File 'lib/michael/commands/repos/edit.rb', line 7

def initialize(repos_filepath, cfg, editor, options)
  super()

  @repos_filepath = repos_filepath
  @cfg = cfg
  @editor = editor
  @options = options
end

Instance Method Details

#executeObject



16
17
18
19
20
21
# File 'lib/michael/commands/repos/edit.rb', line 16

def execute
  list = cfg.fetch(:repos)
  cfg.append('org/repo', to: :repos) if list.nil? || list.empty?

  editor.open(repos_filepath)
end