cocoapods-playgrounds 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 275c67e58a54c7e578d14e226e738171adc10570
4
- data.tar.gz: e993ec4faef79f4ba826da07dfef838a3a004c3c
3
+ metadata.gz: 62abe6d9dadba9c2c9da2016bb929f090164bdf3
4
+ data.tar.gz: 89a8d28aa56d7268b664e3f37667b9df3198d584
5
5
  SHA512:
6
- metadata.gz: 65c3ba2bd2716dc78726405ee5f625892fea4994ed7863d3794eb716daa6b371745c475d700e9db7e258f2e07bc1409d4c9fef7bd7760791a38aa552962e31fb
7
- data.tar.gz: b198629ea4a0784faeea1c9022fa8cf0d217b6dcfcd5f269b66168f2117797dd332137b35a4a5ea972ef87bb8e24723f6136c583235f268e865a161ff8adefca
6
+ metadata.gz: 872e93d6370c92db81c63c13534e34d4babe6734e456f931ba68d027c40a07d6ed77884fcd3e93347cba4495fcf21992c6466b730532e0bf61a324ea3d96349e
7
+ data.tar.gz: 40ee2c758f2cbb108cfeeba66c181bc16508e1cfe6d9b2c634d303039452feeeab51e017283ab836bfc1bf469b20cb5247c1016a5318b00c6f10b9c8aafd1d92
@@ -9,9 +9,16 @@ module Pod
9
9
 
10
10
  self.arguments = [CLAide::Argument.new('NAMES', true)]
11
11
 
12
+ def self.options
13
+ [
14
+ ['--no-install', 'Skip running `pod install`']
15
+ ]
16
+ end
17
+
12
18
  def initialize(argv)
13
19
  arg = argv.shift_argument
14
20
  @names = arg.split(',') if arg
21
+ @install = argv.flag?('install', true)
15
22
  super
16
23
  end
17
24
 
@@ -23,7 +30,7 @@ module Pod
23
30
  def run
24
31
  # TODO: Pass platform and deployment target from configuration
25
32
  generator = WorkspaceGenerator.new(@names)
26
- generator.generate
33
+ generator.generate(@install)
27
34
  end
28
35
  end
29
36
  end
@@ -1,3 +1,3 @@
1
1
  module CocoapodsPlaygrounds
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.1.0'.freeze
3
3
  end
@@ -15,25 +15,25 @@ module Pod
15
15
  @tool = tool
16
16
  end
17
17
 
18
- def generate
18
+ def generate(install = true)
19
19
  @cwd = Pathname.getwd
20
- `rm -fr #{target_dir}`
20
+ `rm -fr '#{target_dir}'`
21
21
  FileUtils.mkdir_p(target_dir)
22
22
 
23
23
  Dir.chdir(target_dir) do
24
- setup_project
24
+ setup_project(install)
25
25
 
26
26
  generator = Pod::PlaygroundGenerator.new(@platform)
27
27
  path = generator.generate(names.first)
28
28
  generate_swift_code(path)
29
29
  end
30
30
 
31
- `open #{workspace_path}`
31
+ `open #{workspace_path}` if install
32
32
  end
33
33
 
34
34
  private
35
35
 
36
- def setup_project
36
+ def setup_project(install = true)
37
37
  case @tool
38
38
  when :carthage then
39
39
  generate_cartfile
@@ -43,21 +43,26 @@ module Pod
43
43
  when :cocoapods then
44
44
  generate_podfile
45
45
  generate_project
46
- Pod::Executable.execute_command('pod', ['install', '--no-repo-update'])
46
+ Pod::Executable.execute_command('pod', ['install', '--no-repo-update']) if install
47
47
  end
48
48
  end
49
49
 
50
50
  def names
51
51
  @names.map do |name|
52
- File.basename(name, '.podspec')
52
+ if !(@cwd + name).exist? && name.include?('/')
53
+ File.dirname(name)
54
+ else
55
+ File.basename(name, '.podspec')
56
+ end
53
57
  end
54
58
  end
55
59
 
56
60
  def pods
57
61
  names.zip(@names).map do |name, path|
58
- path = @cwd + path
62
+ abs_path = @cwd + path
63
+ name = path unless abs_path.exist? # support subspecs
59
64
  requirement = "pod '#{name}'"
60
- requirement += ", :path => '#{path.dirname}'" if path.exist?
65
+ requirement += ", :path => '#{abs_path.dirname}'" if abs_path.exist?
61
66
  requirement
62
67
  end.join("\n")
63
68
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-playgrounds
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
  - Boris Bügling
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-14 00:00:00.000000000 Z
11
+ date: 2016-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods