cf 3.0.0rc2 → 3.0.0rc3

Sign up to get free protection for your applications and to get access to all the features.
data/lib/cf/cli.rb CHANGED
@@ -305,9 +305,8 @@ module CF
305
305
  end
306
306
 
307
307
  def client_target
308
- if File.exists?(target_file)
309
- File.read(target_file).chomp
310
- end
308
+ return File.read(target_file).chomp if File.exists?(target_file)
309
+ sane_target_url(CF::DEFAULT_API_URL)
311
310
  end
312
311
 
313
312
  def ensure_config_dir
data/lib/cf/constants.rb CHANGED
@@ -1,10 +1,11 @@
1
1
  module CF
2
2
  CONFIG_DIR = "~/.cf".freeze
3
3
 
4
- LOGS_DIR = "#{CONFIG_DIR}/logs".freeze
5
- PLUGINS_FILE = "#{CONFIG_DIR}/plugins.yml".freeze
6
- TARGET_FILE = "#{CONFIG_DIR}/target".freeze
7
- TOKENS_FILE = "#{CONFIG_DIR}/tokens.yml".freeze
8
- COLORS_FILE = "#{CONFIG_DIR}/colors.yml".freeze
9
- CRASH_FILE = "#{CONFIG_DIR}/crash".freeze
4
+ LOGS_DIR = "#{CONFIG_DIR}/logs".freeze
5
+ PLUGINS_FILE = "#{CONFIG_DIR}/plugins.yml".freeze
6
+ TARGET_FILE = "#{CONFIG_DIR}/target".freeze
7
+ TOKENS_FILE = "#{CONFIG_DIR}/tokens.yml".freeze
8
+ COLORS_FILE = "#{CONFIG_DIR}/colors.yml".freeze
9
+ CRASH_FILE = "#{CONFIG_DIR}/crash".freeze
10
+ DEFAULT_API_URL = "api.run.pivotal.io".freeze
10
11
  end
data/lib/cf/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module CF
2
- VERSION = "3.0.0rc2".freeze
2
+ VERSION = "3.0.0rc3".freeze
3
3
  end
data/spec/cf/cli_spec.rb CHANGED
@@ -284,8 +284,8 @@ module CF
284
284
  context "when no target file exists" do
285
285
  let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/no_config" }
286
286
 
287
- it "returns nil" do
288
- expect(subject).to eq nil
287
+ it "returns the default production API url" do
288
+ expect(subject).to eq "https://api.run.pivotal.io"
289
289
  end
290
290
  end
291
291
  end
@@ -391,14 +391,6 @@ module CF
391
391
  end
392
392
  end
393
393
 
394
- context "when there is no target" do
395
- let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dirs/no_config" }
396
-
397
- it "returns nil" do
398
- expect(context.client).to eq(nil)
399
- end
400
- end
401
-
402
394
  context "with a cloud controller" do
403
395
  before do
404
396
  context.stub(:target_info) { {:version => 2} }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cf
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0rc2
4
+ version: 3.0.0rc3
5
5
  prerelease: 5
6
6
  platform: ruby
7
7
  authors: