cocoapods-try 0.4.4 → 0.4.5

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: 9ef5b5b27c4ff1b4feb02d84c164dcadfa5cb14f
4
- data.tar.gz: 93e20a0b143abef1d81b0aa1b911d27cb8e4f8f3
3
+ metadata.gz: 148ca9e619a1f63d94bf681574b8c04d551b92e2
4
+ data.tar.gz: e1de8f33e8256c4129782d157839f393da6cc2b4
5
5
  SHA512:
6
- metadata.gz: f31bf5b9e227352e3755ef2a6614b12dceac142885ec19b4363e8721bf5937eb31beb55901670d2843700bf9330575396d0d2e6f861ad3a9caed888ae05a3925
7
- data.tar.gz: f7f08685f5a89398e4ee7307de0700f4e1594a554dc2d7be545892db201b1eee08c892f015bea01e1de5e2434b23a30677be59aaa17ca9282c563eb082000a02
6
+ metadata.gz: b6a47ab3b7edf2f088e64fc74ca2e1f621282760e8f136214027c83f34510b120fb95935d05a47da298ce712bf3c17c446d7cb21cfd030d842cec32eba674c17
7
+ data.tar.gz: 096d695b938cd6b57bda2f1a931093fcb4dbf5666e31066a9d5c0204afd15f340b33df2b505e3fbd3bb62cbcaa738e56944def859b8ef87160e372cfcbe65500
data/CHANGELOG.md CHANGED
@@ -1,10 +1,23 @@
1
1
  # Cocoapods::Try Changelog
2
2
 
3
+ ## 0.4.5
4
+
5
+ ##### Bug Fixes
6
+
7
+ * Use `Dir.tmpdir` instead of explicit `/tmp`.
8
+ [Boris Bügling](https://github.com/neonichu)
9
+ [#34](https://github.com/CocoaPods/cocoapods-try/pull/34)
10
+
11
+ * Automatically detect JSON podspecs.
12
+ [Samuel Giddins](https://github.com/segiddins)
13
+ [#35](https://github.com/CocoaPods/cocoapods-try/issues/35)
14
+
15
+
3
16
  ## 0.4.4
4
17
 
5
18
  ##### Bug Fixes
6
19
 
7
- * Fix working with the CocoaPods download cache introduced in 0.37.
20
+ * Fix working with the CocoaPods download cache introduced in 0.37.
8
21
  [Samuel Giddins](https://github.com/)
9
22
  [#30](https://github.com/CocoaPods/cocoapods-try/issues/30)
10
23
 
data/Gemfile.lock CHANGED
@@ -37,7 +37,7 @@ GIT
37
37
  PATH
38
38
  remote: .
39
39
  specs:
40
- cocoapods-try (0.4.4)
40
+ cocoapods-try (0.4.5)
41
41
 
42
42
  GEM
43
43
  remote: https://rubygems.org/
data/lib/cocoapods_try.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  # The namespace of the Cocoapods try plugin.
3
3
  #
4
4
  module CocoapodsTry
5
- VERSION = '0.4.4'
5
+ VERSION = '0.4.5'
6
6
  end
@@ -63,7 +63,7 @@ module Pod
63
63
 
64
64
  # @return [Pathname]
65
65
  #
66
- TRY_TMP_DIR = Pathname.new('/tmp/CocoaPods/Try')
66
+ TRY_TMP_DIR = Pathname.new(Dir.tmpdir) + 'CocoaPods/Try'
67
67
 
68
68
  # Returns the specification of the last version of the Pod with the given
69
69
  # name.
@@ -100,7 +100,7 @@ module Pod
100
100
  downloader = Pod::Downloader.for_target(target_dir, :git => url)
101
101
  downloader.download
102
102
 
103
- spec_file = target_dir + "#{name}.podspec"
103
+ spec_file = Pathname.glob(target_dir + "#{name}.podspec{,.json}").first
104
104
  Pod::Specification.from_file(spec_file)
105
105
  end
106
106
 
@@ -178,7 +178,7 @@ module Pod
178
178
  if podfile.workspace_path
179
179
  File.expand_path(podfile.workspace_path)
180
180
  else
181
- proj.chomp(File.extname(proj.to_s)) + '.xcworkspace'
181
+ proj.to_s.chomp(File.extname(proj.to_s)) + '.xcworkspace'
182
182
  end
183
183
  end
184
184
  else
@@ -242,7 +242,9 @@ module Pod
242
242
  # directory.
243
243
  #
244
244
  def perform_cocoapods_installation
245
- UI.puts `pod install`
245
+ UI.titled_section 'Performing CocoaPods Installation' do
246
+ Command::Install.invoke
247
+ end
246
248
  end
247
249
 
248
250
  # @return [Bool] Wether the given string is the name of a Pod or an URL
@@ -5,6 +5,9 @@ require File.expand_path('../../spec_helper', __FILE__)
5
5
  module Pod
6
6
  describe Command::Try do
7
7
  describe 'Try' do
8
+ XCODE_PROJECT = Pod::Command::Try::TRY_TMP_DIR + 'Project.xcodeproj'
9
+ XCODE_WORKSPACE = Pod::Command::Try::TRY_TMP_DIR + 'Project.xcworkspace'
10
+
8
11
  it 'registers it self' do
9
12
  Command.parse(%w(try)).should.be.instance_of Command::Try
10
13
  end
@@ -21,24 +24,25 @@ module Pod
21
24
  command = Pod::Command.parse(%w(try ARAnalytics))
22
25
  Installer::PodSourceInstaller.any_instance.expects(:install!)
23
26
  command.expects(:update_specs_repos)
24
- command.expects(:pick_demo_project).returns('/tmp/Proj.xcodeproj')
25
- command.expects(:open_project).with('/tmp/Proj.xcodeproj')
27
+ command.expects(:pick_demo_project).returns(XCODE_PROJECT)
28
+ command.expects(:open_project).with(XCODE_PROJECT)
26
29
  command.run
27
30
  end
28
31
 
29
32
  it 'allows the user to try the Pod with the given Git URL' do
30
33
  require 'cocoapods-downloader/git'
31
34
  Pod::Downloader::Git.any_instance.expects(:download)
32
- spec_file = '/tmp/CocoaPods/Try/ARAnalytics/ARAnalytics.podspec'
35
+ spec_file = Pod::Command::Try::TRY_TMP_DIR + 'ARAnalytics/ARAnalytics.podspec'
36
+ Pathname.stubs(:glob).once.returns([spec_file])
33
37
  stub_spec = stub(:name => 'ARAnalytics')
34
- Pod::Specification.stubs(:from_file).with(Pathname(spec_file)).returns(stub_spec)
38
+ Pod::Specification.stubs(:from_file).with(spec_file).returns(stub_spec)
35
39
 
36
40
  Config.instance.skip_repo_update = false
37
41
  command = Pod::Command.parse(['try', 'https://github.com/orta/ARAnalytics.git'])
38
42
  Installer::PodSourceInstaller.any_instance.expects(:install!)
39
43
  command.expects(:update_specs_repos).never
40
- command.expects(:pick_demo_project).returns('/tmp/Proj.xcodeproj')
41
- command.expects(:open_project).with('/tmp/Proj.xcodeproj')
44
+ command.expects(:pick_demo_project).returns(XCODE_PROJECT)
45
+ command.expects(:open_project).with(XCODE_PROJECT)
42
46
  command.run
43
47
  end
44
48
  end
@@ -57,9 +61,10 @@ module Pod
57
61
  it 'returns a spec for an https git repo' do
58
62
  require 'cocoapods-downloader/git'
59
63
  Pod::Downloader::Git.any_instance.expects(:download)
60
- spec_file = '/tmp/CocoaPods/Try/ARAnalytics/ARAnalytics.podspec'
64
+ spec_file = Pod::Command::Try::TRY_TMP_DIR + 'ARAnalytics/ARAnalytics.podspec'
65
+ Pathname.stubs(:glob).once.returns([spec_file])
61
66
  stub_spec = stub
62
- Pod::Specification.stubs(:from_file).with(Pathname(spec_file)).returns(stub_spec)
67
+ Pod::Specification.stubs(:from_file).with(spec_file).returns(stub_spec)
63
68
  spec = @sut.spec_with_url('https://github.com/orta/ARAnalytics.git')
64
69
  spec.should == stub_spec
65
70
  end
@@ -68,7 +73,7 @@ module Pod
68
73
  it 'installs the pod' do
69
74
  Installer::PodSourceInstaller.any_instance.expects(:install!)
70
75
  spec = stub(:name => 'ARAnalytics')
71
- sandbox_root = Pathname.new('/tmp/CocoaPods/Try')
76
+ sandbox_root = Pathname.new(Pod::Command::Try::TRY_TMP_DIR)
72
77
  sandbox = Sandbox.new(sandbox_root)
73
78
  path = @sut.install_pod(spec, sandbox)
74
79
  path.should == sandbox.root + 'ARAnalytics'
@@ -141,26 +146,27 @@ module Pod
141
146
  describe '#install_podfile' do
142
147
  it 'returns the original project if no Podfile could be found' do
143
148
  Pathname.any_instance.stubs(:exist?).returns(false)
144
- proj = '/tmp/Project.xcodeproj'
149
+ proj = XCODE_PROJECT
145
150
  path = @sut.install_podfile(proj)
146
151
  path.should == proj
147
152
  end
148
153
 
149
154
  it 'performs an installation and returns the path of the workspace' do
150
155
  Pathname.any_instance.stubs(:exist?).returns(true)
151
- proj = '/tmp/Project.xcodeproj'
156
+ proj = XCODE_PROJECT
152
157
  @sut.expects(:perform_cocoapods_installation)
153
- Podfile.stubs(:from_file).returns(stub(:workspace_path => '/tmp/Project.xcworkspace'))
158
+ Podfile.stubs(:from_file).returns(stub(:workspace_path => XCODE_WORKSPACE))
154
159
  path = @sut.install_podfile(proj)
155
- path.should == '/tmp/Project.xcworkspace'
160
+ path.to_s.should == XCODE_WORKSPACE.to_s
156
161
  end
157
162
 
158
163
  it 'returns the default workspace if one is not set' do
159
164
  Pathname.any_instance.stubs(:exist?).returns(true)
160
- proj = '/tmp/Project.xcodeproj'
165
+ proj = XCODE_PROJECT
161
166
  Podfile.stubs(:from_file).returns(stub(:workspace_path => nil))
167
+ @sut.expects(:perform_cocoapods_installation).once
162
168
  path = @sut.install_podfile(proj)
163
- path.should == '/tmp/Project.xcworkspace'
169
+ path.to_s.should == XCODE_WORKSPACE.to_s
164
170
  end
165
171
  end
166
172
  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.4
4
+ version: 0.4.5
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-05-06 00:00:00.000000000 Z
11
+ date: 2015-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -81,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
81
  version: '0'
82
82
  requirements: []
83
83
  rubyforge_project:
84
- rubygems_version: 2.0.14
84
+ rubygems_version: 2.4.7
85
85
  signing_key:
86
86
  specification_version: 4
87
87
  summary: CocoaPods plugin which allows to quickly try the demo project of a Pod.