fb-localizer 0.2.0 → 0.2.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.
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/testapp/README CHANGED
@@ -91,7 +91,7 @@ mode. With gems, use <tt>sudo gem install ruby-debug</tt>. Example:
91
91
 
92
92
  class WeblogController < ActionController::Base
93
93
  def index
94
- @posts = Post.find(:all)
94
+ @posts = Post.all
95
95
  debugger
96
96
  end
97
97
  end
@@ -139,7 +139,7 @@ To reload your controllers and models after launching the console run
139
139
  <tt>reload!</tt>
140
140
 
141
141
  More information about irb can be found at:
142
- link:http://www.rubycentral.com/pickaxe/irb.html
142
+ link:http://www.rubycentral.org/pickaxe/irb.html
143
143
 
144
144
 
145
145
  == dbconsole
@@ -156,6 +156,10 @@ PostgreSQL and SQLite 3.
156
156
  The default directory structure of a generated Ruby on Rails application:
157
157
 
158
158
  |-- app
159
+ | |-- assets
160
+ | |-- images
161
+ | |-- javascripts
162
+ | `-- stylesheets
159
163
  | |-- controllers
160
164
  | |-- helpers
161
165
  | |-- mailers
@@ -172,9 +176,6 @@ The default directory structure of a generated Ruby on Rails application:
172
176
  | `-- tasks
173
177
  |-- log
174
178
  |-- public
175
- | |-- images
176
- | |-- javascripts
177
- | `-- stylesheets
178
179
  |-- script
179
180
  |-- test
180
181
  | |-- fixtures
@@ -188,11 +189,16 @@ The default directory structure of a generated Ruby on Rails application:
188
189
  | |-- sessions
189
190
  | `-- sockets
190
191
  `-- vendor
192
+ |-- assets
193
+ `-- stylesheets
191
194
  `-- plugins
192
195
 
193
196
  app
194
197
  Holds all the code that's specific to this particular application.
195
198
 
199
+ app/assets
200
+ Contains subdirectories for images, stylesheets, and JavaScript files.
201
+
196
202
  app/controllers
197
203
  Holds controllers that should be named like weblogs_controller.rb for
198
204
  automated URL mapping. All controllers should descend from
@@ -237,8 +243,7 @@ lib
237
243
  the load path.
238
244
 
239
245
  public
240
- The directory available for the web server. Contains subdirectories for
241
- images, stylesheets, and javascripts. Also contains the dispatchers and the
246
+ The directory available for the web server. Also contains the dispatchers and the
242
247
  default HTML files. This should be set as the DOCUMENT_ROOT of your web
243
248
  server.
244
249
 
data/testapp/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
+ #!/usr/bin/env rake
1
2
  # Add your own tasks in files placed in lib/tasks ending in .rake,
2
3
  # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
4
 
4
5
  require File.expand_path('../config/application', __FILE__)
5
- require 'rake'
6
6
 
7
7
  Testapp::Application.load_tasks
File without changes
@@ -0,0 +1,9 @@
1
+ // This is a manifest file that'll be compiled into including all the files listed below.
2
+ // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
3
+ // be included in the compiled file accessible from http://example.com/assets/application.js
4
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
5
+ // the compiled file.
6
+ //
7
+ //= require jquery
8
+ //= require jquery_ujs
9
+ //= require_tree .
@@ -0,0 +1,7 @@
1
+ /*
2
+ * This is a manifest file that'll automatically include all the stylesheets available in this directory
3
+ * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
4
+ * the top of the compiled file, but it's generally better to create a new file per style scope.
5
+ *= require_self
6
+ *= require_tree .
7
+ */
File without changes
@@ -2,9 +2,12 @@ require File.expand_path('../boot', __FILE__)
2
2
 
3
3
  require 'rails/all'
4
4
 
5
- # If you have a Gemfile, require the gems listed there, including any gems
6
- # you've limited to :test, :development, or :production.
7
- Bundler.require(:default, Rails.env) if defined?(Bundler)
5
+ if defined?(Bundler)
6
+ # If you precompile assets before deploying to production, use this line
7
+ Bundler.require(*Rails.groups(:assets => %w(development test)))
8
+ # If you want your assets lazily compiled in production, use this line
9
+ # Bundler.require(:default, :assets, Rails.env)
10
+ end
8
11
 
9
12
  module Testapp
10
13
  class Application < Rails::Application
@@ -30,13 +33,16 @@ module Testapp
30
33
  # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
31
34
  # config.i18n.default_locale = :de
32
35
 
33
- # JavaScript files you want as :defaults (application.js is always included).
34
- # config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
35
-
36
36
  # Configure the default encoding used in templates for Ruby 1.9.
37
37
  config.encoding = "utf-8"
38
38
 
39
39
  # Configure sensitive parameters which will be filtered from the log file.
40
40
  config.filter_parameters += [:password]
41
+
42
+ # Enable the asset pipeline
43
+ config.assets.enabled = true
44
+
45
+ # Version of your assets, change this if you want to expire all your assets
46
+ config.assets.version = '1.0'
41
47
  end
42
48
  end
@@ -1,5 +1,8 @@
1
1
  # SQLite version 3.x
2
2
  # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
3
6
  development:
4
7
  adapter: sqlite3
5
8
  database: db/development.sqlite3
@@ -3,7 +3,7 @@ Testapp::Application.configure do
3
3
 
4
4
  # In the development environment your application's code is reloaded on
5
5
  # every request. This slows down response time but is perfect for development
6
- # since you don't have to restart the webserver when you make code changes.
6
+ # since you don't have to restart the web server when you make code changes.
7
7
  config.cache_classes = false
8
8
 
9
9
  # Log error messages when you accidentally call methods on nil.
@@ -11,7 +11,6 @@ Testapp::Application.configure do
11
11
 
12
12
  # Show full error reports and disable caching
13
13
  config.consider_all_requests_local = true
14
- config.action_view.debug_rjs = true
15
14
  config.action_controller.perform_caching = false
16
15
 
17
16
  # Don't care if the mailer can't send
@@ -22,5 +21,10 @@ Testapp::Application.configure do
22
21
 
23
22
  # Only use best-standards-support built into browsers
24
23
  config.action_dispatch.best_standards_support = :builtin
25
- end
26
24
 
25
+ # Do not compress assets
26
+ config.assets.compress = false
27
+
28
+ # Expands the lines which load the assets
29
+ config.assets.debug = true
30
+ end
@@ -1,7 +1,6 @@
1
1
  Testapp::Application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb
3
3
 
4
- # The production environment is meant for finished, "live" apps.
5
4
  # Code is not reloaded between requests
6
5
  config.cache_classes = true
7
6
 
@@ -9,14 +8,27 @@ Testapp::Application.configure do
9
8
  config.consider_all_requests_local = false
10
9
  config.action_controller.perform_caching = true
11
10
 
12
- # Specifies the header that your server uses for sending files
13
- config.action_dispatch.x_sendfile_header = "X-Sendfile"
11
+ # Disable Rails's static asset server (Apache or nginx will already do this)
12
+ config.serve_static_assets = false
13
+
14
+ # Compress JavaScripts and CSS
15
+ config.assets.compress = true
16
+
17
+ # Don't fallback to assets pipeline if a precompiled asset is missed
18
+ config.assets.compile = false
19
+
20
+ # Generate digests for assets URLs
21
+ config.assets.digest = true
14
22
 
15
- # For nginx:
16
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
23
+ # Defaults to Rails.root.join("public/assets")
24
+ # config.assets.manifest = YOUR_PATH
17
25
 
18
- # If you have no front-end server that supports something like X-Sendfile,
19
- # just comment this out and Rails will serve the files
26
+ # Specifies the header that your server uses for sending files
27
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
+
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ # config.force_ssl = true
20
32
 
21
33
  # See everything in the log (default is :info)
22
34
  # config.log_level = :debug
@@ -27,13 +39,12 @@ Testapp::Application.configure do
27
39
  # Use a different cache store in production
28
40
  # config.cache_store = :mem_cache_store
29
41
 
30
- # Disable Rails's static asset server
31
- # In production, Apache or nginx will already do this
32
- config.serve_static_assets = false
33
-
34
- # Enable serving of images, stylesheets, and javascripts from an asset server
42
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
35
43
  # config.action_controller.asset_host = "http://assets.example.com"
36
44
 
45
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
46
+ # config.assets.precompile += %w( search.js )
47
+
37
48
  # Disable delivery errors, bad email addresses will be ignored
38
49
  # config.action_mailer.raise_delivery_errors = false
39
50
 
@@ -7,7 +7,11 @@ Testapp::Application.configure do
7
7
  # and recreated between test runs. Don't rely on the data there!
8
8
  config.cache_classes = true
9
9
 
10
- # Log error messages when you accidentally call methods on nil.
10
+ # Configure static asset server for tests with Cache-Control for performance
11
+ config.serve_static_assets = true
12
+ config.static_cache_control = "public, max-age=3600"
13
+
14
+ # Log error messages when you accidentally call methods on nil
11
15
  config.whiny_nils = true
12
16
 
13
17
  # Show full error reports and disable caching
@@ -4,4 +4,4 @@
4
4
  # If you change this key, all old signed cookies will become invalid!
5
5
  # Make sure the secret is at least 30 characters and all random,
6
6
  # no regular words or you'll be exposed to dictionary attacks.
7
- Testapp::Application.config.secret_token = 'ae50384afc2ad02d2205ee375bf178e4e27513c2533b0d54721c6545472ffbe3db104de81e1bbe0cee53f5e4ebaaaf9353660802ccc7b64460d9569bf97d09fc'
7
+ Testapp::Application.config.secret_token = '848de198d948b8320381d48ad49b3e43fb295bcdf8093321ddee8f21ab6dd38acba4a3047a407f1c6025adcc08262696c54c1298e93ab0409e2734e90f258f96'
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters :format => [:json]
9
+ end
10
+
11
+ # Disable root element in JSON by default.
12
+ ActiveSupport.on_load(:active_record) do
13
+ self.include_root_in_json = false
14
+ end
@@ -1,5 +1,5 @@
1
1
  # Sample localization file for English. Add more files in this directory for other locales.
2
- # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
3
 
4
4
  en:
5
5
  hello: "Hello world"
data/testapp/db/seeds.rb CHANGED
@@ -3,5 +3,5 @@
3
3
  #
4
4
  # Examples:
5
5
  #
6
- # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
7
- # Mayor.create(:name => 'Daley', :city => cities.first)
6
+ # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
7
+ # Mayor.create(name: 'Emanuel', city: cities.first)
File without changes
File without changes
File without changes
metadata CHANGED
@@ -1,92 +1,70 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: fb-localizer
3
- version: !ruby/object:Gem::Version
4
- hash: 23
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.1
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 2
9
- - 0
10
- version: 0.2.0
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Albert Bellonch
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-10-08 00:00:00 +02:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2011-12-19 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: rspec-rails
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70207826031440 !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
27
- - - ~>
28
- - !ruby/object:Gem::Version
29
- hash: 9
30
- segments:
31
- - 2
32
- - 5
33
- version: "2.5"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
34
22
  type: :development
35
- version_requirements: *id001
36
- - !ruby/object:Gem::Dependency
37
- name: rails
38
23
  prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70207826031440
25
+ - !ruby/object:Gem::Dependency
26
+ name: rails
27
+ requirement: &70207826030760 !ruby/object:Gem::Requirement
40
28
  none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- hash: 3
45
- segments:
46
- - 0
47
- version: "0"
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
48
33
  type: :runtime
49
- version_requirements: *id002
50
- - !ruby/object:Gem::Dependency
51
- name: i18n
52
34
  prerelease: false
53
- requirement: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *70207826030760
36
+ - !ruby/object:Gem::Dependency
37
+ name: i18n
38
+ requirement: &70207826027460 !ruby/object:Gem::Requirement
54
39
  none: false
55
- requirements:
56
- - - ">="
57
- - !ruby/object:Gem::Version
58
- hash: 3
59
- segments:
60
- - 0
61
- version: "0"
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
62
44
  type: :runtime
63
- version_requirements: *id003
64
- - !ruby/object:Gem::Dependency
65
- name: libxml-ruby
66
45
  prerelease: false
67
- requirement: &id004 !ruby/object:Gem::Requirement
46
+ version_requirements: *70207826027460
47
+ - !ruby/object:Gem::Dependency
48
+ name: libxml-ruby
49
+ requirement: &70207826026380 !ruby/object:Gem::Requirement
68
50
  none: false
69
- requirements:
70
- - - ">="
71
- - !ruby/object:Gem::Version
72
- hash: 3
73
- segments:
74
- - 0
75
- version: "0"
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
76
55
  type: :runtime
77
- version_requirements: *id004
78
- description: |-
79
- Converts from Ruby's locale to the
80
- nearest Facebook's locale. This way you can localize the "I like it" button on every web page you want
81
- email:
56
+ prerelease: false
57
+ version_requirements: *70207826026380
58
+ description: ! 'Converts from Ruby''s locale to the
59
+
60
+ nearest Facebook''s locale. This way you can localize the "I like it" button on
61
+ every web page you want'
62
+ email:
82
63
  - albert@itnig.net
83
64
  executables: []
84
-
85
65
  extensions: []
86
-
87
66
  extra_rdoc_files: []
88
-
89
- files:
67
+ files:
90
68
  - .gitignore
91
69
  - .rspec
92
70
  - .travis.yml
@@ -107,10 +85,14 @@ files:
107
85
  - testapp/Gemfile.lock
108
86
  - testapp/README
109
87
  - testapp/Rakefile
88
+ - testapp/app/assets/images/rails.png
89
+ - testapp/app/assets/javascripts/application.js
90
+ - testapp/app/assets/stylesheets/application.css
110
91
  - testapp/app/controllers/application_controller.rb
111
92
  - testapp/app/controllers/static_controller.rb
112
93
  - testapp/app/helpers/application_helper.rb
113
- - testapp/app/views/layouts/application.html.erb
94
+ - testapp/app/mailers/.gitkeep
95
+ - testapp/app/models/.gitkeep
114
96
  - testapp/app/views/static/index.html.haml
115
97
  - testapp/config.ru
116
98
  - testapp/config/application.rb
@@ -126,62 +108,52 @@ files:
126
108
  - testapp/config/initializers/mime_types.rb
127
109
  - testapp/config/initializers/secret_token.rb
128
110
  - testapp/config/initializers/session_store.rb
111
+ - testapp/config/initializers/wrap_parameters.rb
129
112
  - testapp/config/locales/en.yml
130
113
  - testapp/config/routes.rb
131
114
  - testapp/db/seeds.rb
132
115
  - testapp/doc/README_FOR_APP
116
+ - testapp/lib/assets/.gitkeep
133
117
  - testapp/lib/tasks/.gitkeep
118
+ - testapp/log/.gitkeep
134
119
  - testapp/public/404.html
135
120
  - testapp/public/422.html
136
121
  - testapp/public/500.html
137
122
  - testapp/public/favicon.ico
138
- - testapp/public/images/rails.png
139
- - testapp/public/javascripts/application.js
140
- - testapp/public/javascripts/controls.js
141
- - testapp/public/javascripts/dragdrop.js
142
- - testapp/public/javascripts/effects.js
143
- - testapp/public/javascripts/prototype.js
144
- - testapp/public/javascripts/rails.js
145
123
  - testapp/public/robots.txt
146
- - testapp/public/stylesheets/.gitkeep
147
124
  - testapp/script/rails
148
- - testapp/test/performance/browsing_test.rb
149
- - testapp/test/test_helper.rb
125
+ - testapp/vendor/assets/stylesheets/.gitkeep
150
126
  - testapp/vendor/plugins/.gitkeep
151
- has_rdoc: true
152
127
  homepage: https://github.com/albertbellonch/fb-localizer
153
128
  licenses: []
154
-
155
129
  post_install_message:
156
130
  rdoc_options: []
157
-
158
- require_paths:
131
+ require_paths:
159
132
  - lib
160
- required_ruby_version: !ruby/object:Gem::Requirement
133
+ required_ruby_version: !ruby/object:Gem::Requirement
161
134
  none: false
162
- requirements:
163
- - - ">="
164
- - !ruby/object:Gem::Version
165
- hash: 3
166
- segments:
135
+ requirements:
136
+ - - ! '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ segments:
167
140
  - 0
168
- version: "0"
169
- required_rubygems_version: !ruby/object:Gem::Requirement
141
+ hash: 3827179848392468177
142
+ required_rubygems_version: !ruby/object:Gem::Requirement
170
143
  none: false
171
- requirements:
172
- - - ">="
173
- - !ruby/object:Gem::Version
174
- hash: 3
175
- segments:
144
+ requirements:
145
+ - - ! '>='
146
+ - !ruby/object:Gem::Version
147
+ version: '0'
148
+ segments:
176
149
  - 0
177
- version: "0"
150
+ hash: 3827179848392468177
178
151
  requirements: []
179
-
180
152
  rubyforge_project: fb-localizer
181
- rubygems_version: 1.5.2
153
+ rubygems_version: 1.8.10
182
154
  signing_key:
183
155
  specification_version: 3
184
156
  summary: Converts from Ruby's locale to the nearest Facebook's locale.
185
- test_files:
157
+ test_files:
186
158
  - spec/helpers/fb-localizer_spec.rb
187
159
  - spec/spec_helper.rb