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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3fb4d8ffc35157aac81808cd5e12e1fb85b9bf78988116b619ddd70405b5f35a
4
- data.tar.gz: 5e6ee38df3baef7c75dd81938c2d4a61cde5b2b8eb523e9c1072f488a7565ff9
3
+ metadata.gz: c604e63ad8aeab75feb1ead6b1bb9439811ffa44dfc63fb229b7e831fb99afa3
4
+ data.tar.gz: 2f1bd033a4932fd960b7634f6adb5f503d2127095e3431bc23cafe7c7885a2c9
5
5
  SHA512:
6
- metadata.gz: 86b68d4e1cdf615ce5782274615164c8a53d3b533a05a9819ddcbaba9d7becce25f7f927a60a6154972ed8f0e1f624f7d42d6407dacb172cb46ae8fc86529bff
7
- data.tar.gz: 4f3ad3bee8c71fa73fe058079189e4fe77abf13e8f51cf88437f8644f9df60b71e4a68ba81d52847833767385fb89befdc762f94e85441e928557c269b2d7fd4
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"
@@ -103,4 +103,4 @@ class Furion
103
103
  end
104
104
  end
105
105
 
106
-
106
+ FurionVersion.checkUpdate
@@ -1,7 +1,12 @@
1
1
 
2
2
 
3
- $CurrentFurionVerion = "1.0.11"
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
- puts dict["version"]
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
- autoUpdate
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
- end
25
-
26
- def self.autoUpdate
27
- result = `gem update furion`
28
- puts result
33
+ return 1
29
34
  end
30
35
 
31
36
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: furion
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.11
4
+ version: 1.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - MTP Huya