dev_projects 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/projects.rb +5 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 616993352822865dd04ba548362f4f5a9acc826b
|
4
|
+
data.tar.gz: f84d0e04d5ab8971634785d2c7b435a884027e8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f204f8f17bb74114ff72e6a823472ab22f9da3e875110e18e3618f6b6ac62534bd6888f33e63f271cad31ba5aac7ae69627581ff3ee6991ac574db7114ea42d8
|
7
|
+
data.tar.gz: c3281862e257cc790e3e31df750acb94e9a08019f01106db4af322e3628beb112a0d83ecd3bdf639dbb9c7503a428bd6453127ae44f5703b776ab1595fdfa7ec
|
data/lib/projects.rb
CHANGED
@@ -4,6 +4,10 @@ require 'json'
|
|
4
4
|
class Projects < Hash
|
5
5
|
attr_accessor :filename
|
6
6
|
|
7
|
+
def initialize
|
8
|
+
@filename=''
|
9
|
+
end
|
10
|
+
|
7
11
|
def update
|
8
12
|
self.each{|k,v|
|
9
13
|
self[k]=Project.new(v) if(v.is_a?(String))
|
@@ -13,7 +17,7 @@ class Projects < Hash
|
|
13
17
|
end
|
14
18
|
|
15
19
|
def save filename=''
|
16
|
-
@filename=filename if filename.length > 0
|
20
|
+
@filename=filename if !filename.nil? && filename.length > 0
|
17
21
|
File.open(@filename,'w'){|f|f.write(self.to_json)} if @filename.length > 0
|
18
22
|
end
|
19
23
|
|