cf 0.6.0.rc1 → 0.6.0.rc2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/cf/cli.rb +10 -11
- data/lib/cf/constants.rb +0 -3
- data/lib/cf/version.rb +1 -1
- data/spec/cf/cli_spec.rb +0 -30
- metadata +9 -9
data/lib/cf/cli.rb
CHANGED
@@ -287,14 +287,6 @@ module CF
|
|
287
287
|
url.gsub(/\/$/, "")
|
288
288
|
end
|
289
289
|
|
290
|
-
def target_file
|
291
|
-
one_of(CF::TARGET_FILE, CF::OLD_TARGET_FILE)
|
292
|
-
end
|
293
|
-
|
294
|
-
def tokens_file
|
295
|
-
one_of(CF::TOKENS_FILE, CF::OLD_TOKENS_FILE)
|
296
|
-
end
|
297
|
-
|
298
290
|
def one_of(*paths)
|
299
291
|
paths.each do |p|
|
300
292
|
exp = File.expand_path(p)
|
@@ -327,13 +319,10 @@ module CF
|
|
327
319
|
|
328
320
|
def targets_info
|
329
321
|
new_toks = File.expand_path(CF::TOKENS_FILE)
|
330
|
-
old_toks = File.expand_path(CF::OLD_TOKENS_FILE)
|
331
322
|
|
332
323
|
info =
|
333
324
|
if File.exist? new_toks
|
334
325
|
YAML.load_file(new_toks)
|
335
|
-
elsif File.exist? old_toks
|
336
|
-
MultiJson.load(File.read(old_toks))
|
337
326
|
end
|
338
327
|
|
339
328
|
info ||= {}
|
@@ -466,5 +455,15 @@ module CF
|
|
466
455
|
}
|
467
456
|
end
|
468
457
|
end
|
458
|
+
|
459
|
+
private
|
460
|
+
|
461
|
+
def target_file
|
462
|
+
File.expand_path(CF::TARGET_FILE)
|
463
|
+
end
|
464
|
+
|
465
|
+
def tokens_file
|
466
|
+
File.expand_path(CF::TOKENS_FILE)
|
467
|
+
end
|
469
468
|
end
|
470
469
|
end
|
data/lib/cf/constants.rb
CHANGED
data/lib/cf/version.rb
CHANGED
data/spec/cf/cli_spec.rb
CHANGED
@@ -260,14 +260,6 @@ describe CF::CLI do
|
|
260
260
|
end
|
261
261
|
end
|
262
262
|
|
263
|
-
context "when a ~/.cf_target exists" do
|
264
|
-
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/old" }
|
265
|
-
|
266
|
-
it "returns the target in that file" do
|
267
|
-
expect(subject).to eq "https://api.some-domain.com"
|
268
|
-
end
|
269
|
-
end
|
270
|
-
|
271
263
|
context "when no target file exists" do
|
272
264
|
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/no_config" }
|
273
265
|
|
@@ -293,18 +285,6 @@ describe CF::CLI do
|
|
293
285
|
end
|
294
286
|
end
|
295
287
|
|
296
|
-
context "when a ~/.cf_token file exists" do
|
297
|
-
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/old" }
|
298
|
-
|
299
|
-
it "returns the target in that file" do
|
300
|
-
expect(subject).to eq({
|
301
|
-
"https://api.some-domain.com" => {
|
302
|
-
:token => "bearer some-token"
|
303
|
-
}
|
304
|
-
})
|
305
|
-
end
|
306
|
-
end
|
307
|
-
|
308
288
|
context "when no token file exists" do
|
309
289
|
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/no_config" }
|
310
290
|
|
@@ -328,16 +308,6 @@ describe CF::CLI do
|
|
328
308
|
end
|
329
309
|
end
|
330
310
|
|
331
|
-
context "when a ~/.cf_token file exists" do
|
332
|
-
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/old" }
|
333
|
-
|
334
|
-
it "returns the info for the given url" do
|
335
|
-
expect(subject).to eq({
|
336
|
-
:token => "bearer some-token"
|
337
|
-
})
|
338
|
-
end
|
339
|
-
end
|
340
|
-
|
341
311
|
context "when no token file exists" do
|
342
312
|
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/no_config" }
|
343
313
|
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: -
|
4
|
+
hash: -3773193672
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
9
|
- 0
|
10
10
|
- rc
|
11
|
-
-
|
12
|
-
version: 0.6.0.
|
11
|
+
- 2
|
12
|
+
version: 0.6.0.rc2
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Cloud Foundry Team
|
@@ -18,7 +18,7 @@ autorequire:
|
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
20
|
|
21
|
-
date: 2013-03-
|
21
|
+
date: 2013-03-19 00:00:00 Z
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
24
24
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
@@ -71,14 +71,14 @@ dependencies:
|
|
71
71
|
requirements:
|
72
72
|
- - ">="
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
hash: -
|
74
|
+
hash: -3773193672
|
75
75
|
segments:
|
76
76
|
- 0
|
77
77
|
- 6
|
78
78
|
- 0
|
79
79
|
- rc
|
80
|
-
-
|
81
|
-
version: 0.6.0.
|
80
|
+
- 2
|
81
|
+
version: 0.6.0.rc2
|
82
82
|
- - <
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
hash: 5
|
@@ -134,7 +134,7 @@ dependencies:
|
|
134
134
|
requirements:
|
135
135
|
- - ">="
|
136
136
|
- !ruby/object:Gem::Version
|
137
|
-
hash: -
|
137
|
+
hash: -3773193682
|
138
138
|
segments:
|
139
139
|
- 0
|
140
140
|
- 7
|
@@ -159,7 +159,7 @@ dependencies:
|
|
159
159
|
requirements:
|
160
160
|
- - ">="
|
161
161
|
- !ruby/object:Gem::Version
|
162
|
-
hash: -
|
162
|
+
hash: -3773193618
|
163
163
|
segments:
|
164
164
|
- 0
|
165
165
|
- 3
|