milkman 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ed084fc316eb5e7092bc447b6784b49cb4761bc6
4
- data.tar.gz: 87a261589670a17d73fd7bc78502bbbc8bb9231a
3
+ metadata.gz: bcbe00c8902d41030eeabf7211e8da5dd205f608
4
+ data.tar.gz: d7366b2f124299abc54ae0e38c0c398e5c0b1f8b
5
5
  SHA512:
6
- metadata.gz: e88fc8802a1c97541aafe654951f551e6fc2de6a85b3335d745e4b5473fc5985e8e155f6f76d1bd6363e7b5e658246dd9603f9374521fd5846b9e0504f3165f6
7
- data.tar.gz: dce35f2574c2bd334e27f859a9bff04291cc9734db74dba722f183c547b327eb52ba83a2c5b1aa16d99d74bd57b6925d84219c1c5fc7872185eec7b99232db99
6
+ metadata.gz: 4e5d97cf0c80ca1faa7f751d80b5523e972b9aa4fd60f7d5a2a547764f56f82c4c03a029672ed8261ea0f9bd7c370a50bfd7627d18e7636c2fc6ab2550ebd084
7
+ data.tar.gz: 022e74eaf5deaacfb6b2c20846836e6a618c7cf1014582b52989eaa056feba9d1fc3743998a97e6da6b660b27d407e026db2313d2fe2e99bcaec13379bfdda67
@@ -3,4 +3,3 @@ script: rspec
3
3
  rvm:
4
4
  - 2.1.5
5
5
  - 2.0.0
6
- - 1.9.3
data/README.md CHANGED
@@ -33,12 +33,12 @@ You can retrieve an API key and shared secret from the official Remember The Mil
33
33
  ### Run the `milkman` executable
34
34
 
35
35
  milkman authorize API_KEY SHARED_SECRET
36
-
36
+
37
37
  Something like the following will be shown to you:
38
38
 
39
39
  Copy the URL below and follow the steps on Remember The Milk (RTM) to authorize Milkman:
40
40
 
41
- http://www.rememberthemilk.com/services/auth/?api_key=API_KEY&shared_secret=SHARED_SECRET&perms=read&format=json&api_sig=08da0d11ef239318027364133ac1a644
41
+ https://www.rememberthemilk.com/services/auth/?api_key=API_KEY&perms=read&format=json&v=2&api_sig=08da0d11ef239318027364133ac1a644
42
42
 
43
43
  Once you've authorized Milkman, you'll receive a hash called 'frob' from Remember The Milk. The page from Remember The Milk will list something like the following: 'No callback URL specified for this API key. Your frob value is YOUR_FROB'. Copy and paste that YOUR_FROB value below and press <enter>:
44
44
 
@@ -48,12 +48,16 @@ Copy the URL (as requested) and paste it in your browser. Next copy the frob fro
48
48
 
49
49
  Both the auth token, API key and shared secret are listed below. Save them using one of the methods above (or perhaps another solution) as you'll need all of them to use Milkman in your own project. Oh, and Remember... The Milk!
50
50
 
51
- api_key: API_KEY
51
+ api_key: API_KEY
52
52
  shared_secret: SHARED_SECRET
53
53
  auth_token: AUTH_TOKEN
54
54
 
55
55
  Take note of the variables and save them, since you'll need them to use Milkman.
56
56
 
57
+ ## Remember The Milk API version
58
+
59
+ From Milkman version 0.0.5 and onwards Milkman will use RTM API version 2 by default.
60
+
57
61
  ## Using Milkman
58
62
 
59
63
  Using Milkman is easy. All you need to know is that all calls go through the `Milkman::Client` class. Specifically it's `get` method. Let's say you want to retrieve all your tasks from RTM. Well, there's a method for that and it's called: `rtm.tasks.getList`. More information about that method can be found [here](https://www.rememberthemilk.com/services/api/methods/rtm.tasks.getList.rtm).
@@ -65,7 +69,7 @@ In order to retrieve the above information, we'll need an instance of the Milkma
65
69
  ```ruby
66
70
  client = Milkman::Client.new api_key: API_KEY, shared_secret: SHARED_SECRET, auth_token: AUTH_TOKEN
67
71
  ```
68
-
72
+
69
73
  That's it.
70
74
 
71
75
  ### Milking the cow, err... Calling our method
@@ -75,7 +79,7 @@ Now, let's call our `rtm.tasks.getList` method:
75
79
  ```ruby
76
80
  client.get "rtm.tasks.getList"
77
81
  ```
78
-
82
+
79
83
  The above call will return every task you have. As can be seen on the [API page](https://www.rememberthemilk.com/services/api/methods/rtm.tasks.getList.rtm) of the above method, there are a couple of optional parameters, like `list_id`, `filter` and `last_sync`. These can be used as follows:
80
84
 
81
85
  ```ruby
@@ -2,8 +2,9 @@ require "i18n"
2
2
 
3
3
  module Milkman
4
4
 
5
- AUTH_URL = "https://www.rememberthemilk.com/services/auth/"
6
- BASE_URL = "http://api.rememberthemilk.com/services/rest/"
5
+ AUTH_URL = "https://www.rememberthemilk.com/services/auth/"
6
+ BASE_URL = "http://api.rememberthemilk.com/services/rest/"
7
+ API_VERSION = 2
7
8
 
8
9
  I18n.load_path += Dir.glob(File.join(File.dirname(__FILE__), "locales/*.yml"))
9
10
 
@@ -20,7 +20,7 @@ module Milkman
20
20
  end
21
21
 
22
22
  def default_options
23
- { perms: "delete", format: "json" }
23
+ { perms: "delete", format: "json", v: API_VERSION }
24
24
  end
25
25
 
26
26
  end
@@ -1,3 +1,3 @@
1
1
  module Milkman
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -15,7 +15,7 @@ module Milkman
15
15
  end
16
16
 
17
17
  it "saves a references to the specified options" do
18
- hash = { api_key: "<api_key>", format: "json", perms: "delete" }
18
+ hash = { api_key: "<api_key>", format: "json", perms: "delete", v: 2 }
19
19
  expect(client.options).to eq hash
20
20
  end
21
21
 
@@ -15,7 +15,7 @@ module Milkman
15
15
  end
16
16
 
17
17
  it "saves a references to the specified options" do
18
- hash = { api_key: "foo", format: "json", perms: "delete" }
18
+ hash = { api_key: "foo", format: "json", perms: "delete", v: 2 }
19
19
 
20
20
  expect(client.options).to eq hash
21
21
  end
@@ -66,7 +66,7 @@ module Milkman
66
66
  context "#get" do
67
67
 
68
68
  it "requests a call to the RTM API with the specified method" do
69
- expect(Milkman::Request).to receive(:call).with "http://api.rememberthemilk.com/services/rest/?api_key=foo&perms=delete&format=json&method=method&api_sig=7c861e6ffbe0ce450cdfcc68f7447753"
69
+ expect(Milkman::Request).to receive(:call).with "http://api.rememberthemilk.com/services/rest/?api_key=foo&perms=delete&format=json&v=2&method=method&api_sig=095631780dd0429ec5a8389f89b97cb3"
70
70
 
71
71
  client = described_class.new(options)
72
72
  client.get "method"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: milkman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Tuhumury