we_bridge_rails_engine_langs 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: baef0aa79c5c4852d16c90d40dd0657b29ce4f45
4
- data.tar.gz: b681b7d1a061c01840a39a6ddd3d5a9ee787e9e2
3
+ metadata.gz: b654160340c79fd8f61102d7e78a55a3a99cb91d
4
+ data.tar.gz: 23f7272f88c4e14c63f43811e870a3c50a260ef0
5
5
  SHA512:
6
- metadata.gz: 077283603733756b5c27bf73f272b0f5ee07ebcf0428efcff4135934d85f42eaba38f17f9ec391a6473c0be16e1a9a534774ea944c645b510022cb24a92f4ed4
7
- data.tar.gz: f084436a59c8afeb3858d3adcec3de4c9ffe6819698d0dada117d7861ad1c7a719d0e4dcb464e192ac085c98103694b3fda746df2bda088e7974056581cd204f
6
+ metadata.gz: bf21931bbc8c42ffe48790a1ffc3ed32f83488a042062ad6e7b8c4480c2e8c8935afaabcf460d21274ae2852ae5e6a77a02ab896f7608436f7a95f5bdc60dd57
7
+ data.tar.gz: 929b0da02d87029b29afbf3ca9efcc64296505ae3a4f5f49d65fa1d5ac4e1d9705996816aa0a9c4d1817a686ce9520055951d72888412037d4f41b02053f3e76
data/db/seeds.rb ADDED
@@ -0,0 +1,12 @@
1
+ Dir[File.expand_path('../seeds/*.rb',__FILE__)].each do |path|
2
+ load path
3
+ end
4
+
5
+ Lang.all.each do |lang|
6
+ Dir[File.expand_path("../seeds/#{lang.code}/*.txt",__FILE__)].each do |path|
7
+ if !(txt = File.read(path).gsub(/\s/,'')).empty?
8
+ code = File.basename(path,'.*').to_sym
9
+ Lang.find_by(code: code).text(lang.code).update!(label: txt)
10
+ end
11
+ end
12
+ end
data/db/seeds/de.rb ADDED
@@ -0,0 +1 @@
1
+ Lang.find_or_create_by(code: :de).update!(enable: false, position: 300)
@@ -0,0 +1 @@
1
+ Deutsch
@@ -0,0 +1 @@
1
+ Englisch
@@ -0,0 +1 @@
1
+ Spanisch
@@ -0,0 +1 @@
1
+ Persisch
@@ -0,0 +1 @@
1
+ Japanisch
data/db/seeds/en.rb ADDED
@@ -0,0 +1 @@
1
+ Lang.find_or_create_by(code: :en).update!(position: 200)
@@ -0,0 +1 @@
1
+ German
@@ -0,0 +1 @@
1
+ English
@@ -0,0 +1 @@
1
+ Spanish
@@ -0,0 +1 @@
1
+ Persian
@@ -0,0 +1 @@
1
+ Japanese
data/db/seeds/es.rb ADDED
@@ -0,0 +1 @@
1
+ Lang.find_or_create_by(code: :es).update!(position: 400,enable: false)
@@ -0,0 +1 @@
1
+ Alemán
@@ -0,0 +1 @@
1
+ Inglés
@@ -0,0 +1 @@
1
+ Españoles
@@ -0,0 +1 @@
1
+ Persa
@@ -0,0 +1 @@
1
+ Japonés
data/db/seeds/fa.rb ADDED
@@ -0,0 +1,2 @@
1
+ Lang.find_or_create_by(code: :fa).update!(position: 500,enable: false)
2
+
@@ -0,0 +1 @@
1
+ آلمان
@@ -0,0 +1 @@
1
+ انگلیسی
@@ -0,0 +1 @@
1
+ اسپانیایی
@@ -0,0 +1 @@
1
+ فارسی
@@ -0,0 +1 @@
1
+ ژاپن
data/db/seeds/ja.rb ADDED
@@ -0,0 +1 @@
1
+ Lang.find_or_create_by(code: :ja).update!(position: 100)
@@ -0,0 +1 @@
1
+ ドイツ語
@@ -0,0 +1 @@
1
+ 英語
@@ -0,0 +1 @@
1
+ スペイン語
@@ -0,0 +1 @@
1
+ ペルシア語
@@ -0,0 +1 @@
1
+ 日本語
@@ -9,5 +9,16 @@ module WeBridgeRailsEngineLangs
9
9
  g.stylesheets true
10
10
  g.javascripts true
11
11
  end
12
+
13
+ initializer :append_migrations_and_seeds do |app|
14
+ unless app.root.to_s.match root.to_s
15
+ config.paths["db/migrate"].expanded.each do |expanded_path|
16
+ app.config.paths["db/migrate"] << expanded_path
17
+ end
18
+ config.paths["db/seeds.rb"].existent.each do |expanded_path|
19
+ app.config.paths["db/seeds.rb"] << expanded_path
20
+ end
21
+ end
22
+ end
12
23
  end
13
24
  end
@@ -1,3 +1,3 @@
1
1
  module WeBridgeRailsEngineLangs
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: we_bridge_rails_engine_langs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shinjiro Itagaki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-09 00:00:00.000000000 Z
11
+ date: 2015-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -143,6 +143,37 @@ files:
143
143
  - app/views/langs/show.html.builder
144
144
  - config/routes.rb
145
145
  - db/migrate/20150803101150_create_langs.rb
146
+ - db/seeds.rb
147
+ - db/seeds/de.rb
148
+ - db/seeds/de/de.txt
149
+ - db/seeds/de/en.txt
150
+ - db/seeds/de/es.txt
151
+ - db/seeds/de/fa.txt
152
+ - db/seeds/de/ja.txt
153
+ - db/seeds/en.rb
154
+ - db/seeds/en/de.txt
155
+ - db/seeds/en/en.txt
156
+ - db/seeds/en/es.txt
157
+ - db/seeds/en/fa.txt
158
+ - db/seeds/en/ja.txt
159
+ - db/seeds/es.rb
160
+ - db/seeds/es/de.txt
161
+ - db/seeds/es/en.txt
162
+ - db/seeds/es/es.txt
163
+ - db/seeds/es/fa.txt
164
+ - db/seeds/es/ja.txt
165
+ - db/seeds/fa.rb
166
+ - db/seeds/fa/de.txt
167
+ - db/seeds/fa/en.txt
168
+ - db/seeds/fa/es.txt
169
+ - db/seeds/fa/fa.txt
170
+ - db/seeds/fa/ja.txt
171
+ - db/seeds/ja.rb
172
+ - db/seeds/ja/de.txt
173
+ - db/seeds/ja/en.txt
174
+ - db/seeds/ja/es.txt
175
+ - db/seeds/ja/fa.txt
176
+ - db/seeds/ja/ja.txt
146
177
  - lib/tasks/we_bridge_rails_engine_langs_tasks.rake
147
178
  - lib/we_bridge_rails_engine_langs.rb
148
179
  - lib/we_bridge_rails_engine_langs/engine.rb