hdcore 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/hdcore.gemspec +1 -0
- data/lib/hdcore/hdcore.rb +2 -1
- data/lib/hdcore/request.rb +8 -1
- data/lib/hdcore/version.rb +1 -1
- data/lib/hdcore.rb +1 -0
- data/spec/lib/hdcore/hdcore_spec.rb +6 -2
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YmQzMGRjZGIzMzZjMDdlMGNhYjMyZjAwYmVhODM0MWNiYjVmNTc1Mg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTRlYWQxYzk2NGZmYzllYzk0ZmNlNWU2YzQ2ZGMxZTZhOTE2ZGIzNQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MjQwZmFkNTU1ZTk0MWZjODUzNDdkOTk2MDYwNDcwOTMzNWQ4MDJiOWFhYWI5
|
10
|
+
MzI0YjlkZGNkYjY5MmZkY2Y4YjBjNTYzM2FmNTM4YjUwYTc2NWI1ZmY5MWE2
|
11
|
+
MTU3NzJlNDZiM2QzY2IxY2IwMTAyNTg2YmQ5ZTcyZjQ4Mzc0YjY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MjE4Njc5MDI5MTE1MTY4YmZmZjY1MTUxMTdhNDllYWRjOWM4M2Q1YjA1NmNm
|
14
|
+
MmQxNzMyNTY0MWY3Zjg2OTdkNjI3YjgyZjEwNDhlMzYzODZiYmYzNGZiNDQx
|
15
|
+
ODk1MDlhZDMxZTdkNWJjOTYxYTFlMzJhNWU4OWUyYWFiNTZjN2E=
|
data/hdcore.gemspec
CHANGED
data/lib/hdcore/hdcore.rb
CHANGED
data/lib/hdcore/request.rb
CHANGED
@@ -59,7 +59,7 @@ module Hdcore
|
|
59
59
|
{
|
60
60
|
:api_key => public_key,
|
61
61
|
:api_unique => uuid = generate_uuid,
|
62
|
-
:api_timestamp => timestamp =
|
62
|
+
:api_timestamp => timestamp = generate_timestamp,
|
63
63
|
:api_hash => generate_hash( timestamp,
|
64
64
|
uuid,
|
65
65
|
private_key,
|
@@ -68,6 +68,13 @@ module Hdcore
|
|
68
68
|
}
|
69
69
|
end
|
70
70
|
|
71
|
+
|
72
|
+
#
|
73
|
+
def generate_timestamp
|
74
|
+
zone = Hdcore.config[:time_zone]
|
75
|
+
Time.use_zone(zone) { Time.now.to_i }
|
76
|
+
end
|
77
|
+
|
71
78
|
# @private
|
72
79
|
# @return [String] SHA256 hash of all the arguments "joined:with:colons"
|
73
80
|
def generate_hash(*args)
|
data/lib/hdcore/version.rb
CHANGED
data/lib/hdcore.rb
CHANGED
@@ -3,8 +3,8 @@ require 'spec_helper'
|
|
3
3
|
describe Hdcore do
|
4
4
|
|
5
5
|
describe '.config' do
|
6
|
-
it 'returns hash with expected keys [:api_endpoint, :public_key, :private_key]' do
|
7
|
-
Hdcore.config.keys.should == [:api_endpoint, :public_key, :private_key]
|
6
|
+
it 'returns hash with expected keys [:api_endpoint, :public_key, :private_key, :time_zone]' do
|
7
|
+
Hdcore.config.keys.should == [:api_endpoint, :public_key, :private_key, :time_zone]
|
8
8
|
end
|
9
9
|
|
10
10
|
it 'returns default [:api_endpoint] => "https://api.hostdime.com/v1"' do
|
@@ -18,6 +18,10 @@ describe Hdcore do
|
|
18
18
|
it 'returns default [:private_key] => nil' do
|
19
19
|
Hdcore.config[:private_key].should == nil
|
20
20
|
end
|
21
|
+
|
22
|
+
it 'returns default [:time_zone] => US/Eastern' do
|
23
|
+
Hdcore.config[:time_zone].should == 'US/Eastern'
|
24
|
+
end
|
21
25
|
end
|
22
26
|
|
23
27
|
describe '.configure' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hdcore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ethan Pemble
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '1.5'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: active_support
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ~>
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '3.0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ~>
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '3.0'
|
83
97
|
description: A basic wrapper for HostDime's customer portal 'Core' API
|
84
98
|
email:
|
85
99
|
- ethan.p@hostdime.com
|