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

41 lines
750 B
Ruby
Raw Normal View History

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