cocoapods-bin 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +4 -0
- data/Gemfile +13 -0
- data/Gemfile.lock +100 -0
- data/LICENSE.txt +22 -0
- data/README.md +15 -0
- data/Rakefile +13 -0
- data/cocoapods-bin.gemspec +26 -0
- data/lib/cocoapods-bin/command/bin/init.rb +66 -0
- data/lib/cocoapods-bin/command/bin/lib/lint.rb +94 -0
- data/lib/cocoapods-bin/command/bin/lib.rb +12 -0
- data/lib/cocoapods-bin/command/bin/open.rb +60 -0
- data/lib/cocoapods-bin/command/bin/repo/push.rb +98 -0
- data/lib/cocoapods-bin/command/bin/repo.rb +12 -0
- data/lib/cocoapods-bin/command/bin/spec/create.rb +68 -0
- data/lib/cocoapods-bin/command/bin/spec/lint.rb +52 -0
- data/lib/cocoapods-bin/command/bin/spec.rb +13 -0
- data/lib/cocoapods-bin/command/bin.rb +52 -0
- data/lib/cocoapods-bin/command.rb +1 -0
- data/lib/cocoapods-bin/config/config.rb +52 -0
- data/lib/cocoapods-bin/config/config_asker.rb +50 -0
- data/lib/cocoapods-bin/gem_version.rb +9 -0
- data/lib/cocoapods-bin/helpers/sources_helper.rb +31 -0
- data/lib/cocoapods-bin/helpers/spec_files_helper.rb +17 -0
- data/lib/cocoapods-bin/helpers/spec_generator.rb +86 -0
- data/lib/cocoapods-bin/helpers.rb +3 -0
- data/lib/cocoapods-bin/native/analyzer.rb +28 -0
- data/lib/cocoapods-bin/native/installation_options.rb +24 -0
- data/lib/cocoapods-bin/native/installer.rb +73 -0
- data/lib/cocoapods-bin/native/linter.rb +29 -0
- data/lib/cocoapods-bin/native/pod_source_installer.rb +15 -0
- data/lib/cocoapods-bin/native/podfile.rb +67 -0
- data/lib/cocoapods-bin/native/resolver.rb +103 -0
- data/lib/cocoapods-bin/native/source.rb +35 -0
- data/lib/cocoapods-bin/native/source_provider_hook.rb +11 -0
- data/lib/cocoapods-bin/native/sources_manager.rb +18 -0
- data/lib/cocoapods-bin/native/validator.rb +16 -0
- data/lib/cocoapods-bin/native.rb +13 -0
- data/lib/cocoapods-bin.rb +1 -0
- data/lib/cocoapods_plugin.rb +3 -0
- data/spec/command/bin_spec.rb +12 -0
- data/spec/spec_helper.rb +50 -0
- metadata +143 -0
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'cocoapods'
|
2
|
+
|
3
|
+
module Pod
|
4
|
+
class Source
|
5
|
+
# Returns the path of the specification with the given name and version.
|
6
|
+
#
|
7
|
+
# @param [String] name
|
8
|
+
# the name of the Pod.
|
9
|
+
#
|
10
|
+
# @param [Version,String] version
|
11
|
+
# the version for the specification.
|
12
|
+
#
|
13
|
+
# @return [Pathname] The path of the specification.
|
14
|
+
#
|
15
|
+
def specification_path(name, version)
|
16
|
+
raise ArgumentError, 'No name' unless name
|
17
|
+
raise ArgumentError, 'No version' unless version
|
18
|
+
path = pod_path(name) + version.to_s
|
19
|
+
|
20
|
+
specification_path =[
|
21
|
+
"#{name}.podspec.json",
|
22
|
+
"#{name}.podspec",
|
23
|
+
# 支持 binary 后缀
|
24
|
+
"#{name}.binary.podspec",
|
25
|
+
"#{name}.binary.podspec.json"
|
26
|
+
].map { |file| path + file }.find { |path| path.exist? }
|
27
|
+
|
28
|
+
unless specification_path
|
29
|
+
raise StandardError, "Unable to find the specification #{name} " \
|
30
|
+
"(#{version}) in the #{self.name} source."
|
31
|
+
end
|
32
|
+
specification_path
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'cocoapods-bin/native/sources_manager'
|
2
|
+
|
3
|
+
Pod::HooksManager.register('cocoapods-bin', :source_provider) do |context, _|
|
4
|
+
sources_manager = Pod::Config.instance.sources_manager
|
5
|
+
podfile = Pod::Config.instance.podfile
|
6
|
+
|
7
|
+
# 添加二进制私有源 && 源码私有源
|
8
|
+
added_sources = [sources_manager.code_source, sources_manager.binary_source]
|
9
|
+
added_sources.reverse! if podfile.use_binaries? || podfile.use_binaries_selector
|
10
|
+
added_sources.each { |source| context.add_source(source) }
|
11
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'cocoapods'
|
2
|
+
require 'cocoapods-bin/config/config'
|
3
|
+
|
4
|
+
module Pod
|
5
|
+
class Source
|
6
|
+
class Manager
|
7
|
+
# 源码 source
|
8
|
+
def code_source
|
9
|
+
source_with_name_or_url(CBin.config.code_repo_url)
|
10
|
+
end
|
11
|
+
|
12
|
+
# 二进制 source
|
13
|
+
def binary_source
|
14
|
+
source_with_name_or_url(CBin.config.binary_repo_url)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
|
2
|
+
module Pod
|
3
|
+
class Validator
|
4
|
+
# def validate_source_url(spec)
|
5
|
+
# return if spec.source.nil? || spec.source[:http].nil?
|
6
|
+
# url = URI(spec.source[:http])
|
7
|
+
# return if url.scheme == 'https' || url.scheme == 'file'
|
8
|
+
# warning('http', "The URL (`#{url}`) doesn't use the encrypted HTTPs protocol. " \
|
9
|
+
# 'It is crucial for Pods to be transferred over a secure protocol to protect your users from man-in-the-middle attacks. '\
|
10
|
+
# 'This will be an error in future releases. Please update the URL to use https.')
|
11
|
+
# end
|
12
|
+
|
13
|
+
def validate_source_url(spec)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'cocoapods'
|
2
|
+
|
3
|
+
if Pod.match_version?('~> 1.4')
|
4
|
+
require 'cocoapods-bin/native/analyzer'
|
5
|
+
require 'cocoapods-bin/native/installer'
|
6
|
+
require 'cocoapods-bin/native/pod_source_installer'
|
7
|
+
require 'cocoapods-bin/native/linter'
|
8
|
+
require 'cocoapods-bin/native/resolver'
|
9
|
+
require 'cocoapods-bin/native/source'
|
10
|
+
require 'cocoapods-bin/native/validator'
|
11
|
+
end
|
12
|
+
|
13
|
+
require 'cocoapods-bin/native/source_provider_hook'
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'cocoapods-bin/gem_version'
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
ROOT = Pathname.new(File.expand_path('../../', __FILE__))
|
3
|
+
$:.unshift((ROOT + 'lib').to_s)
|
4
|
+
$:.unshift((ROOT + 'spec').to_s)
|
5
|
+
|
6
|
+
require 'bundler/setup'
|
7
|
+
require 'bacon'
|
8
|
+
require 'mocha-on-bacon'
|
9
|
+
require 'pretty_bacon'
|
10
|
+
require 'pathname'
|
11
|
+
require 'cocoapods'
|
12
|
+
|
13
|
+
Mocha::Configuration.prevent(:stubbing_non_existent_method)
|
14
|
+
|
15
|
+
require 'cocoapods_plugin'
|
16
|
+
|
17
|
+
#-----------------------------------------------------------------------------#
|
18
|
+
|
19
|
+
module Pod
|
20
|
+
|
21
|
+
# Disable the wrapping so the output is deterministic in the tests.
|
22
|
+
#
|
23
|
+
UI.disable_wrap = true
|
24
|
+
|
25
|
+
# Redirects the messages to an internal store.
|
26
|
+
#
|
27
|
+
module UI
|
28
|
+
@output = ''
|
29
|
+
@warnings = ''
|
30
|
+
|
31
|
+
class << self
|
32
|
+
attr_accessor :output
|
33
|
+
attr_accessor :warnings
|
34
|
+
|
35
|
+
def puts(message = '')
|
36
|
+
@output << "#{message}\n"
|
37
|
+
end
|
38
|
+
|
39
|
+
def warn(message = '', actions = [])
|
40
|
+
@warnings << "#{message}\n"
|
41
|
+
end
|
42
|
+
|
43
|
+
def print(message)
|
44
|
+
@output << message
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
#-----------------------------------------------------------------------------#
|
metadata
ADDED
@@ -0,0 +1,143 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cocoapods-bin
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- tripleCC
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-01-09 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: parallel
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: cocoapods
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.4'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.4'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.3'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.3'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: 组件二进制化插件.
|
70
|
+
email:
|
71
|
+
- triplec.linux@gmail.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ".gitignore"
|
77
|
+
- Gemfile
|
78
|
+
- Gemfile.lock
|
79
|
+
- LICENSE.txt
|
80
|
+
- README.md
|
81
|
+
- Rakefile
|
82
|
+
- cocoapods-bin.gemspec
|
83
|
+
- lib/cocoapods-bin.rb
|
84
|
+
- lib/cocoapods-bin/command.rb
|
85
|
+
- lib/cocoapods-bin/command/bin.rb
|
86
|
+
- lib/cocoapods-bin/command/bin/init.rb
|
87
|
+
- lib/cocoapods-bin/command/bin/lib.rb
|
88
|
+
- lib/cocoapods-bin/command/bin/lib/lint.rb
|
89
|
+
- lib/cocoapods-bin/command/bin/open.rb
|
90
|
+
- lib/cocoapods-bin/command/bin/repo.rb
|
91
|
+
- lib/cocoapods-bin/command/bin/repo/push.rb
|
92
|
+
- lib/cocoapods-bin/command/bin/spec.rb
|
93
|
+
- lib/cocoapods-bin/command/bin/spec/create.rb
|
94
|
+
- lib/cocoapods-bin/command/bin/spec/lint.rb
|
95
|
+
- lib/cocoapods-bin/config/config.rb
|
96
|
+
- lib/cocoapods-bin/config/config_asker.rb
|
97
|
+
- lib/cocoapods-bin/gem_version.rb
|
98
|
+
- lib/cocoapods-bin/helpers.rb
|
99
|
+
- lib/cocoapods-bin/helpers/sources_helper.rb
|
100
|
+
- lib/cocoapods-bin/helpers/spec_files_helper.rb
|
101
|
+
- lib/cocoapods-bin/helpers/spec_generator.rb
|
102
|
+
- lib/cocoapods-bin/native.rb
|
103
|
+
- lib/cocoapods-bin/native/analyzer.rb
|
104
|
+
- lib/cocoapods-bin/native/installation_options.rb
|
105
|
+
- lib/cocoapods-bin/native/installer.rb
|
106
|
+
- lib/cocoapods-bin/native/linter.rb
|
107
|
+
- lib/cocoapods-bin/native/pod_source_installer.rb
|
108
|
+
- lib/cocoapods-bin/native/podfile.rb
|
109
|
+
- lib/cocoapods-bin/native/resolver.rb
|
110
|
+
- lib/cocoapods-bin/native/source.rb
|
111
|
+
- lib/cocoapods-bin/native/source_provider_hook.rb
|
112
|
+
- lib/cocoapods-bin/native/sources_manager.rb
|
113
|
+
- lib/cocoapods-bin/native/validator.rb
|
114
|
+
- lib/cocoapods_plugin.rb
|
115
|
+
- spec/command/bin_spec.rb
|
116
|
+
- spec/spec_helper.rb
|
117
|
+
homepage: https://github.com/EXAMPLE/cocoapods-bin
|
118
|
+
licenses:
|
119
|
+
- MIT
|
120
|
+
metadata: {}
|
121
|
+
post_install_message:
|
122
|
+
rdoc_options: []
|
123
|
+
require_paths:
|
124
|
+
- lib
|
125
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
126
|
+
requirements:
|
127
|
+
- - ">="
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: '0'
|
130
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
|
+
requirements:
|
132
|
+
- - ">="
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
version: '0'
|
135
|
+
requirements: []
|
136
|
+
rubyforge_project:
|
137
|
+
rubygems_version: 2.6.14
|
138
|
+
signing_key:
|
139
|
+
specification_version: 4
|
140
|
+
summary: 组件二进制化插件。利用源码私有源与二进制私有源实现对组件依赖类型的切换.
|
141
|
+
test_files:
|
142
|
+
- spec/command/bin_spec.rb
|
143
|
+
- spec/spec_helper.rb
|