2012-05-10 23:47:29 +02:00
|
|
|
# CLI Module
|
|
|
|
module Middleman::Cli
|
2012-08-14 00:39:06 +02:00
|
|
|
|
2012-05-10 23:47:29 +02:00
|
|
|
# A initializing Bundler
|
|
|
|
class Bundle < Thor
|
|
|
|
include Thor::Actions
|
|
|
|
check_unknown_options!
|
2012-08-14 00:39:06 +02:00
|
|
|
|
2012-05-10 23:47:29 +02:00
|
|
|
namespace :bundle
|
2012-08-14 00:39:06 +02:00
|
|
|
|
2012-05-10 23:47:29 +02:00
|
|
|
desc "bundle", "Setup initial bundle", :hide => true
|
2012-08-14 00:39:06 +02:00
|
|
|
|
2012-05-10 23:47:29 +02:00
|
|
|
# The setup task
|
|
|
|
def bundle
|
2012-05-11 00:07:03 +02:00
|
|
|
run('bundle install --without development test')#, :capture => true)
|
2012-05-10 23:47:29 +02:00
|
|
|
end
|
|
|
|
end
|
2012-08-14 00:39:06 +02:00
|
|
|
|
2012-05-10 23:47:29 +02:00
|
|
|
# A upgrading Bundler
|
|
|
|
class Upgrade < Thor
|
|
|
|
include Thor::Actions
|
|
|
|
check_unknown_options!
|
2012-08-14 00:39:06 +02:00
|
|
|
|
2012-05-10 23:47:29 +02:00
|
|
|
namespace :upgrade
|
|
|
|
|
|
|
|
desc "upgrade", "Upgrade installed bundle"
|
|
|
|
|
|
|
|
# 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-08-14 00:39:06 +02:00
|
|
|
|
2012-05-10 23:47:29 +02:00
|
|
|
# Map "u" to "upgrade"
|
|
|
|
Base.map({
|
|
|
|
"u" => "upgrade"
|
|
|
|
})
|
|
|
|
end
|