timezone 0.6.0 → 0.99.0

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.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +99 -1
  4. data/.travis.yml +6 -3
  5. data/CHANGES.markdown +10 -0
  6. data/Gemfile +1 -1
  7. data/README.markdown +129 -89
  8. data/Rakefile +7 -4
  9. data/benchmark.rb +13 -13
  10. data/lib/timezone/active_support.rb +147 -134
  11. data/lib/timezone/configure.rb +131 -110
  12. data/lib/timezone/deprecate.rb +32 -0
  13. data/lib/timezone/error.rb +16 -5
  14. data/lib/timezone/loader.rb +19 -16
  15. data/lib/timezone/lookup/basic.rb +24 -2
  16. data/lib/timezone/lookup/geonames.rb +9 -5
  17. data/lib/timezone/lookup/google.rb +24 -15
  18. data/lib/timezone/lookup/test.rb +8 -8
  19. data/lib/timezone/lookup.rb +68 -0
  20. data/lib/timezone/net_http_client.rb +23 -9
  21. data/lib/timezone/nil_zone.rb +32 -0
  22. data/lib/timezone/parser.rb +10 -5
  23. data/lib/timezone/version.rb +2 -1
  24. data/lib/timezone/zone.rb +230 -99
  25. data/lib/timezone.rb +75 -1
  26. data/test/basic_lookup_test.rb +2 -2
  27. data/test/geonames_lookup_test.rb +13 -6
  28. data/test/google_lookup_test.rb +34 -24
  29. data/test/http_test_client.rb +7 -6
  30. data/test/test_lookup_test.rb +3 -1
  31. data/test/test_timezone.rb +59 -0
  32. data/test/timezone/lookup/test_geonames.rb +59 -0
  33. data/test/timezone/lookup/test_google.rb +94 -0
  34. data/test/timezone/lookup/test_test.rb +24 -0
  35. data/test/timezone/test_deprecate.rb +20 -0
  36. data/test/timezone/test_loader.rb +32 -0
  37. data/test/timezone/test_lookup.rb +53 -0
  38. data/test/timezone/test_nil_zone.rb +26 -0
  39. data/test/timezone/test_zone.rb +49 -0
  40. data/test/timezone_test.rb +64 -63
  41. data/timezone.gemspec +16 -15
  42. metadata +39 -38
  43. data/.rubocop_todo.yml +0 -235
data/.rubocop_todo.yml DELETED
@@ -1,235 +0,0 @@
1
- # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2016-02-01 11:48:24 -0800 using RuboCop version 0.36.0.
4
- # The point is for the user to remove these configuration records
5
- # one by one as the offenses are removed from the code base.
6
- # Note that changes in the inspected code, or installation of new
7
- # versions of RuboCop, may require this file to be generated again.
8
-
9
- # Offense count: 1
10
- # Cop supports --auto-correct.
11
- Lint/DeprecatedClassMethods:
12
- Exclude:
13
- - 'lib/timezone/loader.rb'
14
-
15
- # Offense count: 4
16
- # Cop supports --auto-correct.
17
- # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods.
18
- Lint/UnusedMethodArgument:
19
- Exclude:
20
- - 'lib/timezone/lookup/basic.rb'
21
- - 'lib/timezone/lookup/test.rb'
22
- - 'test/http_test_client.rb'
23
-
24
- # Offense count: 13
25
- Metrics/AbcSize:
26
- Max: 30
27
-
28
- # Offense count: 22
29
- # Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
30
- # URISchemes: http, https
31
- Metrics/LineLength:
32
- Max: 470
33
-
34
- # Offense count: 8
35
- # Configuration parameters: CountComments.
36
- Metrics/MethodLength:
37
- Max: 20
38
-
39
- # Offense count: 1
40
- Metrics/PerceivedComplexity:
41
- Max: 8
42
-
43
- # Offense count: 2
44
- # Cop supports --auto-correct.
45
- Performance/RedundantBlockCall:
46
- Exclude:
47
- - 'lib/timezone/zone.rb'
48
-
49
- # Offense count: 18
50
- Style/ClassVars:
51
- Exclude:
52
- - 'lib/timezone/configure.rb'
53
- - 'lib/timezone/loader.rb'
54
-
55
- # Offense count: 4
56
- # Cop supports --auto-correct.
57
- Style/DeprecatedHashMethods:
58
- Exclude:
59
- - 'lib/timezone/zone.rb'
60
- - 'test/timezone_test.rb'
61
-
62
- # Offense count: 9
63
- Style/Documentation:
64
- Exclude:
65
- - 'spec/**/*'
66
- - 'test/**/*'
67
- - 'lib/timezone.rb'
68
- - 'lib/timezone/loader.rb'
69
- - 'lib/timezone/lookup/basic.rb'
70
- - 'lib/timezone/lookup/geonames.rb'
71
- - 'lib/timezone/lookup/google.rb'
72
- - 'lib/timezone/lookup/test.rb'
73
- - 'lib/timezone/parser.rb'
74
- - 'lib/timezone/zone.rb'
75
-
76
- # Offense count: 2
77
- Style/DoubleNegation:
78
- Exclude:
79
- - 'lib/timezone/configure.rb'
80
-
81
- # Offense count: 1
82
- # Cop supports --auto-correct.
83
- Style/EmptyLiteral:
84
- Exclude:
85
- - 'lib/timezone/configure.rb'
86
-
87
- # Offense count: 1
88
- # Configuration parameters: MinBodyLength.
89
- Style/GuardClause:
90
- Exclude:
91
- - 'lib/timezone/zone.rb'
92
-
93
- # Offense count: 33
94
- # Cop supports --auto-correct.
95
- # Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues.
96
- # SupportedStyles: ruby19, ruby19_no_mixed_keys, hash_rockets
97
- Style/HashSyntax:
98
- Enabled: false
99
-
100
- # Offense count: 1
101
- # Cop supports --auto-correct.
102
- # Configuration parameters: EnforcedStyle, SupportedStyles.
103
- # SupportedStyles: require_parentheses, require_no_parentheses, require_no_parentheses_except_multiline
104
- Style/MethodDefParentheses:
105
- Enabled: false
106
-
107
- # Offense count: 1
108
- # Configuration parameters: EnforcedStyle, SupportedStyles.
109
- # SupportedStyles: snake_case, camelCase
110
- Style/MethodName:
111
- Enabled: false
112
-
113
- # Offense count: 1
114
- # Cop supports --auto-correct.
115
- Style/NegatedIf:
116
- Exclude:
117
- - 'lib/timezone/loader.rb'
118
-
119
- # Offense count: 10
120
- # Cop supports --auto-correct.
121
- Style/NumericLiterals:
122
- MinDigits: 11
123
-
124
- # Offense count: 1
125
- Style/OpMethod:
126
- Exclude:
127
- - 'lib/timezone/zone.rb'
128
-
129
- # Offense count: 1
130
- # Cop supports --auto-correct.
131
- # Configuration parameters: AllowMultipleReturnValues.
132
- Style/RedundantReturn:
133
- Exclude:
134
- - 'lib/timezone/zone.rb'
135
-
136
- # Offense count: 2
137
- # Cop supports --auto-correct.
138
- Style/RedundantSelf:
139
- Exclude:
140
- - 'lib/timezone/zone.rb'
141
-
142
- # Offense count: 11
143
- # Cop supports --auto-correct.
144
- # Configuration parameters: EnforcedStyle, SupportedStyles.
145
- # SupportedStyles: only_raise, only_fail, semantic
146
- Style/SignalException:
147
- Exclude:
148
- - 'lib/timezone/loader.rb'
149
- - 'lib/timezone/lookup/basic.rb'
150
- - 'lib/timezone/lookup/geonames.rb'
151
- - 'lib/timezone/lookup/google.rb'
152
- - 'lib/timezone/lookup/test.rb'
153
- - 'lib/timezone/zone.rb'
154
-
155
- # Offense count: 1
156
- # Cop supports --auto-correct.
157
- # Configuration parameters: AllowIfMethodIsEmpty.
158
- Style/SingleLineMethods:
159
- Exclude:
160
- - 'test/http_test_client.rb'
161
-
162
- # Offense count: 87
163
- # Cop supports --auto-correct.
164
- Style/SpaceAfterComma:
165
- Exclude:
166
- - 'benchmark.rb'
167
- - 'lib/timezone/lookup/google.rb'
168
- - 'lib/timezone/parser.rb'
169
- - 'lib/timezone/zone.rb'
170
- - 'test/timezone_test.rb'
171
-
172
- # Offense count: 3
173
- # Cop supports --auto-correct.
174
- # Configuration parameters: EnforcedStyle, SupportedStyles.
175
- # SupportedStyles: space, no_space
176
- Style/SpaceAroundEqualsInParameterDefault:
177
- Enabled: false
178
-
179
- # Offense count: 147
180
- # Cop supports --auto-correct.
181
- # Configuration parameters: AllowForAlignment.
182
- Style/SpaceAroundOperators:
183
- Exclude:
184
- - 'lib/timezone/active_support.rb'
185
- - 'lib/timezone/loader.rb'
186
- - 'lib/timezone/parser.rb'
187
- - 'lib/timezone/zone.rb'
188
-
189
- # Offense count: 27
190
- # Cop supports --auto-correct.
191
- # Configuration parameters: EnforcedStyle, SupportedStyles.
192
- # SupportedStyles: space, no_space
193
- Style/SpaceBeforeBlockBraces:
194
- Enabled: false
195
-
196
- # Offense count: 6
197
- # Cop supports --auto-correct.
198
- Style/SpaceBeforeSemicolon:
199
- Exclude:
200
- - 'lib/timezone/error.rb'
201
- - 'test/http_test_client.rb'
202
-
203
- # Offense count: 1
204
- # Cop supports --auto-correct.
205
- # Configuration parameters: SupportedStyles.
206
- # SupportedStyles: use_perl_names, use_english_names
207
- Style/SpecialGlobalVars:
208
- EnforcedStyle: use_perl_names
209
-
210
- # Offense count: 289
211
- # Cop supports --auto-correct.
212
- # Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
213
- # SupportedStyles: single_quotes, double_quotes
214
- Style/StringLiterals:
215
- Enabled: false
216
-
217
- # Offense count: 1
218
- # Cop supports --auto-correct.
219
- Style/TrailingWhitespace:
220
- Exclude:
221
- - 'lib/timezone/net_http_client.rb'
222
-
223
- # Offense count: 2
224
- # Cop supports --auto-correct.
225
- # Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, IgnoreClassMethods, Whitelist.
226
- # Whitelist: to_ary, to_a, to_c, to_enum, to_h, to_hash, to_i, to_int, to_io, to_open, to_path, to_proc, to_r, to_regexp, to_str, to_s, to_sym
227
- Style/TrivialAccessors:
228
- Exclude:
229
- - 'lib/timezone/configure.rb'
230
-
231
- # Offense count: 1
232
- # Cop supports --auto-correct.
233
- Style/UnneededPercentQ:
234
- Exclude:
235
- - 'timezone.gemspec'