lib/embork/cli.rb in embork-0.0.11 vs lib/embork/cli.rb in embork-0.0.12
- old
+ new
@@ -14,22 +14,22 @@
Embork::Generator.new(package_name, options).generate
end
desc "server [ENVIRONMENT]", %{run the development or production server}
option :port, :type => :numeric, :default => 9292
- option :host, :type => :string, :default => 'localhost'
+ option :host, :type => :string, :default => '0.0.0.0'
option :bundle_version, :type => :string, :default => nil
option :with_latest_bundle, :type => :boolean, :default => false
option :enable_tests, :type => :boolean, :default => false
def server(environment = :development)
borkfile = Embork::Borkfile.new options[:borkfile], environment
Embork::Server.new(borkfile, options).run_webrick
end
desc "phrender [ENVIRONMENT]", %{run phrender the prerenderer}
option :port, :type => :numeric, :default => 9292
- option :host, :type => :string, :default => 'localhost'
+ option :host, :type => :string, :default => '0.0.0.0'
option :bundle_version, :type => :string, :default => nil
option :with_latest_bundle, :type => :boolean, :default => false
def phrender(environment = :development)
borkfile = Embork::Borkfile.new options[:borkfile], environment
Embork::Phrender.new(borkfile, options).run_webrick
@@ -39,11 +39,11 @@
def test(environment = :development)
borkfile = Embork::Borkfile.new options[:borkfile], environment
min = 52000
max = 65000
port = (Random.rand * (max - min) + min).to_i
- host = 'localhost'
+ host = '0.0.0.0'
server_options = {
:host => host,
:port => port,
:enable_tests => true,
@@ -64,10 +64,12 @@
:desc => %{By default, older versions of the project are removed, only keeping the last few versions. This flag keeps all old versions.}
def build(environment = :production)
borkfile = Embork::Borkfile.new options[:borkfile], environment
builder = Embork::Builder.new(borkfile)
builder.build
- builder.clean unless options[:keep_all_old_versions]
+ if !options[:keep_all_old_versions]
+ builder.clean
+ end
end
desc "clean", %{Remove all files under the build directory}
def clean
borkfile = Embork::Borkfile.new options[:borkfile]