rumember 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 312293d69ef176ee8c456b216f123055d5b04f14
4
+ data.tar.gz: 023c9fc1a6d0de658d44b96267df7fc587447652
5
+ SHA512:
6
+ metadata.gz: b80383d1b96ae875269c465ad791a726f482616cd4a903c8dc52ceeb89d956ec6d779c96fbd597300a750bda22b65f0eda879e8b981293829e39efdff7864d37
7
+ data.tar.gz: 5ca7e7aa7b34047d7f593b12c9a1532522d7ab7d7a75bdbd7b77bcaff223dac0c5780056aafd0ac82bcdde76c265a3289efdd3f037dabcebcc6de8540cf0a9bb
data/Gemfile CHANGED
@@ -1,2 +1,2 @@
1
- source :gemcutter
1
+ source 'https://rubygems.org'
2
2
  gemspec
@@ -9,6 +9,7 @@ class Rumember
9
9
 
10
10
  API_KEY = '36f62f69fba7135e8049adbe307ff9ba'
11
11
  SHARED_SECRET = '0c33513097c09be4'
12
+ API_VERSION = '2'
12
13
 
13
14
  module Dispatcher
14
15
 
@@ -50,11 +51,12 @@ class Rumember
50
51
  exit 130
51
52
  end
52
53
 
53
- attr_reader :api_key, :shared_secret
54
+ attr_reader :api_key, :shared_secret, :api_version
54
55
 
55
- def initialize(api_key = API_KEY, shared_secret = SHARED_SECRET)
56
+ def initialize(api_key = API_KEY, shared_secret = SHARED_SECRET, api_version = API_VERSION)
56
57
  @api_key = api_key
57
58
  @shared_secret = shared_secret
59
+ @api_version = api_version
58
60
  end
59
61
 
60
62
  def api_sig(params)
@@ -65,7 +67,7 @@ class Rumember
65
67
  end
66
68
 
67
69
  def sign(params)
68
- params = params.merge('api_key' => api_key)
70
+ params = params.merge('api_key' => api_key, 'v' => api_version)
69
71
  params.update('api_sig' => api_sig(params))
70
72
  end
71
73
 
@@ -10,9 +10,19 @@ class Rumember
10
10
  {'list_id' => id}
11
11
  end
12
12
 
13
- def tasks
14
- dispatch('tasks.getList')['tasks']['list']['taskseries'].map do |ts|
15
- Task.new(self, ts)
13
+ def tasks(params = {})
14
+ list = dispatch('tasks.getList', params)['tasks']['list']
15
+ if list.kind_of?(Array)
16
+ list.flat_map do |l|
17
+ ll = List.new(@parent, {'id' => l['id']})
18
+ (l['taskseries'].kind_of?(Array) ? l['taskseries'] : [l['taskseries']]).map do |t|
19
+ Task.new(ll, t)
20
+ end
21
+ end
22
+ else
23
+ (list['taskseries'].kind_of?(Array) ? list['taskseries'] : [list['taskseries']]).map do |t|
24
+ Task.new(self, t)
25
+ end
16
26
  end
17
27
  end
18
28
 
@@ -9,6 +9,22 @@ class Rumember
9
9
  Integer(@attributes['task']['id'])
10
10
  end
11
11
 
12
+ def completed?
13
+ !(@attributes['task']['completed'].empty?)
14
+ end
15
+
16
+ def deleted?
17
+ !(@attributes['task']['completed'].empty?)
18
+ end
19
+
20
+ def postponed
21
+ Integer(@attributes['task']['postponed'])
22
+ end
23
+
24
+ def priority
25
+ @attributes['task']['priority'] == "N" ? 0 : Integer(@attributes['task']['priority'])
26
+ end
27
+
12
28
  def tags
13
29
  if @attributes['tags'].empty?
14
30
  []
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "rumember"
3
- s.version = "1.0.1"
3
+ s.version = "1.1.0"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.authors = ["Tim Pope"]
6
6
  s.email = ["code@tpope.n"+'et']
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
13
13
  s.require_paths = ["lib"]
14
14
 
15
- s.add_runtime_dependency("json", ["~> 1.7.0"])
15
+ s.add_runtime_dependency("json", ["~> 1.8.0"])
16
16
  s.add_runtime_dependency("launchy", ["~> 0.3.0"])
17
- s.add_development_dependency("rspec", ["~> 2.5"])
17
+ s.add_development_dependency("rspec", ["~> 2.5.0"])
18
18
  end
metadata CHANGED
@@ -1,49 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rumember
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
5
- prerelease:
4
+ version: 1.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Tim Pope
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-06-30 00:00:00.000000000 Z
11
+ date: 2017-05-06 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: json
16
- requirement: &76895610 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
- version: 1.7.0
19
+ version: 1.8.0
22
20
  type: :runtime
23
21
  prerelease: false
24
- version_requirements: *76895610
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 1.8.0
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: launchy
27
- requirement: &76895360 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
- - - ~>
31
+ - - "~>"
31
32
  - !ruby/object:Gem::Version
32
33
  version: 0.3.0
33
34
  type: :runtime
34
35
  prerelease: false
35
- version_requirements: *76895360
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.3.0
36
41
  - !ruby/object:Gem::Dependency
37
42
  name: rspec
38
- requirement: &76895080 !ruby/object:Gem::Requirement
39
- none: false
43
+ requirement: !ruby/object:Gem::Requirement
40
44
  requirements:
41
- - - ~>
45
+ - - "~>"
42
46
  - !ruby/object:Gem::Version
43
- version: '2.5'
47
+ version: 2.5.0
44
48
  type: :development
45
49
  prerelease: false
46
- version_requirements: *76895080
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 2.5.0
47
55
  description:
48
56
  email:
49
57
  - code@tpope.net
@@ -52,7 +60,7 @@ executables:
52
60
  extensions: []
53
61
  extra_rdoc_files: []
54
62
  files:
55
- - .gitignore
63
+ - ".gitignore"
56
64
  - Gemfile
57
65
  - MIT-LICENSE
58
66
  - README.markdown
@@ -73,26 +81,25 @@ files:
73
81
  - spec/spec_helper.rb
74
82
  homepage: http://github.com/tpope/rumember
75
83
  licenses: []
84
+ metadata: {}
76
85
  post_install_message:
77
86
  rdoc_options: []
78
87
  require_paths:
79
88
  - lib
80
89
  required_ruby_version: !ruby/object:Gem::Requirement
81
- none: false
82
90
  requirements:
83
- - - ! '>='
91
+ - - ">="
84
92
  - !ruby/object:Gem::Version
85
93
  version: '0'
86
94
  required_rubygems_version: !ruby/object:Gem::Requirement
87
- none: false
88
95
  requirements:
89
- - - ! '>='
96
+ - - ">="
90
97
  - !ruby/object:Gem::Version
91
98
  version: '0'
92
99
  requirements: []
93
100
  rubyforge_project:
94
- rubygems_version: 1.8.11
101
+ rubygems_version: 2.6.8
95
102
  signing_key:
96
- specification_version: 3
103
+ specification_version: 4
97
104
  summary: Remember The Milk Ruby API and command line client
98
105
  test_files: []