lib/frozen_gems/cli.rb in frozen_gems-0.0.1 vs lib/frozen_gems/cli.rb in frozen_gems-0.0.2
- old
+ new
@@ -1,15 +1,15 @@
require 'thor'
-require 'fileutils'
class Cli < Thor
include Thor::Actions
default_task :gems
desc 'gems [GEMFILE_PATH]',
"Write installed gems' versions to Gemfile"
- def gems(gemfile_path = 'Gemfile')
- gemfile_path = File.expand_path(gemfile_path)
- Freezer.new(gemfile_path).overwrite_gemfile
+ def gems(gemfile = GEMFILE)
+ gemfile = File.expand_path(gemfile)
+ abort "#{gemfile} is directory." if File.directory?(gemfile)
+ Freezer.new(gemfile).overwrite_gemfile
end
end