fitbit_api 0.8.2 → 0.8.3

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
  SHA256:
3
- metadata.gz: a3e997f500cb5e13f629c70ee4a960e449204dd4c0568721277b3adeb397277f
4
- data.tar.gz: 6b5168a42468309c215a56d988166ff4fb32398df29790c52c28b04c8c6a9423
3
+ metadata.gz: 3c18d864ec416bee1e27c1b468d524bb8404e63076ba7652917270271d1eea58
4
+ data.tar.gz: 6487033355317ece6cbac6eb43a2b744e975d48b524d88dd4c4378221b96e7e8
5
5
  SHA512:
6
- metadata.gz: 5b864be3c323e0c912b26e4d45af8a5c7827e0d1d5431a68712ccc169a63e3c063b6fc0040e6d76fa2675a1ea4a10b7ac2b577683d670d21f0aee8f65de6ecc0
7
- data.tar.gz: 7f35266d3f1454f61e3f207b2f709400643b2adcb31a29a8b783b2fbbf72805feb05948df48bebedc1c3ec4e3d6746da72ee7f3c78389184c5ed071c72c402b2
6
+ metadata.gz: 3146e0990d97885808beb6db94a877003af2ed3847ee135ceea082199d8623fdb54301fd66218e5e7b52629d513d70e53231a0a3deb23e229e98af0ce762b1fb
7
+ data.tar.gz: 0b94b009192e261dde7ba9e98119dbc942290b12792113d858af621b34158a96f7f206d9cb35b0ba2334dc7f4cfd0b836e30c59102ce4e12d38e14c71bfc18a0
@@ -1,4 +1,8 @@
1
- 0.8.1
1
+ 0.8.3
2
+ -----
3
+ - Fix bug regarding optional `params` parsing for GET requests.
4
+
5
+ 0.8.2
2
6
  -----
3
7
  - Fix `#activity_logs_list` to allow passing in expected URL params.
4
8
 
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2017 Zoran Pesic
3
+ Copyright (c) 2018 Zoran Pesic
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -56,14 +56,15 @@ module FitbitAPI
56
56
  # * +:limit+ - the max of the number of entries returned (max: 20)
57
57
 
58
58
  def activity_logs_list(opts={})
59
- params = {}
59
+ opts[:params] = {}
60
60
  param_defaults = { before_date: Date.today, after_date: nil, sort: 'desc', limit: 20, offset: 0 }
61
61
 
62
- # merge defaults without overwriting specified values, then split params from options
63
- opts.merge!(param_defaults) { |_key, val, _default| val }
64
- param_defaults.keys.each { |i| params[i] = opts.delete(i) }
62
+ # move param values from top-level opts into :params sub-hash
63
+ param_defaults.each do |key, default_val|
64
+ opts[:params][key] = opts.delete(key) || default_val
65
+ end
65
66
 
66
- get("user/#{user_id}/activities/list.json", opts, params: params)
67
+ get("user/#{user_id}/activities/list.json", opts)
67
68
  end
68
69
 
69
70
  # Returns the details of a specific activity in the Fitbit activities database in the format requested.
@@ -67,7 +67,8 @@ module FitbitAPI
67
67
  }
68
68
  end
69
69
 
70
- def get(path, opts={}, params: {})
70
+ def get(path, opts={})
71
+ params = opts.delete(:params) || {}
71
72
  response = token.get(("#{@api_version}/" + path), params: deep_keys_to_camel_case!(params), headers: request_headers).response
72
73
  object = MultiJson.load(response.body) unless response.status == 204
73
74
  process_keys!(object, opts)
@@ -1,4 +1,4 @@
1
1
  module FitbitAPI
2
- VERSION = '0.8.2'
2
+ VERSION = '0.8.3'
3
3
  REPO_URL = 'https://github.com/zokioki/fitbit_api'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fitbit_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zoran
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-29 00:00:00.000000000 Z
11
+ date: 2018-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth2
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  version: '0'
120
120
  requirements: []
121
121
  rubyforge_project:
122
- rubygems_version: 2.7.3
122
+ rubygems_version: 2.7.6
123
123
  signing_key:
124
124
  specification_version: 4
125
125
  summary: A Ruby interface to the Fitbit Web API.