diff --git a/lib/rhc/commands/cartridge.rb b/lib/rhc/commands/cartridge.rb index 675dbd12d..efdd7cfae 100644 --- a/lib/rhc/commands/cartridge.rb +++ b/lib/rhc/commands/cartridge.rb @@ -7,7 +7,7 @@ class Cartridge < Base syntax "" description <<-DESC Cartridges add functionality to OpenShift applications. Each application - has one web cartridge to listens for HTTP requests, and any number + has one web cartridge to listen for HTTP requests, and any number of addon cartridges. Addons may include databases like MySQL and Mongo, administrative tools like phpMyAdmin, or build clients like Jenkins. diff --git a/lib/rhc/helpers.rb b/lib/rhc/helpers.rb index c06b3c3f3..0db8be576 100644 --- a/lib/rhc/helpers.rb +++ b/lib/rhc/helpers.rb @@ -33,6 +33,11 @@ def decode_json(s) RHC::Vendor::OkJson.decode(s) end + def system_path(path) + return path.gsub(File::SEPARATOR, File::ALT_SEPARATOR) if File.const_defined?('ALT_SEPARATOR') and File::ALT_SEPARATOR.present? + path + end + def date(s) now = Date.today d = datetime_rfc3339(s).to_time @@ -112,7 +117,7 @@ def user_agent global_option '--noprompt', "Suppress all interactive operations command", :hide => true do $terminal.page_at = nil end - global_option '--config FILE', "Path of a different config file", :hide => true + global_option '--config FILE', "Path of a different config file (default: #{system_path("~/.openshift/express.conf")})", :hide => true global_option '--clean', "Ignore any saved configuration options", :hide => true global_option '--mock', "Run in mock mode", :hide => true do #:nocov: @@ -308,11 +313,6 @@ def windows? ; RUBY_PLATFORM =~ /win(32|dows|ce)|djgpp|(ms|cyg|bcc)win|mingw32/i def unix? ; !jruby? && !windows? end def mac? ; RbConfig::CONFIG['host_os'] =~ /^darwin/ end - def system_path(path) - return path.gsub(File::SEPARATOR, File::ALT_SEPARATOR) if File.const_defined?('ALT_SEPARATOR') and File::ALT_SEPARATOR.present? - path - end - # # Check if host exists # diff --git a/rhc.gemspec b/rhc.gemspec index db3252ac2..5bdd1ec0f 100644 --- a/rhc.gemspec +++ b/rhc.gemspec @@ -33,7 +33,7 @@ Gem::Specification.new do |s| s.add_dependency 'net-ssh', '>= 2.0.11' s.add_dependency 'archive-tar-minitar' s.add_runtime_dependency 'commander', '>= 4.0' - s.add_runtime_dependency 'highline', '>= 1.5.1' + s.add_runtime_dependency 'highline', '~> 1.6.11' s.add_runtime_dependency 'httpclient', '>= 2.2' s.add_runtime_dependency 'open4' s.add_development_dependency 'rake', '>= 0.8.7', '<= 0.9.2.2' diff --git a/spec/rhc/helpers_spec.rb b/spec/rhc/helpers_spec.rb index f91dce2e8..0d5510e8e 100644 --- a/spec/rhc/helpers_spec.rb +++ b/spec/rhc/helpers_spec.rb @@ -336,6 +336,7 @@ def options it{ "\e[12;34ma".textwrap_ansi(1).should == ["\e[12;34ma\e[0m"] } it{ "\e[1m\e[1m".textwrap_ansi(1).should == ["\e[1m\e[1m\e[0m"] } it{ "\e[1m \e[1m".textwrap_ansi(1).should == ["\e[1m\e[0m", "\e[1m\e[1m\e[0m"] } + it{ "\e[1ma\nb".textwrap_ansi(80).should == ["\e[1ma","b"] } it{ "ab".textwrap_ansi(1,false).should == ['ab'] } it{ " abc".textwrap_ansi(3,false).should == [' abc'] } @@ -349,6 +350,8 @@ def options describe "#strip_ansi" do it{ "\e[1m \e[1m".strip_ansi.should == " " } + it{ "\eiei0".strip_ansi.should == "\eiei0" } + it{ "\e[iei0]".strip_ansi.should == "\e[iei0]" } end context "Resolv helper" do