dexcom 0.3.0 → 0.3.1

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
  SHA256:
3
- metadata.gz: 318075e2340168e9bdb2f21b974cfd3a434c0726396223938a614fb790d75d6e
4
- data.tar.gz: d24bb4a72533377a0964616efca955920d10817e315be455f544efdec49487cc
3
+ metadata.gz: a9fd13bc624d95fe72f20fb528eade9fc3240282f052450a18a81070d6b2c18f
4
+ data.tar.gz: 0fad9ab7130a00684ffc57bf4daebf6ef2bf50892437bb93590f755a20111575
5
5
  SHA512:
6
- metadata.gz: 9ee214af2ee0be1ec1c2447a6834141d7ddcf1d0c49cd93555c8b40d7436dfeca725146da8fe58a3cb768c1c63e5bc9ceb133894a89c98337c62cdab95c140cc
7
- data.tar.gz: a59ba85426354dce6fbd3d100f69bc53e2570a136f35b39c1ea9bd03791185a5d0aafdbc53ef97533ba4d9466ab2ccde6c9fe2246a9c3aefe4e2e1254bd86999
6
+ metadata.gz: 68ae42721d0b56cf18fb3d1b202f244702f5aa38e8da23c6747ed5ebe5b058093fb56197e35bbd975bfc2061d8ac2c2d223a4bb10f36e038812b4fa6693200d4
7
+ data.tar.gz: f6155dad0b5fb77910260612f6a386481e38885210dccf87291c56c602b2b8a837494a674daf4e9563fdcada49d3ea71098cb2cb0204bdde66e957f3647211b2
data/.circleci/config.yml CHANGED
@@ -29,10 +29,6 @@ common: &common
29
29
 
30
30
 
31
31
  jobs:
32
- "ruby-25":
33
- <<: *common
34
- docker:
35
- - image: circleci/ruby:2.5
36
32
  "ruby-26":
37
33
  <<: *common
38
34
  docker:
@@ -41,10 +37,14 @@ jobs:
41
37
  <<: *common
42
38
  docker:
43
39
  - image: ruby:2.7
40
+ "ruby-30":
41
+ <<: *common
42
+ docker:
43
+ - image: ruby:3.0
44
44
  workflows:
45
45
  version: 2.1
46
46
  build:
47
47
  jobs:
48
- - "ruby-25"
49
48
  - "ruby-26"
50
49
  - "ruby-27"
50
+ - "ruby-30"
data/Gemfile CHANGED
@@ -1,4 +1,3 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
-
data/Gemfile.lock CHANGED
@@ -1,66 +1,67 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dexcom (0.3.0)
4
+ dexcom (0.3.1)
5
5
  activesupport
6
6
  httparty
7
7
 
8
8
  GEM
9
- remote: http://rubygems.org/
9
+ remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (5.2.3)
11
+ activesupport (6.1.4)
12
12
  concurrent-ruby (~> 1.0, >= 1.0.2)
13
- i18n (>= 0.7, < 2)
14
- minitest (~> 5.1)
15
- tzinfo (~> 1.1)
16
- addressable (2.7.0)
13
+ i18n (>= 1.6, < 2)
14
+ minitest (>= 5.1)
15
+ tzinfo (~> 2.0)
16
+ zeitwerk (~> 2.3)
17
+ addressable (2.8.0)
17
18
  public_suffix (>= 2.0.2, < 5.0)
18
- climate_control (0.2.0)
19
+ climate_control (1.0.1)
19
20
  coderay (1.1.3)
20
- concurrent-ruby (1.1.5)
21
- crack (0.4.3)
22
- safe_yaml (~> 1.0.0)
23
- diff-lcs (1.3)
24
- factory_bot (5.0.2)
25
- activesupport (>= 4.2.0)
21
+ concurrent-ruby (1.1.9)
22
+ crack (0.4.5)
23
+ rexml
24
+ diff-lcs (1.4.4)
25
+ factory_bot (6.2.0)
26
+ activesupport (>= 5.0.0)
26
27
  hashdiff (1.0.1)
27
- httparty (0.18.0)
28
+ httparty (0.18.1)
28
29
  mime-types (~> 3.0)
29
30
  multi_xml (>= 0.5.2)
30
- i18n (1.6.0)
31
+ i18n (1.8.10)
31
32
  concurrent-ruby (~> 1.0)
32
33
  method_source (1.0.0)
33
34
  mime-types (3.3.1)
34
35
  mime-types-data (~> 3.2015)
35
- mime-types-data (3.2020.0512)
36
- minitest (5.11.3)
36
+ mime-types-data (3.2021.0704)
37
+ minitest (5.14.4)
37
38
  multi_xml (0.6.0)
38
39
  pry (0.13.1)
39
40
  coderay (~> 1.1)
40
41
  method_source (~> 1.0)
41
- public_suffix (4.0.5)
42
- rspec (3.9.0)
43
- rspec-core (~> 3.9.0)
44
- rspec-expectations (~> 3.9.0)
45
- rspec-mocks (~> 3.9.0)
46
- rspec-core (3.9.2)
47
- rspec-support (~> 3.9.3)
48
- rspec-expectations (3.9.2)
42
+ public_suffix (4.0.6)
43
+ rexml (3.2.5)
44
+ rspec (3.10.0)
45
+ rspec-core (~> 3.10.0)
46
+ rspec-expectations (~> 3.10.0)
47
+ rspec-mocks (~> 3.10.0)
48
+ rspec-core (3.10.1)
49
+ rspec-support (~> 3.10.0)
50
+ rspec-expectations (3.10.1)
49
51
  diff-lcs (>= 1.2.0, < 2.0)
50
- rspec-support (~> 3.9.0)
51
- rspec-mocks (3.9.1)
52
+ rspec-support (~> 3.10.0)
53
+ rspec-mocks (3.10.2)
52
54
  diff-lcs (>= 1.2.0, < 2.0)
53
- rspec-support (~> 3.9.0)
54
- rspec-support (3.9.3)
55
- safe_yaml (1.0.5)
56
- thread_safe (0.3.6)
55
+ rspec-support (~> 3.10.0)
56
+ rspec-support (3.10.2)
57
57
  timecop (0.9.1)
58
- tzinfo (1.2.5)
59
- thread_safe (~> 0.1)
60
- webmock (3.8.3)
58
+ tzinfo (2.0.4)
59
+ concurrent-ruby (~> 1.0)
60
+ webmock (3.13.0)
61
61
  addressable (>= 2.3.6)
62
62
  crack (>= 0.3.2)
63
63
  hashdiff (>= 0.4.0, < 2.0.0)
64
+ zeitwerk (2.4.2)
64
65
 
65
66
  PLATFORMS
66
67
  ruby
@@ -76,4 +77,4 @@ DEPENDENCIES
76
77
  webmock
77
78
 
78
79
  BUNDLED WITH
79
- 2.0.2
80
+ 2.2.21
data/lib/dexcom.rb CHANGED
@@ -6,14 +6,4 @@ require 'dexcom/configuration'
6
6
  require 'dexcom/constants'
7
7
  require 'dexcom/version'
8
8
 
9
- module Dexcom
10
- class << self
11
- def configuration
12
- @configuration ||= Configuration.new
13
- end
14
-
15
- def configure
16
- yield configuration
17
- end
18
- end
19
- end
9
+ module Dexcom; end
@@ -1,9 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'httparty'
3
+ require 'utils/httparty_configured'
4
4
 
5
5
  module Dexcom
6
6
  class Authentication
7
+ include ::Utils::HTTPartyConfigured
8
+
7
9
  class << self
8
10
  def access_token
9
11
  refresh_access_token if @access_token.nil?
@@ -1,8 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'utils/httparty_configured'
4
+
3
5
  module Dexcom
4
6
  module BloodGlucoseUtils
5
7
  module ApiHandler
8
+ include ::Utils::HTTPartyConfigured
9
+
6
10
  MAX_MINUTES = 1440
7
11
 
8
12
  def make_api_request(number_of_values)
@@ -2,16 +2,37 @@
2
2
 
3
3
  module Dexcom
4
4
  class Configuration
5
- attr_accessor :username, :password, :outside_usa
5
+ attr_accessor :username, :password, :outside_usa, :logger, :log_level
6
+
7
+ DEFAULT_LOGGER = nil
8
+ DEFAULT_LOGGER_LEVEL = :info
6
9
 
7
10
  def initialize
8
11
  @username = nil
9
12
  @password = nil
10
13
  @outside_usa = nil
14
+ @logger = DEFAULT_LOGGER
15
+ @log_level = DEFAULT_LOGGER_LEVEL
11
16
  end
12
17
 
13
18
  def base_url
14
19
  outside_usa ? URL_BASE_OUTSIDE_USA : URL_BASE
15
20
  end
16
21
  end
22
+
23
+ class << self
24
+ def configuration
25
+ @configuration ||= Configuration.new
26
+ end
27
+
28
+ def configuration=(config)
29
+ raise StandardError('Invalid configuration provided') unless config.is_a? Dexcom::Configuration
30
+
31
+ @configuration = config
32
+ end
33
+
34
+ def configure
35
+ yield configuration
36
+ end
37
+ end
17
38
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dexcom
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.1'
5
5
  end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'httparty'
4
+
5
+ require 'dexcom/configuration'
6
+
7
+ module Utils
8
+ module HTTPartyConfigured
9
+ include HTTParty
10
+
11
+ config = Dexcom.configuration
12
+
13
+ unless config.logger.nil?
14
+ logger config.logger, config.log_level, :apache
15
+ debug_output config.logger if config.log_level == :debug
16
+ end
17
+ end
18
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dexcom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Gascon
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-06 00:00:00.000000000 Z
11
+ date: 2021-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -136,7 +136,7 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
- description:
139
+ description:
140
140
  email: alexgascon.93@gmail.com
141
141
  executables: []
142
142
  extensions: []
@@ -158,11 +158,12 @@ files:
158
158
  - lib/dexcom/configuration.rb
159
159
  - lib/dexcom/constants.rb
160
160
  - lib/dexcom/version.rb
161
- homepage:
161
+ - lib/utils/httparty_configured.rb
162
+ homepage:
162
163
  licenses:
163
164
  - MIT
164
165
  metadata: {}
165
- post_install_message:
166
+ post_install_message:
166
167
  rdoc_options: []
167
168
  require_paths:
168
169
  - lib
@@ -177,9 +178,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
178
  - !ruby/object:Gem::Version
178
179
  version: '0'
179
180
  requirements: []
180
- rubyforge_project:
181
- rubygems_version: 2.7.6
182
- signing_key:
181
+ rubygems_version: 3.2.15
182
+ signing_key:
183
183
  specification_version: 4
184
184
  summary: Gem to interact with Dexcom Share API
185
185
  test_files: []