dfb 1.0.5 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/dfb +8 -0
- data/dfb-1.0.1.gem +0 -0
- data/dfb-1.0.2.gem +0 -0
- data/dfb-1.0.3.gem +0 -0
- data/dfb-1.0.4.gem +0 -0
- data/dfb-1.0.5.gem +0 -0
- data/dfb-1.0.6.gem +0 -0
- data/lib/dfb.rb +115 -30
- data/lib/dfb/version.rb +1 -1
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65647d5a508cfd5a87b71e613fd251592ba3d7877ef458e59821525ca26407b9
|
4
|
+
data.tar.gz: f88be74eba4e6720be6b99f9830dde7fcbc6f8adf36bc312cd1fa1d014ea51a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c52fa0fed48acf050c6b05eb879819b699c68ffcec644295214274d18dcd215be891e4b356f7df74638fa764e886993098a3e6b3b451c504fde005aec853ecc8
|
7
|
+
data.tar.gz: 70a1249913d55c256680083e3b69cfe56ecf63c875054b831632cc1df35796ec43ce7c562cf8de640f800efeecb5163a73b6eb3aff0204b4d0c4d2b6af43c7a0
|
data/bin/dfb
CHANGED
@@ -47,6 +47,14 @@ class App
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
+
desc '修改当前工程指向的目录'
|
51
|
+
arg_name 'Describe arguments to complete here'
|
52
|
+
command :clone do |c|
|
53
|
+
c.action do |global_options,options,args|
|
54
|
+
Dfb.changePath
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
50
58
|
desc '下载词典flutter工程'
|
51
59
|
arg_name 'Describe arguments to complete here'
|
52
60
|
command :clone do |c|
|
data/dfb-1.0.1.gem
ADDED
Binary file
|
data/dfb-1.0.2.gem
ADDED
Binary file
|
data/dfb-1.0.3.gem
ADDED
Binary file
|
data/dfb-1.0.4.gem
ADDED
Binary file
|
data/dfb-1.0.5.gem
ADDED
Binary file
|
data/dfb-1.0.6.gem
ADDED
Binary file
|
data/lib/dfb.rb
CHANGED
@@ -1,8 +1,12 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
|
1
3
|
require 'dfb/version.rb'
|
4
|
+
require './path_manager.rb'
|
2
5
|
|
3
6
|
# Add requires for other files you add to your project here, so
|
4
7
|
# you just need to require this one file in your bin file
|
5
|
-
|
8
|
+
# https://www.cnblogs.com/rubylouvre/archive/2011/04/04/2005122.html
|
9
|
+
module Dfb
|
6
10
|
# Your code goes here...
|
7
11
|
def self.hello
|
8
12
|
p "hello world"
|
@@ -11,55 +15,80 @@ module Dfb
|
|
11
15
|
end
|
12
16
|
|
13
17
|
def self.clone
|
14
|
-
|
15
|
-
|
16
|
-
|
18
|
+
puts "请输入您要放此工程的位置:"
|
19
|
+
val = gets
|
20
|
+
val = val.chop
|
21
|
+
path = val + "/YDNativeFlutterBridge"
|
22
|
+
puts "您的工程的路径为" + val + path
|
23
|
+
PathManager.inputPath(path)
|
24
|
+
puts "git clone ..."
|
25
|
+
|
26
|
+
system 'cd ' + val +'; git clone git@gitlab.corp.youdao.com:luna-dev/YDNativeFlutterBridge.git;'
|
27
|
+
system 'cd ' + path + ';git submodule init;git submodule update;'
|
17
28
|
end
|
18
29
|
|
19
30
|
def self.init_flutter
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
31
|
+
puts "正在配置flutter环境"
|
32
|
+
outputs = File.dirname(__FILE__)
|
33
|
+
outputs = outputs.chop.chop.chop.chop #看到这行代码别骂作者,作者也不熟悉ruby,这个意思是说去除/lib
|
34
|
+
puts outputs
|
35
|
+
system "sh " + outputs + "/install_flutter_env.sh"
|
25
36
|
end
|
26
37
|
|
27
38
|
def self.run_ios
|
28
|
-
|
39
|
+
#ideviceinstaller https://www.jianshu.com/p/92273e86ab2b
|
29
40
|
# system "pod install"
|
41
|
+
if self.isHasProject == false
|
42
|
+
return
|
43
|
+
end
|
30
44
|
p "还没有实现"
|
31
45
|
end
|
32
46
|
|
33
47
|
def self.run_android
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
48
|
+
#https://blog.csdn.net/tymatlab/article/details/80989769
|
49
|
+
if self.isHasProject == false
|
50
|
+
return
|
51
|
+
end
|
52
|
+
self.flutter_clean
|
53
|
+
self.pub_get
|
54
|
+
#打包
|
55
|
+
system self.cdPathWithAndroidExample + ";./gradlew assembleDebug;"
|
56
|
+
#装载,运行
|
57
|
+
system self.cdPathWithAndroidExample + "/app/build/outputs/apk/debug/;adb install -r app-debug.apk;adb shell am start -n com.example.android_example/.MainActivity;"
|
41
58
|
|
42
59
|
end
|
43
60
|
|
44
61
|
def self.attach
|
45
|
-
|
46
|
-
|
62
|
+
if self.isHasProject == false
|
63
|
+
return
|
64
|
+
end
|
65
|
+
puts "执行 flutter attach"
|
66
|
+
system self.cdPathWithFlutterModule + ";flutter attach;"
|
47
67
|
end
|
48
68
|
|
49
69
|
def self.create_package(packageName)
|
70
|
+
if self.isHasProject == false
|
71
|
+
return
|
72
|
+
end
|
50
73
|
self.checkEnv
|
51
|
-
|
52
|
-
command = "
|
74
|
+
puts "创建flutter package"
|
75
|
+
command = self.cdPathWithFlutterModule + "/Business;flutter create --template=package " + packageName
|
76
|
+
p command
|
53
77
|
system command
|
54
|
-
p "~/YDDictFlutter/YDNativeFlutterBridge/Embed/flutter_module/Business/" + packageName
|
55
78
|
end
|
56
79
|
|
57
80
|
def self.pub_get
|
58
|
-
|
81
|
+
if self.isHasProject == false
|
82
|
+
return
|
83
|
+
end
|
84
|
+
system self.cdPathWithFlutterModule + ";sh flutter_pub_get.sh"
|
59
85
|
end
|
60
86
|
|
61
87
|
def self.flutter_clean
|
62
|
-
|
88
|
+
if self.isHasProject == false
|
89
|
+
return
|
90
|
+
end
|
91
|
+
system self.cdPathWithFlutterModule + ";flutter clean;"
|
63
92
|
end
|
64
93
|
|
65
94
|
def self.checkEnv
|
@@ -70,21 +99,77 @@ module Dfb
|
|
70
99
|
def self.checkFlutter
|
71
100
|
outputs = system 'flutter --version'
|
72
101
|
if outputs == nil
|
73
|
-
|
102
|
+
puts '安装flutter...'
|
74
103
|
self.init_flutter
|
75
104
|
else
|
76
|
-
|
105
|
+
puts '已安装flutter环境'
|
77
106
|
end
|
78
107
|
end
|
79
108
|
|
80
109
|
def self.checkProject
|
81
|
-
outputs = system
|
110
|
+
outputs = system self.cdPathWithFlutterModule + ";"
|
82
111
|
if outputs == false
|
83
|
-
|
112
|
+
puts '工程已存在'
|
84
113
|
else
|
85
|
-
|
114
|
+
puts '正在下载工程..'
|
86
115
|
self.clone
|
87
116
|
end
|
88
117
|
end
|
89
|
-
|
118
|
+
|
119
|
+
def self.isHasProject
|
120
|
+
outputs = system self.cdPathWithFlutterModule + ";"
|
121
|
+
if outputs == false
|
122
|
+
puts '工程不存在'
|
123
|
+
return false
|
124
|
+
else
|
125
|
+
return true
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
def self.changePath
|
130
|
+
puts "如果您的工程是YDNativeFlutterBridge 路径是 /Users/chedch/YDDictFlutter/YDNativeFlutterBridge,则输入此路径"
|
131
|
+
puts "请输入您的新的YDNativeFlutterBridge工程路径:"
|
132
|
+
|
133
|
+
val = gets
|
134
|
+
if val =~ /(.*)\/YDNativeFlutterBridge/
|
135
|
+
PathManager.inputPath(val.chop)
|
136
|
+
else
|
137
|
+
puts "'change path' fails"
|
138
|
+
end
|
139
|
+
|
140
|
+
end
|
141
|
+
|
142
|
+
def self.projectPath
|
143
|
+
return PathManager.outputPath
|
144
|
+
end
|
145
|
+
|
146
|
+
def self.cdPath(path)
|
147
|
+
if PathManager.containsPath
|
148
|
+
puts '当前目录:'
|
149
|
+
puts self.projectPath + path
|
150
|
+
return "cd " + self.projectPath + path
|
151
|
+
else
|
152
|
+
puts "路径有错误"
|
153
|
+
return ""
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
def self.cdPathWithFlutterModule
|
158
|
+
self.cdPath("/Embed/flutter_module")
|
159
|
+
end
|
160
|
+
|
161
|
+
def self.cdPathWithAndroidExample
|
162
|
+
self.cdPath("/android_example")
|
163
|
+
end
|
90
164
|
end
|
165
|
+
|
166
|
+
# Dfb.changePath("/user/asdfadfasdf/sdfasdf/user/asdfadfasdf/sdfasdf/user/asdfadfasdf/sdfasdf/user/asdfadfasdf/sdfasdf/user/asdfadfasdf/sdfasdf/user/asdfadfasdf/sdfasdf/user/asdfadfasdf/sdfasdf/user/asdfadfasdf/sdfasdf/user/asdfadfasdf/sdfasdf")
|
167
|
+
# Dfb.systemCDInProject
|
168
|
+
Dfb.attach
|
169
|
+
# Dfb.systemCDInProject
|
170
|
+
# Dfb.changePath
|
171
|
+
# Dfb.run_android
|
172
|
+
# Dfb.cdPathWithFlutterModule
|
173
|
+
# Dfb.cdPathWithAndroidExample
|
174
|
+
|
175
|
+
|
data/lib/dfb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dfb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- chedechao
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-12-
|
11
|
+
date: 2019-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -90,6 +90,12 @@ files:
|
|
90
90
|
- dfb-0.0.8.gem
|
91
91
|
- dfb-0.0.9.gem
|
92
92
|
- dfb-1.0.0.gem
|
93
|
+
- dfb-1.0.1.gem
|
94
|
+
- dfb-1.0.2.gem
|
95
|
+
- dfb-1.0.3.gem
|
96
|
+
- dfb-1.0.4.gem
|
97
|
+
- dfb-1.0.5.gem
|
98
|
+
- dfb-1.0.6.gem
|
93
99
|
- dfb.gemspec
|
94
100
|
- dfb.rdoc
|
95
101
|
- features/dfb.feature
|