cocoapods-try 1.0.0 → 1.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: 5e3e1af736f74015a72a6aaebba60c4e3404975d
4
- data.tar.gz: cf0bf1cd190b4484ccfd701bfcf7112519ec87ca
3
+ metadata.gz: 5cef41a8c21efc2eee62ba1b237d2eb58774cff2
4
+ data.tar.gz: 7a29df423832fa7386330ebe1ef05a3d5f3bff8f
5
5
  SHA512:
6
- metadata.gz: b6bd218995d8fff76af8c2f2b7537b027f1999770fda9a7f6bfd8dde9bf6daad7ac51e18e7f5843358e1edfa88ba9f02fd011d4a64fc9f98be71668cdc5898fb
7
- data.tar.gz: 2e5deb658c5c264b7501ddd7a0d07b56467fb226588fb8180c30cb1eb85cf392acdf8d431f956efb6d7f8017a789546bd412b25310569709098d73d106c4e9d2
6
+ metadata.gz: dd0b895a8eb757e13f9e3d6ce5ec0884c45832d6fa2141e18f6493c17bd8764bb106a6bb2b51e49eaed62b40b8742784f25f7494ab6bccae3f3f5092d0192dae
7
+ data.tar.gz: 3c6637fb7078cdeebec4c7cc6d28b844d9197afb86b548c52132d9cd94ed1420a21b018612b5b4ba473656640bd3ac1716a76d6ebca12c34ce3ab894ea974b50
@@ -1,4 +1,17 @@
1
- # Cocoapods::Try Changelog
1
+ # CocoaPods::Try CHANGELOG
2
+
3
+ ## 1.1.0 (2016-07-10)
4
+
5
+ ##### Enhancements
6
+
7
+ * Added a command line option for specifying the podspec file from Git URL
8
+ [@rockwotj](https://github.com/rockwotj)
9
+ [59](https://github.com/CocoaPods/CocoaPods-try/issues/59)
10
+
11
+ ##### Bug Fixes
12
+
13
+ * None.
14
+
2
15
 
3
16
  ## 1.0.0 (2016-05-10)
4
17
 
@@ -20,7 +20,7 @@ GIT
20
20
  cocoapods-search (= 1.0.0.beta.2)
21
21
  cocoapods-stats (= 1.0.0.beta.4)
22
22
  cocoapods-trunk (= 1.0.0.beta.3)
23
- cocoapods-try (= 1.0.0)
23
+ cocoapods-try (= 1.1.0)
24
24
  colored (~> 1.2)
25
25
  escape (~> 0.0.4)
26
26
  fourflusher (~> 0.3.0)
@@ -41,7 +41,7 @@ GIT
41
41
  PATH
42
42
  remote: .
43
43
  specs:
44
- cocoapods-try (1.0.0)
44
+ cocoapods-try (1.1.0)
45
45
 
46
46
  GEM
47
47
  remote: https://rubygems.org/
@@ -1,5 +1,5 @@
1
1
  # The namespace of the Cocoapods try plugin.
2
2
  #
3
3
  module CocoapodsTry
4
- VERSION = '1.0.0'.freeze
4
+ VERSION = '1.1.0'.freeze
5
5
  end
@@ -16,18 +16,29 @@ module Pod
16
16
  Downloads the Pod with the given `NAME` (or Git `URL`), install its
17
17
  dependencies if needed and opens its demo project. If a Git URL is
18
18
  provided the head of the repo is used.
19
+
20
+ If a Git URL is specified, then a --podspec_name can be provided,
21
+ if the podspec name is different than the git repo for some reason.
19
22
  DESC
20
23
 
21
24
  self.arguments = [CLAide::Argument.new(%w(NAME URL), true)]
22
25
 
26
+ def self.options
27
+ [
28
+ ['--podspec_name=[name]', 'The name of the podspec file within the Git Repository'],
29
+ ].concat(super)
30
+ end
31
+
23
32
  def initialize(argv)
24
33
  @name = argv.shift_argument
34
+ @podspec_name = argv.option('podspec_name')
25
35
  super
26
36
  end
27
37
 
28
38
  def validate!
29
39
  super
30
40
  help! 'A Pod name or URL is required.' unless @name
41
+ help! 'Podspec name can only be used with a Git URL' if @podspec_name && !git_url?(@name)
31
42
  end
32
43
 
33
44
  def run
@@ -62,7 +73,7 @@ module Pod
62
73
  #
63
74
  def setup_spec_in_sandbox(sandbox)
64
75
  if git_url?(@name)
65
- spec = spec_with_url(@name)
76
+ spec = spec_with_url(@name, @podspec_name)
66
77
  sandbox.store_pre_downloaded_pod(spec.name)
67
78
  else
68
79
  update_specs_repos
@@ -91,14 +102,18 @@ module Pod
91
102
  # Returns the specification found in the given Git repository URL by
92
103
  # downloading the repository.
93
104
  #
94
- # @param [String] url
95
- # The URL for the pod Git repository.
105
+ # @param [String] url
106
+ # The URL for the pod Git repository.
107
+ #
108
+ # @param [String] spec_name
109
+ # The name of the podspec file within the Git repository.
96
110
  #
97
111
  # @return [Specification] The specification.
98
112
  #
99
- def spec_with_url(url)
113
+ def spec_with_url(url, spec_name = nil)
100
114
  name = url.split('/').last
101
115
  name = name.chomp('.git') if name.end_with?('.git')
116
+ name = spec_name unless spec_name.nil?
102
117
 
103
118
  target_dir = TRY_TMP_DIR + name
104
119
  target_dir.rmtree if target_dir.exist?
@@ -19,6 +19,13 @@ module Pod
19
19
  end.message.should.match(/A Pod name or URL is required/)
20
20
  end
21
21
 
22
+ it 'presents the help if name and podspec name is provided' do
23
+ command = Pod::Command.parse(%w(try ARAnalytics --podspec_name=Analytics.podspec))
24
+ should.raise CLAide::Help do
25
+ command.validate!
26
+ end.message.should.match(/Podspec name can only be used with a Git URL/)
27
+ end
28
+
22
29
  before do
23
30
  @original_install_method = method = Pod::Command::Try.instance_method(:install_pod)
24
31
  Pod::Command::Try.send(:define_method, :install_pod) do |*args|
@@ -99,6 +106,17 @@ module Pod
99
106
  spec = @sut.spec_with_url('https://github.com/orta/ARAnalytics.git')
100
107
  spec.should == stub_spec
101
108
  end
109
+
110
+ it 'returns a spec for an https git repo with podspec_name option' do
111
+ require 'cocoapods-downloader/git'
112
+ Pod::Downloader::Git.any_instance.expects(:download)
113
+ spec_file = Pod::Command::Try::TRY_TMP_DIR + 'ARAnalytics/Analytics.podspec'
114
+ Pathname.stubs(:glob).once.returns([spec_file])
115
+ stub_spec = stub
116
+ Pod::Specification.stubs(:from_file).with(spec_file).returns(stub_spec)
117
+ spec = @sut.spec_with_url('https://github.com/orta/ARAnalytics.git', 'Analytics')
118
+ spec.should == stub_spec
119
+ end
102
120
  end
103
121
 
104
122
  it 'installs the pod' do
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: 1.0.0
4
+ version: 1.1.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: 2016-05-10 00:00:00.000000000 Z
11
+ date: 2016-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  version: '0'
84
84
  requirements: []
85
85
  rubyforge_project:
86
- rubygems_version: 2.6.3
86
+ rubygems_version: 2.6.5
87
87
  signing_key:
88
88
  specification_version: 4
89
89
  summary: CocoaPods plugin which allows to quickly try the demo project of a Pod.