furion 1.0.3 → 1.0.4
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 +4 -4
- data/bin/furion +2 -2
- data/lib/furion.rb +14 -5
- data/lib/furion/file_editor.rb +64 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca26a733e31772883880213f408db1eced1b5e3f1a48a95c929a171c8ce80784
|
4
|
+
data.tar.gz: 653e973ed7f887dbeabc9f74ae5e829b0a632c3b26f2a8aa491a711025cf38b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bfd9649d727db6827a47c07188311fdfa02bdd39b711d1d2ce4c02166f0f1131d0f4fbb52da11f6498b02459b86ca3462091fbe69549ae164c3d1c7770229f15
|
7
|
+
data.tar.gz: 85ae79eeb1fb27bb225165546238791879d48d97e32ba0af5ea00b5c3cf69374c90c7fb600f5d538aebbc2b94fe5cc6c64da3c9d817332167bb481afd35e6ea1
|
data/bin/furion
CHANGED
@@ -21,10 +21,10 @@ OptionParser.new do |opts|
|
|
21
21
|
opts.on("-v", "--version", "Prints version") do |dh|
|
22
22
|
puts "1.0.3"
|
23
23
|
end
|
24
|
-
opts.on("
|
24
|
+
opts.on("init", "run wrapper pick workflow") do |dh|
|
25
25
|
Furion.makeConfig
|
26
26
|
end
|
27
|
-
opts.on("
|
27
|
+
opts.on("create", "Create project") do |dh|
|
28
28
|
puts "to be continue"
|
29
29
|
end
|
30
30
|
end.parse!
|
data/lib/furion.rb
CHANGED
@@ -1,24 +1,33 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
1
2
|
|
2
3
|
require 'json'
|
3
4
|
require 'plist'
|
4
5
|
require 'open-uri'
|
6
|
+
require 'furion/file_editor'
|
5
7
|
class Furion
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
8
|
+
|
9
|
+
def self.fetchFile(fileName)
|
10
|
+
uri = "https://git.huya.com/chenguohao2/FurionTemplateResource/raw/master/"+fileName
|
11
|
+
data = open(uri){|f| f.read}
|
12
|
+
file = File.new fileName, 'w+'
|
10
13
|
file.binmode
|
11
14
|
file << data
|
12
15
|
file.flush
|
13
16
|
file.close
|
14
|
-
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.makeConfig
|
20
|
+
self.fetchFile("GenConfig.py")
|
21
|
+
self.fetchFile("furionpod")
|
15
22
|
result = `python GenConfig.py `
|
16
23
|
File.write('data.json', result)
|
17
24
|
puts "finish writting"
|
25
|
+
FileEditor.editPodfile
|
18
26
|
`plutil -convert xml1 data.json -o MTPSDK.plist`
|
19
27
|
File.delete('data.json')
|
20
28
|
puts "Config finished, run 'pod install' to continue "
|
21
29
|
end
|
22
30
|
end
|
31
|
+
Furion.makeConfig
|
23
32
|
|
24
33
|
|
@@ -0,0 +1,64 @@
|
|
1
|
+
|
2
|
+
require 'json'
|
3
|
+
require 'plist'
|
4
|
+
require 'find'
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
class FileEditor
|
9
|
+
$wrapperGitUrl = "'https://git.huya.com/MTP/Wrapper-Specs.git'"
|
10
|
+
def self.getCuriOSProjName
|
11
|
+
Find.find(Dir::pwd) do |path|
|
12
|
+
if path.end_with? ".xcodeproj" and File.directory? path
|
13
|
+
return File.basename(path, ".*")
|
14
|
+
break
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.editPodfile
|
20
|
+
projName = self.getCuriOSProjName
|
21
|
+
File.open("_Podfile", "w") do |out|
|
22
|
+
hasSource = false
|
23
|
+
hasAddRequire = false
|
24
|
+
File.foreach("Podfile") do |line|
|
25
|
+
if !hasAddRequire
|
26
|
+
out.puts "source " + $wrapperGitUrl
|
27
|
+
out.puts "load 'furionpod'"
|
28
|
+
hasAddRequire = true
|
29
|
+
end
|
30
|
+
out.puts line
|
31
|
+
|
32
|
+
# if line =~ /#*source +'[a-zA-z]+:\/\/[^\s]*'/
|
33
|
+
# hasSource = true
|
34
|
+
# puts "found it"
|
35
|
+
# else
|
36
|
+
# if hasSource
|
37
|
+
#
|
38
|
+
# end
|
39
|
+
# hasSource = false
|
40
|
+
# end
|
41
|
+
|
42
|
+
if line =~ /target +'#{projName}'/
|
43
|
+
puts "target "+projName
|
44
|
+
out.puts " loadFurionConfigPod()"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
File.delete("Podfile")
|
50
|
+
File.rename("_Podfile","Podfile")
|
51
|
+
end
|
52
|
+
|
53
|
+
def loadWrapperExample
|
54
|
+
|
55
|
+
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: furion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MTP Huya
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: MTP Huya is the best!!!
|
14
14
|
email: mtphuya@yandex.com
|
@@ -19,6 +19,7 @@ extra_rdoc_files: []
|
|
19
19
|
files:
|
20
20
|
- bin/furion
|
21
21
|
- lib/furion.rb
|
22
|
+
- lib/furion/file_editor.rb
|
22
23
|
homepage: https://rubygems.org/gems/furion
|
23
24
|
licenses:
|
24
25
|
- MIT
|