tug 0.0.11 → 0.1.0

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: 7ef802a29eb4279c1e6e9d21812d43a2e83013f0
4
- data.tar.gz: 0978140b84a203282b7349981233499d802c10ba
3
+ metadata.gz: 888e074597d703368a8a64cd93c5d23fa2fbf184
4
+ data.tar.gz: c0ef31b173bb0f70cc613a29677372c46532f847
5
5
  SHA512:
6
- metadata.gz: 146d9fd46884fbcefd7029950802c81b89a337389a2a45a72d1086d3240421980391e4042b4c7827ae55227604855504dc111a0a40b2b883ae0f92e4f3cf2b80
7
- data.tar.gz: 773f873d8f169831cd61d7c791e3d44927c9ed2ae68bd6d7c90bb7b63277f13c424dc4636381253768f21f0a553cb32617c921f6474c07a234bb2459de731e0e
6
+ metadata.gz: 14b6a5bc4b2981aa132efd85616c8d50f2aae377c68d5ea2797a004e4c2302b3b49ed7220f0b6cb7cc6cc37fc0936e0aa01e70db286ea64edf078caef93366a3
7
+ data.tar.gz: ae071e6fcf82da10f4a21242d100452dc737586592c7bb5261927a2829d58a4ab26e4731bd215d19f3a0ac54a93b024caecd6e1bd1205a2f762201a77a580f1a
@@ -5,6 +5,7 @@ module Tug
5
5
  super
6
6
  export_ipa(config_file.project)
7
7
  move_ipa(config_file.project)
8
+ zip_and_move_dsym(config_file.project)
8
9
  end
9
10
 
10
11
  private
@@ -21,5 +22,19 @@ module Tug
21
22
  FileUtils.mv "/tmp/#{scheme}.ipa", "#{project.ipa_export_path}/#{scheme}.ipa"
22
23
  end
23
24
  end
25
+
26
+ def zip_and_move_dsym(project)
27
+ project.schemes.each do |scheme|
28
+ zipfile = zip_file "/tmp/#{scheme}.xcarchive/dSYMs", "#{scheme}.app.dSYM"
29
+ FileUtils.mv zipfile, "#{project.ipa_export_path}/#{scheme}.app.dSYM.zip"
30
+ end
31
+ end
32
+
33
+ def zip_file(folder, file)
34
+ file_name = file.split("/").last
35
+ system("cd #{folder} && zip -r #{file + ".zip"} #{file}")
36
+
37
+ return folder + "/" + file + ".zip"
38
+ end
24
39
  end
25
40
  end
@@ -2,6 +2,7 @@ module Tug
2
2
  class Deployer
3
3
 
4
4
  attr_reader :file
5
+ attr_reader :dsym
5
6
  attr_reader :api_token
6
7
  attr_reader :notes
7
8
  attr_reader :notify
@@ -10,6 +11,7 @@ module Tug
10
11
  @file = options[:file]
11
12
  @api_token = options[:api_token]
12
13
  @notify = options[:notify]
14
+ @dsym = options[:dsym]
13
15
 
14
16
  self.notes = options[:release_notes]
15
17
  end
@@ -33,6 +35,7 @@ module Tug
33
35
 
34
36
  def params
35
37
  params = "-F notes='#{notes}' "
38
+ params += "-F dsym=@#{dsym} "
36
39
  params += "-F notify=#{notify} "
37
40
  end
38
41
  end
@@ -6,6 +6,9 @@ module Tug
6
6
  option :file,
7
7
  :aliases => "-f",
8
8
  :default => Dir.glob("*.ipa").first
9
+ option :dsym,
10
+ :aliases => "-d",
11
+ :default => Dir.glob("*.dSYM.zip").first
9
12
  option :api_token,
10
13
  :aliases => "-a",
11
14
  :default => ENV['TUG_TESTFLIGHT_API_TOKEN']
@@ -29,6 +32,9 @@ module Tug
29
32
  option :file,
30
33
  :aliases => "-f",
31
34
  :default => Dir.glob("*.ipa").first
35
+ option :dsym,
36
+ :aliases => "-d",
37
+ :default => Dir.glob("*.dSYM.zip").first
32
38
  option :api_token,
33
39
  :aliases => "-a",
34
40
  :default => ENV['TUG_HOCKEYAPP_API_TOKEN']
data/lib/tug/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tug
2
- VERSION = "0.0.11"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -7,7 +7,8 @@ describe Tug::Deployer do
7
7
  :api_token => "api_token",
8
8
  :file => "test.ipa",
9
9
  :release_notes => "Notes",
10
- :notify => 1
10
+ :notify => 1,
11
+ :dsym => "test.zip"
11
12
  }
12
13
 
13
14
  @deployer = Tug::Deployer.new(@options)
@@ -24,5 +25,10 @@ describe Tug::Deployer do
24
25
  expect(IO).to receive(:popen).with(/-F notify=1/)
25
26
  @deployer.deploy
26
27
  end
28
+
29
+ it "should send the dsym as a param" do
30
+ expect(IO).to receive(:popen).with(/-F dsym=@test.zip/)
31
+ @deployer.deploy
32
+ end
27
33
  end
28
34
  end
data/spec/hockapp_spec.rb CHANGED
@@ -18,7 +18,8 @@ describe Tug::Hockeyapp do
18
18
  :private => true,
19
19
  :commit_sha => "123",
20
20
  :build_server_url => "hello.com",
21
- :repository_url => "world.com"
21
+ :repository_url => "world.com",
22
+ :dsym => "test.zip"
22
23
  }
23
24
 
24
25
  @deployer = Tug::Hockeyapp.new(@options)
@@ -36,6 +37,11 @@ describe Tug::Hockeyapp do
36
37
  @deployer.deploy
37
38
  end
38
39
 
40
+ it "should send the dsym as a param" do
41
+ expect(IO).to receive(:popen).with(/-F dsym=@test.zip/)
42
+ @deployer.deploy
43
+ end
44
+
39
45
  it "should have some release notes" do
40
46
  expect(IO).to receive(:popen).with(/-F notes='Notes'/)
41
47
  @deployer.deploy
@@ -8,6 +8,7 @@ describe Tug::IpaCommand do
8
8
  allow_any_instance_of(Tug::XcodeBuild).to receive(:system)
9
9
  allow_any_instance_of(Tug::XCTool).to receive(:system)
10
10
  allow(FileUtils).to receive(:mv)
11
+ allow(@command).to receive(:system)
11
12
 
12
13
  yaml = project_yaml
13
14
  @project = Tug::Project.new(yaml)
@@ -27,9 +28,20 @@ describe Tug::IpaCommand do
27
28
  @command.execute(@config)
28
29
  end
29
30
 
31
+ it "should zip the dsym" do
32
+ expect(@command).to receive(:system).with(/zip -r scheme.app.dSYM.zip scheme.app.dSYM/)
33
+ @command.execute(@config)
34
+ end
35
+
36
+ it "should move the zipped dsym file into the export path location" do
37
+ @project.ipa_export_path = "/hello/world"
38
+ expect(FileUtils).to receive(:mv).with(/scheme.app.dSYM.zip/, /hello\/world/)
39
+ @command.execute(@config)
40
+ end
41
+
30
42
  it "should move the ipa file into the export path location" do
31
43
  @project.ipa_export_path = "/hello/world"
32
- expect(FileUtils).to receive(:mv).with(anything, /hello\/world/)
44
+ expect(FileUtils).to receive(:mv).with(/scheme.ipa/, /hello\/world/)
33
45
  @command.execute(@config)
34
46
  end
35
47
  end
@@ -8,7 +8,8 @@ describe Tug::Testflight do
8
8
  :team_token => "team_token",
9
9
  :file => "test.ipa",
10
10
  :notify => true,
11
- :release_notes => "Notes"
11
+ :release_notes => "Notes",
12
+ :dsym => "test.zip"
12
13
  }
13
14
 
14
15
  @deployer = Tug::Testflight.new(@options)
@@ -26,6 +27,11 @@ describe Tug::Testflight do
26
27
  @deployer.deploy
27
28
  end
28
29
 
30
+ it "should send the dsym as a param" do
31
+ expect(IO).to receive(:popen).with(/-F dsym=@test.zip/)
32
+ @deployer.deploy
33
+ end
34
+
29
35
  it "should send the team token as a param" do
30
36
  expect(IO).to receive(:popen).with(/-F team_token='team_token'/)
31
37
  @deployer.deploy
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.11
4
+ version: 0.1.0
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-09-03 00:00:00.000000000 Z
11
+ date: 2014-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor