cocoapods-jysource 1.0.0
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 +7 -0
- data/lib/cocoapods-jysource.rb +1 -0
- data/lib/cocoapods-jysource/command.rb +1 -0
- data/lib/cocoapods-jysource/command/jysource.rb +21 -0
- data/lib/cocoapods-jysource/command/jysource/add.rb +89 -0
- data/lib/cocoapods-jysource/command/jysource/clean.rb +52 -0
- data/lib/cocoapods-jysource/command/jysource/list.rb +63 -0
- data/lib/cocoapods-jysource/command/jysource/path.rb +58 -0
- data/lib/cocoapods-jysource/command/jysource/remove.rb +58 -0
- data/lib/cocoapods-jysource/gem_version.rb +3 -0
- data/lib/cocoapods_plugin.rb +1 -0
- metadata +81 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5796408b48c607e115552d7d32128067eeb3c749303752e1e1a0ddcdb9c12e1b
|
4
|
+
data.tar.gz: a63d827b3be217237b54a242bbefcded6e635c03aa707c5bd472d73c342ed1d5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5a58afbaa5900cfcd46268f0d753bba4a7d93c6e21aaf245992b434e83e541a31de2cbd51778fe1e2cb0dbe0d7e5c35b8a454238abb32dcc701cb365245b5d49
|
7
|
+
data.tar.gz: 32f307f840abddad391d7945cc698c8423d811d6e3fa9141e41c9684e29990f9b898788b329436cc6eebe6617d996f07ca981dde1b05786d25c3098750527211
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'cocoapods-jysource/gem_version'
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'cocoapods-jysource/command/jysource'
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Pod
|
2
|
+
class Command
|
3
|
+
|
4
|
+
# The CocoaPods namespace
|
5
|
+
#
|
6
|
+
class Jysource < Command
|
7
|
+
require 'cocoapods-jysource/command/jysource/add'
|
8
|
+
require 'cocoapods-jysource/command/jysource/clean'
|
9
|
+
require 'cocoapods-jysource/command/jysource/list'
|
10
|
+
require 'cocoapods-jysource/command/jysource/path'
|
11
|
+
require 'cocoapods-jysource/command/jysource/remove'
|
12
|
+
self.abstract_command = true
|
13
|
+
self.default_subcommand = 'list'
|
14
|
+
self.summary = '哈啰源码管理'
|
15
|
+
|
16
|
+
self.description = <<-DESC
|
17
|
+
哈啰源码管理:add、clean、list、path、remove
|
18
|
+
DESC
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
require 'cocoapods-downloader'
|
2
|
+
|
3
|
+
module Pod
|
4
|
+
class Command
|
5
|
+
class Jysource
|
6
|
+
# This is an example of a cocoapods plugin adding a top-level subcommand
|
7
|
+
# to the 'pod' command.
|
8
|
+
#
|
9
|
+
# You can also create subcommands of existing or new commands. Say you
|
10
|
+
# wanted to add a subcommand to `list` to show newly deprecated pods,
|
11
|
+
# (e.g. `pod list deprecated`), there are a few things that would need
|
12
|
+
# to change.
|
13
|
+
#
|
14
|
+
# - move this file to `lib/pod/command/list/deprecated.rb` and update
|
15
|
+
# the class to exist in the the Pod::Command::List namespace
|
16
|
+
# - change this class to extend from `List` instead of `Command`. This
|
17
|
+
# tells the plugin system that it is a subcommand of `list`.
|
18
|
+
# - edit `lib/cocoapods_plugins.rb` to require this file
|
19
|
+
#
|
20
|
+
# @todo Create a PR to add your plugin to CocoaPods/cocoapods.org
|
21
|
+
# in the `plugins.json` file, once your plugin is released.
|
22
|
+
#
|
23
|
+
class Add < Jysource
|
24
|
+
self.summary = '本地添加源码, 使用: pod jysource add #podname #tag, [public只能为yes且此时podname必须为github格式:xx/xx]'
|
25
|
+
|
26
|
+
self.description = <<-DESC
|
27
|
+
给定源码pod name、tag拉取源文件,使用: pod jysource add #podname #tag
|
28
|
+
DESC
|
29
|
+
|
30
|
+
self.arguments = [
|
31
|
+
CLAide::Argument.new('POD', true),
|
32
|
+
CLAide::Argument.new('TAG', true),
|
33
|
+
CLAide::Argument.new('PUBLIC', false)
|
34
|
+
]
|
35
|
+
|
36
|
+
def initialize(argv)
|
37
|
+
@pod = argv.shift_argument
|
38
|
+
@tag = argv.shift_argument
|
39
|
+
@public = argv.shift_argument
|
40
|
+
super
|
41
|
+
end
|
42
|
+
|
43
|
+
def validate!
|
44
|
+
super
|
45
|
+
help! 'A Pod name and version is required.' unless @pod && @tag
|
46
|
+
end
|
47
|
+
|
48
|
+
def run
|
49
|
+
UI.puts "开始下载源码:"
|
50
|
+
UI.puts "#{@pod} " + " #{@tag} "
|
51
|
+
|
52
|
+
if "#{@public}".empty? then
|
53
|
+
if "#{@pod}".start_with?("JY") then
|
54
|
+
git = "http://gitlab.hellobike.cn/Torrent/#{@pod}.git"
|
55
|
+
else
|
56
|
+
git = "git://podspec.hellobike.cn:4709/sources/#{@pod}.git"
|
57
|
+
end
|
58
|
+
else
|
59
|
+
git = "https://github.com/#{@pod}"
|
60
|
+
str = "#{@pod}".split("/")
|
61
|
+
if str.length == 2 && "#{@public}".eql?("yes") then
|
62
|
+
@pod = (str.last).to_s
|
63
|
+
else
|
64
|
+
help! '命令格式不正确'
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
tag = @tag
|
69
|
+
target_path = '/Users/Shared/JYSource/Pods/' + @pod
|
70
|
+
FileUtils.rm_rf(target_path)
|
71
|
+
|
72
|
+
options = { :git => git ,:tag => tag }
|
73
|
+
options = Pod::Downloader.preprocess_options(options)
|
74
|
+
downloader = Pod::Downloader.for_target(target_path, options)
|
75
|
+
# downloader.cache_root = "~/Library/Caches/JYSource/#{@pod}"
|
76
|
+
# downloader.max_cache_size = 500
|
77
|
+
downloader.download
|
78
|
+
downloader.checkout_options
|
79
|
+
|
80
|
+
UI.puts "\033[32m源码下载成功...\033[0m\n"
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
|
89
|
+
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
module Pod
|
4
|
+
class Command
|
5
|
+
class Jysource
|
6
|
+
# This is an example of a cocoapods plugin adding a top-level subcommand
|
7
|
+
# to the 'pod' command.
|
8
|
+
#
|
9
|
+
# You can also create subcommands of existing or new commands. Say you
|
10
|
+
# wanted to add a subcommand to `list` to show newly deprecated pods,
|
11
|
+
# (e.g. `pod list deprecated`), there are a few things that would need
|
12
|
+
# to change.
|
13
|
+
#
|
14
|
+
# - move this file to `lib/pod/command/list/deprecated.rb` and update
|
15
|
+
# the class to exist in the the Pod::Command::List namespace
|
16
|
+
# - change this class to extend from `List` instead of `Command`. This
|
17
|
+
# tells the plugin system that it is a subcommand of `list`.
|
18
|
+
# - edit `lib/cocoapods_plugins.rb` to require this file
|
19
|
+
#
|
20
|
+
# @todo Create a PR to add your plugin to CocoaPods/cocoapods.org
|
21
|
+
# in the `plugins.json` file, once your plugin is released.
|
22
|
+
#
|
23
|
+
class Clean < Jysource
|
24
|
+
self.summary = '清理所有源码文件, 使用: pod jysource clean'
|
25
|
+
|
26
|
+
self.description = <<-DESC
|
27
|
+
删除全部文件
|
28
|
+
DESC
|
29
|
+
|
30
|
+
self.arguments = [
|
31
|
+
|
32
|
+
]
|
33
|
+
|
34
|
+
def initialize(argv)
|
35
|
+
super
|
36
|
+
end
|
37
|
+
|
38
|
+
def validate!
|
39
|
+
super
|
40
|
+
end
|
41
|
+
|
42
|
+
def run
|
43
|
+
target_path = '/Users/Shared/JYSource/Pods'
|
44
|
+
if File.exist?(target_path) then
|
45
|
+
FileUtils.rm_rf(target_path)
|
46
|
+
UI.puts "\033[32m源码已清除成功...\033[0m\n"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
module Pod
|
2
|
+
class Command
|
3
|
+
class Jysource
|
4
|
+
# This is an example of a cocoapods plugin adding a top-level subcommand
|
5
|
+
# to the 'pod' command.
|
6
|
+
#
|
7
|
+
# You can also create subcommands of existing or new commands. Say you
|
8
|
+
# wanted to add a subcommand to `list` to show newly deprecated pods,
|
9
|
+
# (e.g. `pod list deprecated`), there are a few things that would need
|
10
|
+
# to change.
|
11
|
+
#
|
12
|
+
# - move this file to `lib/pod/command/list/deprecated.rb` and update
|
13
|
+
# the class to exist in the the Pod::Command::List namespace
|
14
|
+
# - change this class to extend from `List` instead of `Command`. This
|
15
|
+
# tells the plugin system that it is a subcommand of `list`.
|
16
|
+
# - edit `lib/cocoapods_plugins.rb` to require this file
|
17
|
+
#
|
18
|
+
# @todo Create a PR to add your plugin to CocoaPods/cocoapods.org
|
19
|
+
# in the `plugins.json` file, once your plugin is released.
|
20
|
+
#
|
21
|
+
class List < Jysource
|
22
|
+
self.summary = '源码列表, 使用: pod jysource list'
|
23
|
+
|
24
|
+
self.description = <<-DESC
|
25
|
+
罗列已经下载的源码podname以及对应的版本
|
26
|
+
DESC
|
27
|
+
|
28
|
+
self.arguments = []
|
29
|
+
|
30
|
+
def initialize(argv)
|
31
|
+
super
|
32
|
+
end
|
33
|
+
|
34
|
+
def validate!
|
35
|
+
super
|
36
|
+
end
|
37
|
+
|
38
|
+
def run
|
39
|
+
target_path = '/Users/Shared/JYSource/Pods/'
|
40
|
+
fileDir = Dir::pwd
|
41
|
+
if File.exist?(target_path) then
|
42
|
+
UI.puts "\033[33m已下载源码:\033[0m\n"
|
43
|
+
Dir.entries(target_path).each do |sub|
|
44
|
+
if sub != '.' && sub != '..'
|
45
|
+
subpath = "#{target_path}#{sub}"
|
46
|
+
if File.directory?(subpath)
|
47
|
+
Dir.chdir(subpath)
|
48
|
+
version = `git describe --abbrev=0 --tags 2>/dev/null`
|
49
|
+
puts "#{sub} #{version}"
|
50
|
+
Dir.chdir(fileDir)
|
51
|
+
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
else
|
56
|
+
UI.puts "\033[33m目前无源码...\033[0m\n"
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
module Pod
|
2
|
+
class Command
|
3
|
+
class Jysource
|
4
|
+
# This is an example of a cocoapods plugin adding a top-level subcommand
|
5
|
+
# to the 'pod' command.
|
6
|
+
#
|
7
|
+
# You can also create subcommands of existing or new commands. Say you
|
8
|
+
# wanted to add a subcommand to `list` to show newly deprecated pods,
|
9
|
+
# (e.g. `pod list deprecated`), there are a few things that would need
|
10
|
+
# to change.
|
11
|
+
#
|
12
|
+
# - move this file to `lib/pod/command/list/deprecated.rb` and update
|
13
|
+
# the class to exist in the the Pod::Command::List namespace
|
14
|
+
# - change this class to extend from `List` instead of `Command`. This
|
15
|
+
# tells the plugin system that it is a subcommand of `list`.
|
16
|
+
# - edit `lib/cocoapods_plugins.rb` to require this file
|
17
|
+
#
|
18
|
+
# @todo Create a PR to add your plugin to CocoaPods/cocoapods.org
|
19
|
+
# in the `plugins.json` file, once your plugin is released.
|
20
|
+
#
|
21
|
+
class Path < Jysource
|
22
|
+
self.summary = '源码路径, 使用: pod jysource path'
|
23
|
+
|
24
|
+
self.description = <<-DESC
|
25
|
+
打印源码下载的路径
|
26
|
+
DESC
|
27
|
+
|
28
|
+
def self.options
|
29
|
+
[[
|
30
|
+
'--clean', 'just path'
|
31
|
+
]].concat(super)
|
32
|
+
end
|
33
|
+
|
34
|
+
def initialize(argv)
|
35
|
+
@linked = argv.flag?('clean')
|
36
|
+
super
|
37
|
+
end
|
38
|
+
|
39
|
+
self.arguments = []
|
40
|
+
|
41
|
+
def validate!
|
42
|
+
super
|
43
|
+
end
|
44
|
+
|
45
|
+
def run
|
46
|
+
target_path = '/Users/Shared/JYSource/Pods'
|
47
|
+
if @linked then
|
48
|
+
puts "#{target_path}"
|
49
|
+
else
|
50
|
+
UI.puts "\033[33m已下载源码位置:\033[0m\n"
|
51
|
+
puts "#{target_path}" + "#{@linked}"
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
module Pod
|
4
|
+
class Command
|
5
|
+
class Jysource
|
6
|
+
# This is an example of a cocoapods plugin adding a top-level subcommand
|
7
|
+
# to the 'pod' command.
|
8
|
+
#
|
9
|
+
# You can also create subcommands of existing or new commands. Say you
|
10
|
+
# wanted to add a subcommand to `list` to show newly deprecated pods,
|
11
|
+
# (e.g. `pod list deprecated`), there are a few things that would need
|
12
|
+
# to change.
|
13
|
+
#
|
14
|
+
# - move this file to `lib/pod/command/list/deprecated.rb` and update
|
15
|
+
# the class to exist in the the Pod::Command::List namespace
|
16
|
+
# - change this class to extend from `List` instead of `Command`. This
|
17
|
+
# tells the plugin system that it is a subcommand of `list`.
|
18
|
+
# - edit `lib/cocoapods_plugins.rb` to require this file
|
19
|
+
#
|
20
|
+
# @todo Create a PR to add your plugin to CocoaPods/cocoapods.org
|
21
|
+
# in the `plugins.json` file, once your plugin is released.
|
22
|
+
#
|
23
|
+
class Remove < Jysource
|
24
|
+
self.summary = '清理指定源码文件, 使用: pod jysource remove xxx'
|
25
|
+
|
26
|
+
self.description = <<-DESC
|
27
|
+
删除指定文件
|
28
|
+
DESC
|
29
|
+
|
30
|
+
self.arguments = [
|
31
|
+
CLAide::Argument.new('POD', true)
|
32
|
+
]
|
33
|
+
|
34
|
+
def initialize(argv)
|
35
|
+
@pod = argv.shift_argument
|
36
|
+
super
|
37
|
+
end
|
38
|
+
|
39
|
+
def validate!
|
40
|
+
def validate!
|
41
|
+
super
|
42
|
+
help! 'A Pod name is required.' unless @pod
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def run
|
47
|
+
target_path = "/Users/Shared/JYSource/Pods/#{@pod}"
|
48
|
+
if File.exist?(target_path) then
|
49
|
+
FileUtils.rm_rf(target_path)
|
50
|
+
UI.puts "\033[32m #{@pod} 源码已清除成功...\033[0m\n"
|
51
|
+
else
|
52
|
+
UI.puts "\033[32m没有找到pod: #{@pod.red}\033[0m\n"
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'cocoapods-jysource/command'
|
metadata
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cocoapods-jysource
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- 刘源
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-08-22 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-jysource.
|
42
|
+
email:
|
43
|
+
- liuyuan08833@hellobike.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- lib/cocoapods-jysource.rb
|
49
|
+
- lib/cocoapods-jysource/command.rb
|
50
|
+
- lib/cocoapods-jysource/command/jysource.rb
|
51
|
+
- lib/cocoapods-jysource/command/jysource/add.rb
|
52
|
+
- lib/cocoapods-jysource/command/jysource/clean.rb
|
53
|
+
- lib/cocoapods-jysource/command/jysource/list.rb
|
54
|
+
- lib/cocoapods-jysource/command/jysource/path.rb
|
55
|
+
- lib/cocoapods-jysource/command/jysource/remove.rb
|
56
|
+
- lib/cocoapods-jysource/gem_version.rb
|
57
|
+
- lib/cocoapods_plugin.rb
|
58
|
+
homepage: https://github.com/EXAMPLE/cocoapods-jysource
|
59
|
+
licenses:
|
60
|
+
- MIT
|
61
|
+
metadata: {}
|
62
|
+
post_install_message:
|
63
|
+
rdoc_options: []
|
64
|
+
require_paths:
|
65
|
+
- lib
|
66
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
requirements: []
|
77
|
+
rubygems_version: 3.0.3
|
78
|
+
signing_key:
|
79
|
+
specification_version: 4
|
80
|
+
summary: A longer description of cocoapods-jysource.
|
81
|
+
test_files: []
|