cocoapods-git2local 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: daa3dc5adb1b9c9652fef33c34d417c5e1251f9a743525be7960d0862c6eca13
4
+ data.tar.gz: d2c3d689ee0a01bcb29405328a7950f6a58568b31ea5a669f4b32d973774736e
5
+ SHA512:
6
+ metadata.gz: bcb0bafbe72b5e92afb0b4d28ba5d40951d6efdd12b0f05349dba44e9634e43e678986f1617c31a17424b92e33bc9a4ed6cf93751800e7eb66d2a914a4e02966
7
+ data.tar.gz: 30baef453dfbae00cfb198803b2aedeee43fed92bf1a60cd6da650e6581b3871f93a2d3db60d8441f75237df39e5baa899bc1c466384edbcc5a507e8268c8ef5
@@ -0,0 +1 @@
1
+ require 'pod/pod'
@@ -0,0 +1,3 @@
1
+ module CocoapodsGit2local
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1 @@
1
+ require 'cocoapods-git2local/gem_version'
@@ -0,0 +1 @@
1
+ require 'cocoapods-git2local/command'
data/lib/pod/git.rb ADDED
@@ -0,0 +1,25 @@
1
+ def gitclone(git, commit)
2
+ component = git.split("/")[4].split(".")[0]
3
+ pwd = Dir.pwd
4
+ Dir.chdir("..")
5
+ if File.directory?(component)
6
+ Dir.chdir(component)
7
+ p Dir.pwd
8
+ reset = 'yes'
9
+ unless system("git status | grep 'nothing to commit'")
10
+ p component + "有未提交的修改"
11
+ reset = gets
12
+ end
13
+ if reset == 'yes'
14
+ system("git reset --hard " + commit)
15
+ system("git checkout " + commit)
16
+ end
17
+ else
18
+ system("git clone " + git)
19
+ Dir.chdir(component)
20
+ p Dir.pwd
21
+ system("git checkout " + commit)
22
+ end
23
+
24
+ Dir.chdir(pwd)
25
+ end
data/lib/pod/pod.rb ADDED
@@ -0,0 +1,40 @@
1
+ require 'pod/git'
2
+ #
3
+ # In order to support installing pods from links we want to override the pod entry point
4
+ # in the pod spec so we can lookup a link prior to installing the pod
5
+ #
6
+ module Pod
7
+ class Podfile
8
+ module DSL
9
+ alias_method :real_pod, :pod
10
+ def pod(name = nil, *requirements, &block)
11
+ #
12
+ # Logic:
13
+ # Lookup a link for the given pod name. If a link exists then the pod will be installed
14
+ # via the link instead of the provided requirements (e.g. it will setup local pod development
15
+ # for the link). If the link does not exist, then the pod will be installed normally
16
+ #
17
+
18
+ unless ENV['GIT_2_LOCAL'] == "true"
19
+ real_pod(name, *requirements, &block)
20
+ return
21
+ end
22
+ # link = Pod::Command::Links.get_link(linked_name)
23
+ unless requirements[0].instance_of? String
24
+ unless requirements[0].key?(:git) && requirements[0].key?(:commit)
25
+ real_pod(name, *requirements, &block)
26
+ else
27
+ git = requirements[0].fetch(:git)
28
+ commit = requirements[0].fetch(:commit)
29
+ component = git.split("/")[4].split(".")[0]
30
+ gitclone(git, commit)
31
+ real_pod(name, :path=>"../"+component+"/", &block)
32
+ end
33
+ else
34
+ real_pod(name, *requirements, &block)
35
+ end
36
+
37
+ end
38
+ end
39
+ end
40
+ end
metadata ADDED
@@ -0,0 +1,77 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cocoapods-git2local
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - hujunjian
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-07-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: A short description of cocoapods-git2local.
42
+ email:
43
+ - hujunjian@meituan.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - lib/cocoapods-git2local.rb
49
+ - lib/cocoapods-git2local/command.rb
50
+ - lib/cocoapods-git2local/gem_version.rb
51
+ - lib/cocoapods_plugin.rb
52
+ - lib/pod/git.rb
53
+ - lib/pod/pod.rb
54
+ homepage: https://github.com/EXAMPLE/cocoapods-git2local
55
+ licenses:
56
+ - MIT
57
+ metadata: {}
58
+ post_install_message:
59
+ rdoc_options: []
60
+ require_paths:
61
+ - lib
62
+ required_ruby_version: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
67
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ requirements: []
73
+ rubygems_version: 3.0.9
74
+ signing_key:
75
+ specification_version: 4
76
+ summary: A longer description of cocoapods-git2local.
77
+ test_files: []