tug 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a3a19cbd80c7658c71fc5354c84c7703b52b33d6
4
- data.tar.gz: 5669abeb191d05076e9a98b6429f7f3462ce887a
3
+ metadata.gz: 4cbbce158fb85e6fdfd5bef8222318e185c1fd6a
4
+ data.tar.gz: a480e0d51a26bca15128b412e19d7884495f49b6
5
5
  SHA512:
6
- metadata.gz: 49cc50b509c9a4c45de9c77eb501af64c889a026aae9c4ab292f0c1be18249885e82f9dc6f8e52d7ec41d7d656ad2430881dec0888f498daafd9623b058bec10
7
- data.tar.gz: 102358c25830e6457f3bd5cd91492429da44bee78445690579173829ffe56cd3ee4173cdbe45dbe96fc601b70eea017d82e0ba6ce7a4fdaf608787c5a1f11fe1
6
+ metadata.gz: 40580a44ec5e85d50ceabb7881da0c1eb454bd61679f0432c290113ed5bb3944fca118573e0c8006ed424d78eebd88dc389f4e8b6f431e7396f0c5fc2e1b9406
7
+ data.tar.gz: 0c5dae991023d318c4562cd57eb52f4194736760b8945c556d8612b35bdb410f7f0d145eb1c928a89d1258ff09227714b6b0c8690fcdab8f32712448c9386ce1
@@ -16,8 +16,8 @@ module Tug
16
16
 
17
17
  def initialize(path)
18
18
  config = YAML::load_file(path)
19
- @project = Tug::Project.new(config['project'])
20
- @keychain = Tug::Keychain.keychain(config['keychain'])
19
+ @project = Tug::Project.new(config)
20
+ @keychain = Tug::Keychain.keychain(config)
21
21
  end
22
22
 
23
23
  private
@@ -9,8 +9,10 @@ module Tug
9
9
  attr_accessor :name
10
10
 
11
11
  class << self
12
- def keychain(keychain_yaml)
13
- Tug::Keychain.new(keychain_yaml)
12
+ def keychain(config)
13
+ if config.has_key?("keychain")
14
+ Tug::Keychain.new(config["keychain"])
15
+ end
14
16
  end
15
17
  end
16
18
 
@@ -6,7 +6,8 @@ module Tug
6
6
  attr_reader :ipa_config
7
7
  attr_accessor :ipa_export_path
8
8
 
9
- def initialize(project_yaml)
9
+ def initialize(config)
10
+ project_yaml = config['project']
10
11
  @schemes = project_yaml['schemes']
11
12
  @workspace = project_yaml['workspace']
12
13
  @ipa_config = project_yaml['ipa_config']
data/lib/tug/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tug
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -10,7 +10,7 @@ describe Tug::IpaCommand do
10
10
  allow(FileUtils).to receive(:mv)
11
11
 
12
12
  yaml = project_yaml
13
- yaml["ipa_config"] = "InHouse"
13
+ yaml["project"]["ipa_config"] = "InHouse"
14
14
  @project = Tug::Project.new(yaml)
15
15
 
16
16
  @config = double(Tug::ConfigFile)
@@ -3,20 +3,19 @@ require "spec_helper"
3
3
  describe Tug::Keychain do
4
4
 
5
5
  before(:each) do
6
- @yaml = {"apple_certificate" => "apple",
7
- "distribution_certificate" => "dist",
8
- "distribution_profile" => "path/to/profile",
9
- "private_key" => "private"}
6
+ @yaml = keychain_yaml
10
7
 
11
8
  @keychain = Tug::Keychain.keychain(@yaml)
12
9
  allow(@keychain).to receive(:system)
13
10
  end
14
11
 
15
12
  describe "when returning keychains" do
16
- it "should return a keychian" do
13
+ it "should return a keychain" do
14
+ expect(@keychain).to be
17
15
  end
18
16
 
19
- it "should return a protected keychain if password is missing" do
17
+ it "shouldn't return one for invalid config" do
18
+ expect(Tug::Keychain.keychain({})).to be_nil
20
19
  end
21
20
  end
22
21
 
data/spec/spec_helper.rb CHANGED
@@ -2,10 +2,17 @@ require "tug"
2
2
 
3
3
  module Helpers
4
4
  def project_yaml
5
- {"workspace" => "workspace",
5
+ {"project" => {"workspace" => "workspace",
6
6
  "schemes" => ["scheme"],
7
7
  "ipa_config" => "config",
8
- "ipa_profile" => "profile"}
8
+ "ipa_profile" => "profile"}}
9
+ end
10
+
11
+ def keychain_yaml
12
+ {"keychain" => {"apple_certificate" => "apple",
13
+ "distribution_certificate" => "dist",
14
+ "distribution_profile" => "path/to/profile",
15
+ "private_key" => "private"}}
9
16
  end
10
17
  end
11
18
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tug
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Fish
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-31 00:00:00.000000000 Z
11
+ date: 2014-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor