twitter_cldr_js 2.2.0 → 2.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +7 -0
  2. data/History.txt +8 -0
  3. data/README.md +11 -1
  4. data/Rakefile +4 -5
  5. data/lib/assets/javascripts/twitter_cldr/af.js +208 -98
  6. data/lib/assets/javascripts/twitter_cldr/ar.js +208 -98
  7. data/lib/assets/javascripts/twitter_cldr/be.js +211 -101
  8. data/lib/assets/javascripts/twitter_cldr/bg.js +208 -98
  9. data/lib/assets/javascripts/twitter_cldr/bn.js +208 -98
  10. data/lib/assets/javascripts/twitter_cldr/ca.js +208 -98
  11. data/lib/assets/javascripts/twitter_cldr/cs.js +208 -98
  12. data/lib/assets/javascripts/twitter_cldr/cy.js +208 -98
  13. data/lib/assets/javascripts/twitter_cldr/da.js +208 -98
  14. data/lib/assets/javascripts/twitter_cldr/de.js +208 -98
  15. data/lib/assets/javascripts/twitter_cldr/el.js +208 -98
  16. data/lib/assets/javascripts/twitter_cldr/en-GB.js +1994 -0
  17. data/lib/assets/javascripts/twitter_cldr/en.js +206 -96
  18. data/lib/assets/javascripts/twitter_cldr/es.js +209 -98
  19. data/lib/assets/javascripts/twitter_cldr/eu.js +209 -98
  20. data/lib/assets/javascripts/twitter_cldr/fa.js +209 -98
  21. data/lib/assets/javascripts/twitter_cldr/fi.js +209 -98
  22. data/lib/assets/javascripts/twitter_cldr/fil.js +209 -98
  23. data/lib/assets/javascripts/twitter_cldr/fr.js +209 -98
  24. data/lib/assets/javascripts/twitter_cldr/ga.js +212 -101
  25. data/lib/assets/javascripts/twitter_cldr/gl.js +209 -98
  26. data/lib/assets/javascripts/twitter_cldr/he.js +209 -98
  27. data/lib/assets/javascripts/twitter_cldr/hi.js +209 -98
  28. data/lib/assets/javascripts/twitter_cldr/hr.js +209 -98
  29. data/lib/assets/javascripts/twitter_cldr/hu.js +210 -99
  30. data/lib/assets/javascripts/twitter_cldr/id.js +209 -98
  31. data/lib/assets/javascripts/twitter_cldr/is.js +209 -98
  32. data/lib/assets/javascripts/twitter_cldr/it.js +209 -98
  33. data/lib/assets/javascripts/twitter_cldr/ja.js +209 -98
  34. data/lib/assets/javascripts/twitter_cldr/ko.js +209 -98
  35. data/lib/assets/javascripts/twitter_cldr/lv.js +209 -98
  36. data/lib/assets/javascripts/twitter_cldr/msa.js +209 -98
  37. data/lib/assets/javascripts/twitter_cldr/nl.js +209 -98
  38. data/lib/assets/javascripts/twitter_cldr/no.js +209 -98
  39. data/lib/assets/javascripts/twitter_cldr/pl.js +209 -98
  40. data/lib/assets/javascripts/twitter_cldr/pt.js +209 -98
  41. data/lib/assets/javascripts/twitter_cldr/ro.js +209 -98
  42. data/lib/assets/javascripts/twitter_cldr/ru.js +209 -98
  43. data/lib/assets/javascripts/twitter_cldr/sk.js +209 -98
  44. data/lib/assets/javascripts/twitter_cldr/sq.js +212 -101
  45. data/lib/assets/javascripts/twitter_cldr/sr.js +209 -98
  46. data/lib/assets/javascripts/twitter_cldr/sv.js +209 -98
  47. data/lib/assets/javascripts/twitter_cldr/ta.js +209 -98
  48. data/lib/assets/javascripts/twitter_cldr/th.js +209 -98
  49. data/lib/assets/javascripts/twitter_cldr/tr.js +209 -98
  50. data/lib/assets/javascripts/twitter_cldr/uk.js +209 -98
  51. data/lib/assets/javascripts/twitter_cldr/ur.js +210 -99
  52. data/lib/assets/javascripts/twitter_cldr/vi.js +209 -98
  53. data/lib/assets/javascripts/twitter_cldr/zh-cn.js +209 -98
  54. data/lib/assets/javascripts/twitter_cldr/zh-tw.js +209 -98
  55. data/lib/twitter_cldr/js/compiler.rb +24 -5
  56. data/lib/twitter_cldr/js/mustache/bundle.coffee +6 -0
  57. data/lib/twitter_cldr/js/mustache/parsers/number_parser.coffee +103 -0
  58. data/lib/twitter_cldr/js/renderers/base.rb +2 -0
  59. data/lib/twitter_cldr/js/renderers/parsers/number_parser.rb +34 -0
  60. data/lib/twitter_cldr/js/renderers.rb +4 -0
  61. data/lib/twitter_cldr/js/tasks/tasks.rb +15 -3
  62. data/lib/twitter_cldr/js/version.rb +2 -2
  63. data/lib/twitter_cldr/js.rb +0 -3
  64. data/spec/js/parsers/number_parser.spec.js +211 -0
  65. data/spec/js/utilities.spec.js +0 -3
  66. data/twitter_cldr_js.gemspec +7 -6
  67. metadata +25 -47
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 45132ca6e3f24f38fe4166b2504ce434dd02efd3
4
+ data.tar.gz: 66934f3e44714b90cc2f6b037135d9569287738c
5
+ SHA512:
6
+ metadata.gz: ce5aea98baa5fc37a9eee9c5936c3021dbe78376f88729496a68ae8c1fc1558ed67a808724bf1ae17fa626f9b17b957c757671cd787bbdde1958275a2bb1c42f
7
+ data.tar.gz: 61924baf1a704ba61dda1490c65855581473a7255b7c62c97000436cd860d364f419dbfdf378e50007ac4d50fb4190ee176f1b34b7d3f941ead412465dc4bf86
data/History.txt CHANGED
@@ -1,3 +1,11 @@
1
+ === 2.2.2
2
+
3
+ * Removing rake version requirement.
4
+
5
+ === 2.2.1
6
+
7
+ * Marking compilation dependencies as needed for development only (eg. rubyracer, uglifier, coffeescript, etc).
8
+
1
9
  === 2.2.0
2
10
 
3
11
  * Upgrading to twitter-cldr-rb 2.4.0, which contains an upgrade to CLDR v23.
data/README.md CHANGED
@@ -12,6 +12,16 @@ Currently, twitter-cldr-js supports the following:
12
12
  5. Plural rules
13
13
  6. Bidirectional reordering
14
14
 
15
+ ## Installation
16
+
17
+ Add twitter-cldr-js to your Gemfile:
18
+
19
+ ```ruby
20
+ gem 'twitter_cldr_js', :require => 'twitter_cldr/js'
21
+ ```
22
+
23
+ If you're not using bundler, run `gem install twitter_cldr_js` and then require `twitter_cldr/js` somewhere in your project. Note that twitter-cldr-js isn't really designed to run outside of Rails. If you need the JavaScript functionality it provides but aren't using Rails, consider copying the compiled JavaScript files (lib/assets/javascripts/twitter_cldr/*.js) into your project by hand instead of using this gem directly.
24
+
15
25
  ## Usage with Rails
16
26
 
17
27
  twitter-cldr-js provides a single `.js` file per locale. You can include a locale-specific version (eg. Spanish) in your JavaScript manifest (`app/assets/javascripts/application.js`) like this:
@@ -23,7 +33,7 @@ twitter-cldr-js provides a single `.js` file per locale. You can include a loca
23
33
  This will make the Spanish version of twitter-cldr-js available to the JavaScript in your app. If your app supports multiple languages however, this single-locale approach won't be much use. Instead, require the right file with `javascript_include_tag` for example in a view or a layout:
24
34
 
25
35
  ```ruby
26
- <%= javascript_include_tag "twitter_cldr/#{TwitterCldr.convert_locale(I18n.locale)}.js" %>
36
+ <%= javascript_include_tag "twitter_cldr/#{I18n.locale}.js" %>
27
37
  ```
28
38
 
29
39
  ### Dates and Times
data/Rakefile CHANGED
@@ -31,11 +31,10 @@ end
31
31
 
32
32
  desc 'Run JavaScript specs'
33
33
  task "spec:js" do
34
- ENV["LOCALES"] = "en"
34
+ ENV["LOCALES"] = "en,ar"
35
35
  Rake::Task["twitter_cldr:js:update"].invoke
36
36
 
37
37
  puts "\nJasmine Specs"
38
- failures = 0
39
38
 
40
39
  if `which jasmine-node`.strip.empty?
41
40
  puts "ERROR: You need to install jasmine-node to run JavaScript tests:"
@@ -44,12 +43,12 @@ task "spec:js" do
44
43
  else
45
44
  puts `jasmine-node #{File.dirname(__FILE__)} --junitreport`
46
45
  doc_files = Dir.glob(File.join(File.dirname(__FILE__), "reports/**"))
46
+ failures = 0
47
47
 
48
48
  doc_files.each do |doc_file|
49
49
  doc = REXML::Document.new(File.read(doc_file))
50
- failures += doc.elements.to_a("testsuites/testsuite").inject(0) do |sum, element|
51
- sum += element.attributes["failures"].to_i
52
- sum
50
+ failures = doc.elements.to_a("testsuites/testsuite").inject(0) do |sum, element|
51
+ sum + element.attributes["failures"].to_i
53
52
  end
54
53
  end
55
54