cocoapods-developing-folder 0.0.4 → 0.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
- SHA1:
3
- metadata.gz: 239df26f7c0cdfd28038b5d6860b569a47b703ad
4
- data.tar.gz: abd7e951556b590cd3700c67170c39bf12fb1d80
2
+ SHA256:
3
+ metadata.gz: d04c93c96d60458e3bda533c82082253ac0204babf17aa964683dcc927602760
4
+ data.tar.gz: c6e28449839dd827df1ed1401e5f16587df41caa4ba9a2a3c95095c0418ec895
5
5
  SHA512:
6
- metadata.gz: 5348d0b811a6cc93cf385a513b6c61a38b9ee3e011e43957e4151ca4f470d53bb098f57bb739ace3419d1d22a18d7c72de75a42f66ab48d3b10cc6dc09b892d7
7
- data.tar.gz: 423b1af15cfc55f5b24bcec5de47dc44d4e96ba5d77340304d3110c8d72d1fa1db0342af3d3bb8909016fb3e8cba6d15b7d64b22964758a8c5c374f8013bd881
6
+ metadata.gz: 2f385807d83cb6d2ab69b270f2d638bcb2f00e3eefaa639c7781f780a7e2e0999f8ea7a5645c02db4435179b94b89ee1fd685f99333059d03f8bd9cd12be6b54
7
+ data.tar.gz: 401b1baa76efa7bfe3e83ee7279f470e28f408ea75080a619be22e0e5bd386803fd968e3b026fdb6419df82e35e9675f0f06cb2e971bbf0d934726ceb5315961
data/README.md CHANGED
@@ -1,10 +1,11 @@
1
1
  # cocoapods-developing-folder
2
2
 
3
- A cocoapods plugin provide a branch of tools for who heavily use development pods in project:
3
+ A cocoapods plugin provide a branch of tools for who heavily use development pods in project. You can do these:
4
4
 
5
- - Availability to preserves the folder structure in `development pods`
6
- - Provides a new keyword `folder` to import all local pods in a specific folder and its subfolders
7
- - Function to inhibit warnings for specific pods with a block.
5
+ - new keyword `local_pod` to import a local pod without specifying path
6
+ - new keyword `folder` to import all local pods in a specific folder and its subfolders
7
+ - preserves the folder structure in `development pods`
8
+ - inhibit warnings for specific pods with a block.
8
9
 
9
10
 
10
11
  ## Installation
@@ -13,18 +14,18 @@ A cocoapods plugin provide a branch of tools for who heavily use development po
13
14
 
14
15
  ## Usage
15
16
 
16
- #### 🔸 Preserves the folder structure
17
-
18
- Add the following to your podfile
17
+ Firstly, you should add this in head of Podifle:
19
18
 
20
19
  ```ruby
21
20
  plugin 'cocoapods-developing-folder'
22
- use_folders
23
21
  ```
24
22
 
25
- If you don't want to create groups for top level folders (Local pods are usually grouped in the same folder):
23
+ #### 🔸 Import a local pods without specifying path
24
+
25
+ Use `local_pod` just like `pod` keyword. No need to adding path. E.g.
26
+
26
27
  ```ruby
27
- use_folders :skip_top_level_group => ["modules"]
28
+ local_pod "Evangelion" # no need for `:path => "modules/Evangelion"`
28
29
  ```
29
30
 
30
31
  #### 🔸 Import all local pods in specific folder
@@ -39,6 +40,7 @@ target "ABC" do
39
40
  pod "SnapKit"
40
41
  folder "frameworks/core" # 'frameworks/core' is just a relative path to podfile
41
42
  folder "modules" # it will import all pod in 'modules' folder and its subfolders
43
+ folder "libs", :inhibit_warnings => true # the option will apply to all pods in the libs folder
42
44
  end
43
45
  ```
44
46
 
@@ -51,6 +53,19 @@ pod "Shinji", :path => "modules/some/path/to/Shinji"
51
53
  #...
52
54
  ```
53
55
 
56
+ #### 🔸 Preserves the folder structure
57
+
58
+ Add the following to your podfile
59
+
60
+ ```ruby
61
+ use_folders
62
+ ```
63
+
64
+ If you don't want to create groups for top level folders (Local pods are usually grouped in the same folder):
65
+ ```ruby
66
+ use_folders :skip_top_level_group => ["modules"]
67
+ ```
68
+
54
69
  #### 🔸 Inhibit warnings for specific pods
55
70
 
56
71
  Add the following to your podfile
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.version = CocoapodsDevelopingFolder::VERSION
9
9
  spec.authors = ['leavez']
10
10
  spec.email = ['gaojiji@gmail.com']
11
- spec.description = %q{Preserve the folder hierarchy for development pods in xcode.}
12
- spec.summary = %q{Preserve the folder hierarchy for development pods in xcode}
11
+ spec.description = %q{a branch of tools for who heavily use development pods}
12
+ spec.summary = %q{a branch of tools for who heavily use development pods}
13
13
  spec.homepage = 'https://github.com/leavez/cocoapods-developing-folder'
14
14
  spec.license = 'MIT'
15
15
 
@@ -1,10 +1,11 @@
1
- require 'cocoapods-developing-folder/command/folder_DSL.rb'
1
+ require_relative 'folder_DSL'
2
+ require_relative 'local_pod_DSL'
2
3
 
3
4
  module Pod
4
5
  class Podfile
5
6
 
6
7
  def use_folders(*skipped_top_level_folder_names)
7
- require 'cocoapods-developing-folder/command/preserve_folder.rb'
8
+ require_relative 'preserve_folder'
8
9
  names_to_skip = []
9
10
  first = skipped_top_level_folder_names.first
10
11
  if first.is_a? Hash
@@ -15,7 +16,7 @@ module Pod
15
16
 
16
17
 
17
18
  def inhibit_warnings_with_condition(&condition)
18
- require 'cocoapods-developing-folder/command/inhibit_warnings_with_condition.rb'
19
+ require_relative 'inhibit_warnings_with_condition'
19
20
  Pod.set_inhibit_waning_condition_block proc(&condition)
20
21
  end
21
22
 
@@ -4,22 +4,24 @@ module Pod
4
4
  class Podfile
5
5
  module DSL
6
6
 
7
- def folder(path)
7
+ def folder(path, *requirements)
8
8
  basePath = Pathname.new path
9
- def import_pod(path)
9
+ def import_pod(path, *requirements)
10
10
  podspec = path.children.find do |p|
11
11
  !p.directory? and p.extname == ".podspec"
12
12
  end
13
13
  if podspec != nil
14
- pod podspec.basename(".podspec").to_s, :path => path.to_path
14
+ options = (requirements.last || {}).clone
15
+ options[:path] = path.to_path
16
+ pod(podspec.basename(".podspec").to_s, options)
15
17
  end
16
18
  path.children.each do |p|
17
19
  if p.directory?
18
- import_pod(p)
20
+ import_pod(p, *requirements)
19
21
  end
20
22
  end
21
23
  end
22
- import_pod basePath
24
+ import_pod basePath, *requirements
23
25
  end
24
26
 
25
27
  end
@@ -1,3 +1,3 @@
1
1
  module CocoapodsDevelopingFolder
2
- VERSION = "0.0.4"
2
+ VERSION = "0.5"
3
3
  end
@@ -0,0 +1,33 @@
1
+ require 'pathname'
2
+
3
+ module Pod
4
+ class Podfile
5
+ module DSL
6
+
7
+ def local_pod(name, *requirements)
8
+ basePath = Pathname.new "./"
9
+
10
+ path = nil
11
+ basePath.find do |p|
12
+ if p.basename.to_s == "#{name}.podspec"
13
+ path = p
14
+ break
15
+ end
16
+ end
17
+
18
+ if path == nil
19
+ raise "\ncannot find local pod: #{name}"
20
+ return
21
+ end
22
+ options = requirements.last
23
+ if options and options.kind_of? Hash
24
+ options[:path] = path.to_s
25
+ pod(name, *requirements)
26
+ else
27
+ pod(name, *requirements, :path => path.to_s)
28
+ end
29
+ end
30
+
31
+ end
32
+ end
33
+ end
@@ -1 +1 @@
1
- require 'cocoapods-developing-folder/command'
1
+ require 'cocoapods-developing-folder/folder'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-developing-folder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: '0.5'
5
5
  platform: ruby
6
6
  authors:
7
7
  - leavez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-14 00:00:00.000000000 Z
11
+ date: 2018-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,7 +38,7 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- description: Preserve the folder hierarchy for development pods in xcode.
41
+ description: a branch of tools for who heavily use development pods
42
42
  email:
43
43
  - gaojiji@gmail.com
44
44
  executables: []
@@ -53,12 +53,12 @@ files:
53
53
  - Rakefile
54
54
  - cocoapods-developing-folder.gemspec
55
55
  - lib/cocoapods-developing-folder.rb
56
- - lib/cocoapods-developing-folder/command.rb
57
- - lib/cocoapods-developing-folder/command/folder.rb
58
- - lib/cocoapods-developing-folder/command/folder_DSL.rb
59
- - lib/cocoapods-developing-folder/command/inhibit_warnings_with_condition.rb
60
- - lib/cocoapods-developing-folder/command/preserve_folder.rb
56
+ - lib/cocoapods-developing-folder/folder.rb
57
+ - lib/cocoapods-developing-folder/folder_DSL.rb
61
58
  - lib/cocoapods-developing-folder/gem_version.rb
59
+ - lib/cocoapods-developing-folder/inhibit_warnings_with_condition.rb
60
+ - lib/cocoapods-developing-folder/local_pod_DSL.rb
61
+ - lib/cocoapods-developing-folder/preserve_folder.rb
62
62
  - lib/cocoapods_plugin.rb
63
63
  - spec/command/folder_spec.rb
64
64
  - spec/spec_helper.rb
@@ -82,10 +82,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  version: '0'
83
83
  requirements: []
84
84
  rubyforge_project:
85
- rubygems_version: 2.4.8
85
+ rubygems_version: 2.7.6
86
86
  signing_key:
87
87
  specification_version: 4
88
- summary: Preserve the folder hierarchy for development pods in xcode
88
+ summary: a branch of tools for who heavily use development pods
89
89
  test_files:
90
90
  - spec/command/folder_spec.rb
91
91
  - spec/spec_helper.rb
@@ -1 +0,0 @@
1
- require 'cocoapods-developing-folder/command/folder'