middleman/middleman-cli/lib/middleman-cli/bundler.rb

41 lines
705 B
Ruby
Raw Normal View History

2012-05-10 23:47:29 +02:00
# CLI Module
module Middleman::Cli
2012-05-10 23:47:29 +02:00
# A initializing Bundler
class Bundle < Thor
include Thor::Actions
check_unknown_options!
2012-05-10 23:47:29 +02:00
namespace :bundle
desc 'bundle', 'Setup initial bundle', :hide => true
2012-05-10 23:47:29 +02:00
# The setup task
def bundle
2012-12-31 04:58:37 +01:00
run('bundle install')#, :capture => true)
2012-05-10 23:47:29 +02:00
end
end
2012-05-10 23:47:29 +02:00
# A upgrading Bundler
class Upgrade < Thor
include Thor::Actions
check_unknown_options!
2012-05-10 23:47:29 +02:00
namespace :upgrade
desc 'upgrade', 'Upgrade installed bundle'
2012-05-10 23:47:29 +02:00
# The upgrade task
def upgrade
inside(ENV['MM_ROOT']) do
2012-05-11 00:07:03 +02:00
run('bundle update')#, :capture => true)
2012-05-10 23:47:29 +02:00
end
end
end
2012-05-10 23:47:29 +02:00
# Map "u" to "upgrade"
Base.map({
'u' => 'upgrade'
2012-05-10 23:47:29 +02:00
})
end