furion 1.0.11 → 1.0.12
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 +11 -0
- data/lib/furion.rb +1 -1
- data/lib/furion/version_update.rb +13 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c604e63ad8aeab75feb1ead6b1bb9439811ffa44dfc63fb229b7e831fb99afa3
|
4
|
+
data.tar.gz: 2f1bd033a4932fd960b7634f6adb5f503d2127095e3431bc23cafe7c7885a2c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 813af423dfd89e5c672ab19ef97121534b8a5b8b7039b55fac796ec30b9ca94d0a5d0932d9bba5c99fe04c317d2e674f799a3c485b8d470ba3905344307db6ff
|
7
|
+
data.tar.gz: e43dca55f2f16dac1b0d8635c2d00e6a640b95c7822b525ddf5328f4affa0b54363871050ce4f8498ab88beb6630bec92d75e63fc628e3193a283ef5e96d2145
|
data/bin/furion
CHANGED
@@ -25,10 +25,17 @@ create [projectname] : create new project with 'projectname'"
|
|
25
25
|
end.parse!
|
26
26
|
|
27
27
|
if ARGV[0] == "init"
|
28
|
+
if FurionVersion.checkUpdate == 0
|
29
|
+
return
|
30
|
+
end
|
28
31
|
Furion.makeConfig
|
29
32
|
end
|
30
33
|
|
31
34
|
if ARGV[0] == "create"
|
35
|
+
if FurionVersion.checkUpdate == 0
|
36
|
+
return
|
37
|
+
end
|
38
|
+
|
32
39
|
name = ARGV[1]
|
33
40
|
if name == nil
|
34
41
|
puts "please input project name"
|
@@ -51,7 +58,11 @@ if ARGV[0] == "confdet"
|
|
51
58
|
end
|
52
59
|
|
53
60
|
if ARGV[0] == "update"
|
61
|
+
if FurionVersion.checkUpdate == 0
|
62
|
+
return
|
63
|
+
end
|
54
64
|
Furion.updateConfig
|
65
|
+
|
55
66
|
end
|
56
67
|
|
57
68
|
if ARGV[0] == "checkUpdate"
|
data/lib/furion.rb
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
|
2
2
|
|
3
|
-
$CurrentFurionVerion = "1.0.
|
3
|
+
$CurrentFurionVerion = "1.0.12"
|
4
4
|
$CheckVersionURL = "https://rubygems.org/api/v1/gems/furion.json"
|
5
|
+
|
6
|
+
class String
|
7
|
+
def red; "\033[31m#{self}\033[0m" end
|
8
|
+
end
|
9
|
+
|
5
10
|
class FurionVersion
|
6
11
|
|
7
12
|
def self.getCurVersion
|
@@ -11,21 +16,21 @@ class FurionVersion
|
|
11
16
|
def self.getLatestVersion
|
12
17
|
data = open($CheckVersionURL){|f| f.read}
|
13
18
|
dict = JSON.parse(data)
|
14
|
-
|
19
|
+
return dict["version"]
|
15
20
|
end
|
16
21
|
|
17
22
|
|
23
|
+
|
18
24
|
def self.checkUpdate
|
19
25
|
curVersion = getCurVersion
|
20
26
|
latestVersion = getLatestVersion
|
27
|
+
|
21
28
|
if curVersion != latestVersion
|
22
|
-
|
29
|
+
content = "new version:["+ latestVersion +"] detected\ncurrent:["+curVersion+"]\nto update: 'sudo gem install furion' "
|
30
|
+
puts content.red
|
31
|
+
return 0
|
23
32
|
end
|
24
|
-
|
25
|
-
|
26
|
-
def self.autoUpdate
|
27
|
-
result = `gem update furion`
|
28
|
-
puts result
|
33
|
+
return 1
|
29
34
|
end
|
30
35
|
|
31
36
|
end
|