quanto-ruby 0.0.16 → 0.0.17

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e3bc0b6091f0bdc8e5817acfec8620fa99e5cbc
4
- data.tar.gz: e72e1010d853895ee9ec8d888d1417edb79683fb
3
+ metadata.gz: e07a8c9fabe39d67a1e2387f58820c20901a1d0c
4
+ data.tar.gz: 6bb185d1c3b7e8a9d373da65dc4d3a4d793e560f
5
5
  SHA512:
6
- metadata.gz: 6a7724aa0dec3e3de0b0da0e5b441fbea218ab4ef328a143ab08b11e67126ba2b3995804261afd7d87cf66fe60543e24447024c9c286a12da25a8c76946fb47b
7
- data.tar.gz: fbe00af13ce32d630f49d189f4545fd6fd2ccdc973b9969129479e073b8d3c4d1556809aaf79e003efe0c6d2cad869a096628372c4643d30112e17495dacf5b2
6
+ metadata.gz: c6ad8460d627d1a322a6d015edcc88b033d85ae331049096c3c3ab0f1aeaad5aa6a2402948730258f8684257a60cb9d5465ba2fc8b32743b3e7aa2c7781ad9dc
7
+ data.tar.gz: 2c4a2c30ff04624b59e8f4cda678c92ea0829ede57bc17e71e77074dddc65215eb9d646321cb924034bf96a4096a19e117ac398794b87cc7eefd2da4a1d69834
data/README.md CHANGED
@@ -1,7 +1,5 @@
1
1
  # Quanto::Ruby
2
2
 
3
- TODO: Write a gem description
4
-
5
3
  ## Installation
6
4
 
7
5
  Add this line to your application's Gemfile:
@@ -16,14 +14,56 @@ Or install it yourself as:
16
14
 
17
15
  $ gem install quanto-ruby
18
16
 
19
- ## Usage
17
+ ## Documentation
18
+
19
+ This gem is a simple OAuth client for Quanto.
20
+ Most of the logic is handled by the underlying OAuth2 library, so this gem is simply a wrapper around authenticated API calls.
21
+
22
+ To get started, you can create a client like this:
23
+
24
+ ```ruby
25
+ client = Quanto::Client.new(ENV['QUANTO_KEY'], ENV['QUANTO_SECRET'], access_token: 'my token')
26
+ ```
27
+
28
+ where `'my_token'` should be your actual access token. Once you have a `Client`, you have access to the following methods:
29
+
30
+ - `#record_entry(value, metric_name, options={})`
31
+
32
+ This method records an entry for the given metric in Quanto.
33
+ The optional third argument lets the user specify a date, but the default is today.
34
+ For instance, the following call would record 20 steps for today:
35
+
36
+ ```ruby
37
+ client.record_entry(20, :steps)
38
+ ```
39
+
40
+ while this call would record 137 pushups for April 1st 2013.
41
+
42
+ ```ruby
43
+ client.record_entry(137, :pushups, date: '2013-04-01')
44
+ ```
45
+
46
+ - `#plugin_url`
47
+
48
+ Returns the URL of this plugin on Quanto.
49
+ Useful when redirecting the user after authenticating.
50
+
51
+ - `#activate_plugin`
52
+
53
+ Activates the plugin in Quanto.
54
+ This should be called whenever the plugin has successfully obtained all 3rd party credentials and is ready to send data.
20
55
 
21
- TODO: Write usage instructions here
56
+ - `#metrics`
22
57
 
23
- ## Contributing
58
+ Returns a list of metrics enabled for the current plugin of the following format:
24
59
 
25
- 1. Fork it
26
- 2. Create your feature branch (`git checkout -b my-new-feature`)
27
- 3. Commit your changes (`git commit -am 'Add some feature'`)
28
- 4. Push to the branch (`git push origin my-new-feature`)
29
- 5. Create new Pull Request
60
+ ```ruby
61
+ [{
62
+ 'name' => 'steps',
63
+ 'metric_type' => 'count',
64
+ },
65
+ {
66
+ 'name' => 'sleep',
67
+ 'metric_type' => 'minutes',
68
+ }]
69
+ ```
@@ -5,7 +5,7 @@ module Quanto
5
5
  class Client
6
6
 
7
7
  API_VERSION = "1"
8
- QUANTO_URL = "http://tryquanto.com"
8
+ QUANTO_URL = "http://quanto.herokuapp.com"
9
9
 
10
10
  def initialize(consumer_key, consumer_secret, options = {})
11
11
  @consumer =
@@ -1,3 +1,3 @@
1
1
  module Quanto
2
- VERSION = "0.0.16"
2
+ VERSION = "0.0.17"
3
3
  end
@@ -23,7 +23,7 @@ describe Quanto::Client do
23
23
 
24
24
  it 'passes the quanto URL' do
25
25
  expect(OAuth2::Client).to receive(:new) do |key, secret, options|
26
- expect(options[:site]).to eq('http://tryquanto.com')
26
+ expect(options[:site]).to eq('http://quanto.herokuapp.com')
27
27
  end
28
28
  Quanto::Client.new(consumer_key, consumer_secret)
29
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quanto-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rasmus Rygaard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-19 00:00:00.000000000 Z
11
+ date: 2015-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth2