cocoapods-developing-folder 0.5.2 → 0.5.3

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
  SHA256:
3
- metadata.gz: 8fec3c4079e85da225639a17557a343bf2f10279c5d583d06483f7e9338eb32b
4
- data.tar.gz: 6a3323ba035c43dd613022107e9c226ee0ad3505f61ee015059f71b29c013bbf
3
+ metadata.gz: cebe079c88fb59c78cd6d95c7dbe8ed6ceba9e76a1a61156f20c7eea0092377f
4
+ data.tar.gz: 67df2aa202eb343e88837d46796bd1fc095dac0040b164a423694220d029c098
5
5
  SHA512:
6
- metadata.gz: 3f9dc9ccfb023dbcf8fe4a59c410965f4ef5a66e81c61425dea4a8469b74039c0c246bec35c6bff12fb8f30dafc5936a59f3cb6e5f8744c2ba750cfc4ae7ac23
7
- data.tar.gz: f041955f6f22fd47fb35585bb233d45e898922a5f525c04af5fb63a786fda48743749eecfc842895b503ac06e471d8341eafb2badfbf0a418fcfa367992deee3
6
+ metadata.gz: 02c4f1be44f649d24cdf0b42564f4932b865d86f311ce98b05534762ad9ad308a4e9512b54237c395f69f99ebad15be37111f058e69979b82ebdd751197e5e14
7
+ data.tar.gz: cc8f0c64933bffca62b16a07c0ceaec5c3aa9227e87221832343ef6385250c4624d60a2c5b8cc0bc14c3792aad60002ffb5bfa5c0993e61dfcc5e1a50fd63534
data/README.md CHANGED
@@ -32,6 +32,8 @@ It will search your project root path. If you want smaller or larger search rang
32
32
  ``` ruby
33
33
  # in the podfile
34
34
  local_pod_searching_root "../Libs"
35
+ # Array is also supported.
36
+ # local_pod_searching_root ["../Libs", "../../modules"]
35
37
  ```
36
38
 
37
39
  #### 🔸 Import all local pods in specific folder
@@ -1,3 +1,3 @@
1
1
  module CocoapodsDevelopingFolder
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.3"
3
3
  end
@@ -3,12 +3,18 @@ require_relative 'utiltiy'
3
3
 
4
4
  module Pod
5
5
 
6
- class_attr_accessor :local_pod_DSL_root_path
6
+ class_attr_accessor :local_pod_DSL_root_paths
7
7
 
8
8
  class Podfile
9
9
 
10
10
  def local_pod_searching_root(path)
11
- Pod.local_pod_DSL_root_path = path
11
+ if path.kind_of? Array
12
+ Pod.local_pod_DSL_root_paths = path
13
+ elsif path.kind_of? String
14
+ Pod.local_pod_DSL_root_paths = [path]
15
+ else
16
+ raise "[Error] wrong type for `local_pod_searching_root`"
17
+ end
12
18
  end
13
19
  end
14
20
  end
@@ -22,32 +28,40 @@ module Pod
22
28
  def local_pod(name, *requirements)
23
29
  options = requirements.last
24
30
 
25
- rootPath = Pod.local_pod_DSL_root_path || "./"
31
+ rootPaths = Pod.local_pod_DSL_root_paths || ["./"]
26
32
  if options and options.kind_of? Hash and options[:root_path] != nil
27
- rootPath = options[:root_path]
33
+ rootPaths = [ options[:root_path] ]
28
34
  end
29
- basePath = Pathname.new rootPath
30
35
 
31
- path = nil
32
- basePath.find do |p|
33
- if p.basename.to_s == "#{name}.podspec"
34
- path = p
35
- break
36
- end
37
- end
36
+ rootPodName = Specification.root_name name
37
+ found = false
38
38
 
39
- if path == nil
40
- raise "\ncannot find local pod: #{name}"
41
- return
39
+ rootPaths.each do |rootPath|
40
+ basePath = Pathname.new rootPath
41
+
42
+ path = nil
43
+ basePath.find do |p|
44
+ if p.basename.to_s == "#{rootPodName}.podspec"
45
+ path = p
46
+ break
47
+ end
48
+ end
49
+ next if path.nil?
50
+
51
+ path = unify_path(path.parent)
52
+ path = path.to_s
53
+
54
+ if options and options.kind_of? Hash
55
+ options[:path] = path
56
+ pod(name, *requirements)
57
+ else
58
+ pod(name, *requirements, :path => path)
59
+ end
60
+ found = true
61
+ break
42
62
  end
43
- path = unify_path(path.parent)
44
- path = path.to_s
45
-
46
- if options and options.kind_of? Hash
47
- options[:path] = path
48
- pod(name, *requirements)
49
- else
50
- pod(name, *requirements, :path => path)
63
+ if not found
64
+ raise "\ncannot find local pod: #{name}. Searching roots: #{rootPaths}"
51
65
  end
52
66
  end
53
67
 
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.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - leavez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-27 00:00:00.000000000 Z
11
+ date: 2018-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler