furion 1.0.10 → 1.0.11

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: 33e050630738005972a285c19d87fae626442832a08048feec1d27406d628f1f
4
- data.tar.gz: '068fa164b18a1d937ffb31269c217fec0031c24e9c96fc6a47c25556a7e40ad1'
3
+ metadata.gz: 3fb4d8ffc35157aac81808cd5e12e1fb85b9bf78988116b619ddd70405b5f35a
4
+ data.tar.gz: 5e6ee38df3baef7c75dd81938c2d4a61cde5b2b8eb523e9c1072f488a7565ff9
5
5
  SHA512:
6
- metadata.gz: 80f2baf81d9f32d026a3188b275ecbb2c771712c1b6470222aaeeb4a76f91559acb456f866204975d46a5f1d4f903b418665deddb18e2cbe729ca49962a4e159
7
- data.tar.gz: 8a0b25c6ed61ee1e34e14ad0f27688de12e5e7ef5d12cf2a3b98f32c287db672d65888d9680109f8d6538ae7ca39921476546a87d38603023ec3f218d880e8a0
6
+ metadata.gz: 86b68d4e1cdf615ce5782274615164c8a53d3b533a05a9819ddcbaba9d7becce25f7f927a60a6154972ed8f0e1f624f7d42d6407dacb172cb46ae8fc86529bff
7
+ data.tar.gz: 4f3ad3bee8c71fa73fe058079189e4fe77abf13e8f51cf88437f8644f9df60b71e4a68ba81d52847833767385fb89befdc762f94e85441e928557c269b2d7fd4
data/bin/furion CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'furion'
4
4
  require 'optionparser'
5
+ require 'furion/version_update'
5
6
  options = {}
6
7
 
7
8
 
@@ -13,11 +14,11 @@ OptionParser.new do |opts|
13
14
  -h : print the help message
14
15
  init : run wrapper-pick work flow in existed project
15
16
  update : update the config of sdk-wrapper
16
- create
17
- "
17
+ create [projectname] : create new project with 'projectname'"
18
+
18
19
  end
19
20
  opts.on("-v", "--version", "Prints version") do |dh|
20
- puts "1.0.9.1"
21
+ puts FurionVersion.getCurVersion
21
22
  end
22
23
 
23
24
 
@@ -34,9 +35,7 @@ if ARGV[0] == "create"
34
35
  else
35
36
  if name.length > 1
36
37
  Furion.genProj(name)
37
- puts Dir.pwd
38
38
  Dir.chdir name
39
- puts Dir.pwd
40
39
  Furion.makeConfig
41
40
  system("open .")
42
41
  else
@@ -53,4 +52,8 @@ end
53
52
 
54
53
  if ARGV[0] == "update"
55
54
  Furion.updateConfig
55
+ end
56
+
57
+ if ARGV[0] == "checkUpdate"
58
+ FurionVersion.checkUpdate
56
59
  end
data/lib/furion.rb CHANGED
@@ -7,6 +7,8 @@ require 'furion/file_editor'
7
7
  require 'zip'
8
8
  require 'furion/ver_conflict_detector'
9
9
  require 'furion/project_generate'
10
+ require 'rubygems'
11
+ require 'furion/version_update'
10
12
  class Furion
11
13
 
12
14
  def self.fetchFile(fileName)
@@ -95,6 +97,10 @@ class Furion
95
97
  puts "to be continue"
96
98
  end
97
99
  end
100
+
101
+ def self.checkUpdate
102
+ FurionVersion.checkUpdate
103
+ end
98
104
  end
99
105
 
100
106
 
@@ -0,0 +1,31 @@
1
+
2
+
3
+ $CurrentFurionVerion = "1.0.11"
4
+ $CheckVersionURL = "https://rubygems.org/api/v1/gems/furion.json"
5
+ class FurionVersion
6
+
7
+ def self.getCurVersion
8
+ return $CurrentFurionVerion
9
+ end
10
+
11
+ def self.getLatestVersion
12
+ data = open($CheckVersionURL){|f| f.read}
13
+ dict = JSON.parse(data)
14
+ puts dict["version"]
15
+ end
16
+
17
+
18
+ def self.checkUpdate
19
+ curVersion = getCurVersion
20
+ latestVersion = getLatestVersion
21
+ if curVersion != latestVersion
22
+ autoUpdate
23
+ end
24
+ end
25
+
26
+ def self.autoUpdate
27
+ result = `gem update furion`
28
+ puts result
29
+ end
30
+
31
+ end
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.10
4
+ version: 1.0.11
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-12-12 00:00:00.000000000 Z
11
+ date: 2019-12-17 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: MTP Huya is the best!!!
14
14
  email: mtphuya@yandex.com
@@ -22,6 +22,7 @@ files:
22
22
  - lib/furion/file_editor.rb
23
23
  - lib/furion/project_generate.rb
24
24
  - lib/furion/ver_conflict_detector.rb
25
+ - lib/furion/version_update.rb
25
26
  homepage: https://rubygems.org/gems/furion
26
27
  licenses:
27
28
  - MIT