twitter_cldr 2.1.0 → 2.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.
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ == 2.1.1
2
+
3
+ * Modified AdditionalDateFormatSelector to return the correct format on exact format match.
4
+
1
5
  == 2.1.0
2
6
 
3
7
  * Significant performance improvements (memoization, resource preloading).
@@ -17,9 +17,13 @@ module TwitterCldr
17
17
  nil
18
18
  else
19
19
  cache_key = TwitterCldr::Utils.compute_cache_key(goal_pattern)
20
- pattern_cache[cache_key] ||= rank(goal_pattern).min do |(p1, score1), (p2, score2)|
21
- score1 <=> score2
22
- end.first
20
+ pattern_cache[cache_key] ||= if @pattern_hash.include?(goal_pattern.to_sym)
21
+ goal_pattern
22
+ else
23
+ rank(goal_pattern).min do |(p1, score1), (p2, score2)|
24
+ score1 <=> score2
25
+ end.first
26
+ end
23
27
  end
24
28
  end
25
29
 
@@ -4,5 +4,5 @@
4
4
  # http://www.apache.org/licenses/LICENSE-2.0
5
5
 
6
6
  module TwitterCldr
7
- VERSION = "2.1.0"
7
+ VERSION = "2.1.1"
8
8
  end
@@ -90,6 +90,7 @@ describe AdditionalDateFormatSelector do
90
90
 
91
91
  describe "#find_closest" do
92
92
  it "returns an exact match if it exists" do
93
+ selector.find_closest("h").should == "h"
93
94
  selector.find_closest("MMMd").should == "MMMd"
94
95
  selector.find_closest("Hms").should == "Hms"
95
96
  selector.find_closest("yQQQQ").should == "yQQQQ"
metadata CHANGED
@@ -1,48 +1,40 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: twitter_cldr
3
- version: !ruby/object:Gem::Version
4
- hash: 11
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.1.1
5
5
  prerelease:
6
- segments:
7
- - 2
8
- - 1
9
- - 0
10
- version: 2.1.0
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Cameron Dutro
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2013-02-04 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2013-02-13 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: json
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 1
29
- segments:
30
- - 1
31
- - 1
32
- - 9
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
33
21
  version: 1.1.9
34
22
  type: :runtime
35
- version_requirements: *id001
36
- description: Ruby implementation of the ICU (International Components for Unicode) that uses the Common Locale Data Repository to format dates, plurals, and more.
37
- email:
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 1.1.9
30
+ description: Ruby implementation of the ICU (International Components for Unicode)
31
+ that uses the Common Locale Data Repository to format dates, plurals, and more.
32
+ email:
38
33
  - cdutro@twitter.com
39
34
  executables: []
40
-
41
35
  extensions: []
42
-
43
36
  extra_rdoc_files: []
44
-
45
- files:
37
+ files:
46
38
  - lib/twitter_cldr/collation/collator.rb
47
39
  - lib/twitter_cldr/collation/implicit_collation_elements.rb
48
40
  - lib/twitter_cldr/collation/sort_key_builder.rb
@@ -1071,36 +1063,27 @@ files:
1071
1063
  - twitter_cldr.gemspec
1072
1064
  homepage: http://twitter.com
1073
1065
  licenses: []
1074
-
1075
1066
  post_install_message:
1076
1067
  rdoc_options: []
1077
-
1078
- require_paths:
1068
+ require_paths:
1079
1069
  - lib
1080
- required_ruby_version: !ruby/object:Gem::Requirement
1070
+ required_ruby_version: !ruby/object:Gem::Requirement
1081
1071
  none: false
1082
- requirements:
1083
- - - ">="
1084
- - !ruby/object:Gem::Version
1085
- hash: 3
1086
- segments:
1087
- - 0
1088
- version: "0"
1089
- required_rubygems_version: !ruby/object:Gem::Requirement
1072
+ requirements:
1073
+ - - ! '>='
1074
+ - !ruby/object:Gem::Version
1075
+ version: '0'
1076
+ required_rubygems_version: !ruby/object:Gem::Requirement
1090
1077
  none: false
1091
- requirements:
1092
- - - ">="
1093
- - !ruby/object:Gem::Version
1094
- hash: 3
1095
- segments:
1096
- - 0
1097
- version: "0"
1078
+ requirements:
1079
+ - - ! '>='
1080
+ - !ruby/object:Gem::Version
1081
+ version: '0'
1098
1082
  requirements: []
1099
-
1100
1083
  rubyforge_project:
1101
- rubygems_version: 1.8.10
1084
+ rubygems_version: 1.8.25
1102
1085
  signing_key:
1103
1086
  specification_version: 3
1104
- summary: Ruby implementation of the ICU (International Components for Unicode) that uses the Common Locale Data Repository to format dates, plurals, and more.
1087
+ summary: Ruby implementation of the ICU (International Components for Unicode) that
1088
+ uses the Common Locale Data Repository to format dates, plurals, and more.
1105
1089
  test_files: []
1106
-