survey-gizmo-ruby 6.5.0 → 6.5.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: cbebb0d8248b60e24838fc85ed431ac209c461ca
4
- data.tar.gz: 2216c41d34b989cbfe6a601782c2bd60cd75d0ac
3
+ metadata.gz: '04916024e8381ac6d6cc8717e4fa4fa66360ce29'
4
+ data.tar.gz: a8c9ce7f8d64768ccb29afbfe429693c93b0ccfa
5
5
  SHA512:
6
- metadata.gz: f50812670cfa09889e9eed180986acc227c7341442280d9e177f2d6458bfdd7d91d9bb8d84ca9fbc468927babb1d65b63240cd592026ef1b35dfe44995035a8b
7
- data.tar.gz: 3ac1474438bb866af5ce26d8b16454e1d9c08b4ba3f386fc1bd02f903569d56561d783a3c437e4cb223517d6058bd6093dbc3bc0d692c3c0e42a37d20c6c61ce
6
+ metadata.gz: cc5c7b798d0df953d5b1b6434389a5e76919fe42f31c449141a9e62d5a14d857f609ded3706fa3492a40177c3bace5a040664c37bf0356955406ee566badd35a
7
+ data.tar.gz: 3673f9b1def4d57d9a55763c4e872008dbc160fbb02013e61cc3b24b2026f7d1bda7f2351e4bc7c573e6f15603c56f9c629488f964d9a3d1eb6dfc9f408d7b79
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Versions
2
2
 
3
+ ## 6.5.1
4
+ * Allow setting default locale for multi-language title (#101)
5
+
3
6
  ## 6.5.0
4
7
  * Drop support for ruby 2.0; allow ActiveSupport 5.x
5
8
 
data/README.md CHANGED
@@ -38,6 +38,9 @@ SurveyGizmo.configure do |config|
38
38
  # Optional - Defaults to 300 seconds
39
39
  config.timeout_seconds = 600
40
40
 
41
+ # Optional - Defaults to English. If the survey has just one translation in languages different than English, with this option methods always return the proper locale.
42
+ config.locale = 'Italian'
43
+
41
44
  # Optional - Configure arguments to the Retriable gem directly that will be merged into the defaults
42
45
  config.retriable_params = { tries: 30, max_elapsed_time: 3600 }
43
46
  end
@@ -37,6 +37,7 @@ module SurveyGizmo
37
37
  DEFAULT_RESULTS_PER_PAGE = 50
38
38
  DEFAULT_TIMEOUT_SECONDS = 300
39
39
  DEFAULT_REGION = :us
40
+ DEFAULT_LOCALE = 'English'
40
41
 
41
42
  REGION_INFO = {
42
43
  us: {
@@ -77,7 +78,7 @@ module SurveyGizmo
77
78
  attr_accessor :results_per_page
78
79
  attr_accessor :timeout_seconds
79
80
  attr_accessor :retriable_params
80
-
81
+ attr_accessor :locale
81
82
  # TODO Deprecated; remove in 7.0
82
83
  attr_accessor :retry_attempts
83
84
  attr_accessor :retry_interval
@@ -90,6 +91,7 @@ module SurveyGizmo
90
91
  @results_per_page = DEFAULT_RESULTS_PER_PAGE
91
92
  @timeout_seconds = DEFAULT_TIMEOUT_SECONDS
92
93
  @retriable_params = DEFAULT_RETRIABLE_PARAMS
94
+ @locale = DEFAULT_LOCALE
93
95
  self.region = DEFAULT_REGION
94
96
 
95
97
  @logger = SurveyGizmo::Logger.new(STDOUT)
@@ -8,7 +8,7 @@ module SurveyGizmo
8
8
  end
9
9
 
10
10
  def title=(val)
11
- super(val.is_a?(Hash) ? val['English'] : val)
11
+ super(val.is_a?(Hash) ? val[SurveyGizmo.configuration.locale] : val)
12
12
  end
13
13
  end
14
14
  end
@@ -1,3 +1,3 @@
1
1
  module SurveyGizmo
2
- VERSION = '6.5.0'
2
+ VERSION = '6.5.1'
3
3
  end
@@ -57,6 +57,20 @@ describe SurveyGizmo::Configuration do
57
57
  end
58
58
  }.to raise_error
59
59
  end
60
+ end
61
+
62
+ describe 'locale' do
63
+ it 'should set English locale by default' do
64
+ SurveyGizmo.configure
65
+ expect(SurveyGizmo.configuration.locale).to eq('English')
66
+ end
60
67
 
68
+ it 'should set Italian locale with Italian specified' do
69
+ SurveyGizmo.configure do |config|
70
+ config.locale = 'Italian'
71
+ end
72
+
73
+ expect(SurveyGizmo.configuration.locale).to eq('Italian')
74
+ end
61
75
  end
62
76
  end
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.5.0
4
+ version: 6.5.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: 2017-06-06 00:00:00.000000000 Z
14
+ date: 2017-12-18 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport
@@ -265,7 +265,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
265
265
  version: '0'
266
266
  requirements: []
267
267
  rubyforge_project:
268
- rubygems_version: 2.5.2
268
+ rubygems_version: 2.6.8
269
269
  signing_key:
270
270
  specification_version: 4
271
271
  summary: Gem to use the SurveyGizmo.com REST API, v3+
@@ -281,3 +281,4 @@ test_files:
281
281
  - spec/test_json/page.json
282
282
  - spec/test_json/question.json
283
283
  - spec/test_json/survey.json
284
+ has_rdoc: