flumtter 5.7.0 → 5.7.1

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
  SHA1:
3
- metadata.gz: 2efd77a7cd78ad3a4c95efead3ad3f034bf7869a
4
- data.tar.gz: 01e9bd0d32ac39f742722ed21010e896d8d85cb0
3
+ metadata.gz: 51c7dded133a22ce48f92b558a58eb5a0b333b43
4
+ data.tar.gz: be6495df2f9eec385a94b71f9425cd8f12cf45eb
5
5
  SHA512:
6
- metadata.gz: 9334019798f5de8598c81e0b92406f1f7f441dd38a2386407f6178fe857166708d547da5f297cdbdb75b80641edfb04a3de0cedde9e03bf4f33682094d174320
7
- data.tar.gz: ca3d5fbb5ffcc39aa5a3faae8e5b1205b7cdf7132103488fcee4e263e226b1aa7912ce892d4dd6a44ccc91300501151f312130ebc5325259b7b238c804e063ed
6
+ metadata.gz: d2af0637a7d08410679c3c3d169b8fc61e7e8e83f9b69c238a763e540e98d36ae94981310489368a8b4c831a390f53539813d482afb02586d01c3e1d4f6fee05
7
+ data.tar.gz: 0934cc7756cdfa44c78f99778ecf3cc5216a8df9d3ddd749010fdaab5c5b92196abbcb83579166994050d79f48f1e1eaab20fbf766cdb88f468ca252222e41bc
@@ -1,4 +1,5 @@
1
1
  require 'pry'
2
+ require 'json'
2
3
 
3
4
  module Flumtter
4
5
  SourcePath = File.expand_path('../../', __FILE__)
@@ -12,10 +13,22 @@ module Flumtter
12
13
  FileUtils.cp_r(SourcePath.join(".flumtter"), UserPath)
13
14
  end
14
15
 
15
- data_path = UserPath.join("data", "data.bin")
16
- Config = Marshal.load(File.read(data_path)) rescue {}
16
+ old_data_path = UserPath.join("data", "data.bin")
17
+ data_path = UserPath.join("data", "keys.json")
18
+
19
+ Config = if File.exist?(data_path)
20
+ JSON.parse(File.read(data_path), {:symbolize_names => true})
21
+ elsif File.exist?(old_data_path)
22
+ puts "Migrating config data.bin to keys.json"
23
+ config = Marshal.load(File.read(old_data_path)) rescue {}
24
+ File.write(data_path, config.to_json)
25
+ File.unlink(old_data_path)
26
+ puts "Migration Success"
27
+ config
28
+ end
29
+
17
30
  at_exit {
18
- File.write(data_path, Marshal.dump(Config))
31
+ File.write(data_path, Config.to_json)
19
32
  }
20
33
 
21
34
  Thread.abort_on_exception = true
@@ -1,3 +1,3 @@
1
1
  module Flumtter
2
- VERSION = "5.7.0"
2
+ VERSION = "5.7.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flumtter
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.7.0
4
+ version: 5.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - flum1025