cocoapods-try 0.4.5 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -2
- data/.rubocop_cocoapods.yml +11 -1
- data/.rubocop_todo.yml +12 -0
- data/CHANGELOG.md +30 -9
- data/Gemfile.lock +39 -33
- data/lib/cocoapods_try.rb +1 -1
- data/lib/pod/command/try.rb +20 -36
- data/lib/pod/try_settings.rb +53 -0
- data/spec/command/try_settings_spec.rb +105 -0
- data/spec/command/try_spec.rb +1 -1
- metadata +7 -4
- data/rubocop-todo.yml +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea75c16ca0ccd1530ab19b3a0d461fffcf0671c6
|
4
|
+
data.tar.gz: 3703e30185d9cc9b2d0212182530c3dca6938e7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bc0dcc8cc7273893a1c8448abbe35beaf6f949ce9878ac6037448b4cd0f38f2139b709b1bfa59dce0eb4b689429aeb29aabf04e6a4f7220c3fb787a7ba53073
|
7
|
+
data.tar.gz: d8b17cb0c8932865fe531182cc42a979218c410911201f51249b5d7c260753848a62f64655e9b1eba60fb449adefa8a3573f12543e11899b8e4b4b66ed7aae4a
|
data/.rubocop.yml
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
inherit_from:
|
2
|
-
|
3
|
-
|
2
|
+
- .rubocop_todo.yml
|
3
|
+
- .rubocop_cocoapods.yml
|
data/.rubocop_cocoapods.yml
CHANGED
@@ -5,6 +5,7 @@ AllCops:
|
|
5
5
|
- ./*.gemspec
|
6
6
|
Exclude:
|
7
7
|
- ./spec/fixtures/**/*
|
8
|
+
- ./vendor/bundle/**/*
|
8
9
|
|
9
10
|
# At the moment not ready to be used
|
10
11
|
# https://github.com/bbatsov/rubocop/issues/947
|
@@ -58,6 +59,16 @@ Next:
|
|
58
59
|
Metrics/ClassLength:
|
59
60
|
Enabled: false
|
60
61
|
|
62
|
+
# Arbitrary max lengths for modules simply do not work and enabling this will
|
63
|
+
# lead to a never ending stream of annoyance and changes.
|
64
|
+
Metrics/ModuleLength:
|
65
|
+
Enabled: false
|
66
|
+
|
67
|
+
# Arbitrary max lengths for methods simply do not work and enabling this will
|
68
|
+
# lead to a never ending stream of annoyance and changes.
|
69
|
+
Metrics/MethodLength:
|
70
|
+
Enabled: false
|
71
|
+
|
61
72
|
# No enforced convention here.
|
62
73
|
Metrics/BlockNesting:
|
63
74
|
Enabled: false
|
@@ -108,4 +119,3 @@ ClassAndModuleChildren:
|
|
108
119
|
UselessComparison:
|
109
120
|
Exclude:
|
110
121
|
- spec/**/*
|
111
|
-
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2015-08-14 22:12:21 -0700 using RuboCop version 0.33.0.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 20
|
10
|
+
# Configuration parameters: AllowURI, URISchemes.
|
11
|
+
Metrics/LineLength:
|
12
|
+
Max: 108
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,27 @@
|
|
1
1
|
# Cocoapods::Try Changelog
|
2
2
|
|
3
|
-
## 0.
|
3
|
+
## 0.5.0 (2015-08-26)
|
4
|
+
|
5
|
+
##### Enhancements
|
6
|
+
|
7
|
+
* Any CocoaPod / GitHub repo can now declare their own pre-install commands, and prefer a
|
8
|
+
project. To use this, add a `.cocoapods.yml` file to the root of your repo. The yaml file
|
9
|
+
should have a structure like:
|
10
|
+
|
11
|
+
``` yaml
|
12
|
+
try:
|
13
|
+
install:
|
14
|
+
pre:
|
15
|
+
- pod install
|
16
|
+
- git submodule init
|
17
|
+
project: 'ORStackView.xcworkspace'
|
18
|
+
```
|
19
|
+
|
20
|
+
[Orta Therox](https://github.com/orta)
|
21
|
+
[#33](https://github.com/CocoaPods/cocoapods-try/issues/33)
|
22
|
+
|
23
|
+
|
24
|
+
## 0.4.5 (2015-05-27)
|
4
25
|
|
5
26
|
##### Bug Fixes
|
6
27
|
|
@@ -13,7 +34,7 @@
|
|
13
34
|
[#35](https://github.com/CocoaPods/cocoapods-try/issues/35)
|
14
35
|
|
15
36
|
|
16
|
-
## 0.4.4
|
37
|
+
## 0.4.4 (2015-05-06)
|
17
38
|
|
18
39
|
##### Bug Fixes
|
19
40
|
|
@@ -22,7 +43,7 @@
|
|
22
43
|
[#30](https://github.com/CocoaPods/cocoapods-try/issues/30)
|
23
44
|
|
24
45
|
|
25
|
-
## 0.4.3
|
46
|
+
## 0.4.3 (2014-12-25)
|
26
47
|
|
27
48
|
##### Bug Fixes
|
28
49
|
|
@@ -30,31 +51,31 @@
|
|
30
51
|
[Daniel Tomlinson](https://github.com/DanielTomlinson)
|
31
52
|
[CocoaPods/CocoaPods#2563](https://github.com/CocoaPods/CocoaPods/pull/2563)
|
32
53
|
|
33
|
-
## 0.4.2
|
54
|
+
## 0.4.2 (2014-10-29)
|
34
55
|
|
35
56
|
* Prefer projects or workspaces with the name including Sample over others.
|
36
57
|
[Kyle Fuller](https://github.com/kylef)
|
37
58
|
|
38
|
-
## 0.4.1
|
59
|
+
## 0.4.1 (2014-09-26)
|
39
60
|
|
40
61
|
* Add `--no-repo-update` option.
|
41
62
|
[Eloy Durán](https://github.com/alloy)
|
42
63
|
|
43
|
-
## 0.4.0
|
64
|
+
## 0.4.0 (2014-09-11)
|
44
65
|
|
45
66
|
### Enhancements
|
46
67
|
|
47
68
|
* Adopted new argument format of CLAide.
|
48
69
|
[Olivier Halligon](https://github.com/AliSoftware)
|
49
70
|
|
50
|
-
## 0.3.0
|
71
|
+
## 0.3.0 (2014-05-19)
|
51
72
|
|
52
73
|
### Enhancements
|
53
74
|
|
54
75
|
* Adopted new CLAide release.
|
55
76
|
[Fabio Pelosin](https://github.com/irrationalfab)
|
56
77
|
|
57
|
-
## 0.2.0
|
78
|
+
## 0.2.0 (2014-03-28)
|
58
79
|
|
59
80
|
### Enhancements
|
60
81
|
|
@@ -80,7 +101,7 @@
|
|
80
101
|
* Typo fixes.
|
81
102
|
[Mark Townsend](https://github.com/markltownsend)
|
82
103
|
|
83
|
-
## 0.1.0
|
104
|
+
## 0.1.0 (2013-12-02)
|
84
105
|
|
85
106
|
* Initial implementation.
|
86
107
|
[Fabio Pelosin](https://github.com/fabiopelosin)
|
data/Gemfile.lock
CHANGED
@@ -1,35 +1,36 @@
|
|
1
1
|
GIT
|
2
2
|
remote: https://github.com/CocoaPods/CLAide.git
|
3
|
-
revision:
|
3
|
+
revision: 675dd608cd5b3f8b62a4f34da48aff5d0b75d41f
|
4
4
|
branch: master
|
5
5
|
specs:
|
6
|
-
claide (0.
|
6
|
+
claide (0.9.1)
|
7
7
|
|
8
8
|
GIT
|
9
9
|
remote: https://github.com/CocoaPods/CocoaPods.git
|
10
|
-
revision:
|
10
|
+
revision: b8f6bd87e2897a38511cff9192f3f72c410dc34b
|
11
11
|
branch: master
|
12
12
|
specs:
|
13
|
-
cocoapods (0.
|
13
|
+
cocoapods (0.38.2)
|
14
14
|
activesupport (>= 3.2.15)
|
15
|
-
claide (~> 0.
|
16
|
-
cocoapods-core (= 0.
|
17
|
-
cocoapods-downloader (~> 0.9.
|
15
|
+
claide (~> 0.9.1)
|
16
|
+
cocoapods-core (= 0.38.2)
|
17
|
+
cocoapods-downloader (~> 0.9.1)
|
18
18
|
cocoapods-plugins (~> 0.4.2)
|
19
|
-
cocoapods-
|
20
|
-
cocoapods-
|
19
|
+
cocoapods-stats (~> 0.5.3)
|
20
|
+
cocoapods-trunk (~> 0.6.1)
|
21
|
+
cocoapods-try (~> 0.5.0)
|
21
22
|
colored (~> 1.2)
|
22
23
|
escape (~> 0.0.4)
|
23
|
-
molinillo (~> 0.
|
24
|
+
molinillo (~> 0.3.1)
|
24
25
|
nap (~> 0.8)
|
25
|
-
xcodeproj (~> 0.
|
26
|
+
xcodeproj (~> 0.26.3)
|
26
27
|
|
27
28
|
GIT
|
28
29
|
remote: https://github.com/CocoaPods/Core.git
|
29
|
-
revision:
|
30
|
+
revision: ee3a58cb516034942b684469a3b2766a8004b49b
|
30
31
|
branch: master
|
31
32
|
specs:
|
32
|
-
cocoapods-core (0.
|
33
|
+
cocoapods-core (0.38.2)
|
33
34
|
activesupport (>= 3.2.15)
|
34
35
|
fuzzy_match (~> 2.0.4)
|
35
36
|
nap (~> 0.8.0)
|
@@ -37,25 +38,27 @@ GIT
|
|
37
38
|
PATH
|
38
39
|
remote: .
|
39
40
|
specs:
|
40
|
-
cocoapods-try (0.
|
41
|
+
cocoapods-try (0.5.0)
|
41
42
|
|
42
43
|
GEM
|
43
44
|
remote: https://rubygems.org/
|
44
45
|
specs:
|
45
|
-
activesupport (4.2.
|
46
|
+
activesupport (4.2.3)
|
46
47
|
i18n (~> 0.7)
|
47
48
|
json (~> 1.7, >= 1.7.7)
|
48
49
|
minitest (~> 5.1)
|
49
50
|
thread_safe (~> 0.3, >= 0.3.4)
|
50
51
|
tzinfo (~> 1.1)
|
51
|
-
ast (2.
|
52
|
-
astrolabe (1.3.
|
53
|
-
parser (
|
52
|
+
ast (2.1.0)
|
53
|
+
astrolabe (1.3.1)
|
54
|
+
parser (~> 2.2)
|
54
55
|
bacon (1.2.0)
|
55
|
-
cocoapods-downloader (0.9.
|
56
|
+
cocoapods-downloader (0.9.1)
|
56
57
|
cocoapods-plugins (0.4.2)
|
57
58
|
nap
|
58
|
-
cocoapods-
|
59
|
+
cocoapods-stats (0.5.3)
|
60
|
+
nap (~> 0.8)
|
61
|
+
cocoapods-trunk (0.6.1)
|
59
62
|
nap (>= 0.8)
|
60
63
|
netrc (= 0.7.8)
|
61
64
|
codeclimate-test-reporter (0.4.7)
|
@@ -65,41 +68,41 @@ GEM
|
|
65
68
|
escape (0.0.4)
|
66
69
|
fuzzy_match (2.0.4)
|
67
70
|
i18n (0.7.0)
|
68
|
-
json (1.8.
|
71
|
+
json (1.8.3)
|
69
72
|
metaclass (0.0.4)
|
70
|
-
minitest (5.
|
73
|
+
minitest (5.8.0)
|
71
74
|
mocha (1.1.0)
|
72
75
|
metaclass (~> 0.0.1)
|
73
76
|
mocha-on-bacon (0.2.2)
|
74
77
|
mocha (>= 0.13.0)
|
75
|
-
molinillo (0.
|
76
|
-
multi_json (1.11.0)
|
78
|
+
molinillo (0.3.1)
|
77
79
|
nap (0.8.0)
|
78
80
|
netrc (0.7.8)
|
79
|
-
parser (2.2.
|
81
|
+
parser (2.2.2.6)
|
80
82
|
ast (>= 1.1, < 3.0)
|
81
|
-
powerpack (0.1.
|
83
|
+
powerpack (0.1.1)
|
82
84
|
prettybacon (0.0.2)
|
83
85
|
bacon (~> 1.2)
|
84
86
|
rainbow (2.0.0)
|
85
87
|
rake (10.4.2)
|
86
|
-
rubocop (0.
|
88
|
+
rubocop (0.33.0)
|
87
89
|
astrolabe (~> 1.3)
|
88
|
-
parser (>= 2.2.
|
90
|
+
parser (>= 2.2.2.5, < 3.0)
|
89
91
|
powerpack (~> 0.1)
|
90
92
|
rainbow (>= 1.99.1, < 3.0)
|
91
93
|
ruby-progressbar (~> 1.4)
|
92
94
|
ruby-progressbar (1.7.5)
|
93
|
-
simplecov (0.
|
95
|
+
simplecov (0.10.0)
|
94
96
|
docile (~> 1.1.0)
|
95
|
-
|
96
|
-
simplecov-html (~> 0.
|
97
|
-
simplecov-html (0.
|
97
|
+
json (~> 1.8)
|
98
|
+
simplecov-html (~> 0.10.0)
|
99
|
+
simplecov-html (0.10.0)
|
98
100
|
thread_safe (0.3.5)
|
99
101
|
tzinfo (1.2.2)
|
100
102
|
thread_safe (~> 0.1)
|
101
|
-
xcodeproj (0.
|
103
|
+
xcodeproj (0.26.3)
|
102
104
|
activesupport (>= 3)
|
105
|
+
claide (~> 0.9.1)
|
103
106
|
colored (~> 1.2)
|
104
107
|
|
105
108
|
PLATFORMS
|
@@ -118,3 +121,6 @@ DEPENDENCIES
|
|
118
121
|
prettybacon
|
119
122
|
rake
|
120
123
|
rubocop
|
124
|
+
|
125
|
+
BUNDLED WITH
|
126
|
+
1.10.6
|
data/lib/cocoapods_try.rb
CHANGED
data/lib/pod/command/try.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'pod/try_settings'
|
1
2
|
|
2
3
|
# The CocoaPods namespace
|
3
4
|
#
|
@@ -36,17 +37,13 @@ module Pod
|
|
36
37
|
def run
|
37
38
|
ensure_master_spec_repo_exists!
|
38
39
|
sandbox = Sandbox.new(TRY_TMP_DIR)
|
39
|
-
|
40
|
-
spec = spec_with_url(@name)
|
41
|
-
sandbox.store_pre_downloaded_pod(spec.name)
|
42
|
-
else
|
43
|
-
update_specs_repos
|
44
|
-
spec = spec_with_name(@name)
|
45
|
-
end
|
40
|
+
spec = setup_spec_in_sandbox(sandbox)
|
46
41
|
|
47
42
|
UI.title "Trying #{spec.name}" do
|
48
43
|
pod_dir = install_pod(spec, sandbox)
|
49
|
-
|
44
|
+
settings = TrySettings.settings_from_folder(pod_dir)
|
45
|
+
settings.run_pre_install_commands(true)
|
46
|
+
proj = settings.project_path || pick_demo_project(pod_dir)
|
50
47
|
file = install_podfile(proj)
|
51
48
|
if file
|
52
49
|
open_project(file)
|
@@ -65,6 +62,19 @@ module Pod
|
|
65
62
|
#
|
66
63
|
TRY_TMP_DIR = Pathname.new(Dir.tmpdir) + 'CocoaPods/Try'
|
67
64
|
|
65
|
+
# Puts the spec's data in the sandbox
|
66
|
+
#
|
67
|
+
def setup_spec_in_sandbox(sandbox)
|
68
|
+
if git_url?(@name)
|
69
|
+
spec = spec_with_url(@name)
|
70
|
+
sandbox.store_pre_downloaded_pod(spec.name)
|
71
|
+
else
|
72
|
+
update_specs_repos
|
73
|
+
spec = spec_with_name(@name)
|
74
|
+
end
|
75
|
+
spec
|
76
|
+
end
|
77
|
+
|
68
78
|
# Returns the specification of the last version of the Pod with the given
|
69
79
|
# name.
|
70
80
|
#
|
@@ -97,7 +107,7 @@ module Pod
|
|
97
107
|
target_dir = TRY_TMP_DIR + name
|
98
108
|
target_dir.rmtree if target_dir.exist?
|
99
109
|
|
100
|
-
downloader = Pod::Downloader.for_target(target_dir,
|
110
|
+
downloader = Pod::Downloader.for_target(target_dir, :git => url)
|
101
111
|
downloader.download
|
102
112
|
|
103
113
|
spec_file = Pathname.glob(target_dir + "#{name}.podspec{,.json}").first
|
@@ -150,7 +160,7 @@ module Pod
|
|
150
160
|
selection_array = projs.map do |p|
|
151
161
|
Pathname.new(p).relative_path_from(dir).to_s
|
152
162
|
end
|
153
|
-
index = choose_from_array(selection_array, message)
|
163
|
+
index = UI.choose_from_array(selection_array, message)
|
154
164
|
projs[index]
|
155
165
|
end
|
156
166
|
end
|
@@ -212,32 +222,6 @@ module Pod
|
|
212
222
|
`open "#{path}"`
|
213
223
|
end
|
214
224
|
|
215
|
-
# Presents a choice among the elements of an array to the user.
|
216
|
-
#
|
217
|
-
# @param [Array<#to_s>] array
|
218
|
-
# The list of the elements among which the user should make his
|
219
|
-
# choice.
|
220
|
-
#
|
221
|
-
# @param [String] message
|
222
|
-
# The message to display to the user.
|
223
|
-
#
|
224
|
-
# @return [Fixnum] The index of the chosen array item.
|
225
|
-
#
|
226
|
-
# @todo This method was duplicated from the spec subcommands
|
227
|
-
#
|
228
|
-
def choose_from_array(array, message)
|
229
|
-
array.each_with_index do |item, index|
|
230
|
-
UI.puts "#{ index + 1 }: #{ item }"
|
231
|
-
end
|
232
|
-
UI.puts "#{message} [1-#{array.count}]?"
|
233
|
-
index = STDIN.gets.chomp.to_i - 1
|
234
|
-
if index < 0 || index > array.count
|
235
|
-
raise Informative, "#{ index + 1 } is invalid [1-#{array.count}]"
|
236
|
-
else
|
237
|
-
index
|
238
|
-
end
|
239
|
-
end
|
240
|
-
|
241
225
|
# @return [void] Performs a CocoaPods installation in the working
|
242
226
|
# directory.
|
243
227
|
#
|
@@ -0,0 +1,53 @@
|
|
1
|
+
module Pod
|
2
|
+
class TrySettings
|
3
|
+
attr_accessor :pre_install_commands, :project_path
|
4
|
+
|
5
|
+
# Creates a TrySettings instance based on a folder path
|
6
|
+
#
|
7
|
+
def self.settings_from_folder(path)
|
8
|
+
settings_path = Pathname.new(path) + '.cocoapods.yml'
|
9
|
+
return TrySettings.new unless File.exist? settings_path
|
10
|
+
|
11
|
+
settings = YAMLHelper.load_file(settings_path)
|
12
|
+
try_settings = TrySettings.new
|
13
|
+
return try_settings unless settings['try']
|
14
|
+
|
15
|
+
if settings['try']['install']
|
16
|
+
try_settings.pre_install_commands = Array(settings['try']['install']['pre'])
|
17
|
+
end
|
18
|
+
|
19
|
+
if settings['try']['project']
|
20
|
+
try_settings.project_path = Pathname.new(path) + settings['try']['project']
|
21
|
+
end
|
22
|
+
|
23
|
+
try_settings
|
24
|
+
end
|
25
|
+
|
26
|
+
# If we need to run commands from pod-try we should let the users know
|
27
|
+
# what is going to be running on their device.
|
28
|
+
#
|
29
|
+
def prompt_for_permission
|
30
|
+
UI.titled_section 'Running Pre-Install Commands' do
|
31
|
+
commands = pre_install_commands.length > 1 ? 'commands' : 'command'
|
32
|
+
UI.puts "In order to try this pod, CocoaPods-Try needs to run the following #{commands}:"
|
33
|
+
pre_install_commands.each { |command| UI.puts " - #{command}" }
|
34
|
+
UI.puts "\nPress return to run these #{commands}, or press `ctrl + c` to stop trying this pod."
|
35
|
+
end
|
36
|
+
|
37
|
+
# Give an elegant exit point.
|
38
|
+
UI.gets.chomp
|
39
|
+
end
|
40
|
+
|
41
|
+
# Runs the pre_install_commands from
|
42
|
+
#
|
43
|
+
# @param [Bool] prompt
|
44
|
+
# Should CocoaPods-Try show a prompt with the commands to the user.
|
45
|
+
#
|
46
|
+
def run_pre_install_commands(prompt)
|
47
|
+
if pre_install_commands
|
48
|
+
prompt_for_permission if prompt
|
49
|
+
pre_install_commands.each { |command| Executable.execute_command('bash', ['-e', command], true) }
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,105 @@
|
|
1
|
+
require 'tmpdir'
|
2
|
+
require File.expand_path('../../spec_helper', __FILE__)
|
3
|
+
|
4
|
+
# The CocoaPods namespace
|
5
|
+
#
|
6
|
+
module Pod
|
7
|
+
describe TrySettings do
|
8
|
+
it 'returns an instance with empty defaults when there are no yml settings files' do
|
9
|
+
Dir.mktmpdir do |dir|
|
10
|
+
settings = TrySettings.settings_from_folder dir
|
11
|
+
settings.should.be.instance_of TrySettings
|
12
|
+
settings.pre_install_commands.should.be.nil?
|
13
|
+
settings.project_path.should.be.nil?
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'returns an instance with the right defaults when there are no yml settings files' do
|
18
|
+
Dir.mktmpdir do |dir|
|
19
|
+
yaml = <<YAML
|
20
|
+
try:
|
21
|
+
install:
|
22
|
+
pre:
|
23
|
+
- pod install
|
24
|
+
- git submodule init
|
25
|
+
project: 'ORStackView.xcworkspace'
|
26
|
+
YAML
|
27
|
+
File.open(dir + '/.cocoapods.yml', 'w') { |f| f.write(yaml) }
|
28
|
+
|
29
|
+
settings = TrySettings.settings_from_folder dir
|
30
|
+
settings.should.be.instance_of TrySettings
|
31
|
+
settings.pre_install_commands.should == ['pod install', 'git submodule init']
|
32
|
+
settings.project_path.should == Pathname.new(dir) + 'ORStackView.xcworkspace'
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'converts a string for the pre_install hook to a single object array' do
|
37
|
+
Dir.mktmpdir do |dir|
|
38
|
+
yaml = <<YAML
|
39
|
+
try:
|
40
|
+
install:
|
41
|
+
pre: pod install
|
42
|
+
YAML
|
43
|
+
File.open(dir + '/.cocoapods.yml', 'w') { |f| f.write(yaml) }
|
44
|
+
|
45
|
+
settings = TrySettings.settings_from_folder dir
|
46
|
+
settings.should.be.instance_of TrySettings
|
47
|
+
settings.pre_install_commands.should == ['pod install']
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'handles running commands in the pre-install' do
|
52
|
+
Dir.mktmpdir do |dir|
|
53
|
+
yaml = <<YAML
|
54
|
+
try:
|
55
|
+
install:
|
56
|
+
pre:
|
57
|
+
- pod install
|
58
|
+
- git submodule init
|
59
|
+
YAML
|
60
|
+
File.open(dir + '/.cocoapods.yml', 'w') { |f| f.write(yaml) }
|
61
|
+
|
62
|
+
Executable.expects(:execute_command).with('bash', ['-e', 'pod install'], true)
|
63
|
+
Executable.expects(:execute_command).with('bash', ['-e', 'git submodule init'], true)
|
64
|
+
|
65
|
+
settings = TrySettings.settings_from_folder dir
|
66
|
+
settings.run_pre_install_commands false
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
it 'handles not including system commands in the pre-install' do
|
71
|
+
Dir.mktmpdir do |dir|
|
72
|
+
yaml = <<YAML
|
73
|
+
try:
|
74
|
+
project: 'ORStackView.xcworkspace'
|
75
|
+
YAML
|
76
|
+
File.open(dir + '/.cocoapods.yml', 'w') { |f| f.write(yaml) }
|
77
|
+
|
78
|
+
settings = TrySettings.settings_from_folder dir
|
79
|
+
settings.project_path.should == Pathname.new(dir) + 'ORStackView.xcworkspace'
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
it 'handles not including the try in the yaml' do
|
84
|
+
Dir.mktmpdir do |dir|
|
85
|
+
yaml = <<YAML
|
86
|
+
thing: "other"
|
87
|
+
YAML
|
88
|
+
File.open(dir + '/.cocoapods.yml', 'w') { |f| f.write(yaml) }
|
89
|
+
|
90
|
+
settings = TrySettings.settings_from_folder dir
|
91
|
+
settings.pre_install_commands.should.be.nil?
|
92
|
+
settings.project_path.should.be.nil?
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
it 'does not show a prompt with no pre_install commands' do
|
97
|
+
Dir.mktmpdir do |dir|
|
98
|
+
TrySettings.any_instance.expects(:prompt_for_permission).never
|
99
|
+
|
100
|
+
settings = TrySettings.settings_from_folder dir
|
101
|
+
settings.run_pre_install_commands true
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
data/spec/command/try_spec.rb
CHANGED
@@ -119,7 +119,7 @@ module Pod
|
|
119
119
|
it 'asks the user which project would like to open if not a single suitable one is found' do
|
120
120
|
projects = ['Lib_1.xcodeproj', 'Lib_2.xcodeproj']
|
121
121
|
Dir.stubs(:glob).returns(projects)
|
122
|
-
|
122
|
+
UI.stubs(:choose_from_array).returns(0)
|
123
123
|
path = @sut.pick_demo_project(stub(:cleanpath => ''))
|
124
124
|
path.should == 'Lib_1.xcodeproj'
|
125
125
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-try
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fabio Pelosin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -47,6 +47,7 @@ files:
|
|
47
47
|
- .gitignore
|
48
48
|
- .rubocop.yml
|
49
49
|
- .rubocop_cocoapods.yml
|
50
|
+
- .rubocop_todo.yml
|
50
51
|
- .travis.yml
|
51
52
|
- CHANGELOG.md
|
52
53
|
- Gemfile
|
@@ -58,7 +59,8 @@ files:
|
|
58
59
|
- lib/cocoapods_plugin.rb
|
59
60
|
- lib/cocoapods_try.rb
|
60
61
|
- lib/pod/command/try.rb
|
61
|
-
-
|
62
|
+
- lib/pod/try_settings.rb
|
63
|
+
- spec/command/try_settings_spec.rb
|
62
64
|
- spec/command/try_spec.rb
|
63
65
|
- spec/spec_helper.rb
|
64
66
|
homepage: https://github.com/cocoapods/cocoapods-try
|
@@ -81,10 +83,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
83
|
version: '0'
|
82
84
|
requirements: []
|
83
85
|
rubyforge_project:
|
84
|
-
rubygems_version: 2.4.
|
86
|
+
rubygems_version: 2.4.8
|
85
87
|
signing_key:
|
86
88
|
specification_version: 4
|
87
89
|
summary: CocoaPods plugin which allows to quickly try the demo project of a Pod.
|
88
90
|
test_files:
|
91
|
+
- spec/command/try_settings_spec.rb
|
89
92
|
- spec/command/try_spec.rb
|
90
93
|
- spec/spec_helper.rb
|
data/rubocop-todo.yml
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
# This configuration was generated by `rubocop --auto-gen-config`
|
2
|
-
# on 2014-05-19 20:21:03 +0200 using RuboCop version 0.21.0.
|
3
|
-
# The point is for the user to remove these configuration records
|
4
|
-
# one by one as the offenses are removed from the code base.
|
5
|
-
# Note that changes in the inspected code, or installation of new
|
6
|
-
# versions of RuboCop, may require this file to be generated again.
|
7
|
-
|
8
|
-
# Offense count: 1
|
9
|
-
# Configuration parameters: CountComments.
|
10
|
-
ClassLength:
|
11
|
-
Max: 148
|
12
|
-
|
13
|
-
# Offense count: 11
|
14
|
-
LineLength:
|
15
|
-
Max: 108
|
16
|
-
|
17
|
-
# Offense count: 3
|
18
|
-
# Configuration parameters: CountComments.
|
19
|
-
MethodLength:
|
20
|
-
Max: 20
|
21
|
-
|
22
|
-
# Offense count: 1
|
23
|
-
UnusedBlockArgument:
|
24
|
-
Enabled: false
|