morpheus-cli 2.10.1 → 2.10.2

Sign up to get free protection for your applications and to get access to all the features.
metadata CHANGED
@@ -1,16 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: morpheus-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.10.1
4
+ version: 2.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Estes
8
8
  - Bob Whiton
9
9
  - Jeremy Michael Crosbie
10
+ - James Dickson
10
11
  autorequire:
11
12
  bindir: bin
12
13
  cert_chain: []
13
- date: 2017-02-27 00:00:00.000000000 Z
14
+ date: 2017-03-07 00:00:00.000000000 Z
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
16
17
  name: bundler
@@ -176,11 +177,13 @@ files:
176
177
  - lib/morpheus/cli/cli_command.rb
177
178
  - lib/morpheus/cli/cli_registry.rb
178
179
  - lib/morpheus/cli/clouds.rb
179
- - lib/morpheus/cli/config_file.rb
180
+ - lib/morpheus/cli/coloring_command.rb
180
181
  - lib/morpheus/cli/credentials.rb
181
182
  - lib/morpheus/cli/dashboard_command.rb
182
183
  - lib/morpheus/cli/deployments.rb
183
184
  - lib/morpheus/cli/deploys.rb
185
+ - lib/morpheus/cli/dot_file.rb
186
+ - lib/morpheus/cli/echo_command.rb
184
187
  - lib/morpheus/cli/error_handler.rb
185
188
  - lib/morpheus/cli/groups.rb
186
189
  - lib/morpheus/cli/hosts.rb
@@ -190,6 +193,7 @@ files:
190
193
  - lib/morpheus/cli/library.rb
191
194
  - lib/morpheus/cli/license.rb
192
195
  - lib/morpheus/cli/load_balancers.rb
196
+ - lib/morpheus/cli/log_level_command.rb
193
197
  - lib/morpheus/cli/login.rb
194
198
  - lib/morpheus/cli/logout.rb
195
199
  - lib/morpheus/cli/mixins/accounts_helper.rb
@@ -205,6 +209,8 @@ files:
205
209
  - lib/morpheus/cli/security_group_rules.rb
206
210
  - lib/morpheus/cli/security_groups.rb
207
211
  - lib/morpheus/cli/shell.rb
212
+ - lib/morpheus/cli/source_command.rb
213
+ - lib/morpheus/cli/ssl_verification_command.rb
208
214
  - lib/morpheus/cli/tasks.rb
209
215
  - lib/morpheus/cli/users.rb
210
216
  - lib/morpheus/cli/version.rb
@@ -217,6 +223,7 @@ files:
217
223
  - lib/morpheus/logging.rb
218
224
  - lib/morpheus/rest_client.rb
219
225
  - morpheus-cli.gemspec
226
+ - scripts/generate_morpheus_commands_help.morpheus
220
227
  homepage: http://www.morpheusdata.com
221
228
  licenses:
222
229
  - MIT
@@ -1,126 +0,0 @@
1
- require 'fileutils'
2
- require 'time'
3
- require 'morpheus/cli/cli_registry'
4
- require 'morpheus/logging'
5
- require 'term/ansicolor'
6
-
7
- class Morpheus::Cli::ConfigFile
8
- include Term::ANSIColor
9
- class << self
10
- def init(filename=nil)
11
- @instance ||= Morpheus::Cli::ConfigFile.new(filename)
12
- end
13
-
14
- def instance
15
- #@instance ||= init(Morpheus::Cli.config_filename)
16
- @instance or raise "#{self}.init() must be called!"
17
- end
18
-
19
- end
20
-
21
- attr_reader :filename
22
- attr_reader :config
23
-
24
- def initialize(fn)
25
- @config = {}
26
- # only create the file if we're using the default, otherwise error
27
- if fn
28
- @filename = File.expand_path(fn)
29
- else
30
- @filename = File.expand_path(Morpheus::Cli.config_filename)
31
- if !Dir.exists?(File.dirname(@filename))
32
- FileUtils.mkdir_p(File.dirname(@filename))
33
- end
34
- if !File.exists?(@filename)
35
- print "#{Term::ANSIColor.dark}Initializing default config file#{Term::ANSIColor.reset}\n" if Morpheus::Logging.debug?
36
- FileUtils.touch(@filename)
37
- save_file()
38
- end
39
- end
40
- load_file()
41
- end
42
-
43
- def load_file
44
- #puts "loading config #{@filename}"
45
- @config = {}
46
- if !@filename
47
- return false
48
- end
49
- if !File.exist?(@filename)
50
- raise "Morpheus cli config file not found: #{@filename}"
51
- end
52
- file_contents = File.read(@filename)
53
- file_contents.split
54
- config_text = File.open(@filename).read
55
- config_lines = config_text.split(/\n/)
56
- #config_lines = config_lines.reject {|line| line =~ /^\#/} # strip comments
57
- config_lines.each_with_index do |line, line_index|
58
- line_num = line_index + 1
59
- line = line.strip
60
- #puts "parsing config line #{line_num} : #{line}"
61
- next if line.empty?
62
- next if line =~ /^\#/ # skip comments
63
-
64
- if line =~ /^alias\s+/
65
- alias_name, command_string = Morpheus::Cli::CliRegistry.parse_alias_definition(line)
66
- if alias_name.empty? || command_string.empty?
67
- print "#{dark} #=> bad config line #{line_num} invalid alias definition: #{line}\n" if Morpheus::Logging.debug?
68
- else
69
- # @config[:aliases] ||= []
70
- # @config[:aliases] << {name: alias_name, command: command_string}
71
- begin
72
- Morpheus::Cli::CliRegistry.instance.add_alias(alias_name, command_string)
73
- rescue => err
74
- print "#{dark} #=> #{err.message}#{reset}\n" if Morpheus::Logging.debug?
75
- end
76
- end
77
- elsif line =~ /^colorize/
78
- Term::ANSIColor::coloring = true
79
- elsif line =~ /^uncolorize/
80
- Term::ANSIColor::coloring = false
81
- # what else shall we make configurable?
82
- else
83
- print "#{dark} #=> config line #{line_num} unrecognized: #{line}#{reset}\n" if Morpheus::Logging.debug?
84
- end
85
- end
86
-
87
- # if @config[:aliases]
88
- # @config[:aliases].each do |it|
89
- # Morpheus::Cli::CliRegistry.instance.add_alias(it[:name], it[:command])
90
- # end
91
- # end
92
-
93
- #puts "done loading config from #{}"
94
-
95
- return @config
96
- end
97
-
98
- def save_file
99
- if !@filename
100
- print "#{Term::ANSIColor.dark}Skipping config file save because filename has not been set#{Term::ANSIColor.reset}\n" if Morpheus::Logging.debug?
101
- return false
102
- end
103
- print "#{dark} #=> Saving config file #{@filename}#{reset}\n" if Morpheus::Logging.debug?
104
- out = ""
105
- out << "# .morpheusrc file #{@filename}"
106
- out << "\n"
107
- out << "# Auto-generated by morpheus #{Morpheus::Cli::VERSION} on #{Time.now.iso8601}"
108
- out << "\n\n"
109
- out << "# aliases"
110
- out << "\n"
111
- Morpheus::Cli::CliRegistry.instance.all_aliases.each do |k, v|
112
- out << "alias #{k}='#{v}'"
113
- out << "\n"
114
- end
115
- out << "\n"
116
- File.open(@filename, 'w') {|f| f.write(out) }
117
- return true
118
- end
119
-
120
- # this will load any local changes, and then resave everything in the config (shell)
121
- def reload_file
122
- load_file
123
- save_file
124
- end
125
-
126
- end