morpheus-cli 3.3.2.2 → 3.3.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -104,9 +104,9 @@ def format_human_duration(seconds)
104
104
  #seconds = seconds.round
105
105
  days, hours, minutes = (seconds / (60*60*24)).floor, (seconds / (60*60)).floor, (seconds / (60)).floor
106
106
  if days > 365
107
- out << "#{days.floor} days (more than a year!!)"
107
+ out << "#{days.floor} days (over a year)"
108
108
  elsif days > 61
109
- out << "#{days.floor} days (months!)"
109
+ out << "#{days.floor} days (many months)"
110
110
  elsif days > 31
111
111
  out << "#{days.floor} days (over a month)"
112
112
  elsif days > 0
@@ -90,16 +90,15 @@ module Morpheus
90
90
  end
91
91
 
92
92
  attr_accessor :prompt #, :angry_prompt
93
- attr_reader :stdin, :stdout, :stderr, :homedir
93
+ attr_reader :stdin, :stdout, :stderr, :home_directory
94
94
 
95
95
 
96
+ # Create a new instance of Morpheus::Terminal
96
97
  # @param stdin [IO] Default is STDIN
97
98
  # @param stdout [IO] Default is STDOUT
98
99
  # @param stderr [IO] Default is STDERR
99
100
  # @param [IO] stderr
100
101
  # @stderr = stderr
101
- # @homedir = homedir
102
- # instead, setup global stuff for now...
103
102
  def initialize(stdin=STDIN,stdout=STDOUT, stderr=STDERR, homedir=nil)
104
103
  # todo: establish config context for executing commands,
105
104
  # so you can run them in parallel within the same process
@@ -114,8 +113,8 @@ module Morpheus
114
113
  set_stderr(stderr)
115
114
 
116
115
  # establish home directory
117
- @homedir = homedir || ENV['MORPHEUS_CLI_HOME'] || File.join(Dir.home, ".morpheus")
118
- Morpheus::Cli.home_directory = @homedir
116
+ use_homedir = homedir || ENV['MORPHEUS_CLI_HOME'] || File.join(Dir.home, ".morpheus")
117
+ set_home_directory(use_homedir)
119
118
 
120
119
  # use colors by default
121
120
  set_coloring(STDOUT.isatty)
@@ -175,6 +174,20 @@ module Morpheus
175
174
  @stderr
176
175
  end
177
176
 
177
+ def set_home_directory(homedir)
178
+ full_homedir = File.expand_path(homedir)
179
+ # if !Dir.exists?(full_homedir)
180
+ # print_red_alert "Directory not found: #{full_homedir}"
181
+ # exit 1
182
+ # end
183
+ @home_directory = full_homedir
184
+
185
+ # todo: deprecate this
186
+ Morpheus::Cli.home_directory = full_homedir
187
+
188
+ @home_directory
189
+ end
190
+
178
191
  # def coloring=(v)
179
192
  # set_coloring(enabled)
180
193
  # end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: morpheus-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.2.2
4
+ version: 3.3.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Estes
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2018-05-23 00:00:00.000000000 Z
14
+ date: 2018-05-25 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -226,6 +226,8 @@ files:
226
226
  - lib/morpheus/cli/deploys.rb
227
227
  - lib/morpheus/cli/dot_file.rb
228
228
  - lib/morpheus/cli/echo_command.rb
229
+ - lib/morpheus/cli/edit_profile_command.rb
230
+ - lib/morpheus/cli/edit_rc_command.rb
229
231
  - lib/morpheus/cli/error_handler.rb
230
232
  - lib/morpheus/cli/groups.rb
231
233
  - lib/morpheus/cli/hosts.rb