vmc 0.2.10 → 0.2.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,6 +26,7 @@ module VMC::Cli::Command
26
26
 
27
27
  def set_target(target_url)
28
28
  target_url = "http://#{target_url}" unless /^https?/ =~ target_url
29
+ target_url = target_url.gsub(/\/+$/, '')
29
30
  client = VMC::Client.new(target_url)
30
31
  unless client.target_valid?
31
32
  if prompt_ok
@@ -72,7 +73,7 @@ module VMC::Cli::Command
72
73
  return display "No Aliases" if aliases.empty?
73
74
  atable = table do |t|
74
75
  t.headings = 'Alias', "Command"
75
- aliases.each { |k,v| t << [v, k] }
76
+ aliases.each { |k,v| t << [k, v] }
76
77
  end
77
78
  display "\n"
78
79
  display atable
@@ -88,9 +89,13 @@ module VMC::Cli::Command
88
89
 
89
90
  def unalias(key)
90
91
  aliases = VMC::Cli::Config.aliases
91
- aliases.delete(key)
92
- VMC::Cli::Config.store_aliases(aliases)
93
- display "Successfully unaliased '#{key}'".green
92
+ if aliases.has_key?(key)
93
+ aliases.delete(key)
94
+ VMC::Cli::Config.store_aliases(aliases)
95
+ display "Successfully unaliased '#{key}'".green
96
+ else
97
+ display "Unknown alias '#{key}'".red
98
+ end
94
99
  end
95
100
 
96
101
  end
data/lib/cli/config.rb CHANGED
@@ -36,6 +36,7 @@ module VMC::Cli
36
36
  @suggest_url = DEFAULT_SUGGEST
37
37
  end
38
38
  @target_url = "http://#{@target_url}" unless /^https?/ =~ @target_url
39
+ @target_url = @target_url.gsub(/\/+$/, '')
39
40
  @target_url
40
41
  end
41
42
 
data/lib/cli/version.rb CHANGED
@@ -2,6 +2,6 @@ module VMC
2
2
  module Cli
3
3
  # This version number is used as the RubyGem release version.
4
4
  # The internal VMC version number is VMC::VERSION.
5
- VERSION = '0.2.10'
5
+ VERSION = '0.2.11'
6
6
  end
7
7
  end
data/lib/vmc/client.rb CHANGED
@@ -37,6 +37,7 @@ class VMC::Client
37
37
  # Initialize new client to the target_uri with optional auth_token
38
38
  def initialize(target_url=VMC::DEFAULT_TARGET, auth_token=nil)
39
39
  target_url = "http://#{target_url}" unless /^https?/ =~ target_url
40
+ target_url = target_url.gsub(/\/+$/, '')
40
41
  @target = target_url
41
42
  @auth_token = auth_token
42
43
  end
metadata CHANGED
@@ -1,8 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vmc
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 1
4
5
  prerelease:
5
- version: 0.2.10
6
+ segments:
7
+ - 0
8
+ - 2
9
+ - 11
10
+ version: 0.2.11
6
11
  platform: ruby
7
12
  authors:
8
13
  - VMware
@@ -10,7 +15,7 @@ autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
17
 
13
- date: 2011-04-03 00:00:00 -05:00
18
+ date: 2011-04-04 00:00:00 -05:00
14
19
  default_executable:
15
20
  dependencies:
16
21
  - !ruby/object:Gem::Dependency
@@ -21,6 +26,11 @@ dependencies:
21
26
  requirements:
22
27
  - - ~>
23
28
  - !ruby/object:Gem::Version
29
+ hash: 1
30
+ segments:
31
+ - 1
32
+ - 5
33
+ - 1
24
34
  version: 1.5.1
25
35
  type: :runtime
26
36
  version_requirements: *id001
@@ -32,6 +42,11 @@ dependencies:
32
42
  requirements:
33
43
  - - ~>
34
44
  - !ruby/object:Gem::Version
45
+ hash: 13
46
+ segments:
47
+ - 2
48
+ - 0
49
+ - 1
35
50
  version: 2.0.1
36
51
  type: :runtime
37
52
  version_requirements: *id002
@@ -43,6 +58,11 @@ dependencies:
43
58
  requirements:
44
59
  - - ~>
45
60
  - !ruby/object:Gem::Version
61
+ hash: 13
62
+ segments:
63
+ - 1
64
+ - 6
65
+ - 1
46
66
  version: 1.6.1
47
67
  type: :runtime
48
68
  version_requirements: *id003
@@ -54,9 +74,19 @@ dependencies:
54
74
  requirements:
55
75
  - - ">="
56
76
  - !ruby/object:Gem::Version
77
+ hash: 13
78
+ segments:
79
+ - 1
80
+ - 6
81
+ - 1
57
82
  version: 1.6.1
58
83
  - - <
59
84
  - !ruby/object:Gem::Version
85
+ hash: 11
86
+ segments:
87
+ - 1
88
+ - 7
89
+ - 0
60
90
  version: 1.7.0
61
91
  type: :runtime
62
92
  version_requirements: *id004
@@ -68,6 +98,11 @@ dependencies:
68
98
  requirements:
69
99
  - - ~>
70
100
  - !ruby/object:Gem::Version
101
+ hash: 3
102
+ segments:
103
+ - 1
104
+ - 4
105
+ - 2
71
106
  version: 1.4.2
72
107
  type: :runtime
73
108
  version_requirements: *id005
@@ -79,6 +114,9 @@ dependencies:
79
114
  requirements:
80
115
  - - ">="
81
116
  - !ruby/object:Gem::Version
117
+ hash: 3
118
+ segments:
119
+ - 0
82
120
  version: "0"
83
121
  type: :development
84
122
  version_requirements: *id006
@@ -90,6 +128,11 @@ dependencies:
90
128
  requirements:
91
129
  - - ~>
92
130
  - !ruby/object:Gem::Version
131
+ hash: 27
132
+ segments:
133
+ - 1
134
+ - 3
135
+ - 0
93
136
  version: 1.3.0
94
137
  type: :development
95
138
  version_requirements: *id007
@@ -101,6 +144,11 @@ dependencies:
101
144
  requirements:
102
145
  - - ~>
103
146
  - !ruby/object:Gem::Version
147
+ hash: 3
148
+ segments:
149
+ - 1
150
+ - 5
151
+ - 0
104
152
  version: 1.5.0
105
153
  type: :development
106
154
  version_requirements: *id008
@@ -171,12 +219,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
171
219
  requirements:
172
220
  - - ">="
173
221
  - !ruby/object:Gem::Version
222
+ hash: 3
223
+ segments:
224
+ - 0
174
225
  version: "0"
175
226
  required_rubygems_version: !ruby/object:Gem::Requirement
176
227
  none: false
177
228
  requirements:
178
229
  - - ">="
179
230
  - !ruby/object:Gem::Version
231
+ hash: 3
232
+ segments:
233
+ - 0
180
234
  version: "0"
181
235
  requirements: []
182
236