blertr 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,4 +2,4 @@
2
2
  :username: blertr.app
3
3
  :password: The.blert$
4
4
  :to: vlandham@gmail.com
5
- :time: 300
5
+ :time: 360
@@ -14,7 +14,9 @@ module Blertr
14
14
  if !File.exists?(@path)
15
15
  create
16
16
  end
17
- yaml_data = YAML::load(open(@path))
17
+ file = File.open(@path, 'r')
18
+ yaml_data = YAML::load(file)
19
+ file.close
18
20
  @list = yaml_data.to_a if yaml_data
19
21
  end
20
22
 
@@ -6,7 +6,9 @@ module Blertr
6
6
  def self.options_for name
7
7
  rtn = {}
8
8
  if File.exists? config_file_for(name)
9
- yaml_data = YAML::load(open(config_file_for(name)))
9
+ file = File.open(config_file_for(name),'r')
10
+ yaml_data = YAML::load(file)
11
+ file.close
10
12
  if yaml_data
11
13
  rtn = Hash[yaml_data.map {|k,v| [k.to_sym, v]}]
12
14
  end
@@ -15,10 +17,14 @@ module Blertr
15
17
  end
16
18
 
17
19
  def self.save_options_for name, new_options
20
+ begin
18
21
  file = config_file_for name
19
22
  File.open(file, 'w') do |file|
20
23
  file.puts(YAML::dump(new_options))
21
24
  end
25
+ rescue
26
+ puts "problem saving options"
27
+ end
22
28
  end
23
29
 
24
30
  def self.remove_optons_for name
@@ -1,3 +1,3 @@
1
1
  module Blertr
2
- VERSION = "0.2.0".freeze
2
+ VERSION = "0.2.1".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blertr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: