twitter_cldr 2.0.0 → 2.0.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.0.1
2
+
3
+ * Fixed bug for additional date formats that was causing the wrong format to be returned.
4
+
1
5
  == 2.0.0
2
6
 
3
7
  * Added locales ga, ta, gl, cy, sr, bg, ku, ro, lv, be, sq, sk, and bn.
@@ -59,8 +59,12 @@ module TwitterCldr
59
59
  end
60
60
 
61
61
  def exist_score(entities, goal_entities)
62
- goal_entities.count do |goal_entity|
63
- !entities.any? { |entity| entity[0] == goal_entity[0] }
62
+ goal_entities.inject(0) do |sum, goal_entity|
63
+ if !entities.any? { |entity| entity[0] == goal_entity[0] }
64
+ sum + 1
65
+ else
66
+ sum
67
+ end
64
68
  end
65
69
  end
66
70
 
@@ -4,5 +4,5 @@
4
4
  # http://www.apache.org/licenses/LICENSE-2.0
5
5
 
6
6
  module TwitterCldr
7
- VERSION = "2.0.0"
7
+ VERSION = "2.0.1"
8
8
  end
@@ -30,9 +30,9 @@ describe AdditionalDateFormatSelector do
30
30
 
31
31
  describe "#exist_score" do
32
32
  it "calculates a higher score if an entity doesn't exist" do
33
- goal_entities = selector.send(:separate, "MMMd")
33
+ goal_entities = selector.send(:separate, "MMMEd")
34
34
  entities = selector.send(:separate, "d")
35
- selector.send(:exist_score, entities, goal_entities).should == 1
35
+ selector.send(:exist_score, entities, goal_entities).should == 2
36
36
  end
37
37
 
38
38
  it "calculates a zero score if all entities exist" do
metadata CHANGED
@@ -1,40 +1,48 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: twitter_cldr
3
- version: !ruby/object:Gem::Version
4
- version: 2.0.0
3
+ version: !ruby/object:Gem::Version
4
+ hash: 13
5
5
  prerelease:
6
+ segments:
7
+ - 2
8
+ - 0
9
+ - 1
10
+ version: 2.0.1
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Cameron Dutro
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2012-11-29 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2012-12-06 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: json
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: 1.1.9
22
- type: :runtime
23
22
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
23
+ requirement: &id001 !ruby/object:Gem::Requirement
25
24
  none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 1
29
+ segments:
30
+ - 1
31
+ - 1
32
+ - 9
29
33
  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:
34
+ 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:
33
38
  - cdutro@twitter.com
34
39
  executables: []
40
+
35
41
  extensions: []
42
+
36
43
  extra_rdoc_files: []
37
- files:
44
+
45
+ files:
38
46
  - lib/twitter_cldr/collation/collator.rb
39
47
  - lib/twitter_cldr/collation/implicit_collation_elements.rb
40
48
  - lib/twitter_cldr/collation/sort_key_builder.rb
@@ -975,33 +983,36 @@ files:
975
983
  - twitter_cldr.gemspec
976
984
  homepage: http://twitter.com
977
985
  licenses: []
986
+
978
987
  post_install_message:
979
988
  rdoc_options: []
980
- require_paths:
989
+
990
+ require_paths:
981
991
  - lib
982
- required_ruby_version: !ruby/object:Gem::Requirement
992
+ required_ruby_version: !ruby/object:Gem::Requirement
983
993
  none: false
984
- requirements:
985
- - - ! '>='
986
- - !ruby/object:Gem::Version
987
- version: '0'
988
- segments:
994
+ requirements:
995
+ - - ">="
996
+ - !ruby/object:Gem::Version
997
+ hash: 3
998
+ segments:
989
999
  - 0
990
- hash: -2261829356265887459
991
- required_rubygems_version: !ruby/object:Gem::Requirement
1000
+ version: "0"
1001
+ required_rubygems_version: !ruby/object:Gem::Requirement
992
1002
  none: false
993
- requirements:
994
- - - ! '>='
995
- - !ruby/object:Gem::Version
996
- version: '0'
997
- segments:
1003
+ requirements:
1004
+ - - ">="
1005
+ - !ruby/object:Gem::Version
1006
+ hash: 3
1007
+ segments:
998
1008
  - 0
999
- hash: -2261829356265887459
1009
+ version: "0"
1000
1010
  requirements: []
1011
+
1001
1012
  rubyforge_project:
1002
- rubygems_version: 1.8.24
1013
+ rubygems_version: 1.8.10
1003
1014
  signing_key:
1004
1015
  specification_version: 3
1005
- summary: Ruby implementation of the ICU (International Components for Unicode) that
1006
- uses the Common Locale Data Repository to format dates, plurals, and more.
1016
+ summary: Ruby implementation of the ICU (International Components for Unicode) that uses the Common Locale Data Repository to format dates, plurals, and more.
1007
1017
  test_files: []
1018
+