Class: GemfileLocker::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/gemfile_locker/cli.rb

Instance Method Summary collapse

Instance Method Details

#lock(*only) ⇒ Object



24
25
26
27
28
29
# File 'lib/gemfile_locker/cli.rb', line 24

def lock(*only)
  gemfile = options[:gemfile]
  lockfile = File.read("#{gemfile}.lock")
  processor_opts = only.any? ? options.merge(only: only) : options
  run_editor gemfile, Locker.new(lockfile, processor_opts)
end

#unlock(*only) ⇒ Object



36
37
38
39
# File 'lib/gemfile_locker/cli.rb', line 36

def unlock(*only)
  processor_opts = only.any? ? options.merge(only: only) : options
  run_editor options[:gemfile], Unlocker.new(processor_opts)
end