fb-localizer 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. data/Gemfile.lock +80 -65
  2. data/README.md +2 -0
  3. data/fb-localizer.gemspec +1 -1
  4. data/lib/fb-localizer/railtie.rb +25 -23
  5. data/lib/fb-localizer/version.rb +1 -1
  6. data/testapp/.gitignore +1 -0
  7. data/testapp/Gemfile +15 -1
  8. data/testapp/Gemfile.lock +104 -58
  9. data/testapp/README +12 -7
  10. data/testapp/Rakefile +1 -1
  11. data/testapp/{public → app/assets}/images/rails.png +0 -0
  12. data/testapp/app/assets/javascripts/application.js +9 -0
  13. data/testapp/app/assets/stylesheets/application.css +7 -0
  14. data/testapp/{public/stylesheets → app/mailers}/.gitkeep +0 -0
  15. data/testapp/app/models/.gitkeep +0 -0
  16. data/testapp/config/application.rb +12 -6
  17. data/testapp/config/database.yml +3 -0
  18. data/testapp/config/environments/development.rb +7 -3
  19. data/testapp/config/environments/production.rb +23 -12
  20. data/testapp/config/environments/test.rb +5 -1
  21. data/testapp/config/initializers/secret_token.rb +1 -1
  22. data/testapp/config/initializers/wrap_parameters.rb +14 -0
  23. data/testapp/config/locales/en.yml +1 -1
  24. data/testapp/db/seeds.rb +2 -2
  25. data/testapp/lib/assets/.gitkeep +0 -0
  26. data/testapp/log/.gitkeep +0 -0
  27. data/testapp/vendor/assets/stylesheets/.gitkeep +0 -0
  28. metadata +70 -98
  29. data/testapp/app/views/layouts/application.html.erb +0 -14
  30. data/testapp/public/javascripts/application.js +0 -2
  31. data/testapp/public/javascripts/controls.js +0 -965
  32. data/testapp/public/javascripts/dragdrop.js +0 -974
  33. data/testapp/public/javascripts/effects.js +0 -1123
  34. data/testapp/public/javascripts/prototype.js +0 -6001
  35. data/testapp/public/javascripts/rails.js +0 -191
  36. data/testapp/test/performance/browsing_test.rb +0 -9
  37. data/testapp/test/test_helper.rb +0 -13
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fb-localizer (0.2.0)
4
+ fb-localizer (0.2.1)
5
5
  i18n
6
6
  libxml-ruby
7
7
  rails
@@ -9,92 +9,107 @@ PATH
9
9
  GEM
10
10
  remote: http://rubygems.org/
11
11
  specs:
12
- abstract (1.0.0)
13
- actionmailer (3.0.5)
14
- actionpack (= 3.0.5)
15
- mail (~> 2.2.15)
16
- actionpack (3.0.5)
17
- activemodel (= 3.0.5)
18
- activesupport (= 3.0.5)
19
- builder (~> 2.1.2)
20
- erubis (~> 2.6.6)
21
- i18n (~> 0.4)
22
- rack (~> 1.2.1)
23
- rack-mount (~> 0.6.13)
24
- rack-test (~> 0.5.7)
25
- tzinfo (~> 0.3.23)
26
- activemodel (3.0.5)
27
- activesupport (= 3.0.5)
28
- builder (~> 2.1.2)
29
- i18n (~> 0.4)
30
- activerecord (3.0.5)
31
- activemodel (= 3.0.5)
32
- activesupport (= 3.0.5)
33
- arel (~> 2.0.2)
34
- tzinfo (~> 0.3.23)
35
- activeresource (3.0.5)
36
- activemodel (= 3.0.5)
37
- activesupport (= 3.0.5)
38
- activesupport (3.0.5)
39
- arel (2.0.10)
40
- builder (2.1.2)
41
- diff-lcs (1.1.2)
42
- erubis (2.6.6)
43
- abstract (>= 1.0.0)
44
- i18n (0.5.0)
12
+ actionmailer (3.1.3)
13
+ actionpack (= 3.1.3)
14
+ mail (~> 2.3.0)
15
+ actionpack (3.1.3)
16
+ activemodel (= 3.1.3)
17
+ activesupport (= 3.1.3)
18
+ builder (~> 3.0.0)
19
+ erubis (~> 2.7.0)
20
+ i18n (~> 0.6)
21
+ rack (~> 1.3.5)
22
+ rack-cache (~> 1.1)
23
+ rack-mount (~> 0.8.2)
24
+ rack-test (~> 0.6.1)
25
+ sprockets (~> 2.0.3)
26
+ activemodel (3.1.3)
27
+ activesupport (= 3.1.3)
28
+ builder (~> 3.0.0)
29
+ i18n (~> 0.6)
30
+ activerecord (3.1.3)
31
+ activemodel (= 3.1.3)
32
+ activesupport (= 3.1.3)
33
+ arel (~> 2.2.1)
34
+ tzinfo (~> 0.3.29)
35
+ activeresource (3.1.3)
36
+ activemodel (= 3.1.3)
37
+ activesupport (= 3.1.3)
38
+ activesupport (3.1.3)
39
+ multi_json (~> 1.0)
40
+ arel (2.2.1)
41
+ builder (3.0.0)
42
+ diff-lcs (1.1.3)
43
+ erubis (2.7.0)
44
+ hike (1.2.1)
45
+ i18n (0.6.0)
46
+ json (1.6.3)
45
47
  libxml-ruby (2.2.2)
46
- mail (2.2.19)
47
- activesupport (>= 2.3.6)
48
+ mail (2.3.0)
48
49
  i18n (>= 0.4.0)
49
50
  mime-types (~> 1.16)
50
51
  treetop (~> 1.4.8)
51
- mime-types (1.16)
52
- polyglot (0.3.2)
53
- rack (1.2.2)
54
- rack-mount (0.6.14)
52
+ mime-types (1.17.2)
53
+ multi_json (1.0.4)
54
+ polyglot (0.3.3)
55
+ rack (1.3.5)
56
+ rack-cache (1.1)
57
+ rack (>= 0.4)
58
+ rack-mount (0.8.3)
55
59
  rack (>= 1.0.0)
56
- rack-test (0.5.7)
60
+ rack-ssl (1.3.2)
61
+ rack
62
+ rack-test (0.6.1)
57
63
  rack (>= 1.0)
58
- rails (3.0.5)
59
- actionmailer (= 3.0.5)
60
- actionpack (= 3.0.5)
61
- activerecord (= 3.0.5)
62
- activeresource (= 3.0.5)
63
- activesupport (= 3.0.5)
64
+ rails (3.1.3)
65
+ actionmailer (= 3.1.3)
66
+ actionpack (= 3.1.3)
67
+ activerecord (= 3.1.3)
68
+ activeresource (= 3.1.3)
69
+ activesupport (= 3.1.3)
64
70
  bundler (~> 1.0)
65
- railties (= 3.0.5)
66
- railties (3.0.5)
67
- actionpack (= 3.0.5)
68
- activesupport (= 3.0.5)
71
+ railties (= 3.1.3)
72
+ railties (3.1.3)
73
+ actionpack (= 3.1.3)
74
+ activesupport (= 3.1.3)
75
+ rack-ssl (~> 1.3.2)
69
76
  rake (>= 0.8.7)
70
- thor (~> 0.14.4)
71
- rake (0.8.7)
72
- rspec (2.5.0)
73
- rspec-core (~> 2.5.0)
74
- rspec-expectations (~> 2.5.0)
75
- rspec-mocks (~> 2.5.0)
76
- rspec-core (2.5.1)
77
- rspec-expectations (2.5.0)
77
+ rdoc (~> 3.4)
78
+ thor (~> 0.14.6)
79
+ rake (0.9.2.2)
80
+ rdoc (3.12)
81
+ json (~> 1.4)
82
+ rspec (2.7.0)
83
+ rspec-core (~> 2.7.0)
84
+ rspec-expectations (~> 2.7.0)
85
+ rspec-mocks (~> 2.7.0)
86
+ rspec-core (2.7.1)
87
+ rspec-expectations (2.7.0)
78
88
  diff-lcs (~> 1.1.2)
79
- rspec-mocks (2.5.0)
80
- rspec-rails (2.5.0)
89
+ rspec-mocks (2.7.0)
90
+ rspec-rails (2.7.0)
81
91
  actionpack (~> 3.0)
82
92
  activesupport (~> 3.0)
83
93
  railties (~> 3.0)
84
- rspec (~> 2.5.0)
85
- sqlite3 (1.3.3)
94
+ rspec (~> 2.7.0)
95
+ sprockets (2.0.3)
96
+ hike (~> 1.2)
97
+ rack (~> 1.0)
98
+ tilt (~> 1.1, != 1.3.0)
99
+ sqlite3 (1.3.5)
86
100
  sqlite3-ruby (1.3.3)
87
101
  sqlite3 (>= 1.3.3)
88
102
  thor (0.14.6)
103
+ tilt (1.3.3)
89
104
  treetop (1.4.10)
90
105
  polyglot
91
106
  polyglot (>= 0.3.1)
92
- tzinfo (0.3.25)
107
+ tzinfo (0.3.31)
93
108
 
94
109
  PLATFORMS
95
110
  ruby
96
111
 
97
112
  DEPENDENCIES
98
113
  fb-localizer!
99
- rspec-rails (~> 2.5)
114
+ rspec-rails
100
115
  sqlite3-ruby
data/README.md CHANGED
@@ -13,6 +13,8 @@ So, if we want to add a localized "I like it" button into our web page, we need
13
13
  Note: a more complex algorithm on planning which is the nearest locale
14
14
  is planned.
15
15
 
16
+ [![Build Status](https://secure.travis-ci.org/albertbellonch/fb-localizer.png)](http://travis-ci.org/albertbellonch/fb-localizer)
17
+
16
18
  Priority locales
17
19
  ----------------
18
20
 
data/fb-localizer.gemspec CHANGED
@@ -21,7 +21,7 @@ nearest Facebook's locale. This way you can localize the "I like it" button on e
21
21
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
22
22
  s.require_paths = ["lib"]
23
23
 
24
- s.add_development_dependency "rspec-rails", "~> 2.5"
24
+ s.add_development_dependency "rspec-rails"
25
25
  s.add_dependency "rails"
26
26
  s.add_dependency "i18n"
27
27
  s.add_dependency "libxml-ruby"
@@ -6,31 +6,33 @@ require "timeout"
6
6
 
7
7
  module FbLocalizer
8
8
  class Railtie < Rails::Railtie
9
- initializer "fb-localizer.configure_rails_initialization" do
10
- def load_defaults
11
- FbLocalizer::FbLocalizerHelpers.const_set(:FB_LOCALES, ["en_US","es_ES","ca_ES"])
12
- end
9
+ initializer "fb-localizer.configure_rails_initialization" do |app|
10
+ app.config.after_initialize do
11
+ def load_defaults
12
+ FbLocalizer::FbLocalizerHelpers.const_set(:FB_LOCALES, ["en_US","es_ES","ca_ES"])
13
+ end
13
14
 
14
- if FbLocalizer.skip_loading
15
- puts "FB-Localizer => Skipped, using defaults instead"
16
- load_defaults
17
- else
18
- begin
19
- Timeout::timeout(5) do
20
- url = "http://www.facebook.com/translations/FacebookLocales.xml"
21
- open(url){ |f|
22
- xml = f.readlines.join("\n")
23
- fb_locales = XML::Parser.string(xml).parse
24
- FbLocalizer::FbLocalizerHelpers::FB_LOCALES = []
25
- fb_locales.find('//locales/locale/codes/code/standard/representation').each do |node|
26
- FbLocalizer::FbLocalizerHelpers::FB_LOCALES << node.content
27
- end
28
- puts "FB-Localizer => Locales read successfully from <http://www.facebook.com/translations/FacebookLocales.xml>"
29
- }
30
- end
31
- rescue Exception => e
32
- puts "FB-Localizer => Exception '#{e}', using defaults instead"
15
+ if FbLocalizer.skip_loading
16
+ puts "FB-Localizer => Skipped, using defaults instead"
33
17
  load_defaults
18
+ else
19
+ begin
20
+ Timeout::timeout(15) do
21
+ url = "http://www.facebook.com/translations/FacebookLocales.xml"
22
+ open(url){ |f|
23
+ xml = f.readlines.join("\n")
24
+ fb_locales = XML::Parser.string(xml).parse
25
+ FbLocalizer::FbLocalizerHelpers::FB_LOCALES = []
26
+ fb_locales.find('//locales/locale/codes/code/standard/representation').each do |node|
27
+ FbLocalizer::FbLocalizerHelpers::FB_LOCALES << node.content
28
+ end
29
+ puts "FB-Localizer => Locales read successfully from <http://www.facebook.com/translations/FacebookLocales.xml>"
30
+ }
31
+ end
32
+ rescue Exception => e
33
+ puts "FB-Localizer => Exception '#{e}', using defaults instead"
34
+ load_defaults
35
+ end
34
36
  end
35
37
  end
36
38
  end
@@ -1,5 +1,5 @@
1
1
  module Fb
2
2
  module Localizer
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
data/testapp/.gitignore CHANGED
@@ -2,3 +2,4 @@
2
2
  db/*.sqlite3
3
3
  log/*.log
4
4
  tmp/
5
+ .sass-cache/
data/testapp/Gemfile CHANGED
@@ -1,8 +1,22 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
- gem 'rails', '3.0.5'
3
+ gem 'rails', '3.1.1'
4
+
4
5
  gem 'fb-localizer', :path => ".."
5
6
 
6
7
  gem 'haml-rails'
7
8
 
8
9
  gem 'sqlite3'
10
+
11
+ group :assets do
12
+ gem 'sass-rails', '~> 3.1.4'
13
+ gem 'coffee-rails', '~> 3.1.1'
14
+ gem 'uglifier', '>= 1.0.3'
15
+ end
16
+
17
+ gem 'jquery-rails'
18
+
19
+ group :test do
20
+ # Pretty printed test output
21
+ gem 'turn', :require => false
22
+ end
data/testapp/Gemfile.lock CHANGED
@@ -1,90 +1,136 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- fb-localizer (0.1.3)
4
+ fb-localizer (0.2.0)
5
5
  i18n
6
- libxml-ruby (= 1.1.3)
6
+ libxml-ruby
7
7
  rails
8
8
 
9
9
  GEM
10
10
  remote: http://rubygems.org/
11
11
  specs:
12
- abstract (1.0.0)
13
- actionmailer (3.0.5)
14
- actionpack (= 3.0.5)
15
- mail (~> 2.2.15)
16
- actionpack (3.0.5)
17
- activemodel (= 3.0.5)
18
- activesupport (= 3.0.5)
19
- builder (~> 2.1.2)
20
- erubis (~> 2.6.6)
21
- i18n (~> 0.4)
22
- rack (~> 1.2.1)
23
- rack-mount (~> 0.6.13)
24
- rack-test (~> 0.5.7)
25
- tzinfo (~> 0.3.23)
26
- activemodel (3.0.5)
27
- activesupport (= 3.0.5)
28
- builder (~> 2.1.2)
29
- i18n (~> 0.4)
30
- activerecord (3.0.5)
31
- activemodel (= 3.0.5)
32
- activesupport (= 3.0.5)
33
- arel (~> 2.0.2)
34
- tzinfo (~> 0.3.23)
35
- activeresource (3.0.5)
36
- activemodel (= 3.0.5)
37
- activesupport (= 3.0.5)
38
- activesupport (3.0.5)
39
- arel (2.0.9)
40
- builder (2.1.2)
41
- erubis (2.6.6)
42
- abstract (>= 1.0.0)
43
- haml (3.1.1)
12
+ actionmailer (3.1.1)
13
+ actionpack (= 3.1.1)
14
+ mail (~> 2.3.0)
15
+ actionpack (3.1.1)
16
+ activemodel (= 3.1.1)
17
+ activesupport (= 3.1.1)
18
+ builder (~> 3.0.0)
19
+ erubis (~> 2.7.0)
20
+ i18n (~> 0.6)
21
+ rack (~> 1.3.2)
22
+ rack-cache (~> 1.1)
23
+ rack-mount (~> 0.8.2)
24
+ rack-test (~> 0.6.1)
25
+ sprockets (~> 2.0.2)
26
+ activemodel (3.1.1)
27
+ activesupport (= 3.1.1)
28
+ builder (~> 3.0.0)
29
+ i18n (~> 0.6)
30
+ activerecord (3.1.1)
31
+ activemodel (= 3.1.1)
32
+ activesupport (= 3.1.1)
33
+ arel (~> 2.2.1)
34
+ tzinfo (~> 0.3.29)
35
+ activeresource (3.1.1)
36
+ activemodel (= 3.1.1)
37
+ activesupport (= 3.1.1)
38
+ activesupport (3.1.1)
39
+ multi_json (~> 1.0)
40
+ ansi (1.3.0)
41
+ arel (2.2.1)
42
+ builder (3.0.0)
43
+ coffee-rails (3.1.1)
44
+ coffee-script (>= 2.2.0)
45
+ railties (~> 3.1.0)
46
+ coffee-script (2.2.0)
47
+ coffee-script-source
48
+ execjs
49
+ coffee-script-source (1.1.2)
50
+ erubis (2.7.0)
51
+ execjs (1.2.9)
52
+ multi_json (~> 1.0)
53
+ haml (3.1.3)
44
54
  haml-rails (0.3.4)
45
55
  actionpack (~> 3.0)
46
56
  activesupport (~> 3.0)
47
57
  haml (~> 3.0)
48
58
  railties (~> 3.0)
49
- i18n (0.5.0)
50
- libxml-ruby (1.1.3)
51
- mail (2.2.15)
52
- activesupport (>= 2.3.6)
59
+ hike (1.2.1)
60
+ i18n (0.6.0)
61
+ jquery-rails (1.0.16)
62
+ railties (~> 3.0)
63
+ thor (~> 0.14)
64
+ json (1.6.1)
65
+ libxml-ruby (2.2.2)
66
+ mail (2.3.0)
53
67
  i18n (>= 0.4.0)
54
68
  mime-types (~> 1.16)
55
69
  treetop (~> 1.4.8)
56
70
  mime-types (1.16)
57
- polyglot (0.3.1)
58
- rack (1.2.2)
59
- rack-mount (0.6.14)
71
+ multi_json (1.0.3)
72
+ polyglot (0.3.2)
73
+ rack (1.3.4)
74
+ rack-cache (1.1)
75
+ rack (>= 0.4)
76
+ rack-mount (0.8.3)
60
77
  rack (>= 1.0.0)
61
- rack-test (0.5.7)
78
+ rack-ssl (1.3.2)
79
+ rack
80
+ rack-test (0.6.1)
62
81
  rack (>= 1.0)
63
- rails (3.0.5)
64
- actionmailer (= 3.0.5)
65
- actionpack (= 3.0.5)
66
- activerecord (= 3.0.5)
67
- activeresource (= 3.0.5)
68
- activesupport (= 3.0.5)
82
+ rails (3.1.1)
83
+ actionmailer (= 3.1.1)
84
+ actionpack (= 3.1.1)
85
+ activerecord (= 3.1.1)
86
+ activeresource (= 3.1.1)
87
+ activesupport (= 3.1.1)
69
88
  bundler (~> 1.0)
70
- railties (= 3.0.5)
71
- railties (3.0.5)
72
- actionpack (= 3.0.5)
73
- activesupport (= 3.0.5)
89
+ railties (= 3.1.1)
90
+ railties (3.1.1)
91
+ actionpack (= 3.1.1)
92
+ activesupport (= 3.1.1)
93
+ rack-ssl (~> 1.3.2)
74
94
  rake (>= 0.8.7)
75
- thor (~> 0.14.4)
76
- rake (0.8.7)
77
- sqlite3 (1.3.3)
95
+ rdoc (~> 3.4)
96
+ thor (~> 0.14.6)
97
+ rake (0.9.2)
98
+ rdoc (3.10)
99
+ json (~> 1.4)
100
+ sass (3.1.10)
101
+ sass-rails (3.1.4)
102
+ actionpack (~> 3.1.0)
103
+ railties (~> 3.1.0)
104
+ sass (>= 3.1.4)
105
+ sprockets (~> 2.0.0)
106
+ tilt (~> 1.3.2)
107
+ sprockets (2.0.2)
108
+ hike (~> 1.2)
109
+ rack (~> 1.0)
110
+ tilt (~> 1.1, != 1.3.0)
111
+ sqlite3 (1.3.4)
78
112
  thor (0.14.6)
79
- treetop (1.4.9)
113
+ tilt (1.3.3)
114
+ treetop (1.4.10)
115
+ polyglot
80
116
  polyglot (>= 0.3.1)
81
- tzinfo (0.3.25)
117
+ turn (0.8.3)
118
+ ansi
119
+ tzinfo (0.3.30)
120
+ uglifier (1.0.3)
121
+ execjs (>= 0.3.0)
122
+ multi_json (>= 1.0.2)
82
123
 
83
124
  PLATFORMS
84
125
  ruby
85
126
 
86
127
  DEPENDENCIES
128
+ coffee-rails (~> 3.1.1)
87
129
  fb-localizer!
88
130
  haml-rails
89
- rails (= 3.0.5)
131
+ jquery-rails
132
+ rails (= 3.1.1)
133
+ sass-rails (~> 3.1.4)
90
134
  sqlite3
135
+ turn
136
+ uglifier (>= 1.0.3)