thrust 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,17 @@
1
+ module Thrust
2
+ module Tasks
3
+ class FocusedSpecs
4
+ FOCUSED_METHODS = %w[fit(@ fcontext(@ fdescribe(@]
5
+
6
+ def initialize(executor = Thrust::Executor.new)
7
+ @executor = executor
8
+ end
9
+
10
+ def run(thrust)
11
+ pattern = FOCUSED_METHODS.join("\\|")
12
+ directories = thrust.app_config.ios_spec_targets.values.map(&:target).join(' ')
13
+ @executor.system_or_exit %Q[grep -l -r -e "\\(#{pattern}\\)" #{directories} | grep -v 'Frameworks'; exit 0]
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,37 @@
1
+ module Thrust
2
+ module Tasks
3
+ class IOSSpecs
4
+ def initialize(out = $stdout,
5
+ xcode_tools_provider = Thrust::IOS::XCodeToolsProvider.new,
6
+ cedar = Thrust::IOS::Cedar.new)
7
+ @xcode_tools_provider = xcode_tools_provider
8
+ @cedar = cedar
9
+ @out = out
10
+ end
11
+
12
+ def run(thrust, target_info, args)
13
+ build_configuration = target_info.build_configuration
14
+ type = target_info.type
15
+ target = target_info.target
16
+ scheme = target_info.scheme
17
+ build_sdk = target_info.build_sdk
18
+ runtime_sdk = args[:runtime_sdk] || target_info.runtime_sdk
19
+
20
+ tools_options = {
21
+ project_name: thrust.app_config.project_name,
22
+ workspace_name: thrust.app_config.workspace_name
23
+ }
24
+
25
+ xcode_tools = @xcode_tools_provider.instance(@out, build_configuration, thrust.build_dir, tools_options)
26
+ xcode_tools.build_scheme_or_target(scheme || target, build_sdk)
27
+
28
+ if type == 'app'
29
+ xcode_tools.kill_simulator
30
+ @cedar.run(build_configuration, target, runtime_sdk, build_sdk, target_info.device, target_info.device_type_id, thrust.build_dir, thrust.app_config.ios_sim_binary)
31
+ else
32
+ xcode_tools.test(target || scheme, build_configuration, runtime_sdk, thrust.build_dir)
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,20 @@
1
+ module Thrust
2
+ module Tasks
3
+ class Nof
4
+ FOCUSED_METHODS = %w[fit(@ fcontext(@ fdescribe(@]
5
+
6
+ def initialize(executor = Thrust::Executor.new)
7
+ @executor = executor
8
+ end
9
+
10
+ def run
11
+ substitutions = FOCUSED_METHODS.map do |method|
12
+ unfocused_method = method.sub(/^f/, '')
13
+ "-e 's/#{method}/#{unfocused_method}/g;'"
14
+ end
15
+
16
+ @executor.system_or_exit %Q[rake focused_specs | xargs -I filename sed -i '' #{substitutions.join(' ')} "filename"]
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,24 @@
1
+ module Thrust
2
+ module Tasks
3
+ class Trim
4
+ def initialize(executor = Thrust::Executor.new)
5
+ @executor = executor
6
+ end
7
+
8
+ def run
9
+ awk_statement = <<-AWK
10
+ {
11
+ if ($1 == "RM" || $1 == "R")
12
+ print $4;
13
+ else if ($1 != "D")
14
+ print $2;
15
+ }
16
+ AWK
17
+
18
+ awk_statement.gsub!(%r{\s+}, " ")
19
+
20
+ @executor.system_or_exit %Q[git status --porcelain | awk '#{awk_statement}' | grep -e '.*\.[cmh]$' | xargs sed -i '' -e 's/ / /g;s/ *$//g;']
21
+ end
22
+ end
23
+ end
24
+ end
data/lib/thrust/tasks.rb CHANGED
@@ -1,3 +1,4 @@
1
- load File.expand_path("../../tasks/cedar.rake", __FILE__) unless File.exists?('AndroidManifest.xml')
2
- load File.expand_path("../../tasks/testflight.rake", __FILE__)
3
- load File.expand_path("../../tasks/version.rake", __FILE__)
1
+ load File.expand_path('../../tasks/cedar.rake', __FILE__) unless File.exists?('AndroidManifest.xml')
2
+ load File.expand_path('../../tasks/autotag.rake', __FILE__)
3
+ load File.expand_path('../../tasks/testflight.rake', __FILE__)
4
+ load File.expand_path('../../tasks/version.rake', __FILE__)
@@ -1,37 +1,38 @@
1
- class Thrust::Testflight
2
- def initialize(thrust_executor, out, input, api_token, team_token)
3
- @thrust_executor = thrust_executor
4
- @out = out
5
- @in = input
6
- @git = Thrust::Git.new(@thrust_executor, @out)
7
- @api_token = api_token
8
- @team_token = team_token
9
- end
10
-
11
- def upload(package_file, notify, distribution_list, autogenerate_deploy_notes, deployment_target, dsym_path = nil)
12
- if dsym_path
13
- @out.puts 'Zipping dSYM...'
14
- zipped_dsym_path = "#{dsym_path}.zip"
15
- @thrust_executor.system_or_exit "zip -r -T -y '#{zipped_dsym_path}' '#{dsym_path}'"
16
- @out.puts 'Done!'
1
+ module Thrust
2
+ class Testflight
3
+ def initialize(thrust_executor, out, input, api_token, team_token)
4
+ @thrust_executor = thrust_executor
5
+ @out = out
6
+ @in = input
7
+ @git = Thrust::Git.new(@out, @thrust_executor)
8
+ @api_token = api_token
9
+ @team_token = team_token
17
10
  end
18
11
 
19
- if autogenerate_deploy_notes
20
- message_file_path = @git.generate_notes_for_deployment(deployment_target)
21
- else
22
- message_file_path = Thrust::UserPrompt.get_user_input('Deploy Notes: ', @out, @in)
23
- end
12
+ def upload(package_file, notify, distribution_list, autogenerate_deploy_notes, deployment_target, dsym_path = nil)
13
+ if dsym_path
14
+ @out.puts 'Zipping dSYM...'
15
+ zipped_dsym_path = "#{dsym_path}.zip"
16
+ @thrust_executor.system_or_exit "zip -r -T -y '#{zipped_dsym_path}' '#{dsym_path}'"
17
+ @out.puts 'Done!'
18
+ end
24
19
 
20
+ if autogenerate_deploy_notes
21
+ message_file_path = @git.generate_notes_for_deployment(deployment_target)
22
+ else
23
+ message_file_path = Thrust::UserPrompt.get_user_input('Deploy Notes: ', @out, @in)
24
+ end
25
25
 
26
- @thrust_executor.system_or_exit [
27
- 'curl http://testflightapp.com/api/builds.json',
28
- "-F file=@#{package_file}",
29
- ("-F dsym=@#{zipped_dsym_path}" if dsym_path),
30
- "-F api_token='#{@api_token}'",
31
- "-F team_token='#{@team_token}'",
32
- "-F notes=@#{message_file_path}",
33
- "-F notify=#{(ENV['NOTIFY'] || notify).to_s.downcase.capitalize}",
34
- ("-F distribution_lists='#{distribution_list}'" if distribution_list)
35
- ].compact.join(' ')
26
+ @thrust_executor.system_or_exit [
27
+ 'curl http://testflightapp.com/api/builds.json',
28
+ "-F file=@#{package_file}",
29
+ ("-F dsym=@#{zipped_dsym_path}" if dsym_path),
30
+ "-F api_token='#{(ENV['TESTFLIGHT_API_TOKEN'] || @api_token)}'",
31
+ "-F team_token='#{@team_token}'",
32
+ "-F notes=@#{message_file_path}",
33
+ "-F notify=#{(ENV['NOTIFY'] || notify).to_s.downcase.capitalize}",
34
+ ("-F distribution_lists='#{distribution_list}'" if distribution_list)
35
+ ].compact.join(' ')
36
+ end
36
37
  end
37
38
  end
@@ -0,0 +1,11 @@
1
+ module Thrust
2
+ class TestflightCredentials
3
+ attr_reader :api_token,
4
+ :team_token
5
+
6
+ def initialize(attributes)
7
+ @api_token = attributes['api_token']
8
+ @team_token = attributes['team_token']
9
+ end
10
+ end
11
+ end
@@ -1,12 +1,14 @@
1
1
  require 'colorize'
2
2
 
3
- module Thrust::UserPrompt
4
- def self.get_user_input(prompt, out, stdin = $stdin)
5
- out.print prompt.yellow
6
- message = stdin.gets
7
- message_file = Tempfile.new('message')
8
- message_file << message
9
- message_file.close
10
- message_file.path
3
+ module Thrust
4
+ class UserPrompt
5
+ def self.get_user_input(prompt, fout, fin)
6
+ fout.print(prompt.yellow)
7
+ message = fin.gets
8
+ message_file = Tempfile.new('message')
9
+ message_file << message
10
+ message_file.close
11
+ message_file.path
12
+ end
11
13
  end
12
- end
14
+ end
data/lib/thrust.rb CHANGED
@@ -1,9 +1,6 @@
1
- module Thrust; end
2
- module Thrust::Android; end
3
- module Thrust::IOS; end
4
-
5
1
  require 'thrust/config'
6
2
  require 'thrust/executor'
3
+ require 'thrust/execution_helper'
7
4
  require 'thrust/git'
8
5
  require 'thrust/testflight'
9
6
  require 'thrust/user_prompt'
@@ -18,3 +15,11 @@ require 'thrust/ios/deploy'
18
15
  require 'thrust/ios/deploy_provider'
19
16
  require 'thrust/ios/x_code_tools'
20
17
  require 'thrust/ios/x_code_tools_provider'
18
+
19
+ require 'thrust/tasks/autotag/create'
20
+ require 'thrust/tasks/autotag/list'
21
+ require 'thrust/tasks/clean'
22
+ require 'thrust/tasks/focused_specs'
23
+ require 'thrust/tasks/ios_specs'
24
+ require 'thrust/tasks/nof'
25
+ require 'thrust/tasks/trim'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thrust
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Levine
@@ -9,9 +9,11 @@ authors:
9
9
  - Andrew Bruce
10
10
  - Andrew Kitchen
11
11
  - Brandon Liu
12
- - Can Berk Güder
12
+ - Brian Butz
13
+ - Can Berk Guder
13
14
  - Eugenia Dellapenna
14
15
  - Jeff Hui
16
+ - Joe Masilotti
15
17
  - Johnathon Britz
16
18
  - Jonathan Barnes
17
19
  - Michael McCormick
@@ -30,86 +32,86 @@ dependencies:
30
32
  name: colorize
31
33
  requirement: !ruby/object:Gem::Requirement
32
34
  requirements:
33
- - - ~>
35
+ - - "~>"
34
36
  - !ruby/object:Gem::Version
35
37
  version: '0.6'
36
38
  type: :runtime
37
39
  prerelease: false
38
40
  version_requirements: !ruby/object:Gem::Requirement
39
41
  requirements:
40
- - - ~>
42
+ - - "~>"
41
43
  - !ruby/object:Gem::Version
42
44
  version: '0.6'
43
45
  - !ruby/object:Gem::Dependency
44
46
  name: auto_tagger
45
47
  requirement: !ruby/object:Gem::Requirement
46
48
  requirements:
47
- - - ~>
49
+ - - "~>"
48
50
  - !ruby/object:Gem::Version
49
51
  version: '0.2'
50
52
  type: :runtime
51
53
  prerelease: false
52
54
  version_requirements: !ruby/object:Gem::Requirement
53
55
  requirements:
54
- - - ~>
56
+ - - "~>"
55
57
  - !ruby/object:Gem::Version
56
58
  version: '0.2'
57
59
  - !ruby/object:Gem::Dependency
58
60
  name: rake
59
61
  requirement: !ruby/object:Gem::Requirement
60
62
  requirements:
61
- - - ~>
63
+ - - "~>"
62
64
  - !ruby/object:Gem::Version
63
65
  version: '10.1'
64
66
  type: :runtime
65
67
  prerelease: false
66
68
  version_requirements: !ruby/object:Gem::Requirement
67
69
  requirements:
68
- - - ~>
70
+ - - "~>"
69
71
  - !ruby/object:Gem::Version
70
72
  version: '10.1'
71
73
  - !ruby/object:Gem::Dependency
72
74
  name: fakefs
73
75
  requirement: !ruby/object:Gem::Requirement
74
76
  requirements:
75
- - - ~>
77
+ - - "~>"
76
78
  - !ruby/object:Gem::Version
77
79
  version: '0.5'
78
80
  type: :development
79
81
  prerelease: false
80
82
  version_requirements: !ruby/object:Gem::Requirement
81
83
  requirements:
82
- - - ~>
84
+ - - "~>"
83
85
  - !ruby/object:Gem::Version
84
86
  version: '0.5'
85
87
  - !ruby/object:Gem::Dependency
86
88
  name: rspec
87
89
  requirement: !ruby/object:Gem::Requirement
88
90
  requirements:
89
- - - '>='
91
+ - - '='
90
92
  - !ruby/object:Gem::Version
91
- version: '0'
93
+ version: '2.14'
92
94
  type: :development
93
95
  prerelease: false
94
96
  version_requirements: !ruby/object:Gem::Requirement
95
97
  requirements:
96
- - - '>='
98
+ - - '='
97
99
  - !ruby/object:Gem::Version
98
- version: '0'
100
+ version: '2.14'
99
101
  - !ruby/object:Gem::Dependency
100
102
  name: timecop
101
103
  requirement: !ruby/object:Gem::Requirement
102
104
  requirements:
103
- - - '>='
105
+ - - "~>"
104
106
  - !ruby/object:Gem::Version
105
- version: '0'
107
+ version: '0.7'
106
108
  type: :development
107
109
  prerelease: false
108
110
  version_requirements: !ruby/object:Gem::Requirement
109
111
  requirements:
110
- - - '>='
112
+ - - "~>"
111
113
  - !ruby/object:Gem::Version
112
- version: '0'
114
+ version: '0.7'
113
115
  description: Thrust provides a collection of rake tasks for iOS and Android projects. These
114
116
  include tasks for running Cedar test suites (iOS) and for deploying apps to Testflight
115
117
  (iOS and Android).
@@ -122,6 +124,7 @@ files:
122
124
  - bin/thrust
123
125
  - lib/config/android_example.yml
124
126
  - lib/config/ios_example.yml
127
+ - lib/tasks/autotag.rake
125
128
  - lib/tasks/cedar.rake
126
129
  - lib/tasks/testflight.rake
127
130
  - lib/tasks/version.rake
@@ -129,7 +132,10 @@ files:
129
132
  - lib/thrust/android/deploy.rb
130
133
  - lib/thrust/android/deploy_provider.rb
131
134
  - lib/thrust/android/tools.rb
135
+ - lib/thrust/app_config.rb
132
136
  - lib/thrust/config.rb
137
+ - lib/thrust/deployment_target.rb
138
+ - lib/thrust/execution_helper.rb
133
139
  - lib/thrust/executor.rb
134
140
  - lib/thrust/git.rb
135
141
  - lib/thrust/ios/agv_tool.rb
@@ -138,8 +144,17 @@ files:
138
144
  - lib/thrust/ios/deploy_provider.rb
139
145
  - lib/thrust/ios/x_code_tools.rb
140
146
  - lib/thrust/ios/x_code_tools_provider.rb
147
+ - lib/thrust/ios_spec_target.rb
141
148
  - lib/thrust/tasks.rb
149
+ - lib/thrust/tasks/autotag/create.rb
150
+ - lib/thrust/tasks/autotag/list.rb
151
+ - lib/thrust/tasks/clean.rb
152
+ - lib/thrust/tasks/focused_specs.rb
153
+ - lib/thrust/tasks/ios_specs.rb
154
+ - lib/thrust/tasks/nof.rb
155
+ - lib/thrust/tasks/trim.rb
142
156
  - lib/thrust/testflight.rb
157
+ - lib/thrust/testflight_credentials.rb
143
158
  - lib/thrust/user_prompt.rb
144
159
  homepage: http://github.com/pivotal/thrust
145
160
  licenses:
@@ -151,12 +166,12 @@ require_paths:
151
166
  - lib
152
167
  required_ruby_version: !ruby/object:Gem::Requirement
153
168
  requirements:
154
- - - '>='
169
+ - - ">="
155
170
  - !ruby/object:Gem::Version
156
171
  version: 1.9.3
157
172
  required_rubygems_version: !ruby/object:Gem::Requirement
158
173
  requirements:
159
- - - '>='
174
+ - - ">="
160
175
  - !ruby/object:Gem::Version
161
176
  version: '0'
162
177
  requirements: []