tug 0.0.8 → 0.0.9

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 92525ca816fadaf365802e1ef27f74e35e725a0c
4
- data.tar.gz: 76d77bbbe3c1a3ff2efe8516ac24a1ab6ad3d740
3
+ metadata.gz: 5cb7e7608dd93ade99bb9d66231af0e3f9c5c8b9
4
+ data.tar.gz: 13d26a4e20c86f9b9c66926d2c125302d08b9464
5
5
  SHA512:
6
- metadata.gz: 621ec288ab99b7cba06746a73368e6e191a82891a78efd79eda15a7a4b70a06f29ec1af2e4282ed101db629492701b727345468371bc3a11c00849abf45e146b
7
- data.tar.gz: d4774587818baf97de2c7b185d429081b6b7e33e30374132be5203f46307d365ce4ee703a74b246f46e8985888f59bf24cc41af861d19cd63002602632974354
6
+ metadata.gz: 43d9868ee52f371d4f772671530c52abebe95cbc3148f2c03fea5b4b71cc13bf6d678a4ef6a0f9aa983ed8e2fbbbecb62b6cf31e2fbfbb738deb5db47d6d1ad8
7
+ data.tar.gz: 02cd175263f7f45e6fe330255e5f6d6a9482e9e3ea75e93fa873fbc26ee02e9340eecea1e5bd39f9ea62b28d688c0f9013304acbadf7dc5950ad254530ace81d
data/README.md CHANGED
@@ -49,7 +49,7 @@ $ tug build
49
49
  ##### Options
50
50
 
51
51
  ```
52
- -c, [--config=CONFIG] # the tug config file to use (optional, defaults to .tug.yml)
52
+ -c, [--config] # the tug config file to use (optional, defaults to .tug.yml)
53
53
  ```
54
54
 
55
55
  ### IPA
@@ -63,8 +63,8 @@ $ tug ipa
63
63
  ##### Options
64
64
 
65
65
  ```
66
- -c, [--config=CONFIG] # the tug config file to use (optional, defaults to .tug.yml)
67
- -e, [--export=EXPORT] # the directory to export the .ipa to (optional, defaults to current directory)
66
+ -c, [--config] # the tug config file to use (optional, defaults to .tug.yml)
67
+ -e, [--export] # the directory to export the .ipa to (optional, defaults to current directory)
68
68
  ```
69
69
 
70
70
  ### Deploy
@@ -82,11 +82,12 @@ $ tug deploy testflight
82
82
  ###### Options
83
83
 
84
84
  ```
85
- -f, [--file=FILE] # path to an ipa to deploy (optional, searches current directory by default)
86
- -a, [--api-token=API_TOKEN] # testflight api token (optional, environmental variable by default)
87
- -t, [--team-token=TEAM_TOKEN] # testflight tea, token (optional, environmental variable by default)
88
- -l, [--lists=LISTS] # testflight distrubution lists to send the buld to (optional, defaults to none)
89
- -n, [--notify=NOTIFY] # notify testflight users of the new build (optional, defaults to false)
85
+ -f, [--file] # path to an ipa to deploy (optional, searches current directory by default)
86
+ -a, [--api-token] # testflight api token (optional, environmental variable by default)
87
+ -t, [--team-token] # testflight tea, token (optional, environmental variable by default)
88
+ -l, [--lists] # testflight distrubution lists to send the buld to (optional, defaults to none)
89
+ -n, [--notify] # notify testflight users of the new build (optional, defaults to false)
90
+ -r, [--release-notes] # release notes for the build, can be plain text or a path to a file (optional)
90
91
  ```
91
92
 
92
93
  >
@@ -105,9 +106,9 @@ $ tug provision
105
106
  ##### Options
106
107
 
107
108
  ```
108
- -c, [--config=CONFIG] # the tug config file to use (optional, defaults to .tug.yml)
109
- -k, [--keychain=KEYCHAIN] # the keychain to install the certificates to (optional, defaults to tug)
110
- -p, [--password=PASSWORD] # the password required to access your .p12 private key (optional, environment variable by default)
109
+ -c, [--config] # the tug config file to use (optional, defaults to .tug.yml)
110
+ -k, [--keychain] # the keychain to install the certificates to (optional, defaults to tug)
111
+ -p, [--password] # the password required to access your .p12 private key (optional, environment variable by default)
111
112
  ```
112
113
 
113
114
  > The following environment variable is used to set your .p12 private key password
@@ -6,6 +6,7 @@ module Tug
6
6
  attr_reader :team_token
7
7
  attr_reader :lists
8
8
  attr_reader :notify
9
+ attr_reader :notes
9
10
 
10
11
  class << self
11
12
  def deployer(options)
@@ -19,6 +20,7 @@ module Tug
19
20
  @notify = options[:notify]
20
21
  @api_token = options[:api_token]
21
22
  @team_token = options[:team_token]
23
+ self.notes = options[:release_notes]
22
24
  end
23
25
 
24
26
  def deploy
@@ -27,16 +29,17 @@ module Tug
27
29
  end
28
30
  end
29
31
 
32
+ def notes=(notes)
33
+ parser = Tug::NotesParser.notes_parser(notes)
34
+ @notes = parser.notes
35
+ end
36
+
30
37
  private
31
38
 
32
39
  def url
33
40
  "http://testflightapp.com/api/builds.json"
34
41
  end
35
42
 
36
- def notes
37
- "This build was uploaded via Tug"
38
- end
39
-
40
43
  def params
41
44
  params = "-F file=@#{ipa} "
42
45
  params += "-F api_token='#{api_token}' "
@@ -0,0 +1,10 @@
1
+ module Tug
2
+
3
+ class NotesFileParser < NotesParser
4
+
5
+ def initialize(notes)
6
+ file = File.open(notes)
7
+ @notes = file.read
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,20 @@
1
+ module Tug
2
+ class NotesParser
3
+
4
+ attr_reader :notes
5
+
6
+ class << self
7
+ def notes_parser(notes)
8
+ if File.file? notes
9
+ Tug::NotesFileParser.new(notes)
10
+ else
11
+ Tug::NotesParser.new(notes)
12
+ end
13
+ end
14
+ end
15
+
16
+ def initialize(notes)
17
+ @notes = notes
18
+ end
19
+ end
20
+ end
@@ -8,6 +8,7 @@ module Tug
8
8
  option :team_token, :aliases => "-t", :default => ENV['TUG_TESTFLIGHT_TEAM_TOKEN']
9
9
  option :lists, :aliases => "-l"
10
10
  option :notify, :aliases => "-n", :default => false
11
+ option :release_notes, :aliases => "-r", :default => "This build was uploaded via Tug"
11
12
  def testflight
12
13
  deployer = Tug::Deployer.deployer(options)
13
14
  deployer.deploy
data/lib/tug/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tug
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
data/lib/tug.rb CHANGED
@@ -23,4 +23,6 @@ require "tug/tool/xctool_archive"
23
23
 
24
24
  require "tug/keychain/keychain"
25
25
 
26
- require "tug/deployment/deployer"
26
+ require "tug/deployment/deployer"
27
+ require "tug/deployment/notes_parser"
28
+ require "tug/deployment/notes_file_parser"
@@ -7,7 +7,8 @@ describe Tug::Deployer do
7
7
  :api_token => "api_token",
8
8
  :team_token => "team_token",
9
9
  :file => "test.ipa",
10
- :notify => true
10
+ :notify => true,
11
+ :release_notes => "Notes"
11
12
  }
12
13
 
13
14
  @deployer = Tug::Deployer.deployer(@options)
@@ -42,7 +43,7 @@ describe Tug::Deployer do
42
43
  end
43
44
 
44
45
  it "should have some release notes" do
45
- expect(IO).to receive(:popen).with(/-F notes='This build was uploaded via Tug'/)
46
+ expect(IO).to receive(:popen).with(/-F notes='Notes'/)
46
47
  @deployer.deploy
47
48
  end
48
49
 
@@ -0,0 +1,12 @@
1
+ require 'spec_helper'
2
+
3
+ describe Tug::NotesFileParser do
4
+
5
+ describe "When parsing notes" do
6
+
7
+ it "should parse notes from a file" do
8
+ parser = Tug::NotesFileParser.new(release_notes_path)
9
+ expect(parser.notes).to match("Hello World")
10
+ end
11
+ end
12
+ end
data/spec/output.txt CHANGED
@@ -0,0 +1,2 @@
1
+ Config file missing:
2
+ Try specifying a path to your config file with the --config option
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ describe Tug::NotesParser do
4
+
5
+ describe "When returning a parser" do
6
+
7
+ it "should return a notes parser for plain text notes" do
8
+ expect(File).to receive(:file?).and_return(false)
9
+ expect(Tug::NotesParser.notes_parser("test")).to be_kind_of(Tug::NotesParser)
10
+ end
11
+
12
+ it "should return a notes file parser for file notes" do
13
+ expect(File).to receive(:file?).and_return(true)
14
+
15
+ file = double(File)
16
+ expect(file).to receive(:read)
17
+ expect(File).to receive(:open).and_return(file)
18
+
19
+ expect(Tug::NotesParser.notes_parser("test")).to be_kind_of(Tug::NotesFileParser)
20
+ end
21
+ end
22
+ end
data/spec/spec_helper.rb CHANGED
@@ -14,6 +14,10 @@ module Helpers
14
14
  "distribution_profile" => "path/to/profile",
15
15
  "private_key" => "private"}}
16
16
  end
17
+
18
+ def release_notes_path
19
+ File.join(File.dirname(__FILE__), 'test_notes.txt')
20
+ end
17
21
  end
18
22
 
19
23
  RSpec.configure do |config|
@@ -0,0 +1 @@
1
+ Hello World
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.8
4
+ version: 0.0.9
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-01 00:00:00.000000000 Z
11
+ date: 2014-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -107,6 +107,8 @@ files:
107
107
  - lib/tug/config/config_file.rb
108
108
  - lib/tug/config/missing_config_file.rb
109
109
  - lib/tug/deployment/deployer.rb
110
+ - lib/tug/deployment/notes_file_parser.rb
111
+ - lib/tug/deployment/notes_parser.rb
110
112
  - lib/tug/interface/interface.rb
111
113
  - lib/tug/keychain/keychain.rb
112
114
  - lib/tug/project/project.rb
@@ -121,9 +123,12 @@ files:
121
123
  - spec/deployer_spec.rb
122
124
  - spec/ipa_command_spec.rb
123
125
  - spec/keychain_spec.rb
126
+ - spec/notes_file_parser_spec.rb
124
127
  - spec/output.txt
125
128
  - spec/project_spec.rb
129
+ - spec/release_notes_spec.rb
126
130
  - spec/spec_helper.rb
131
+ - spec/test_notes.txt
127
132
  - spec/xctool_spec.rb
128
133
  - tug.gemspec
129
134
  homepage: https://github.com/alexfish/tug
@@ -157,7 +162,10 @@ test_files:
157
162
  - spec/deployer_spec.rb
158
163
  - spec/ipa_command_spec.rb
159
164
  - spec/keychain_spec.rb
165
+ - spec/notes_file_parser_spec.rb
160
166
  - spec/output.txt
161
167
  - spec/project_spec.rb
168
+ - spec/release_notes_spec.rb
162
169
  - spec/spec_helper.rb
170
+ - spec/test_notes.txt
163
171
  - spec/xctool_spec.rb