lib/awestruct/cli/options.rb in awestruct-0.5.6 vs lib/awestruct/cli/options.rb in awestruct-0.5.7.RC1
- old
+ new
@@ -4,20 +4,13 @@
module Awestruct
module CLI
class Options
- LOCAL_HOSTS = {
- 'localhost' => 'localhost',
- '0.0.0.0' => 'localhost',
- '127.0.0.1' => 'localhost',
- '::1' => '[::1]',
- 'localhost6' => 'localhost6'
- }
- DEFAULT_BIND_ADDR = '0.0.0.0'
+ DEFAULT_BIND_ADDR = 'localhost'
DEFAULT_PORT = 4242
- DEFAULT_BASE_URL = %(http://#{LOCAL_HOSTS[DEFAULT_BIND_ADDR] || DEFAULT_BIND_ADDR}:#{DEFAULT_PORT})
+ DEFAULT_BASE_URL = %(http://#{DEFAULT_BIND_ADDR}:#{DEFAULT_PORT})
DEFAULT_GENERATE_ON_ACCESS = false
attr_accessor :generate
attr_accessor :server
attr_accessor :port
@@ -78,11 +71,11 @@
end
opts.on( '-i', '--init', 'Initialize a new project in the current directory' ) do |init|
self.init = init
self.generate = false
end
- opts.on( '-f', '--framework FRAMEWORK', 'Specify a compass framework during initialization (bootstrap, foundation, blueprint, 960)' ) do |framework|
+ opts.on( '-f', '--framework FRAMEWORK', 'Specify a compass framework during initialization (bootstrap, foundation)' ) do |framework|
self.framework = framework
end
opts.on( '--[no-]scaffold', 'Create scaffolding during initialization (default: true)' ) do |s|
self.scaffold = s
end
@@ -161,10 +154,9 @@
end
end
opts.parse!(args)
self.port ||= DEFAULT_PORT
- self.bind_addr = LOCAL_HOSTS[DEFAULT_BIND_ADDR] if self.bind_addr === DEFAULT_BIND_ADDR
self.base_url = %(http://#{self.bind_addr}:#{self.port}) if self.base_url === DEFAULT_BASE_URL
self.generate = true if self.generate.nil?
self
end # parse()