i18n_generators 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/VERSION +1 -1
- data/generators/i18n/i18n_generator.rb +8 -4
- data/generators/i18n_locale/i18n_locale_command.rb +8 -1
- data/i18n_generators.gemspec +59 -61
- data/lib/generators/i18n_locale/i18n_locale_generator.rb +11 -2
- metadata +6 -7
- data/.gitignore +0 -1
data/History.txt
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.2
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'net/https'
|
1
2
|
require 'rubygems'
|
2
3
|
require 'rails_generator'
|
3
4
|
require 'rails_generator/commands'
|
@@ -69,10 +70,13 @@ class I18nGenerator < Rails::Generator::NamedBase
|
|
69
70
|
private
|
70
71
|
def defined_in_rails_i18n_repository?
|
71
72
|
begin
|
72
|
-
uri = "
|
73
|
-
|
74
|
-
|
75
|
-
|
73
|
+
uri = URI.parse "https://github.com/svenfuchs/rails-i18n/raw/master/rails/locale/#{locale_name}.yml"
|
74
|
+
http = Net::HTTP.new uri.host, uri.port
|
75
|
+
http.use_ssl = true
|
76
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
77
|
+
req = Net::HTTP::Get.new uri.request_uri
|
78
|
+
res = http.request req
|
79
|
+
res.code == '200'
|
76
80
|
rescue
|
77
81
|
false
|
78
82
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'net/https'
|
1
2
|
require 'rubygems'
|
2
3
|
require 'rails_generator'
|
3
4
|
require 'rails_generator/commands'
|
@@ -26,7 +27,13 @@ module I18nGenerator::Generator
|
|
26
27
|
|
27
28
|
def fetch_from_rails_i18n_repository
|
28
29
|
file('i18n:base.yml', "config/locales/#{locale_name}.yml") do |f|
|
29
|
-
|
30
|
+
uri = URI.parse "https://github.com/svenfuchs/rails-i18n/raw/master/rails/locale/#{locale_name}.yml"
|
31
|
+
http = Net::HTTP.new uri.host, uri.port
|
32
|
+
http.use_ssl = true
|
33
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
34
|
+
req = Net::HTTP::Get.new uri.request_uri
|
35
|
+
res = http.request req
|
36
|
+
res.body
|
30
37
|
end
|
31
38
|
end
|
32
39
|
|
data/i18n_generators.gemspec
CHANGED
@@ -1,86 +1,84 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{i18n_generators}
|
8
|
-
s.version = "1.0.
|
8
|
+
s.version = "1.0.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Akira Matsuda"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-11-29}
|
13
13
|
s.description = %q{A Rails generator plugin & gem that generates Rails I18n locale files for almost every known locale.}
|
14
14
|
s.email = %q{ronnie@dio.jp}
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"README.rdoc"
|
17
17
|
]
|
18
18
|
s.files = [
|
19
|
-
".
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
"spec/yaml_spec.rb"
|
19
|
+
"History.txt",
|
20
|
+
"MIT-LICENSE",
|
21
|
+
"README.rdoc",
|
22
|
+
"Rakefile",
|
23
|
+
"VERSION",
|
24
|
+
"generators/i18n/USAGE",
|
25
|
+
"generators/i18n/i18n_generator.rb",
|
26
|
+
"generators/i18n/lib/yaml.rb",
|
27
|
+
"generators/i18n/templates/base.yml",
|
28
|
+
"generators/i18n/templates/i18n_config.rb",
|
29
|
+
"generators/i18n/templates/translation.yml",
|
30
|
+
"generators/i18n_locale/USAGE",
|
31
|
+
"generators/i18n_locale/i18n_locale_command.rb",
|
32
|
+
"generators/i18n_locale/i18n_locale_generator.rb",
|
33
|
+
"generators/i18n_locale/lib/cldr.rb",
|
34
|
+
"generators/i18n_scaffold/i18n_scaffold_generator.rb",
|
35
|
+
"generators/i18n_scaffold/templates/controller.rb",
|
36
|
+
"generators/i18n_scaffold/templates/functional_test.rb",
|
37
|
+
"generators/i18n_scaffold/templates/helper.rb",
|
38
|
+
"generators/i18n_scaffold/templates/helper_test.rb",
|
39
|
+
"generators/i18n_scaffold/templates/layout.html.erb",
|
40
|
+
"generators/i18n_scaffold/templates/style.css",
|
41
|
+
"generators/i18n_scaffold/templates/view_edit.html.erb",
|
42
|
+
"generators/i18n_scaffold/templates/view_index.html.erb",
|
43
|
+
"generators/i18n_scaffold/templates/view_new.html.erb",
|
44
|
+
"generators/i18n_scaffold/templates/view_show.html.erb",
|
45
|
+
"generators/i18n_translation/USAGE",
|
46
|
+
"generators/i18n_translation/i18n_translation_command.rb",
|
47
|
+
"generators/i18n_translation/i18n_translation_generator.rb",
|
48
|
+
"generators/i18n_translation/lib/erb_executer.rb",
|
49
|
+
"generators/i18n_translation/lib/recording_backend.rb",
|
50
|
+
"generators/i18n_translation/lib/through_ryoku.rb",
|
51
|
+
"generators/i18n_translation/lib/translator.rb",
|
52
|
+
"i18n_generators.gemspec",
|
53
|
+
"lib/generators/i18n/USAGE",
|
54
|
+
"lib/generators/i18n/i18n_generator.rb",
|
55
|
+
"lib/generators/i18n_locale/USAGE",
|
56
|
+
"lib/generators/i18n_locale/i18n_locale_generator.rb",
|
57
|
+
"lib/generators/i18n_translation/USAGE",
|
58
|
+
"lib/generators/i18n_translation/i18n_translation_generator.rb",
|
59
|
+
"lib/generators/i18n_translation/lib/translator.rb",
|
60
|
+
"lib/generators/i18n_translation/lib/yaml.rb",
|
61
|
+
"lib/generators/i18n_translation/lib/yaml_waml.rb",
|
62
|
+
"spec/cldr_spec.rb",
|
63
|
+
"spec/data/cldr/ja.html",
|
64
|
+
"spec/data/yml/active_record/en-US.yml",
|
65
|
+
"spec/i18n_locale_command_spec.rb",
|
66
|
+
"spec/i18n_translation_command_spec.rb",
|
67
|
+
"spec/spec_helper.rb",
|
68
|
+
"spec/translator_spec.rb",
|
69
|
+
"spec/yaml_spec.rb"
|
71
70
|
]
|
72
71
|
s.homepage = %q{http://github.com/amatsuda/i18n_generators/}
|
73
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
74
72
|
s.require_paths = ["lib"]
|
75
73
|
s.rubygems_version = %q{1.3.7}
|
76
74
|
s.summary = %q{Generates I18n locale files for Rails 3 and Rails 2}
|
77
75
|
s.test_files = [
|
78
76
|
"spec/cldr_spec.rb",
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
77
|
+
"spec/i18n_locale_command_spec.rb",
|
78
|
+
"spec/i18n_translation_command_spec.rb",
|
79
|
+
"spec/spec_helper.rb",
|
80
|
+
"spec/translator_spec.rb",
|
81
|
+
"spec/yaml_spec.rb"
|
84
82
|
]
|
85
83
|
|
86
84
|
if s.respond_to? :specification_version then
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'net/https'
|
2
|
+
|
1
3
|
class I18nLocaleGenerator < Rails::Generators::NamedBase
|
2
4
|
def main
|
3
5
|
unless file_name =~ /^[a-zA-Z]{2}([-_][a-zA-Z]+)?$/
|
@@ -33,8 +35,15 @@ class I18nLocaleGenerator < Rails::Generators::NamedBase
|
|
33
35
|
def fetch_from_rails_i18n_repository
|
34
36
|
log "fetching #{locale_name}.yml from rails-i18n repository..."
|
35
37
|
begin
|
36
|
-
|
37
|
-
|
38
|
+
uri = URI.parse "https://github.com/svenfuchs/rails-i18n/raw/master/rails/locale/#{locale_name}.yml"
|
39
|
+
http = Net::HTTP.new uri.host, uri.port
|
40
|
+
http.use_ssl = true
|
41
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
42
|
+
req = Net::HTTP::Get.new uri.request_uri
|
43
|
+
res = http.request req
|
44
|
+
raise unless res.code == '200'
|
45
|
+
|
46
|
+
create_file "config/locales/#{locale_name}.yml", res.body
|
38
47
|
rescue
|
39
48
|
log "could not find #{locale_name}.yml on rails-i18n repository"
|
40
49
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i18n_generators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 2
|
10
|
+
version: 1.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Akira Matsuda
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-11-29 00:00:00 +09:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -28,7 +28,6 @@ extensions: []
|
|
28
28
|
extra_rdoc_files:
|
29
29
|
- README.rdoc
|
30
30
|
files:
|
31
|
-
- .gitignore
|
32
31
|
- History.txt
|
33
32
|
- MIT-LICENSE
|
34
33
|
- README.rdoc
|
@@ -85,8 +84,8 @@ homepage: http://github.com/amatsuda/i18n_generators/
|
|
85
84
|
licenses: []
|
86
85
|
|
87
86
|
post_install_message:
|
88
|
-
rdoc_options:
|
89
|
-
|
87
|
+
rdoc_options: []
|
88
|
+
|
90
89
|
require_paths:
|
91
90
|
- lib
|
92
91
|
required_ruby_version: !ruby/object:Gem::Requirement
|
data/.gitignore
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
pkg
|