survey-gizmo-ruby 6.1.0 → 6.1.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
  SHA1:
3
- metadata.gz: c9212a1b4d700277db950e43704325fe142193b3
4
- data.tar.gz: 5fa9f82cd2349c0bd649e56807ee8378687205c3
3
+ metadata.gz: ecb8c80ba90e28bba4741e13df3dc580149080e2
4
+ data.tar.gz: 06aaa5d1a4329a5ff21c1304d9b8bc78df9d2dbc
5
5
  SHA512:
6
- metadata.gz: 5731f64d824843664d1dd208fc92bbf1060815d96bf25c545908018b0508167f3f955c3e021f0f6d127c15fd8e5f3321f96643cedd938f4ff25785735172b2b9
7
- data.tar.gz: 94874505cc5d2739334cf86bde4805616eb2dd178d865eaf20cba1cf670733f870debee1b38b0ae61225db68f22c5498f677cef48915002b25c70f1b8bb9ce97
6
+ metadata.gz: a9b1cdb3c9cf76cfd3d26f2ae91ed61810cdbfacdec900498d61bcf447470ce0e2d3e6f05857a92a3a0653c6433423a23ebc8b69ac1de37c12f6845e646532b4
7
+ data.tar.gz: 5c5a95ae7a2e38aa6bd0f88502da2d164bbffafe29828ce77730a8d32f3c05ee440182ba47988a7886bb3cfdc2efca3fecfffcc543d72a064a370fb5c8c0a34f
data/README.md CHANGED
@@ -10,7 +10,7 @@ Currently supports SurveyGizmo API **v4** (default) and **v3**.
10
10
 
11
11
  ### Major Changes in 6.x
12
12
  * **BREAKING CHANGE**: SurveyGizmo changed the authentication so you need to configure `api_token` and `api_token_secret` instead of user and password.
13
- * **BREAKING CHANGE**: Pester has been removed as the retry source in favor of Faraday's `Request::Retry`.
13
+ * **BREAKING CHANGE**: Pester has been removed as the retry source in favor of `Retriable`.
14
14
 
15
15
  ### Major Changes in 5.x
16
16
 
@@ -10,7 +10,7 @@ module SurveyGizmo::API
10
10
  {
11
11
  field: 'datesubmitted',
12
12
  operator: '>=',
13
- value: time.in_time_zone('Eastern Time (US & Canada)').strftime('%Y-%m-%d %H:%M:%S')
13
+ value: time.in_time_zone(SurveyGizmo::Configuration::SURVEYGIZMO_TIME_ZONE).strftime('%Y-%m-%d %H:%M:%S')
14
14
  }
15
15
  end
16
16
 
@@ -25,6 +25,7 @@ module SurveyGizmo
25
25
  DEFAULT_TIMEOUT_SECONDS = 300
26
26
  DEFAULT_RETRIES = 3
27
27
  DEFAULT_RETRY_INTERVAL = 60
28
+ SURVEYGIZMO_TIME_ZONE = 'Eastern Time (US & Canada)'
28
29
 
29
30
  attr_accessor :api_token
30
31
  attr_accessor :api_token_secret
@@ -39,10 +39,10 @@ module SurveyGizmo
39
39
 
40
40
  # Handle really crappy [] notation in SG API, so far just in SurveyResponse
41
41
  Array.wrap(body['data']).compact.each do |datum|
42
- # SurveyGizmo returns date information in EST but does not provide time zone information.
43
- # See https://surveygizmov4.helpgizmo.com/help/article/link/date-and-time-submitted
42
+ # SurveyGizmo returns date information using US/Eastern timezone but does not provide time zone information.
43
+ # See https://apihelp.surveygizmo.com/help/article/link/surveyresponse-returned-fields#examplereturns
44
44
  TIME_FIELDS.each do |time_key|
45
- datum[time_key] = datum[time_key] + ' EST' unless datum[time_key].blank?
45
+ datum[time_key] = ActiveSupport::TimeZone.new(SurveyGizmo::Configuration::SURVEYGIZMO_TIME_ZONE).parse(datum[time_key]) unless datum[time_key].blank?
46
46
  end
47
47
 
48
48
  datum.keys.grep(/^\[/).each do |key|
@@ -1,3 +1,3 @@
1
1
  module SurveyGizmo
2
- VERSION = '6.1.0'
2
+ VERSION = '6.1.1'
3
3
  end
@@ -221,7 +221,7 @@ describe 'Survey Gizmo Resource' do
221
221
 
222
222
  describe SurveyGizmo::API::Response do
223
223
  let(:create_attributes) { {:survey_id => 1234, :datesubmitted => "2015-04-15 05:46:30" } }
224
- let(:create_attributes_to_compare) { create_attributes.merge(:datesubmitted => Time.parse("2015-04-15 05:46:30 EST")) }
224
+ let(:create_attributes_to_compare) { create_attributes.merge(:datesubmitted => Time.parse("2015-04-15 05:46:30 -0400")) }
225
225
  let(:get_attributes) { create_attributes.merge(:id => 1) }
226
226
  let(:get_attributes_to_compare) { create_attributes_to_compare.merge(:id => 1) }
227
227
  let(:update_attributes) { {:survey_id => 1234, :title => 'Updated'} }
@@ -235,6 +235,14 @@ describe 'Survey Gizmo Resource' do
235
235
  it_should_behave_like 'an API object'
236
236
  it_should_behave_like 'an object with errors'
237
237
 
238
+ context 'during EST' do
239
+ let(:create_attributes) { {:survey_id => 1234, :datesubmitted => "2015-01-15 05:46:30" } }
240
+ let(:create_attributes_to_compare) { create_attributes.merge(:datesubmitted => Time.parse("2015-01-15 05:46:30 -0500")) }
241
+
242
+ it_should_behave_like 'an API object'
243
+ it_should_behave_like 'an object with errors'
244
+ end
245
+
238
246
  context 'answers' do
239
247
  let(:survey_id) { 6 }
240
248
  let(:response_id) { 7 }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: survey-gizmo-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.0
4
+ version: 6.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kabari Hendrick
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2016-03-18 00:00:00.000000000 Z
14
+ date: 2016-03-25 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport