podsorz 0.0.1
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/.gitignore +8 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +109 -0
- data/LICENSE.txt +21 -0
- data/Podfile +0 -0
- data/PodsOrzConfig.rb +13 -0
- data/README.md +39 -0
- data/Rakefile +2 -0
- data/bin/podsorz +14 -0
- data/lib/podsorz.rb +40 -0
- data/lib/podsorz/command/commit.rb +35 -0
- data/lib/podsorz/command/install.rb +23 -0
- data/lib/podsorz/command/publish.rb +40 -0
- data/lib/podsorz/command/setup.rb +28 -0
- data/lib/podsorz/command/switch.rb +47 -0
- data/lib/podsorz/core/orz_config_templet.rb +13 -0
- data/lib/podsorz/core/orz_env_detector.rb +56 -0
- data/lib/podsorz/core/pod_orzconfig_parse.rb +24 -0
- data/lib/podsorz/core/podfile_io.rb +188 -0
- data/lib/podsorz/core/podfile_model.rb +34 -0
- data/lib/podsorz/core/pods_detector.rb +96 -0
- data/lib/podsorz/core/pods_git_manager.rb +429 -0
- data/lib/podsorz/core/pods_git_operator.rb +700 -0
- data/lib/podsorz/core/pods_repo.rb +195 -0
- data/lib/podsorz/core/pods_version.rb +138 -0
- data/lib/podsorz/util/git_operator.rb +208 -0
- data/lib/podsorz/util/logger.rb +32 -0
- data/lib/podsorz/util/process_operator.rb +19 -0
- data/lib/podsorz/version.rb +3 -0
- data/podsorz.gemspec +40 -0
- metadata +117 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c817bbde2a999fb5a286e8e15b2a25427b07865e11e62297b296d4539770ad40
|
4
|
+
data.tar.gz: 8586b8f32cfb1d2ba847d30cacf806f044483e2fb6e57e2fdb6ee41d9f5ae98c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: bfc2ab6a02268c30887d20242676df8ea8c82cb294239e44cd4dfed9507969c8da74b6cd697806df127c31eda35637ec316c25e11c205ae98cad166f1c96d824
|
7
|
+
data.tar.gz: 6b90b63373e2e80461611e0c6a5f20d716bf0bcb2e685e2dfbdb38117a0e040b233f804ba9917a7c3891eb6810f9ae871587f29dc1d0466d9744a968517ae051
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,109 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
podsorz (0.0.1)
|
5
|
+
cocoapods
|
6
|
+
colorize
|
7
|
+
gli (~> 2.16)
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: https://rubygems.org/
|
11
|
+
specs:
|
12
|
+
CFPropertyList (3.0.2)
|
13
|
+
activesupport (5.2.4.4)
|
14
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
15
|
+
i18n (>= 0.7, < 2)
|
16
|
+
minitest (~> 5.1)
|
17
|
+
tzinfo (~> 1.1)
|
18
|
+
addressable (2.7.0)
|
19
|
+
public_suffix (>= 2.0.2, < 5.0)
|
20
|
+
algoliasearch (1.27.5)
|
21
|
+
httpclient (~> 2.8, >= 2.8.3)
|
22
|
+
json (>= 1.5.1)
|
23
|
+
atomos (0.1.3)
|
24
|
+
claide (1.0.3)
|
25
|
+
cocoapods (1.10.0)
|
26
|
+
addressable (~> 2.6)
|
27
|
+
claide (>= 1.0.2, < 2.0)
|
28
|
+
cocoapods-core (= 1.10.0)
|
29
|
+
cocoapods-deintegrate (>= 1.0.3, < 2.0)
|
30
|
+
cocoapods-downloader (>= 1.4.0, < 2.0)
|
31
|
+
cocoapods-plugins (>= 1.0.0, < 2.0)
|
32
|
+
cocoapods-search (>= 1.0.0, < 2.0)
|
33
|
+
cocoapods-trunk (>= 1.4.0, < 2.0)
|
34
|
+
cocoapods-try (>= 1.1.0, < 2.0)
|
35
|
+
colored2 (~> 3.1)
|
36
|
+
escape (~> 0.0.4)
|
37
|
+
fourflusher (>= 2.3.0, < 3.0)
|
38
|
+
gh_inspector (~> 1.0)
|
39
|
+
molinillo (~> 0.6.6)
|
40
|
+
nap (~> 1.0)
|
41
|
+
ruby-macho (~> 1.4)
|
42
|
+
xcodeproj (>= 1.19.0, < 2.0)
|
43
|
+
cocoapods-core (1.10.0)
|
44
|
+
activesupport (> 5.0, < 6)
|
45
|
+
addressable (~> 2.6)
|
46
|
+
algoliasearch (~> 1.0)
|
47
|
+
concurrent-ruby (~> 1.1)
|
48
|
+
fuzzy_match (~> 2.0.4)
|
49
|
+
nap (~> 1.0)
|
50
|
+
netrc (~> 0.11)
|
51
|
+
public_suffix
|
52
|
+
typhoeus (~> 1.0)
|
53
|
+
cocoapods-deintegrate (1.0.4)
|
54
|
+
cocoapods-downloader (1.4.0)
|
55
|
+
cocoapods-plugins (1.0.0)
|
56
|
+
nap
|
57
|
+
cocoapods-search (1.0.0)
|
58
|
+
cocoapods-trunk (1.5.0)
|
59
|
+
nap (>= 0.8, < 2.0)
|
60
|
+
netrc (~> 0.11)
|
61
|
+
cocoapods-try (1.2.0)
|
62
|
+
colored2 (3.1.2)
|
63
|
+
colorize (0.8.1)
|
64
|
+
concurrent-ruby (1.1.7)
|
65
|
+
escape (0.0.4)
|
66
|
+
ethon (0.12.0)
|
67
|
+
ffi (>= 1.3.0)
|
68
|
+
ffi (1.13.1)
|
69
|
+
fourflusher (2.3.1)
|
70
|
+
fuzzy_match (2.0.4)
|
71
|
+
gh_inspector (1.1.3)
|
72
|
+
gli (2.19.2)
|
73
|
+
httpclient (2.8.3)
|
74
|
+
i18n (1.8.5)
|
75
|
+
concurrent-ruby (~> 1.0)
|
76
|
+
json (2.3.1)
|
77
|
+
minitest (5.14.2)
|
78
|
+
molinillo (0.6.6)
|
79
|
+
nanaimo (0.3.0)
|
80
|
+
nap (1.1.0)
|
81
|
+
netrc (0.11.0)
|
82
|
+
public_suffix (4.0.6)
|
83
|
+
rake (10.5.0)
|
84
|
+
ruby-macho (1.4.0)
|
85
|
+
thread_safe (0.3.6)
|
86
|
+
typhoeus (1.4.0)
|
87
|
+
ethon (>= 0.9.0)
|
88
|
+
tzinfo (1.2.8)
|
89
|
+
thread_safe (~> 0.1)
|
90
|
+
xcodeproj (1.19.0)
|
91
|
+
CFPropertyList (>= 2.3.3, < 4.0)
|
92
|
+
atomos (~> 0.1.3)
|
93
|
+
claide (>= 1.0.2, < 2.0)
|
94
|
+
colored2 (~> 3.1)
|
95
|
+
nanaimo (~> 0.3.0)
|
96
|
+
|
97
|
+
PLATFORMS
|
98
|
+
ruby
|
99
|
+
|
100
|
+
DEPENDENCIES
|
101
|
+
bundler (~> 1.17)
|
102
|
+
cocoapods
|
103
|
+
colorize
|
104
|
+
gli (~> 2.16)
|
105
|
+
podsorz!
|
106
|
+
rake (~> 10.0)
|
107
|
+
|
108
|
+
BUNDLED WITH
|
109
|
+
1.17.2
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020 Xiangqi
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/Podfile
ADDED
File without changes
|
data/PodsOrzConfig.rb
ADDED
data/README.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# Podsorz
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/podsorz`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'podsorz'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install podsorz
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/podsorz.
|
36
|
+
|
37
|
+
## License
|
38
|
+
|
39
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/podsorz
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
#require "bundler/setup"
|
4
|
+
require "podsorz"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/lib/podsorz.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
require "podsorz/version"
|
2
|
+
require "podsorz/util/process_operator"
|
3
|
+
|
4
|
+
require "podsorz/command/setup"
|
5
|
+
require "podsorz/command/switch"
|
6
|
+
require "podsorz/command/commit"
|
7
|
+
require "podsorz/command/publish"
|
8
|
+
require "podsorz/command/install"
|
9
|
+
|
10
|
+
require 'gli'
|
11
|
+
|
12
|
+
include GLI::App
|
13
|
+
|
14
|
+
module PodsOrz
|
15
|
+
program_desc %{iOS application modulize into pods, improvement for develop modules. CMD: git-flow, auto publish code, auto push repo, auto rewrite podfile}
|
16
|
+
|
17
|
+
current_exec_path = Dir.pwd()
|
18
|
+
|
19
|
+
flag %i[p path], default_value: current_exec_path
|
20
|
+
|
21
|
+
if ProcessOperator.already_in_process
|
22
|
+
Logger.error("There is another 'podsorz' command in process, please wait")
|
23
|
+
exit()
|
24
|
+
end
|
25
|
+
|
26
|
+
setup_command()
|
27
|
+
switch_command()
|
28
|
+
commit_command()
|
29
|
+
publish_command()
|
30
|
+
install_command()
|
31
|
+
|
32
|
+
desc "Show podsorz version"
|
33
|
+
command :version do |version|
|
34
|
+
version.action do |global_options, options, args|
|
35
|
+
p VERSION
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
exit run(ARGV)
|
40
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require "podsorz/core/pods_detector"
|
2
|
+
require "podsorz/core/pods_git_manager"
|
3
|
+
|
4
|
+
module PodsOrz
|
5
|
+
def self.commit_command
|
6
|
+
desc "Execute git commit command"
|
7
|
+
command :commit do |commit|
|
8
|
+
commit.switch :push, :negatable => false, :desc => "Push Local branch & commits into remote"
|
9
|
+
commit.switch :notify, :negatable => false, :desc => "1.Merge personal branch & commit into parent(base on) branch 2.Update Podfile_orz.rb"
|
10
|
+
commit.example "podsorz commit", desc:"Just local branch commit"
|
11
|
+
commit.example "podsorz commit --push", desc:"Push Local branch & commits into remote"
|
12
|
+
commit.example "podsorz commit --push --notify", desc:"1.Push Local branch & commits into remote 2.Update Podfile_orz.rb 3.If personal branch, merge into parent branch"
|
13
|
+
commit.example "podsorz commit --notify ❌", desc:"Not support,illegality command"
|
14
|
+
|
15
|
+
commit.action do |global_options, options, args|
|
16
|
+
is_push = options[:push]
|
17
|
+
is_notify = options[:notify]
|
18
|
+
|
19
|
+
if is_push == false && is_notify == true
|
20
|
+
help_now!("illegality 'notify' options")
|
21
|
+
end
|
22
|
+
|
23
|
+
dir_path = global_options[:path]
|
24
|
+
detector = PodsOrz::PodsDetector.new(dir_path)
|
25
|
+
detector.start_detector()
|
26
|
+
|
27
|
+
git_manager = PodsOrz::PodsGitManager.new(dir_path)
|
28
|
+
is_same = git_manager.ensure_pods_branch()
|
29
|
+
exit() unless is_same
|
30
|
+
|
31
|
+
git_manager.pod_commit(is_push, is_notify)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require "podsorz/core/pods_detector"
|
2
|
+
require "podsorz/core/pods_git_manager"
|
3
|
+
|
4
|
+
module PodsOrz
|
5
|
+
def self.install_command
|
6
|
+
desc "Pod Install command, do the same with 'pod install'.Repo will update to latest, pod in 'FIX_POD_LIST' NOT update to latest!"
|
7
|
+
command :install do |install|
|
8
|
+
install.example "podsorz install", :desc => "Install pods, 'FIX_POD_LIST' are 'NOT' updated to latest, they are using your local 'git' code"
|
9
|
+
|
10
|
+
install.action do |global_options, options, args|
|
11
|
+
dir_path = global_options[:path]
|
12
|
+
detector = PodsOrz::PodsDetector.new(dir_path)
|
13
|
+
detector.start_detector()
|
14
|
+
|
15
|
+
git_manager = PodsOrz::PodsGitManager.new(dir_path)
|
16
|
+
is_same = git_manager.ensure_pods_branch()
|
17
|
+
exit() unless is_same
|
18
|
+
|
19
|
+
git_manager.install_pod(dir_path)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require "podsorz/core/pods_detector"
|
2
|
+
require "podsorz/core/pods_git_manager"
|
3
|
+
require "podsorz/util/logger"
|
4
|
+
|
5
|
+
module PodsOrz
|
6
|
+
def self.publish_command()
|
7
|
+
desc "Publish pods release version.Make sure everything works pass through Tester, work branch MUST be 'release'"
|
8
|
+
long_desc %{
|
9
|
+
what will 'podsorz publish' cmd do:\n
|
10
|
+
1.判断 release 是否存在新的 commit 内容 \n
|
11
|
+
2.若存在新的 commit,podspec 文件修改内容 versoin +1\n
|
12
|
+
3.将 release 分支代码 Merge into master / develop \n
|
13
|
+
4.为release branch 最新代码打上 New Tag\n
|
14
|
+
5.Repo 添加kuxiu_specs 并且 更新到最新 \n
|
15
|
+
6.比较 local version, git tag, remote version 三者关系\n
|
16
|
+
7.发布新的组件版本\n
|
17
|
+
8.更改远端 Podfile_orz.rb, 同步对应 pod 到最新的 version\n
|
18
|
+
}
|
19
|
+
command :publish do |publish|
|
20
|
+
publish.action do |global_options, options, args|
|
21
|
+
dir_path = global_options[:path]
|
22
|
+
detector = PodsOrz::PodsDetector.new(dir_path)
|
23
|
+
detector.start_detector()
|
24
|
+
|
25
|
+
git_manager = PodsOrz::PodsGitManager.new(dir_path)
|
26
|
+
|
27
|
+
is_same = git_manager.ensure_pods_branch()
|
28
|
+
exit() unless is_same
|
29
|
+
|
30
|
+
branch_name = git_manager.fetch_pods_branch_name()
|
31
|
+
unless branch_name.include? "release"
|
32
|
+
Logger.error("Publish command need 'release' branch, current branch:'#{branch_name}', you should 'podsorz switch release' first")
|
33
|
+
exit()
|
34
|
+
end
|
35
|
+
|
36
|
+
git_manager.start_repo_publish
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require "podsorz/core/orz_env_detector"
|
2
|
+
|
3
|
+
|
4
|
+
module PodsOrz
|
5
|
+
def self.setup_command
|
6
|
+
desc "Setup PodsOrz environment, init PodFile, PodsOrzConfig.rb, check Podfile_orz.rb exist"
|
7
|
+
command :setup do |setup|
|
8
|
+
setup.action do |global_options, options, args|
|
9
|
+
dir_path = global_options[:path]
|
10
|
+
|
11
|
+
is_directory = File.directory?(dir_path)
|
12
|
+
|
13
|
+
unless is_directory
|
14
|
+
Logger.error("Setup failure, it is not a directory path: #{dir_path}")
|
15
|
+
exit()
|
16
|
+
end
|
17
|
+
|
18
|
+
|
19
|
+
detector = PodsOrz::OrzEnvDetector.new()
|
20
|
+
detector.detect_podfile(dir_path)
|
21
|
+
detector.detect_PodsOrzConfig(dir_path)
|
22
|
+
|
23
|
+
podfile_orz_result = detector.detect_podfile_orz(dir_path)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require "podsorz/core/pods_detector"
|
2
|
+
require "podsorz/core/pods_git_manager"
|
3
|
+
|
4
|
+
module PodsOrz
|
5
|
+
def self.switch_command
|
6
|
+
desc "Switch branch which is in fix_pods_list.Argument match 'develop', 'feature', 'release', 'bugfix'"
|
7
|
+
arg_name '\'branch_name\''
|
8
|
+
command :switch do |switch|
|
9
|
+
switch.example "podsorz switch develop", desc:"siwtch into 'develop' branch."
|
10
|
+
switch.action do |global_options, options, args|
|
11
|
+
help_now!('branch_name is required') if args.empty?
|
12
|
+
|
13
|
+
input_branch = args.shift.to_s.strip.chomp
|
14
|
+
available = ["develop", "feature", "release", "bugfix"]
|
15
|
+
result = ""
|
16
|
+
available.each do |branch|
|
17
|
+
cmp_result = branch.casecmp(input_branch)
|
18
|
+
if cmp_result == 0
|
19
|
+
result = branch
|
20
|
+
break
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
help_now!("branch is unknow,current support:'develop', 'feature', 'release', 'bugfix'") if result.empty?
|
25
|
+
|
26
|
+
dir_path = global_options[:path]
|
27
|
+
|
28
|
+
detector = PodsOrz::PodsDetector.new(dir_path)
|
29
|
+
detector.start_detector()
|
30
|
+
|
31
|
+
git_manager = PodsOrz::PodsGitManager.new(dir_path)
|
32
|
+
case result
|
33
|
+
when "develop"
|
34
|
+
git_manager.switch_develop_state()
|
35
|
+
when "feature"
|
36
|
+
git_manager.switch_feature_state()
|
37
|
+
when "release"
|
38
|
+
git_manager.switch_release_state()
|
39
|
+
when "bugfix"
|
40
|
+
git_manager.switch_bugfix_state()
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|