dev_projects 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/project.rb +8 -3
- 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: f9226d313b6618f821088856b6fa4d98899a9a35
|
4
|
+
data.tar.gz: 344cdba01396f8f8479c94531a22edb7bfad800d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a806cf26fee880086e7a2aa9a1b9668e784c126ad56999133ca459205a1af97e02e21373f1bf67fa61687417d1810260437bb5382398f9d8efd984491f099690
|
7
|
+
data.tar.gz: 27e3b2c64c13dab0a3c64b62e9b8d449e790a5b022cad02fbc35ba7aa9ed1ce1fd60c57abc5aa662692a4ee7f0e0de326e0d20681e2b2217cc47dc1894261fb9
|
data/lib/project.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
class Project < Hash
|
2
|
-
def initialize
|
2
|
+
def initialize value=''
|
3
3
|
self[:url]=''
|
4
|
+
self[:url] = value if value.is_a?(String)
|
5
|
+
if(value.is_a?(Hash))
|
6
|
+
value.each{|k,v|self[k]=v}
|
7
|
+
end
|
4
8
|
end
|
5
9
|
|
6
10
|
def get_latest_unique_id
|
@@ -13,8 +17,9 @@ class Project < Hash
|
|
13
17
|
end
|
14
18
|
|
15
19
|
def self.load_projects
|
16
|
-
projects=
|
17
|
-
|
20
|
+
projects=Project.new
|
21
|
+
h=JSON.parse(IO.read(projects_filename)) if File.exists?(projects_filename)
|
22
|
+
projects=Project.new(h) if File.exists?(projects_filename)
|
18
23
|
projects
|
19
24
|
end
|
20
25
|
end
|