exvo_globalize 0.3.2 → 0.4.0

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/README.md CHANGED
@@ -4,11 +4,13 @@ This gem lets you make use of the Globalize app (http://globalize.exvo.com/)
4
4
  to handle the translation of your Rails app into multiple languages.
5
5
 
6
6
 
7
+
7
8
  ## Requirements
8
9
 
9
10
  Rails 3.0+
10
11
 
11
12
 
13
+
12
14
  ## Installation
13
15
 
14
16
  Install the gem
@@ -29,14 +31,16 @@ bundle
29
31
  $ bundle
30
32
  ```
31
33
 
32
- and generate the database migration
34
+ finally generate the database migration and the javascript library:
33
35
 
34
36
  ```bash
35
- $ rails generate exvo_globalize
37
+ $ rails generate exvo_globalize:install
36
38
  ```
37
39
 
40
+ If you don’t plan on using I18n in javascript you can just delete the generated `public/javascripts/exvo_globalize_i18n.js` file.
38
41
 
39
- It is advised to have your `/globalize/` actions behind an authorization barrier (besides `/globalize/translations.json`, which is by default publicly accessible).
42
+
43
+ It is advised to have your `/globalize/` actions behind an authorization barrier (besides `/globalize/translations.json` and `/globalize/translations/js/*.js`, which are by default publicly accessible).
40
44
  Create a `config/initializers/exvo_globalize.rb` file with similar contents:
41
45
 
42
46
  ```ruby
@@ -50,6 +54,27 @@ I18n::Backend::GlobalizeStore.authenticator = proc {
50
54
 
51
55
 
52
56
 
57
+ ### Javascript support
58
+
59
+ Basic support for I18n in the javascript is included. In order for it to work you need to include two javascript files in your application’s layout (the order is important):
60
+
61
+ ```ruby
62
+ = javascript_include_tag 'exvo_globalize_i18n'
63
+ = i18n_translations_javascript_include_tag(I18n.locale)
64
+ ```
65
+
66
+
67
+ Now you can use translations inside your javascript:
68
+
69
+ ```js
70
+ t("new")
71
+ => "New"
72
+ ```
73
+
74
+ The above, of course, expects you to have the `:new` key for the current `I18n.locale` in one of your `config/locales/*.yml` files.
75
+
76
+
77
+
53
78
  ## Getting back your database stored translations
54
79
 
55
80
  If you wish to extract your database stored translations to a separate YAML/Ruby file, there are two rake task to help you with that:
@@ -89,4 +114,29 @@ And pressing `Update translations`.
89
114
 
90
115
 
91
116
 
117
+ ## Running the tests
118
+
119
+ Running tests via `Guard` is the recommended way:
120
+
121
+ ```bash
122
+ $ bundle exec guard
123
+ ```
124
+
125
+ But tests can be run separately as well:
126
+
127
+ ```bash
128
+ $ bundle exec rspec spec
129
+ ```
130
+
131
+ and
132
+
133
+ ```bash
134
+ $ jasmine-headless-webkit -c
135
+ ```
136
+
137
+ There is a great guide for setting up `jasmine-headless-webkit` in your OS if you have problems with it:
138
+ http://johnbintz.github.com/jasmine-headless-webkit/
139
+
140
+
141
+
92
142
  Copyright © 2011 Exvo.com Development BV, released under the MIT license
data/Rakefile CHANGED
@@ -2,6 +2,7 @@ require 'bundler/gem_tasks'
2
2
 
3
3
  require 'rspec/core'
4
4
  require 'rspec/core/rake_task'
5
+ import 'lib/tasks/jasmine.rake'
5
6
  RSpec::Core::RakeTask.new(:spec) do |spec|
6
7
  spec.pattern = FileList['spec/**/*_spec.rb']
7
8
  end
@@ -0,0 +1,90 @@
1
+ var I18n = (function() {
2
+ // Replace {{foo}} with obj.foo
3
+ function interpolate(string, object) {
4
+ return string.replace(/\{\{([^}]+)\}\}/g, function() {
5
+ return object[arguments[1]] || arguments[0];
6
+ });
7
+ };
8
+
9
+ // Split "foo.bar" to ["foo", "bar"] if key is a string
10
+ function keyToArray(key) {
11
+ if(!key) {
12
+ return [];
13
+ }
14
+ if(typeof key != "string") {
15
+ return key;
16
+ }
17
+ return key.split('.');
18
+ };
19
+
20
+ // Looks up a translation using an array of strings where the last
21
+ // is the key and any string before that define the scope. The
22
+ // current locale is always prepended and does not need to be
23
+ // provided. The second parameter is an array of strings used as
24
+ // defaults if the key can not be found. If a key starts with ":"
25
+ // it is used as a key for lookup. This method does not perform
26
+ // pluralization or interpolation.
27
+ function lookup(keys, defaults) {
28
+ var i = 0, value = I18n.translations;
29
+ defaults = (typeof defaults === "string") ? [defaults] : (defaults || []);
30
+ while(keys[i]) {
31
+ value = value && value[keys[i]];
32
+ i++;
33
+ }
34
+ if(value) {
35
+ return value;
36
+ } else {
37
+ if(defaults.length === 0) {
38
+ return null;
39
+ } else if (defaults[0].substr(0,1) === ':') {
40
+ return lookup(keys.slice(0, keys.length - 1).concat(keyToArray(defaults[0].substr(1))), defaults.slice(1));
41
+ } else {
42
+ return defaults[0];
43
+ }
44
+ }
45
+ };
46
+
47
+ // Returns other when 0 given
48
+ function pluralize(value, count) {
49
+ if(count === undefined) return value;
50
+ return count === 1 ? value.one : value.other;
51
+ };
52
+
53
+ // Works mostly the same as the Ruby equivalent, except there are
54
+ // no symbols in JavaScript, so keys are always strings. The only
55
+ // time this makes a difference is when differentiating between
56
+ // keys and values in the defaultValue option. Strings starting
57
+ // with ":" will be considered to be keys and used for lookup,
58
+ // while other strings are returned as-is.
59
+ function translate(key, options) {
60
+ if(typeof key != "string") {
61
+ // Bulk lookup
62
+ var a = [], i;
63
+ for(i = 0; i < key.length; i++) {
64
+ a.push(translate(key[i], options));
65
+ }
66
+ return a;
67
+ } else {
68
+ options = options || {};
69
+ options.defaultValue = options.defaultValue || null;
70
+ key = keyToArray(options.scope).concat(keyToArray(key));
71
+ var value = lookup(key, options.defaultValue);
72
+ if(typeof value !== "string" && value) {
73
+ value = pluralize(value, options.count);
74
+ }
75
+ if(typeof value === "string") {
76
+ value = interpolate(value, options);
77
+ }
78
+ return value;
79
+ }
80
+ }
81
+
82
+ return {
83
+ translate: translate,
84
+ t: translate
85
+ };
86
+ })();
87
+
88
+ var t = (function(key, options) {
89
+ return I18n.t(key, options);
90
+ });
@@ -5,10 +5,16 @@ class GlobalizeTranslationsController < ApplicationController
5
5
 
6
6
  layout 'exvo_globalize'
7
7
 
8
- respond_to :html, :json
9
-
8
+ respond_to :html, :json, :js
9
+
10
10
  def show
11
- @translations = I18n.backend.available_app_translations.merge({ :default_locale => I18n.default_locale })
11
+ @translations = if params[:id].present?
12
+ hash = I18n.backend.available_translations
13
+ hash.has_key?(params[:id].to_sym) ? hash[params[:id].to_sym] : {}
14
+ else
15
+ I18n.backend.available_app_translations.merge({ :default_locale => I18n.default_locale })
16
+ end
17
+
12
18
  respond_with @translations
13
19
  end
14
20
 
@@ -46,10 +52,10 @@ class GlobalizeTranslationsController < ApplicationController
46
52
  end
47
53
 
48
54
  private
49
-
55
+
50
56
  def globalize_translations_authenticator
51
- # get :show as JSON does not require authentication
52
- return if params[:action].to_s == 'show' and request.format.json?
57
+ # get :show as JSON or JS does not require authentication
58
+ return if params[:action].to_s == 'show' and (request.format.json? or request.format.js?)
53
59
 
54
60
  # call custom authenticator method if available
55
61
  if I18n::Backend::GlobalizeStore.authenticator && I18n::Backend::GlobalizeStore.authenticator.respond_to?(:call)
@@ -0,0 +1,4 @@
1
+ var I18n = I18n || {};
2
+ I18n.locale = I18n.locale || '<%= I18n.locale %>';
3
+ I18n.default_locale = I18n.locale || '<%= I18n.default_locale %>';
4
+ I18n.translations = I18n.translations || <%= ActiveSupport::JSON.encode(@translations).html_safe %>;
data/config/routes.rb CHANGED
@@ -1,7 +1,8 @@
1
1
  Rails.application.routes.draw do
2
2
  scope '/globalize' do
3
3
  resource :translations, :only => [:show, :update], :as => 'globalize_translations', :controller => 'globalize_translations' do
4
- get :list, :on => :collection
4
+ resources :js, :only => [:show], :as => 'javascript', :controller => 'globalize_translations'
5
+ get :list
5
6
  end
6
7
  end
7
8
  end
@@ -25,8 +25,6 @@ Gem::Specification.new do |s|
25
25
  s.add_dependency 'awesome_print', ['>= 0.3.2']
26
26
  s.add_dependency 'ya2yaml', ['>= 0.30']
27
27
  s.add_dependency 'httparty', ['>= 0.6.1']
28
- s.add_development_dependency 'guard', ['>= 0.5.0']
29
- s.add_development_dependency 'guard-rspec', ['>= 0.4.0']
30
28
  s.add_development_dependency 'sqlite3', ['>= 1.3']
31
29
  s.add_development_dependency 'rspec', ['>= 2.6']
32
30
  s.add_development_dependency 'rspec-rails', ['>= 2.6']
@@ -34,4 +32,9 @@ Gem::Specification.new do |s|
34
32
  s.add_development_dependency 'shoulda-matchers', ['>= 1.0.0.beta3']
35
33
  s.add_development_dependency 'capybara', ['>= 1.0.0']
36
34
  s.add_development_dependency 'json', ['>= 1.5.1']
35
+ s.add_development_dependency 'jasmine-headless-webkit'
36
+ s.add_development_dependency 'therubyracer'
37
+ s.add_development_dependency 'guard', ['>= 0.5.0']
38
+ s.add_development_dependency 'guard-rspec', ['>= 0.4.0']
39
+ s.add_development_dependency 'guard-jasmine-headless-webkit'
37
40
  end
@@ -18,13 +18,13 @@ module I18n
18
18
  # load only app translations (Simple I18n backend)
19
19
  I18n.load_path = Dir.glob(File.join(Rails.root, 'config/locales', '**', '*.{yml,rb}'))
20
20
  simple.reload!
21
- simple.load_translations
21
+ simple.send(:init_translations)
22
22
  translations = simple.available_translations
23
23
 
24
24
  # restore original translations
25
25
  I18n.load_path = load_path
26
26
  simple.reload!
27
- simple.load_translations
27
+ simple.send(:init_translations)
28
28
 
29
29
  # return app's translations
30
30
  translations
@@ -6,6 +6,11 @@ module I18n
6
6
  # Extend the Simple backend with a custom `available_translations` method
7
7
  # returning a combined hash with all translations from this backend
8
8
  def available_translations
9
+ # simple backend is lazy loaded (woken up by first I18n.t() call)
10
+ # wake it up if it's still sleeping
11
+ send(:init_translations) unless initialized?
12
+
13
+ # nested Hash with all translations
9
14
  send(:translations)
10
15
  end
11
16
  end
@@ -28,5 +28,10 @@ module ExvoGlobalize
28
28
  out += " " * indent_level + "</ul>\n"
29
29
  end
30
30
 
31
+ # Outputs the javascript include tag with translations in the selected language (locale param) in the js format
32
+ def i18n_translations_javascript_include_tag(locale)
33
+ javascript_include_tag("/globalize/translations/js/#{locale}.js")
34
+ end
35
+
31
36
  end
32
37
  end
@@ -1,3 +1,3 @@
1
1
  module ExvoGlobalize
2
- VERSION = "0.3.2"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -0,0 +1,37 @@
1
+ require 'rails/generators'
2
+
3
+ module ExvoGlobalize
4
+
5
+ # Creates a new migration adding the translations table to the application
6
+ # and copies the exvo_globalize_i18n.js to public/javascripts/ (for Rails 3.0.x)
7
+ #
8
+ # @example
9
+ # $ rails generate exvo_globalize:install
10
+ class InstallGenerator < Rails::Generators::Base
11
+ include Rails::Generators::Migration
12
+
13
+ class_option :template_engine
14
+ source_root File.join(File.dirname(__FILE__), 'templates')
15
+
16
+ def self.next_migration_number(dirname)
17
+ if ActiveRecord::Base.timestamped_migrations
18
+ Time.now.utc.strftime("%Y%m%d%H%M%S")
19
+ else
20
+ "%.3d" % (current_migration_number(dirname) + 1)
21
+ end
22
+ end
23
+
24
+ desc "Add a 'create_globalize_translations' migration"
25
+ def create_migration_file
26
+ migration_template 'migration.rb', 'db/migrate/create_globalize_translations.rb'
27
+ end
28
+
29
+ if ::Rails::VERSION::MAJOR == 3 && ::Rails::VERSION::MINOR == 0
30
+ desc "Copy the exvo_globalize_i18n.js to public/javascripts/"
31
+ def copy_javascript_library
32
+ template '../../../../app/assets/javascripts/exvo_globalize_i18n.js', 'public/javascripts/exvo_globalize_i18n.js'
33
+ end
34
+ end
35
+ end
36
+
37
+ end
@@ -0,0 +1,8 @@
1
+ begin
2
+ require 'jasmine'
3
+ load 'jasmine/tasks/jasmine.rake'
4
+ rescue LoadError
5
+ task :jasmine do
6
+ abort "Jasmine is not available. In order to run jasmine, you must: (sudo) gem install jasmine"
7
+ end
8
+ end
@@ -6,6 +6,26 @@ describe GlobalizeTranslationsController do
6
6
  render_views
7
7
  let(:page) { Capybara::Node::Simple.new(@response.body) }
8
8
 
9
+ context "JS" do
10
+
11
+ describe "GET :show" do
12
+ before do
13
+ get :show, :format => :js, :id => 'en'
14
+ end
15
+
16
+ specify { response.content_type.should eq(Mime::JS) }
17
+
18
+ it "returns a hash" do
19
+ assigns(:translations).should be_a(Hash)
20
+ end
21
+
22
+ it "returns a hash with translations" do
23
+ assigns(:translations)[:name].should eq("YAML Name")
24
+ end
25
+ end
26
+
27
+ end
28
+
9
29
  context "JSON" do
10
30
 
11
31
  describe "GET :show" do
@@ -0,0 +1,7 @@
1
+ describe("Translation", function() {
2
+
3
+ it("should translate the phrase using the t() function", function() {
4
+ expect(t("new")).toEqual("New")
5
+ })
6
+
7
+ })
@@ -0,0 +1,2 @@
1
+ I18n.locale = 'en'
2
+ I18n.translations = { "new": "New" }
@@ -0,0 +1,8 @@
1
+ src_files:
2
+ - app/assets/javascripts/exvo_globalize_i18n.js
3
+ - spec/javascripts/fixtures/translations.js
4
+
5
+ spec_files:
6
+ - '**/*[sS]pec.js'
7
+
8
+ spec_dir: spec/javascripts
data/spec/spec_helper.rb CHANGED
@@ -24,6 +24,6 @@ RSpec.configure do |config|
24
24
  CreateGlobalizeTranslations.up unless ActiveRecord::Base.connection.table_exists? 'globalize_translations'
25
25
  end
26
26
 
27
- # run each spec within a transactions
27
+ # run each spec within a transaction
28
28
  config.use_transactional_fixtures = true
29
29
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exvo_globalize
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 3
9
- - 2
10
- version: 0.3.2
8
+ - 4
9
+ - 0
10
+ version: 0.4.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Pawe\xC5\x82 Go\xC5\x9Bcicki"
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-06 00:00:00 +02:00
18
+ date: 2011-09-09 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -113,42 +113,10 @@ dependencies:
113
113
  version: 0.6.1
114
114
  type: :runtime
115
115
  version_requirements: *id006
116
- - !ruby/object:Gem::Dependency
117
- name: guard
118
- prerelease: false
119
- requirement: &id007 !ruby/object:Gem::Requirement
120
- none: false
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- hash: 11
125
- segments:
126
- - 0
127
- - 5
128
- - 0
129
- version: 0.5.0
130
- type: :development
131
- version_requirements: *id007
132
- - !ruby/object:Gem::Dependency
133
- name: guard-rspec
134
- prerelease: false
135
- requirement: &id008 !ruby/object:Gem::Requirement
136
- none: false
137
- requirements:
138
- - - ">="
139
- - !ruby/object:Gem::Version
140
- hash: 15
141
- segments:
142
- - 0
143
- - 4
144
- - 0
145
- version: 0.4.0
146
- type: :development
147
- version_requirements: *id008
148
116
  - !ruby/object:Gem::Dependency
149
117
  name: sqlite3
150
118
  prerelease: false
151
- requirement: &id009 !ruby/object:Gem::Requirement
119
+ requirement: &id007 !ruby/object:Gem::Requirement
152
120
  none: false
153
121
  requirements:
154
122
  - - ">="
@@ -159,11 +127,11 @@ dependencies:
159
127
  - 3
160
128
  version: "1.3"
161
129
  type: :development
162
- version_requirements: *id009
130
+ version_requirements: *id007
163
131
  - !ruby/object:Gem::Dependency
164
132
  name: rspec
165
133
  prerelease: false
166
- requirement: &id010 !ruby/object:Gem::Requirement
134
+ requirement: &id008 !ruby/object:Gem::Requirement
167
135
  none: false
168
136
  requirements:
169
137
  - - ">="
@@ -174,11 +142,11 @@ dependencies:
174
142
  - 6
175
143
  version: "2.6"
176
144
  type: :development
177
- version_requirements: *id010
145
+ version_requirements: *id008
178
146
  - !ruby/object:Gem::Dependency
179
147
  name: rspec-rails
180
148
  prerelease: false
181
- requirement: &id011 !ruby/object:Gem::Requirement
149
+ requirement: &id009 !ruby/object:Gem::Requirement
182
150
  none: false
183
151
  requirements:
184
152
  - - ">="
@@ -189,11 +157,11 @@ dependencies:
189
157
  - 6
190
158
  version: "2.6"
191
159
  type: :development
192
- version_requirements: *id011
160
+ version_requirements: *id009
193
161
  - !ruby/object:Gem::Dependency
194
162
  name: factory_girl_rails
195
163
  prerelease: false
196
- requirement: &id012 !ruby/object:Gem::Requirement
164
+ requirement: &id010 !ruby/object:Gem::Requirement
197
165
  none: false
198
166
  requirements:
199
167
  - - ">="
@@ -205,11 +173,11 @@ dependencies:
205
173
  - 0
206
174
  version: 1.1.0
207
175
  type: :development
208
- version_requirements: *id012
176
+ version_requirements: *id010
209
177
  - !ruby/object:Gem::Dependency
210
178
  name: shoulda-matchers
211
179
  prerelease: false
212
- requirement: &id013 !ruby/object:Gem::Requirement
180
+ requirement: &id011 !ruby/object:Gem::Requirement
213
181
  none: false
214
182
  requirements:
215
183
  - - ">="
@@ -223,11 +191,11 @@ dependencies:
223
191
  - 3
224
192
  version: 1.0.0.beta3
225
193
  type: :development
226
- version_requirements: *id013
194
+ version_requirements: *id011
227
195
  - !ruby/object:Gem::Dependency
228
196
  name: capybara
229
197
  prerelease: false
230
- requirement: &id014 !ruby/object:Gem::Requirement
198
+ requirement: &id012 !ruby/object:Gem::Requirement
231
199
  none: false
232
200
  requirements:
233
201
  - - ">="
@@ -239,11 +207,11 @@ dependencies:
239
207
  - 0
240
208
  version: 1.0.0
241
209
  type: :development
242
- version_requirements: *id014
210
+ version_requirements: *id012
243
211
  - !ruby/object:Gem::Dependency
244
212
  name: json
245
213
  prerelease: false
246
- requirement: &id015 !ruby/object:Gem::Requirement
214
+ requirement: &id013 !ruby/object:Gem::Requirement
247
215
  none: false
248
216
  requirements:
249
217
  - - ">="
@@ -255,7 +223,81 @@ dependencies:
255
223
  - 1
256
224
  version: 1.5.1
257
225
  type: :development
226
+ version_requirements: *id013
227
+ - !ruby/object:Gem::Dependency
228
+ name: jasmine-headless-webkit
229
+ prerelease: false
230
+ requirement: &id014 !ruby/object:Gem::Requirement
231
+ none: false
232
+ requirements:
233
+ - - ">="
234
+ - !ruby/object:Gem::Version
235
+ hash: 3
236
+ segments:
237
+ - 0
238
+ version: "0"
239
+ type: :development
240
+ version_requirements: *id014
241
+ - !ruby/object:Gem::Dependency
242
+ name: therubyracer
243
+ prerelease: false
244
+ requirement: &id015 !ruby/object:Gem::Requirement
245
+ none: false
246
+ requirements:
247
+ - - ">="
248
+ - !ruby/object:Gem::Version
249
+ hash: 3
250
+ segments:
251
+ - 0
252
+ version: "0"
253
+ type: :development
258
254
  version_requirements: *id015
255
+ - !ruby/object:Gem::Dependency
256
+ name: guard
257
+ prerelease: false
258
+ requirement: &id016 !ruby/object:Gem::Requirement
259
+ none: false
260
+ requirements:
261
+ - - ">="
262
+ - !ruby/object:Gem::Version
263
+ hash: 11
264
+ segments:
265
+ - 0
266
+ - 5
267
+ - 0
268
+ version: 0.5.0
269
+ type: :development
270
+ version_requirements: *id016
271
+ - !ruby/object:Gem::Dependency
272
+ name: guard-rspec
273
+ prerelease: false
274
+ requirement: &id017 !ruby/object:Gem::Requirement
275
+ none: false
276
+ requirements:
277
+ - - ">="
278
+ - !ruby/object:Gem::Version
279
+ hash: 15
280
+ segments:
281
+ - 0
282
+ - 4
283
+ - 0
284
+ version: 0.4.0
285
+ type: :development
286
+ version_requirements: *id017
287
+ - !ruby/object:Gem::Dependency
288
+ name: guard-jasmine-headless-webkit
289
+ prerelease: false
290
+ requirement: &id018 !ruby/object:Gem::Requirement
291
+ none: false
292
+ requirements:
293
+ - - ">="
294
+ - !ruby/object:Gem::Version
295
+ hash: 3
296
+ segments:
297
+ - 0
298
+ version: "0"
299
+ type: :development
300
+ version_requirements: *id018
259
301
  description: It exposes `/globalize/translations.json` with JSON of all translations in the app
260
302
  email:
261
303
  - pawel.goscicki@gmail.com
@@ -272,11 +314,13 @@ files:
272
314
  - MIT-LICENSE
273
315
  - README.md
274
316
  - Rakefile
317
+ - app/assets/javascripts/exvo_globalize_i18n.js
275
318
  - app/controllers/globalize_translations_controller.rb
276
319
  - app/models/globalize_translation.rb
277
320
  - app/views/globalize_translations/_flash_messages.html.haml
278
321
  - app/views/globalize_translations/list.html.haml
279
322
  - app/views/globalize_translations/show.html.haml
323
+ - app/views/globalize_translations/show.js.erb
280
324
  - app/views/layouts/exvo_globalize.html.haml
281
325
  - config/locales/ar.yml
282
326
  - config/locales/bg.yml
@@ -342,9 +386,10 @@ files:
342
386
  - lib/exvo_globalize/globalize_app.rb
343
387
  - lib/exvo_globalize/helpers.rb
344
388
  - lib/exvo_globalize/version.rb
345
- - lib/generators/exvo_globalize/exvo_globalize_generator.rb
389
+ - lib/generators/exvo_globalize/install_generator.rb
346
390
  - lib/generators/exvo_globalize/templates/migration.rb
347
391
  - lib/tasks/dump.rake
392
+ - lib/tasks/jasmine.rake
348
393
  - spec/app.rb
349
394
  - spec/controllers/globalize_translations_controller_spec.rb
350
395
  - spec/exvo_globalize/caching_spec.rb
@@ -355,6 +400,9 @@ files:
355
400
  - spec/factories.rb
356
401
  - spec/fixtures/locales/en.yml
357
402
  - spec/fixtures/locales/pl.yml
403
+ - spec/javascripts/exvo_globalize_i18n_spec.js
404
+ - spec/javascripts/fixtures/translations.js
405
+ - spec/javascripts/support/jasmine.yml
358
406
  - spec/models/globalize_translation_spec.rb
359
407
  - spec/spec_helper.rb
360
408
  has_rdoc: true
@@ -1,23 +0,0 @@
1
- require 'rails/generators'
2
-
3
- class ExvoGlobalizeGenerator < Rails::Generators::Base
4
- desc "Add a 'create_globalize_translations' migration"
5
-
6
- include Rails::Generators::Migration
7
-
8
- def self.source_root
9
- @source_root ||= File.join(File.dirname(__FILE__), 'templates')
10
- end
11
-
12
- def self.next_migration_number(dirname)
13
- if ActiveRecord::Base.timestamped_migrations
14
- Time.now.utc.strftime("%Y%m%d%H%M%S")
15
- else
16
- "%.3d" % (current_migration_number(dirname) + 1)
17
- end
18
- end
19
-
20
- def create_migration_file
21
- migration_template 'migration.rb', 'db/migrate/create_globalize_translations.rb'
22
- end
23
- end