prek 0.4.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/.gitignore +8 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +164 -0
- data/LICENSE.txt +21 -0
- data/README.md +43 -0
- data/Rakefile +2 -0
- data/bin/console +14 -0
- data/bin/prek +6 -0
- data/bin/setup +8 -0
- data/lib/bytedance/version.rb +3 -0
- data/lib/command/fastlanehelper.rb +23 -0
- data/lib/command/file_help.rb +39 -0
- data/lib/command/file_helper.rb +15 -0
- data/lib/command/lib.rb +18 -0
- data/lib/command/lib/create.rb +40 -0
- data/lib/command/lib/publish.rb +45 -0
- data/lib/command/module/create.rb +42 -0
- data/lib/command/mvvm.rb +29 -0
- data/lib/command/project.rb +17 -0
- data/lib/prek.rb +35 -0
- data/prek.gemspec +33 -0
- metadata +150 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3e75b802b381c0b3a43df1a27eae70f1c968ed0a75f5aa746b890ddfcba1dd99
|
4
|
+
data.tar.gz: f8d785ed9c86decabbe50433d2a0d291868bd5c29e67affb599691776920690a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3ad32eb9c4c1817e124b67431660f56da725a762143ae6b8cba62268e5a509e3926e13f64f9425f2fee11ea6eb1cb8eed4f2f1c55f3b5b1bc5564a1e6c9f436f
|
7
|
+
data.tar.gz: a992a80273ead9953a611e9dd51b15c98c74e0afbbb60a6c935c65ff394910405e1cee44015cfd35f2450594b804feb44441146f7e63be91d914c881c56db6ff
|
data/.gitignore
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at 4705140@qq.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,164 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
bytedance (0.2.0)
|
5
|
+
colored (~> 1.2)
|
6
|
+
fastlane (~> 2.94)
|
7
|
+
json (~> 1.8)
|
8
|
+
terminal-table (~> 1.8)
|
9
|
+
xcodeproj (~> 1.5)
|
10
|
+
|
11
|
+
GEM
|
12
|
+
remote: https://rubygems.org/
|
13
|
+
specs:
|
14
|
+
CFPropertyList (3.0.0)
|
15
|
+
addressable (2.5.2)
|
16
|
+
public_suffix (>= 2.0.2, < 4.0)
|
17
|
+
atomos (0.1.2)
|
18
|
+
babosa (1.0.2)
|
19
|
+
claide (1.0.2)
|
20
|
+
colored (1.2)
|
21
|
+
colored2 (3.1.2)
|
22
|
+
commander-fastlane (4.4.6)
|
23
|
+
highline (~> 1.7.2)
|
24
|
+
declarative (0.0.10)
|
25
|
+
declarative-option (0.1.0)
|
26
|
+
domain_name (0.5.20180417)
|
27
|
+
unf (>= 0.0.5, < 1.0.0)
|
28
|
+
dotenv (2.4.0)
|
29
|
+
emoji_regex (0.1.1)
|
30
|
+
excon (0.62.0)
|
31
|
+
faraday (0.15.0)
|
32
|
+
multipart-post (>= 1.2, < 3)
|
33
|
+
faraday-cookie_jar (0.0.6)
|
34
|
+
faraday (>= 0.7.4)
|
35
|
+
http-cookie (~> 1.0.0)
|
36
|
+
faraday_middleware (0.12.2)
|
37
|
+
faraday (>= 0.7.4, < 1.0)
|
38
|
+
fastimage (2.1.3)
|
39
|
+
fastlane (2.94.0)
|
40
|
+
CFPropertyList (>= 2.3, < 4.0.0)
|
41
|
+
addressable (>= 2.3, < 3.0.0)
|
42
|
+
babosa (>= 1.0.2, < 2.0.0)
|
43
|
+
bundler (>= 1.12.0, < 2.0.0)
|
44
|
+
colored
|
45
|
+
commander-fastlane (>= 4.4.6, < 5.0.0)
|
46
|
+
dotenv (>= 2.1.1, < 3.0.0)
|
47
|
+
emoji_regex (~> 0.1)
|
48
|
+
excon (>= 0.45.0, < 1.0.0)
|
49
|
+
faraday (~> 0.9)
|
50
|
+
faraday-cookie_jar (~> 0.0.6)
|
51
|
+
faraday_middleware (~> 0.9)
|
52
|
+
fastimage (>= 2.1.0, < 3.0.0)
|
53
|
+
gh_inspector (>= 1.1.2, < 2.0.0)
|
54
|
+
google-api-client (>= 0.13.1, < 0.14.0)
|
55
|
+
highline (>= 1.7.2, < 2.0.0)
|
56
|
+
json (< 3.0.0)
|
57
|
+
mini_magick (~> 4.5.1)
|
58
|
+
multi_json
|
59
|
+
multi_xml (~> 0.5)
|
60
|
+
multipart-post (~> 2.0.0)
|
61
|
+
plist (>= 3.1.0, < 4.0.0)
|
62
|
+
public_suffix (~> 2.0.0)
|
63
|
+
rubyzip (>= 1.1.0, < 2.0.0)
|
64
|
+
security (= 0.1.3)
|
65
|
+
simctl (~> 1.6.3)
|
66
|
+
slack-notifier (>= 2.0.0, < 3.0.0)
|
67
|
+
terminal-notifier (>= 1.6.2, < 2.0.0)
|
68
|
+
terminal-table (>= 1.4.5, < 2.0.0)
|
69
|
+
tty-screen (>= 0.6.3, < 1.0.0)
|
70
|
+
tty-spinner (>= 0.8.0, < 1.0.0)
|
71
|
+
word_wrap (~> 1.0.0)
|
72
|
+
xcodeproj (>= 1.5.7, < 2.0.0)
|
73
|
+
xcpretty (>= 0.2.4, < 1.0.0)
|
74
|
+
xcpretty-travis-formatter (>= 0.0.3)
|
75
|
+
gh_inspector (1.1.3)
|
76
|
+
google-api-client (0.13.6)
|
77
|
+
addressable (~> 2.5, >= 2.5.1)
|
78
|
+
googleauth (~> 0.5)
|
79
|
+
httpclient (>= 2.8.1, < 3.0)
|
80
|
+
mime-types (~> 3.0)
|
81
|
+
representable (~> 3.0)
|
82
|
+
retriable (>= 2.0, < 4.0)
|
83
|
+
googleauth (0.6.2)
|
84
|
+
faraday (~> 0.12)
|
85
|
+
jwt (>= 1.4, < 3.0)
|
86
|
+
logging (~> 2.0)
|
87
|
+
memoist (~> 0.12)
|
88
|
+
multi_json (~> 1.11)
|
89
|
+
os (~> 0.9)
|
90
|
+
signet (~> 0.7)
|
91
|
+
highline (1.7.10)
|
92
|
+
http-cookie (1.0.3)
|
93
|
+
domain_name (~> 0.5)
|
94
|
+
httpclient (2.8.3)
|
95
|
+
json (1.8.3)
|
96
|
+
jwt (2.1.0)
|
97
|
+
little-plugger (1.1.4)
|
98
|
+
logging (2.2.2)
|
99
|
+
little-plugger (~> 1.1)
|
100
|
+
multi_json (~> 1.10)
|
101
|
+
memoist (0.16.0)
|
102
|
+
mime-types (3.1)
|
103
|
+
mime-types-data (~> 3.2015)
|
104
|
+
mime-types-data (3.2016.0521)
|
105
|
+
mini_magick (4.5.1)
|
106
|
+
minitest (5.8.3)
|
107
|
+
multi_json (1.13.1)
|
108
|
+
multi_xml (0.6.0)
|
109
|
+
multipart-post (2.0.0)
|
110
|
+
nanaimo (0.2.5)
|
111
|
+
naturally (2.1.0)
|
112
|
+
os (0.9.6)
|
113
|
+
plist (3.4.0)
|
114
|
+
public_suffix (2.0.5)
|
115
|
+
representable (3.0.4)
|
116
|
+
declarative (< 0.1.0)
|
117
|
+
declarative-option (< 0.2.0)
|
118
|
+
uber (< 0.2.0)
|
119
|
+
retriable (3.1.1)
|
120
|
+
rouge (2.0.7)
|
121
|
+
rubyzip (1.2.1)
|
122
|
+
security (0.1.3)
|
123
|
+
signet (0.8.1)
|
124
|
+
addressable (~> 2.3)
|
125
|
+
faraday (~> 0.9)
|
126
|
+
jwt (>= 1.5, < 3.0)
|
127
|
+
multi_json (~> 1.10)
|
128
|
+
simctl (1.6.4)
|
129
|
+
CFPropertyList
|
130
|
+
naturally
|
131
|
+
slack-notifier (2.3.2)
|
132
|
+
terminal-notifier (1.8.0)
|
133
|
+
terminal-table (1.8.0)
|
134
|
+
unicode-display_width (~> 1.1, >= 1.1.1)
|
135
|
+
tty-cursor (0.5.0)
|
136
|
+
tty-screen (0.6.4)
|
137
|
+
tty-spinner (0.8.0)
|
138
|
+
tty-cursor (>= 0.5.0)
|
139
|
+
uber (0.1.0)
|
140
|
+
unf (0.1.4)
|
141
|
+
unf_ext
|
142
|
+
unf_ext (0.0.7.5)
|
143
|
+
unicode-display_width (1.3.2)
|
144
|
+
word_wrap (1.0.0)
|
145
|
+
xcodeproj (1.5.7)
|
146
|
+
CFPropertyList (>= 2.3.3, < 4.0)
|
147
|
+
atomos (~> 0.1.2)
|
148
|
+
claide (>= 1.0.2, < 2.0)
|
149
|
+
colored2 (~> 3.1)
|
150
|
+
nanaimo (~> 0.2.4)
|
151
|
+
xcpretty (0.2.8)
|
152
|
+
rouge (~> 2.0.7)
|
153
|
+
xcpretty-travis-formatter (1.0.0)
|
154
|
+
xcpretty (~> 0.2, >= 0.0.7)
|
155
|
+
|
156
|
+
PLATFORMS
|
157
|
+
ruby
|
158
|
+
|
159
|
+
DEPENDENCIES
|
160
|
+
bytedance!
|
161
|
+
minitest (~> 5.0)
|
162
|
+
|
163
|
+
BUNDLED WITH
|
164
|
+
1.16.1
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 jialei
|
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/README.md
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# Bytedance
|
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/bytedance`. 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 'bytedance'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install bytedance
|
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]/bytedance. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
|
+
|
37
|
+
## License
|
38
|
+
|
39
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
40
|
+
|
41
|
+
## Code of Conduct
|
42
|
+
|
43
|
+
Everyone interacting in the Bytedance project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/bytedance/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "prek"
|
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/bin/prek
ADDED
data/bin/setup
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
module Bytedance
|
2
|
+
class FastlaneHelper
|
3
|
+
|
4
|
+
def initialize()
|
5
|
+
load_require
|
6
|
+
@runner = Fastlane::Runner.new
|
7
|
+
end
|
8
|
+
|
9
|
+
def load_require
|
10
|
+
Dir[File.expand_path('*.rb', File.dirname(FileHelper.fastlane_action_path))].each do |file|
|
11
|
+
require file
|
12
|
+
end
|
13
|
+
Dir[File.expand_path('*.rb', File.dirname(FileHelper.fastlane_helper_path))].each do |file|
|
14
|
+
require file
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def execute_fastlane_action(action_name)
|
19
|
+
@runner.execute_action(action_name,@runner.class_reference_from_action_name(action_name),[],custom_dir:".")
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module Bytedance
|
2
|
+
class FastlaneHelper
|
3
|
+
|
4
|
+
def initialize()
|
5
|
+
load_require
|
6
|
+
@runner = Fastlane::Runner.new
|
7
|
+
end
|
8
|
+
|
9
|
+
def load_require
|
10
|
+
Dir[File.expand_path('*.rb', File.dirname(FileHelper.fastlane_action_path))].each do |file|
|
11
|
+
require file
|
12
|
+
end
|
13
|
+
Dir[File.expand_path('*.rb', File.dirname(FileHelper.fastlane_helper_path))].each do |file|
|
14
|
+
require file
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def execute_fastlane_action(action_name)
|
19
|
+
@runner.execute_action(action_name,@runner.class_reference_from_action_name(action_name),[],custom_dir:".")
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
class FileHelper
|
25
|
+
|
26
|
+
def self.fastlane_base_path
|
27
|
+
File.dirname(`gem which fastlane`)
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.fastlane_action_path
|
31
|
+
FileHelper.fastlane_base_path + "/fastlane/actions/."
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.fastlane_helper_path
|
35
|
+
FileHelper.fastlane_base_path + "/fastlane/helper/."
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class FileHelper
|
2
|
+
|
3
|
+
def self.fastlane_base_path
|
4
|
+
File.dirname(`gem which fastlane`)
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.fastlane_action_path
|
8
|
+
FileHelper.fastlane_base_path + "/fastlane/actions/."
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.fastlane_helper_path
|
12
|
+
FileHelper.fastlane_base_path + "/fastlane/helper/."
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
data/lib/command/lib.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
module Bytedance
|
2
|
+
class BytedanceManager
|
3
|
+
class Lib < BytedanceManager
|
4
|
+
require_relative './lib/publish'
|
5
|
+
require_relative './lib/create'
|
6
|
+
self.abstract_command = true
|
7
|
+
self.summary = ''
|
8
|
+
|
9
|
+
self.description = <<-DESC
|
10
|
+
|
11
|
+
DESC
|
12
|
+
|
13
|
+
def run
|
14
|
+
super
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Prek
|
2
|
+
class PrekManager
|
3
|
+
class Lib
|
4
|
+
class Create < Lib
|
5
|
+
self.summary = ''
|
6
|
+
|
7
|
+
def self.options
|
8
|
+
|
9
|
+
end
|
10
|
+
|
11
|
+
def initialize(params)
|
12
|
+
@projectName = params.shift_argument
|
13
|
+
@components = params.option('components','optional')
|
14
|
+
@prefix = params.option('prefix','Prek')
|
15
|
+
@platform = params.flag?('platform',true)
|
16
|
+
super
|
17
|
+
end
|
18
|
+
|
19
|
+
def validate!
|
20
|
+
super
|
21
|
+
if @components && !%w(none optional all).include?(@components)
|
22
|
+
help! "`#{@components}' 参数无效,components = none 或 optional 或 all "
|
23
|
+
end
|
24
|
+
|
25
|
+
if !@projectName
|
26
|
+
help! "参数错误,需要输入项目名称,bytedance lib create projectName"
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
def run
|
32
|
+
super
|
33
|
+
parameter = [@projectName,'--components='+ @components,'--prefix=' + @prefix, @platform ? '--platform' : '--no-platform', '--template-url=git@code.byted.org:ex_kid/exk-pod-template.git']
|
34
|
+
finalParams = CLAide::ARGV.new(parameter)
|
35
|
+
Pod::Command::Lib::Create.new(finalParams).run
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'fastlane/other_action'
|
2
|
+
require 'fastlane/fastlane_require'
|
3
|
+
require_relative '../file_help'
|
4
|
+
|
5
|
+
module Bytedance
|
6
|
+
class BytedanceManager
|
7
|
+
class Lib
|
8
|
+
class Publish < Lib
|
9
|
+
self.summary = ''
|
10
|
+
|
11
|
+
def self.options
|
12
|
+
[['--project', '是否引入平台基础库,默认引入,不引入使用--no-platform'],
|
13
|
+
['--repo', 'none 不引入任何组件,optional 选择自己想要的(default), all 引入全部组件,于平台一致'],
|
14
|
+
['--pod-version', '可选,默认 prefix = TT']].concat(super)
|
15
|
+
end
|
16
|
+
|
17
|
+
def initialize(params)
|
18
|
+
super
|
19
|
+
@fastlane_helper = FastlaneHelper.new
|
20
|
+
@target_repo = params.option('repo','optional')
|
21
|
+
@target_project = params.option('project')
|
22
|
+
@target_version = params.option('pod-version')
|
23
|
+
end
|
24
|
+
|
25
|
+
def validate!
|
26
|
+
super
|
27
|
+
if @components && !%w(none optional all).include?(@components)
|
28
|
+
help! "`#{@components}' 参数无效,components = none 或 optional 或 all "
|
29
|
+
end
|
30
|
+
|
31
|
+
if !@target_project
|
32
|
+
help! "参数错误,需要输入项目名称,bytedance lib create projectName"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def run
|
37
|
+
super
|
38
|
+
puts "Publish running"
|
39
|
+
@fastlane_helper.execute_fastlane_action('git_pull')
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Prek
|
2
|
+
class PrekManager
|
3
|
+
class Project
|
4
|
+
class Create < Project
|
5
|
+
self.summary = ''
|
6
|
+
|
7
|
+
def self.options
|
8
|
+
[['--platform', '是否引入平台基础库,默认引入,不引入使用--no-platform'],
|
9
|
+
['--components=[none|optional|all]', 'none 不引入任何组件,optional 选择自己想要的(default), all 引入全部组件,于平台一致'],
|
10
|
+
['--prefix', '可选,默认 prefix = Prek']].concat(super)
|
11
|
+
end
|
12
|
+
|
13
|
+
def initialize(params)
|
14
|
+
@projectName = params.shift_argument
|
15
|
+
@components = params.option('components','optional')
|
16
|
+
@prefix = params.option('prefix','Prek')
|
17
|
+
@platform = params.flag?('platform',true)
|
18
|
+
super
|
19
|
+
end
|
20
|
+
|
21
|
+
def validate!
|
22
|
+
super
|
23
|
+
if @components && !%w(none optional all).include?(@components)
|
24
|
+
help! "`#{@components}' 参数无效,components = none 或 optional 或 all "
|
25
|
+
end
|
26
|
+
|
27
|
+
if !@projectName
|
28
|
+
help! "参数错误,需要输入项目名称,bytedance project create projectName"
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
def run
|
34
|
+
super
|
35
|
+
parameter = [@projectName,'--components='+ @components,'--prefix=' + @prefix, @platform ? '--platform' : '--no-platform', '--template-url=git@code.byted.org:prek/pod-template.git']
|
36
|
+
finalParams = CLAide::ARGV.new(parameter)
|
37
|
+
Pod::Command::Lib::Create.new(finalParams).run
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
data/lib/command/mvvm.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
|
2
|
+
module Bytedance
|
3
|
+
class BytedanceManager
|
4
|
+
class Mvvm < BytedanceManager
|
5
|
+
self.summary = ''
|
6
|
+
|
7
|
+
def self.options
|
8
|
+
|
9
|
+
end
|
10
|
+
|
11
|
+
def initialize(params)
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
def validate!
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
def run
|
20
|
+
super
|
21
|
+
|
22
|
+
puts system('git clone git@code.byted.org:ex_kid/mvvm_template.git')
|
23
|
+
puts system('rm -rf ~/Library/Developer/Xcode/Templates/File\ Templates/mvvm_template')
|
24
|
+
puts system('mv -f mvvm_template ~/Library/Developer/Xcode/Templates/File\ Templates/')
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Bytedance
|
2
|
+
class BytedanceManager
|
3
|
+
class Project < BytedanceManager
|
4
|
+
require_relative './project/create'
|
5
|
+
self.abstract_command = true
|
6
|
+
self.summary = ''
|
7
|
+
|
8
|
+
self.description = <<-DESC
|
9
|
+
|
10
|
+
DESC
|
11
|
+
|
12
|
+
def run
|
13
|
+
super
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/prek.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'claide'
|
4
|
+
require 'colored'
|
5
|
+
require 'cocoapods'
|
6
|
+
require 'fastlane'
|
7
|
+
|
8
|
+
|
9
|
+
module Prek
|
10
|
+
|
11
|
+
class PrekManager < CLAide::Command
|
12
|
+
require_relative './command/lib'
|
13
|
+
require_relative './command/module'
|
14
|
+
require_relative './command/mvvm'
|
15
|
+
self.abstract_command = true
|
16
|
+
|
17
|
+
self.description = <<-DESC
|
18
|
+
|
19
|
+
DESC
|
20
|
+
|
21
|
+
self.command = 'bytedance'
|
22
|
+
|
23
|
+
def self.options
|
24
|
+
[
|
25
|
+
|
26
|
+
].concat(super)
|
27
|
+
end
|
28
|
+
|
29
|
+
def run
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
data/prek.gemspec
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "bytedance/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "prek"
|
8
|
+
spec.version = Bytedance::VERSION
|
9
|
+
spec.authors = ["jialei"]
|
10
|
+
spec.email = ["4705140@qq.com"]
|
11
|
+
|
12
|
+
spec.summary = "bytedance project manage tool"
|
13
|
+
spec.description = "manage tool"
|
14
|
+
spec.homepage = "https://code.byted.org/jialei.jay/tool_bytedance"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
20
|
+
f.match(%r{^(test|spec|features)/})
|
21
|
+
end
|
22
|
+
spec.bindir = "bin"
|
23
|
+
spec.executables = "prek"
|
24
|
+
spec.require_paths = %w{ lib }
|
25
|
+
|
26
|
+
spec.add_development_dependency "minitest", "~> 5.0"
|
27
|
+
spec.add_runtime_dependency "xcodeproj",'~> 1.5'
|
28
|
+
spec.add_runtime_dependency "json",'~> 1.8'
|
29
|
+
spec.add_runtime_dependency "terminal-table",'~> 1.8'
|
30
|
+
spec.add_runtime_dependency "fastlane", '~> 2.94'
|
31
|
+
spec.add_runtime_dependency "colored" ,'~> 1.2'
|
32
|
+
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,150 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: prek
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.4.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- jialei
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-10-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: minitest
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '5.0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '5.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: xcodeproj
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.5'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.5'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: json
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.8'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.8'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: terminal-table
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.8'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.8'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: fastlane
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '2.94'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '2.94'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: colored
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.2'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.2'
|
97
|
+
description: manage tool
|
98
|
+
email:
|
99
|
+
- 4705140@qq.com
|
100
|
+
executables:
|
101
|
+
- prek
|
102
|
+
extensions: []
|
103
|
+
extra_rdoc_files: []
|
104
|
+
files:
|
105
|
+
- ".gitignore"
|
106
|
+
- CODE_OF_CONDUCT.md
|
107
|
+
- Gemfile
|
108
|
+
- Gemfile.lock
|
109
|
+
- LICENSE.txt
|
110
|
+
- README.md
|
111
|
+
- Rakefile
|
112
|
+
- bin/console
|
113
|
+
- bin/prek
|
114
|
+
- bin/setup
|
115
|
+
- lib/bytedance/version.rb
|
116
|
+
- lib/command/fastlanehelper.rb
|
117
|
+
- lib/command/file_help.rb
|
118
|
+
- lib/command/file_helper.rb
|
119
|
+
- lib/command/lib.rb
|
120
|
+
- lib/command/lib/create.rb
|
121
|
+
- lib/command/lib/publish.rb
|
122
|
+
- lib/command/module/create.rb
|
123
|
+
- lib/command/mvvm.rb
|
124
|
+
- lib/command/project.rb
|
125
|
+
- lib/prek.rb
|
126
|
+
- prek.gemspec
|
127
|
+
homepage: https://code.byted.org/jialei.jay/tool_bytedance
|
128
|
+
licenses:
|
129
|
+
- MIT
|
130
|
+
metadata: {}
|
131
|
+
post_install_message:
|
132
|
+
rdoc_options: []
|
133
|
+
require_paths:
|
134
|
+
- lib
|
135
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - ">="
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '0'
|
140
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '0'
|
145
|
+
requirements: []
|
146
|
+
rubygems_version: 3.0.3
|
147
|
+
signing_key:
|
148
|
+
specification_version: 4
|
149
|
+
summary: bytedance project manage tool
|
150
|
+
test_files: []
|