cocoapods-try-release-fix 0.1.1 → 0.1.2

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: be63bdbd27501b3ec5239201329a3916bcd87a31
4
- data.tar.gz: 2404c5104caea42299e952f070faae0e33f84253
3
+ metadata.gz: 7276b8fe8e6b0d203c1ea4caaa630a723062b2ca
4
+ data.tar.gz: 598d5fb692e421071b03e1bb8fcf626754f76456
5
5
  SHA512:
6
- metadata.gz: ef5a78d733eaed67ca95fe191cfce2338a85530e5c8e1519c91ad3e491976b3eb0555c47da64a83d3f34a61dbb08fd7cb005351674626afec685d976791377fd
7
- data.tar.gz: f4dd2d870c5480896b9ed2902449cff05786b24ada8281fe1bb8a541689fbf70814c971061931497067517d33296f060ea3337662c8308bcbebc6ffa920d83df
6
+ metadata.gz: 784bead28bd534c72936ef41360f7687b0c883591628b84a8507327ba21a9ebab5e5a4f3fe794ab6d1a449103bc1c44716dbaf2c803a4a997822bb9d16a16385
7
+ data.tar.gz: c279283f96b29a63a1ea49d35eac617ffb9a2b073f9fbc3b133eb2616d8093ff15f016fb82ba53d86e9ceff0dc6c51e9115277d6df9f8c0146f31b6710502a54
@@ -1,3 +1,12 @@
1
1
  # Cocoapods::Try Changelog
2
2
 
3
- ## Master
3
+ ## 0.1.2
4
+
5
+ * Prefer workspaces over projects. - [kylef](https://github.com/kylef)
6
+ * Open workspaces uf available. - [kylef](https://github.com/kylef)
7
+ * Don't consider workspaces in bundles. - [alloy](https://github.com/alloy)
8
+ * Typo fixes. - [markltownsend](https://github.com/markltownsend)
9
+
10
+ ## 0.1.0
11
+
12
+ * Initial implementation - [fabiopelosin](https://github.com/fabiopelosin)
@@ -0,0 +1,21 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'cocoapods_try.rb'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "cocoapods-try-release-fix"
8
+ spec.version = CocoapodsTry::VERSION
9
+ spec.authors = ["Fabio Pelosin"]
10
+ spec.summary = %q{CocoaPods plugin which allows to quickly try the demo project of a Pod.}
11
+ spec.homepage = "https://github.com/cocoapods/cocoapods-try"
12
+ spec.license = "MIT"
13
+
14
+ spec.files = `git ls-files`.split($/)
15
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
16
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
17
+ spec.require_paths = ["lib"]
18
+
19
+ spec.add_development_dependency "bundler", "~> 1.3"
20
+ spec.add_development_dependency "rake"
21
+ end
@@ -1,3 +1,3 @@
1
1
  module CocoapodsTry
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -7,7 +7,7 @@ module Pod
7
7
  self.summary = "Try a Pod!"
8
8
 
9
9
  self.description = <<-DESC
10
- Donwloads the Pod with the given NAME and opens its project.
10
+ Downloads the Pod with the given NAME and opens its project.
11
11
  DESC
12
12
 
13
13
  self.arguments = 'NAME'
@@ -94,7 +94,11 @@ module Pod
94
94
  #
95
95
  def pick_demo_project(dir)
96
96
  glob_match = Dir.glob("#{dir}/**/*.xc{odeproj,workspace}")
97
- glob_match = glob_match.reject { |p| p.include?('Pods.xcodeproj') }
97
+ glob_match = glob_match.reject do |p|
98
+ p.include?('Pods.xcodeproj') || \
99
+ p.end_with?('.xcodeproj/project.xcworkspace') || \
100
+ (p.end_with?('.xcodeproj') && glob_match.include?(p.chomp(File.extname(p.to_s)) + '.xcworkspace'))
101
+ end
98
102
 
99
103
  if glob_match.count == 0
100
104
  raise Informative, "Unable to find any project in the source files" \
@@ -134,7 +138,12 @@ module Pod
134
138
  perform_cocoapods_installation
135
139
 
136
140
  podfile = Pod::Podfile.from_file(podfile_path)
137
- File.expand_path(podfile.workspace_path)
141
+
142
+ if podfile.workspace_path
143
+ File.expand_path(podfile.workspace_path)
144
+ else
145
+ proj.chomp(File.extname(proj.to_s)) + '.xcworkspace'
146
+ end
138
147
  end
139
148
  else
140
149
  proj
@@ -98,6 +98,18 @@ module Pod
98
98
  path = @sut.pick_demo_project(stub(:cleanpath => ''))
99
99
  path.should == 'Project Demo.xcworkspace'
100
100
  end
101
+
102
+ it "should not show workspaces inside a project" do
103
+ Dir.stubs(:glob).returns(['Project Demo.xcodeproj', 'Project Demo.xcodeproj/project.xcworkspace'])
104
+ path = @sut.pick_demo_project(stub(:cleanpath => ''))
105
+ path.should == 'Project Demo.xcodeproj'
106
+ end
107
+
108
+ it "should prefer workspaces over projects with the same name" do
109
+ Dir.stubs(:glob).returns(['Project Demo.xcodeproj', 'Project Demo.xcworkspace'])
110
+ path = @sut.pick_demo_project(stub(:cleanpath => ''))
111
+ path.should == 'Project Demo.xcworkspace'
112
+ end
101
113
  end
102
114
 
103
115
  describe "#install_podfile" do
@@ -116,6 +128,14 @@ module Pod
116
128
  path = @sut.install_podfile(proj)
117
129
  path.should == "/tmp/Project.xcworkspace"
118
130
  end
131
+
132
+ it "returns the default workspace if one is not set" do
133
+ Pathname.any_instance.stubs(:exist?).returns(true)
134
+ proj = "/tmp/Project.xcodeproj"
135
+ Podfile.stubs(:from_file).returns(stub(:workspace_path => nil))
136
+ path = @sut.install_podfile(proj)
137
+ path.should == "/tmp/Project.xcworkspace"
138
+ end
119
139
  end
120
140
  end
121
141
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-try-release-fix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabio Pelosin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-25 00:00:00.000000000 Z
11
+ date: 2014-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -51,6 +51,7 @@ files:
51
51
  - LICENSE
52
52
  - README.md
53
53
  - Rakefile
54
+ - cocoapods-try-release-fix.gemspec
54
55
  - cocoapods-try.gemspec
55
56
  - lib/cocoapods_plugin.rb
56
57
  - lib/cocoapods_try.rb
@@ -77,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
78
  version: '0'
78
79
  requirements: []
79
80
  rubyforge_project:
80
- rubygems_version: 2.0.3
81
+ rubygems_version: 2.0.6
81
82
  signing_key:
82
83
  specification_version: 4
83
84
  summary: CocoaPods plugin which allows to quickly try the demo project of a Pod.