gct 0.3.8 → 0.3.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e11a0e8f6fd269b8140df2ad74d54bdd6a49ecf5d3eabea57c34ecd2e9ab6ad5
4
- data.tar.gz: 478a642ec91c9d3c6af390af83860bc9da92d7ea2bbfdf74c451430c2495717e
3
+ metadata.gz: 3916a6b218a57f70b55c78f86fc05ab29bd9c0db6718ba525249a62b6f92b514
4
+ data.tar.gz: bffb1a3d12eba75d4ee371c95c1a0145027d75c5d50e399520a4d7d6b9ac16e7
5
5
  SHA512:
6
- metadata.gz: a07a78b2eadf6986cfe53fe7eb6c714bd69debace24b84e261143d3723df74d63a02e106b63f5e6754a5723201574d617f552849bcb9d804d5409f7b39db0c0c
7
- data.tar.gz: 0356c696a37c07ef54d5ef99f9d6af1df366c852179051820912295a5af5495a7873adca27cf61ad56d3cb54f67b2d5275563508c890543b9fbef577c8f361f4
6
+ metadata.gz: d3e6420ec4067f11b7a72f6406949739abce31b8e0772ecede4dda7653385154dce1e89cb3bc2dc9d0707c8a15c1ff8dfd0639bb84d18d8a2e17f79b235a2c02
7
+ data.tar.gz: 2e8d40284080f8a079137afe3e3c44c336d7294603549811608f33e24c91e016ebbff240c0db30a1db3c0c67ad164c74c8f77f9c0251981057a000a0f177f22c
@@ -9,8 +9,10 @@ module Gct
9
9
 
10
10
  def yaml_write(key, value)
11
11
  begin
12
+ config_map = YAML.load(File.open(@path, "r"))
13
+ config_map[key] = value
12
14
  yaml_file = File.open(@path, "w")
13
- YAML::dump({key => value}, yaml_file)
15
+ YAML::dump(config_map, yaml_file)
14
16
  rescue IOError => e
15
17
  raise e.message
16
18
  ensure
@@ -2,5 +2,5 @@ module Gct
2
2
  # freeze 冻结对象,将对象变成一个常量
3
3
  # unless 右边的代码块成立,才会运行左边的代码块
4
4
  # defined? 是用来判断本地变量是否存在,也可用来判断是否存在方法
5
- VERSION = "0.3.8".freeze unless defined? Gct::VERSION
5
+ VERSION = "0.3.9".freeze unless defined? Gct::VERSION
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gct
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - jieming