tycli-public 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tycli/command/group/status.rb +1 -0
- data/lib/tycli/command/lib/create.rb +3 -6
- data/lib/tycli/command/repo/push.rb +1 -2
- data/lib/tycli/repo/spec.rb +10 -0
- data/lib/tycli/spec_repo.rb +41 -5
- data/lib/tycli/util/file_util.rb +12 -0
- data/lib/tycli/util/puts_util.rb +56 -4
- data/lib/tycli/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbd695f107cca40fe98f67a4cf624722b0c37bcf
|
4
|
+
data.tar.gz: a50cca500aa97781350724c114f6471315c7711e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07560e9235f91991089de5678de8a50477e9cf83506130d25e98f101e3a61c3e3d4283c6546e4dae5c78b046a1b84bf2fc2a605b465be77c10d2d6e4ceb468aa
|
7
|
+
data.tar.gz: 80f30f4077e2f914bd44925fe6a1802b6d1f30b41caa02d92e4e9eb9d67ef3a8ae564836ccf271d5c246ecbf45a8407349507e464459e38f431c2c07754d8ae3
|
@@ -63,12 +63,9 @@ module Tuya
|
|
63
63
|
if File.exist? "./#{@name}"
|
64
64
|
puts "#{@name} is alerady exits".red
|
65
65
|
else
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
puts "#{s}".red
|
70
|
-
end
|
71
|
-
end
|
66
|
+
command = %W(lib create #{@name} --template-url=https://github.com/TuyaInc/pod-template.git)
|
67
|
+
require 'tycli/executable'
|
68
|
+
EXE.exe("pod", command, true )
|
72
69
|
end
|
73
70
|
end
|
74
71
|
end
|
@@ -24,7 +24,6 @@ module Tuya
|
|
24
24
|
@is_commit = argv.flag?('commit', true)
|
25
25
|
|
26
26
|
@version = argv.option('version')
|
27
|
-
# @version = '0.0.1' unless @version
|
28
27
|
@podspec = argv.shift_argument
|
29
28
|
|
30
29
|
end
|
@@ -32,7 +31,7 @@ module Tuya
|
|
32
31
|
def run
|
33
32
|
puts "Pushing the podspec: #{@podspec} to version: #{@version}".green
|
34
33
|
|
35
|
-
Tuya::SpecRepo.push(@version, @is_commit, @podspec)
|
34
|
+
Tuya::SpecRepo.push(@version, @is_commit, @podspec, @verbose)
|
36
35
|
end
|
37
36
|
end
|
38
37
|
end
|
data/lib/tycli/repo/spec.rb
CHANGED
@@ -1,6 +1,16 @@
|
|
1
1
|
module Tuya
|
2
2
|
class PodSpec
|
3
3
|
|
4
|
+
def self.local_pod_version_exist(version, spec, lib_name)
|
5
|
+
|
6
|
+
require 'tycli/system'
|
7
|
+
|
8
|
+
system = Tuya::System.instance
|
9
|
+
local_path = system.pod_config.repos_dir + spec + lib_name + version
|
10
|
+
|
11
|
+
File.directory?(local_path)
|
12
|
+
end
|
13
|
+
|
4
14
|
def self.ask_pod_spec
|
5
15
|
|
6
16
|
files = podspec_files(nil)
|
data/lib/tycli/spec_repo.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Tuya
|
2
2
|
class SpecRepo
|
3
|
-
def self.push(version, is_commit_all, podspec)
|
3
|
+
def self.push(version, is_commit_all, podspec, verbose)
|
4
4
|
|
5
5
|
require 'tycli/repo/spec'
|
6
6
|
require 'tycli/git'
|
@@ -43,18 +43,54 @@ module Tuya
|
|
43
43
|
|
44
44
|
podspecs.each do |podspec_file|
|
45
45
|
|
46
|
-
puts "\
|
46
|
+
puts "\nPushing #{podspec_file}...".yellow
|
47
47
|
|
48
48
|
pod_push = "pod repo push #{group.spec} #{podspec_file} --sources='#{group.url},https://github.com/CocoaPods/Specs.git,https://github.com/TuyaInc/TYPublicSpecs.git' --use-libraries --allow-warnings"
|
49
49
|
|
50
|
+
if verbose
|
51
|
+
pod_push = "#{pod_push} --verbose"
|
52
|
+
end
|
53
|
+
|
50
54
|
pod_push_result = `#{pod_push}`
|
51
55
|
|
52
|
-
|
53
|
-
|
54
|
-
|
56
|
+
push_result = Tuya::PodSpec.local_pod_version_exist(version, group.spec, File.basename(FileUtils.pwd))
|
57
|
+
|
58
|
+
|
59
|
+
if verbose
|
60
|
+
if pod_push_result.length > 10000
|
61
|
+
|
62
|
+
require 'tycli/util/file_util'
|
63
|
+
log_name = "repo_push_result_#{podspec_file}_#{version}.log"
|
64
|
+
|
65
|
+
if push_result
|
66
|
+
log_name = "success_#{log_name}"
|
67
|
+
puts "\nThe detail log is :#{log_name}\n".yellow
|
68
|
+
else
|
69
|
+
log_name = "error_#{log_name}"
|
70
|
+
puts "\nThe detail error log is :#{log_name}\n".red
|
71
|
+
end
|
72
|
+
|
73
|
+
TYUtil::TYFile.new_file("log", log_name, pod_push_result)
|
74
|
+
else
|
75
|
+
|
76
|
+
puts "The detail log is:\n".red
|
77
|
+
puts pod_push_result.magenta
|
55
78
|
end
|
56
79
|
end
|
80
|
+
|
81
|
+
if push_result
|
82
|
+
puts "Push #{podspec_file} Successful\n".green
|
83
|
+
else
|
84
|
+
suggest_log(podspec_file, pod_push_result)
|
85
|
+
end
|
86
|
+
|
57
87
|
end
|
58
88
|
end
|
89
|
+
|
90
|
+
def self.suggest_log(podspec_file, content)
|
91
|
+
puts "\nPush #{podspec_file} Failed you can use 'tuya repo push --verbose for more information' ".red
|
92
|
+
require 'tycli/util/puts_util'
|
93
|
+
TYUtil::TYPuts.filter(content, TYUtil::TYPuts::ERROR_KEYS)
|
94
|
+
end
|
59
95
|
end
|
60
96
|
end
|
data/lib/tycli/util/puts_util.rb
CHANGED
@@ -1,17 +1,25 @@
|
|
1
1
|
$LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
|
2
|
+
|
3
|
+
require 'colored'
|
4
|
+
|
2
5
|
module TYUtil
|
3
6
|
class TYPuts
|
4
7
|
|
8
|
+
|
5
9
|
ERROR_KEYS = [
|
6
10
|
"fatal",
|
7
11
|
"error",
|
12
|
+
"ERROR",
|
8
13
|
"can not",
|
9
|
-
"not found"
|
14
|
+
"not found",
|
15
|
+
"Couldn"#Couldn't find
|
10
16
|
]
|
11
17
|
|
12
18
|
def self.filter_color(target, keys, color, pre)
|
13
19
|
target.each_line do |s|
|
14
20
|
|
21
|
+
# p 111
|
22
|
+
# p s
|
15
23
|
eval_command = ""
|
16
24
|
keys.each do |key|
|
17
25
|
temp = ""
|
@@ -20,16 +28,60 @@ module TYUtil
|
|
20
28
|
end
|
21
29
|
eval_command = "#{eval_command}#{temp}s.include?('#{key}')"
|
22
30
|
end
|
31
|
+
# p eval_command
|
23
32
|
if eval_command.length > 0 && (eval eval_command)
|
24
|
-
|
25
|
-
|
33
|
+
# p 11111
|
34
|
+
# p pre
|
35
|
+
# p 222
|
36
|
+
|
37
|
+
out = "#{pre} #{s}"
|
38
|
+
if out.include?("''")
|
39
|
+
out.gsub!("'","")
|
40
|
+
end
|
41
|
+
|
42
|
+
# p "#{pre} #{s}"
|
43
|
+
# p 33
|
44
|
+
# p out
|
45
|
+
|
46
|
+
# puts "puts '#{out}'.#{color}"
|
47
|
+
|
48
|
+
# eval "puts '#{out}'.#{color}"
|
26
49
|
end
|
27
50
|
end
|
28
51
|
|
29
52
|
end
|
30
53
|
|
54
|
+
def self.filter_content(target, keys, pre)
|
55
|
+
|
56
|
+
regular_temp = ""
|
57
|
+
is_put_pre = false
|
58
|
+
keys.each do |key|
|
59
|
+
temp = ""
|
60
|
+
if regular_temp.length > 0
|
61
|
+
temp = "|"
|
62
|
+
end
|
63
|
+
regular_temp = "#{regular_temp}#{temp}(.*)#{key}(.*)"
|
64
|
+
end
|
65
|
+
|
66
|
+
regular = "^(#{regular_temp})$"
|
67
|
+
target.gsub(/#{regular}/) do |matched|
|
68
|
+
|
69
|
+
if !is_put_pre
|
70
|
+
is_put_pre = true
|
71
|
+
puts pre.yellow
|
72
|
+
puts "\n"
|
73
|
+
end
|
74
|
+
|
75
|
+
if matched.length < 2000
|
76
|
+
puts matched.magenta
|
77
|
+
puts "\n"
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
31
82
|
def self.filter(target, keys)
|
32
|
-
filter_color(target, keys, 'yellow', '[!tuya-cli]')
|
83
|
+
# filter_color(target, keys, 'yellow', '[!tuya-cli suggested]')
|
84
|
+
filter_content(target, keys, '「tuya-cli」 Maybe the reason for the error is :')
|
33
85
|
end
|
34
86
|
end
|
35
87
|
end
|
data/lib/tycli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tycli-public
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- fangdong
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -143,6 +143,7 @@ files:
|
|
143
143
|
- lib/tycli/spec_repo.rb
|
144
144
|
- lib/tycli/system.rb
|
145
145
|
- lib/tycli/util/ask.rb
|
146
|
+
- lib/tycli/util/file_util.rb
|
146
147
|
- lib/tycli/util/puts_util.rb
|
147
148
|
- lib/tycli/version.rb
|
148
149
|
homepage: https://docs.tuya.com/cn/
|