cocoapods-backup 0.0.2 → 0.0.3

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
  SHA256:
3
- metadata.gz: e40ee550d5e3b54a32979395f793a0e195a5261971b937ffa0d69c763b6fd2b4
4
- data.tar.gz: 184d4cb4c44df76af2b6f30ff9302b742505586cd402ea00eb1f03b820be3cf3
3
+ metadata.gz: 29bab0121eb2490a93bf29a0bbe33e65b7e76cfe5683012f965e3e5867004e4f
4
+ data.tar.gz: ab232a91ace412309ddc383c8f58354c8b3f27cbca847438b8c5021356454e5e
5
5
  SHA512:
6
- metadata.gz: a611f08b9538105dede08eee66a6aa947217f241856d7e09c1757934b0625905a4e0733281b4813eac11e98c7ee1b42d7aafd0c261743e2b63d181013f59a3bf
7
- data.tar.gz: c4c419b1d447b9c49e07508766f3876f1b24cc00d74bd9c79a96d0c77124146dc09560b19e026e6107841e908fe10b436d1d78f6e809e085fba4215fde2d0de1
6
+ metadata.gz: 6b435d3d1f85cf14f0217dbeee59c2b8e12a5f218f5743e6aa199e8752c16bad6cf827cef9e6e45e1592c3430fc5429f44593bdef722c994ff1b793bf5395716
7
+ data.tar.gz: 8ced5a163461e4c535909f351a601ac9dd90182cb00ee3bf5dc44d656a168b46a3c6b5f14ce0cb8dd7a3833cb6d63ced37df1dec15371aede17ef3c6f6a486d5
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 0.0.2
2
+ current_version = 0.0.3
3
3
  commit = True
4
4
  tag = True
5
5
  tag_name = {new_version}
@@ -30,3 +30,7 @@ pod 'AFNetworking',
30
30
  :tag => '2.6.3',
31
31
  :backup => true # 标志该 Pod 优先以本地备份源码为主
32
32
  ```
33
+
34
+ ## 版本
35
+
36
+ 详见 [Release 页面](https://github.com/kingcos/cocoapods-backup/releases)。
@@ -5,7 +5,7 @@ require 'cocoapods-backup/gem_version.rb'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'cocoapods-backup'
8
- spec.version = '0.0.2'
8
+ spec.version = '0.0.3'
9
9
  spec.authors = ['kingcos']
10
10
  spec.email = ['2821836721v@gmail.com']
11
11
  spec.description = %q{Using current sources for your pods.}
@@ -17,27 +17,33 @@ module Pod
17
17
  sandbox = Config.instance.sandbox
18
18
 
19
19
  if should_backup
20
- # 0. Fixed when subspec (eg. pod 'OHHTTPStubs/Swift', only OHHTTPStubs.podspec.json exists)
20
+ # 0. Using pod when only import subspec
21
+ # (eg. pod 'OHHTTPStubs/Swift', only OHHTTPStubs.podspec.json exists)
21
22
  pod_name = name.split("/")[0]
22
23
 
23
24
  # 1. Finding MyPod.podspec.json
24
25
  podspec_json_filename = "#{pod_name}.podspec.json"
25
- # /Users/kingcos/Project/Pods/Local Podspecs/MyPod.podspec.json
26
- podspec_json_org_path = sandbox.specifications_root + podspec_json_filename
27
- # /Users/kingcos/Project/Pods/MyPod
28
- pod_source_path = sandbox.sources_root + pod_name
29
- # /Users/kingcos/Project/Pods/MyPod/MyPod.podspec.json
30
- podspec_json_dest_path = pod_source_path + podspec_json_filename
31
-
32
- if !podspec_json_org_path.exist?
33
- Pod::UI.warn "[Skipped] Cannot finding #{pod_name}.podspec.json in #{sandbox.specifications_root}"
26
+ # Pods/Local Podspecs/ + MyPod.podspec.json
27
+ podspec_json_original_path = Pathname.new("Pods/Local Podspecs") + podspec_json_filename
28
+ # Pods/MyPod
29
+ pod_source_path = Pathname.new("Pods") + pod_name
30
+ # Pods/MyPod/MyPod.podspec.json
31
+ podspec_json_dest_path = Pathname.new("Pods/#{pod_name}") + podspec_json_filename
34
32
 
33
+ if !podspec_json_original_path.exist?
34
+ Pod::UI.warn "[cocoapods-backup] Cannot finding #{pod_name}.podspec.json in your Pods/Local Podspecs path."
35
35
  pod_method.bind(self).(name, *args)
36
36
  return
37
37
  end
38
38
 
39
39
  # 2. ln -s Pods/Local Podspecs/MyPod.podspec.json Pods/MyPod/MyPod.podspec.json
40
- File.symlink(podspec_json_org_path, podspec_json_dest_path) unless File.symlink? (podspec_json_dest_path)
40
+ if File.symlink? (podspec_json_dest_path)
41
+ File.delete(podspec_json_dest_path)
42
+ end
43
+
44
+ # Note: symbolic link with relative path on macOS (ln -s ../some_dir/file file)
45
+ # ln -s ../../Pods/Local Podspecs/MyPod.podspec.json Pods/AdyenCSE/MyPod.podspec.json
46
+ File.symlink("../../" + podspec_json_original_path.to_s, podspec_json_dest_path.to_s)
41
47
 
42
48
  # 3. Using :path => 'Pods/MyPod'
43
49
  args.last[:path] = pod_source_path.to_s
@@ -1,3 +1,3 @@
1
1
  module CocoapodsBackup
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - kingcos
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-04 00:00:00.000000000 Z
11
+ date: 2020-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler