ztodo 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile.lock CHANGED
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ztodo (1.0.0)
4
+ ztodo (1.2.0)
5
+ colorize
5
6
 
6
7
  GEM
7
8
  remote: https://rubygems.org/
data/lib/ztodo/project.rb CHANGED
@@ -66,8 +66,19 @@ class Ztodo::Project
66
66
 
67
67
  # Create task (but not add it to data)
68
68
  def create
69
- {:key=>'key', :description=>'put description here',
70
- :done=>false, :priority=> Ztodo::Project::NORMAL}
69
+ new_key = 0
70
+
71
+ @data.each do |k, elem|
72
+ begin
73
+ curr = elem[:key].to_s.to_i
74
+ new_key = curr if new_key < curr
75
+ rescue
76
+ end
77
+ end
78
+
79
+ new_key += 1
80
+ {:key=>new_key.to_s, :description=>'put description here',
81
+ :done=>false, :priority=> Ztodo::Project::NORMAL}
71
82
  end
72
83
 
73
84
  end
data/lib/ztodo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ztodo
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ztodo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-18 00:00:00.000000000 Z
12
+ date: 2012-11-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: colorize