localyzed 0.0.0.3 → 0.0.0.4

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.
@@ -1,5 +1,10 @@
1
- Rails::Application.configure do
2
- config.middleware.insert_before(Rack::Lock, Rack::Rewrite) do
3
- r301 %r{(.*|)\/(en|fr)($|\?[^\\]*)}, '/$1/$2/$3' # redirect '/en' to '/en/'
1
+ require 'rack/rewrite'
2
+ class Localyzed::Railtie < Rails::Railtie
3
+ initializer "localized2.configure" do |app|
4
+ app.class.configure do
5
+ config.middleware.insert_before(Rack::Lock, Rack::Rewrite) do
6
+ r301 %r{(.*|)\/(en|fr)($|\?[^\\]*)}, '/$1/$2/$3' # redirect '/en' to '/en/'
7
+ end
8
+ end
4
9
  end
5
- end
10
+ end
@@ -2,6 +2,6 @@ class Localyzed::Railtie < Rails::Railtie
2
2
  config.localyzed = ActiveSupport::OrderedOptions.new
3
3
 
4
4
  initializer "localized.configure" do |app|
5
- Localized.configure(app.config.localized)
5
+ Localyzed.configure(app.config.localyzed)
6
6
  end
7
7
  end
@@ -1,3 +1,3 @@
1
1
  module Localyzed
2
- VERSION = "0.0.0.3"
2
+ VERSION = "0.0.0.4"
3
3
  end
@@ -1,25 +1,68 @@
1
- # SQLite version 3.x
2
- # gem install sqlite3
1
+ # MySQL. Versions 4.1 and 5.0 are recommended.
3
2
  #
4
- # Ensure the SQLite 3 gem is defined in your Gemfile
5
- # gem 'sqlite3'
3
+ # Install the MySQL driver:
4
+ # gem install mysql
5
+ # On Mac OS X:
6
+ # sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql
7
+ # On Mac OS X Leopard:
8
+ # sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
9
+ # This sets the ARCHFLAGS environment variable to your native architecture
10
+ # On Windows:
11
+ # gem install mysql
12
+ # Choose the win32 build.
13
+ # Install MySQL and put its /bin directory on your path.
14
+ #
15
+ # And be sure to use new-style password hashing:
16
+ # http://dev.mysql.com/doc/refman/5.0/en/old-client.html
17
+
18
+ <%
19
+ # http://mislav.uniqpath.com/rails/branching-the-database-along-with-your-code/
20
+ # if want to create specific db for branch => git config --bool branch.#{branch}.database true
21
+ branch = `git symbolic-ref HEAD 2>/dev/null`.chomp.sub('refs/heads/', '')
22
+ suffix = `git config --bool branch.#{branch}.database`.chomp == 'true' ? "_#{branch}" : ""
23
+ %>
24
+
6
25
  development:
7
- adapter: sqlite3
8
- database: db/development.sqlite3
26
+ adapter: mysql2
27
+ encoding: utf8
28
+ reconnect: false
29
+ # ... adapter/auth config ...
30
+ database: localyzed<%= suffix %>_development
9
31
  pool: 5
32
+ username: root
33
+ password:
34
+ host: 127.0.0.1
10
35
  timeout: 5000
11
36
 
12
37
  # Warning: The database defined as "test" will be erased and
13
38
  # re-generated from your development database when you run "rake".
14
39
  # Do not set this db to the same as development or production.
15
- test:
16
- adapter: sqlite3
17
- database: db/test.sqlite3
40
+ test: &test
41
+ adapter: mysql2
42
+ encoding: utf8
43
+ reconnect: false
44
+ # ... adapter/auth config ...
45
+ database: localyzed<%= suffix %>_testing
18
46
  pool: 5
47
+ username: root
48
+ password:
49
+ host: 127.0.0.1
19
50
  timeout: 5000
20
51
 
21
- production:
22
- adapter: sqlite3
23
- database: db/production.sqlite3
52
+ cucumber:
53
+ <<: *test
54
+
55
+ production: &production
56
+ adapter: mysql2
57
+ encoding: utf8
58
+ reconnect: false
59
+ # ... adapter/auth config ...
60
+ database: localyzed<%= suffix %>_development
24
61
  pool: 5
62
+ username: root
63
+ password:
64
+ host: 127.0.0.1
25
65
  timeout: 5000
66
+
67
+ staging:
68
+ <<: *production
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: localyzed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0.3
4
+ version: 0.0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -60,7 +60,7 @@ dependencies:
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  - !ruby/object:Gem::Dependency
63
- name: sqlite3
63
+ name: mysql2
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  none: false
66
66
  requirements:
@@ -115,6 +115,7 @@ files:
115
115
  - test/dummy/config/locales/en.yml
116
116
  - test/dummy/config/routes.rb
117
117
  - test/dummy/config.ru
118
+ - test/dummy/log/development.log
118
119
  - test/dummy/public/404.html
119
120
  - test/dummy/public/422.html
120
121
  - test/dummy/public/500.html
@@ -170,6 +171,7 @@ test_files:
170
171
  - test/dummy/config/locales/en.yml
171
172
  - test/dummy/config/routes.rb
172
173
  - test/dummy/config.ru
174
+ - test/dummy/log/development.log
173
175
  - test/dummy/public/404.html
174
176
  - test/dummy/public/422.html
175
177
  - test/dummy/public/500.html