survey-gizmo-ruby 6.2.2 → 6.2.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
  SHA1:
3
- metadata.gz: ab1eb13371249cc2f26137bbe0323478da4fd207
4
- data.tar.gz: 3cb470de80d38514bd94d63d5c32722d29ead07a
3
+ metadata.gz: a97c56891cb5d32899be0d8761f6111ea93594aa
4
+ data.tar.gz: 52c6711838243e3215f6514f7915610a863900d8
5
5
  SHA512:
6
- metadata.gz: 21d0913d8ba602e29f298b7a657f579930e05b77d07aa71d49463d939987658032e4c6e25f49d94aa8cd7f1798d11a99c60b0487561fc6bb4fa28fd4148fe41b
7
- data.tar.gz: 24aa16c01024c4853e2b77bd8825a4e52dc84d92096badcf0c4e68bef9cb55f6814e5cfe0266d28171a9b986fcc40c9a07737ed18aa51a916cb592a6f5e48033
6
+ metadata.gz: 114bee62cb95e00705c8d0c3a55d144851b11fba7635959b478d0b7b92272834436a6f3deb52330f87bf7eb8ddb3e4c7062a6dccff6a08e0a2675a1344bd9a6e
7
+ data.tar.gz: 3fb1758367b9685ee72f42a7104f1431180cb74dd49ef430e999b140c3c29156fc1dd32069b18db6541a9ef510a572b5ba15f81ae6ab217f4a585be4ac3c4d5d
@@ -36,7 +36,7 @@ module SurveyGizmo::API
36
36
  end
37
37
 
38
38
  def parsed_answers
39
- filtered_answers = answers.select do |k,v|
39
+ filtered_answers = answers.select do |k, v|
40
40
  next false unless v.is_a?(FalseClass) || v.present?
41
41
 
42
42
  # Strip out "Other" answers that don't actually have the "other" text (they come back as two responses - one
@@ -47,7 +47,10 @@ module SurveyGizmo::API
47
47
  true
48
48
  end
49
49
  end
50
- filtered_answers.map { |k,v| Answer.new(children_params.merge(key: k, value: v, answer_text: v, submitted_at: submitted_at)) }
50
+
51
+ filtered_answers.map do |k, v|
52
+ Answer.new(children_params.merge(key: k, value: v, answer_text: v, submitted_at: submitted_at))
53
+ end
51
54
  end
52
55
  end
53
56
  end
@@ -39,10 +39,12 @@ 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 using US/Eastern timezone but does not provide time zone information.
42
+ # SurveyGizmo returns date information using US/Eastern or Berlin timezone depending on which URI you use, but
43
+ # does not return any information about the timezone.
43
44
  # See https://apihelp.surveygizmo.com/help/article/link/surveyresponse-returned-fields#examplereturns
44
45
  TIME_FIELDS.each do |time_key|
45
- datum[time_key] = ActiveSupport::TimeZone.new(SurveyGizmo.configuration.api_time_zone).parse(datum[time_key]) unless datum[time_key].blank?
46
+ next if datum[time_key].blank?
47
+ datum[time_key] = ActiveSupport::TimeZone.new(SurveyGizmo.configuration.api_time_zone).parse(datum[time_key])
46
48
  end
47
49
 
48
50
  datum.keys.grep(/^\[/).each do |key|
@@ -163,7 +163,7 @@ module SurveyGizmo
163
163
  private
164
164
 
165
165
  def attributes_without_blanks
166
- attributes.reject { |k,v| v.blank? }
166
+ attributes.reject { |k, v| v.blank? }
167
167
  end
168
168
 
169
169
  # Extract attributes required for API calls about this object
@@ -184,7 +184,7 @@ module SurveyGizmo
184
184
  # Also used for loading member objects, e.g. loading Options for a given Question.
185
185
  def children_params
186
186
  klass_id = self.class.name.split('::').last.downcase + '_id'
187
- route_params.merge(klass_id.to_sym => id).reject { |k,v| k == :id }
187
+ route_params.merge(klass_id.to_sym => id).reject { |k, v| k == :id }
188
188
  end
189
189
 
190
190
  def create_route(method)
@@ -1,3 +1,3 @@
1
1
  module SurveyGizmo
2
- VERSION = '6.2.2'
2
+ VERSION = '6.2.3'
3
3
  end
@@ -22,9 +22,9 @@ describe 'Survey Gizmo Resource' do
22
22
  it '#reload' do
23
23
  stub_request(:get, /#{@base}/).to_return(json_response(true, get_attributes))
24
24
  obj = described_class.new(get_attributes.merge(update_attributes))
25
- obj.attributes.reject {|k,v| v.blank? }.should == get_attributes.merge(update_attributes)
25
+ obj.attributes.reject { |k, v| v.blank? }.should == get_attributes.merge(update_attributes)
26
26
  obj.reload
27
- obj.attributes.reject {|k,v| v.blank? }.should == get_attributes
27
+ obj.attributes.reject { |k, v| v.blank? }.should == get_attributes
28
28
  end
29
29
 
30
30
  it 'should raise an error if params are missing' do
@@ -263,7 +263,7 @@ describe 'Survey Gizmo Resource' do
263
263
 
264
264
  it 'should propagate time, survey_id, and response_id' do
265
265
  response = described_class.new(
266
- answers: answers.select { |k,v| k == "[question(5)]"},
266
+ answers: answers.select { |k, v| k == "[question(5)]"},
267
267
  survey_id: survey_id,
268
268
  id: response_id,
269
269
  submitted_at: timestamp
@@ -16,7 +16,7 @@ shared_examples_for 'an API object' do
16
16
  stub_request(:put, /#{@base}/).to_return(json_response(true, create_attributes))
17
17
  obj = described_class.create(create_attributes)
18
18
 
19
- obj.attributes.reject { |k,v| v.blank? }.should == (create_attributes_to_compare || create_attributes)
19
+ obj.attributes.reject { |k, v| v.blank? }.should == (create_attributes_to_compare || create_attributes)
20
20
  end
21
21
  end
22
22
 
@@ -25,7 +25,7 @@ shared_examples_for 'an API object' do
25
25
  stub_request(:get, /#{@base}/).to_return(json_response(true, get_attributes))
26
26
  obj = described_class.first(first_params)
27
27
  a_request(:get, /#{@base}#{uri_paths[:get]}/).should have_been_made
28
- obj.attributes.reject{|k,v| v.blank? }.should == (get_attributes_to_compare || get_attributes)
28
+ obj.attributes.reject { |k, v| v.blank? }.should == (get_attributes_to_compare || get_attributes)
29
29
  end
30
30
 
31
31
  it "should return false if the request fails" do
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
15
15
  gem.licenses = ['MIT']
16
16
  gem.required_ruby_version = '>= 1.9'
17
17
 
18
- gem.add_dependency 'activesupport', '>= 3.0'
18
+ gem.add_dependency 'activesupport', '>= 3.0', '< 5.0'
19
19
  gem.add_dependency 'addressable', '~> 2'
20
20
  gem.add_dependency 'awesome_print', '~> 1'
21
21
  gem.add_dependency 'faraday', '>= 0.9.1', '~> 0.9'
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.2.2
4
+ version: 6.2.3
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-06-30 00:00:00.000000000 Z
14
+ date: 2016-07-01 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport
@@ -20,6 +20,9 @@ dependencies:
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
22
  version: '3.0'
23
+ - - "<"
24
+ - !ruby/object:Gem::Version
25
+ version: '5.0'
23
26
  type: :runtime
24
27
  prerelease: false
25
28
  version_requirements: !ruby/object:Gem::Requirement
@@ -27,6 +30,9 @@ dependencies:
27
30
  - - ">="
28
31
  - !ruby/object:Gem::Version
29
32
  version: '3.0'
33
+ - - "<"
34
+ - !ruby/object:Gem::Version
35
+ version: '5.0'
30
36
  - !ruby/object:Gem::Dependency
31
37
  name: addressable
32
38
  requirement: !ruby/object:Gem::Requirement