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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/project.rb +8 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ad29de38be5d07e936f0f82b0eea7dbe01c30d7b
4
- data.tar.gz: 58fa39d331bdf722bef690743030251ba1386a83
3
+ metadata.gz: f9226d313b6618f821088856b6fa4d98899a9a35
4
+ data.tar.gz: 344cdba01396f8f8479c94531a22edb7bfad800d
5
5
  SHA512:
6
- metadata.gz: 8dea78f6227a3df14d957e715cb5bf0943e9c4802ae70f4c1a53a9ccfd508cc455c0d7694e4068466b8ae5a6c0ae32134bc6e063263e266ba9125a91e6461faf
7
- data.tar.gz: 76c55f799885d3d4a21a0ae4b7bbaa910f4ea758aaa8fc09b8c62f32834e6300d9d480793d3ecfb76006380e99422164adada1bb801fc082c59da2b495fba3bf
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=Hash.new
17
- projects=JSON.parse(IO.read(projects_filename)) if File.exists?(projects_filename)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dev_projects
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lou Parslow