padrino-gen 0.7.6 → 0.7.7
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/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.7
|
@@ -8,7 +8,6 @@ class <%= @class_name %> < Padrino::Application
|
|
8
8
|
# set :sessions, false # Enabled by default
|
9
9
|
# set :reload, false # Reload application files (default in development)
|
10
10
|
# set :default_builder, "foo" # Set a custom form builder (default 'StandardFormBuilder')
|
11
|
-
# set :locale, :en # Set the current I18n.locale (default :en)
|
12
11
|
# set :locale_path, "bar" # Set path for I18n translations (default your_app/locales)
|
13
12
|
# enable :autolocale # Auto Set locale if url match /:lang/foo/bar (disabled by default)
|
14
13
|
# disable :padrino_helpers # Disables padrino markup helpers (enabled by default if present)
|
@@ -11,7 +11,7 @@ gem 'thin' # or mongrel
|
|
11
11
|
gem 'rack-test', :require => 'rack/test', :group => 'test'
|
12
12
|
|
13
13
|
<%- if options.dev? -%>
|
14
|
-
#
|
14
|
+
# Padrino
|
15
15
|
%w(core gen helpers mailer admin).each do |gem|
|
16
16
|
gem 'padrino-' + gem, :path => '<%= Padrino::Generators::DEV_PATH %>/padrino-' + gem
|
17
17
|
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
namespace :locale do
|
2
|
+
desc "Create or update the app/models locale using your I18n.locale"
|
3
|
+
task :models => :environment do
|
4
|
+
models = Dir["#{Padrino.root}/app/models/**/*.rb"].collect { |m| File.basename(m, ".rb") }
|
5
|
+
|
6
|
+
models.each do |m|
|
7
|
+
# Get the model class
|
8
|
+
klass = m.camelize.constantize
|
9
|
+
next unless klass.respond_to?(:properties) || klass.respond_to?(:human_local_name) || klass.respond_to?(:human_local_attribute_name)
|
10
|
+
|
11
|
+
# Init the processing
|
12
|
+
print "Processing #{m.humanize}: "
|
13
|
+
FileUtils.mkdir_p("#{Padrino.root}/app/locale/models/#{m}")
|
14
|
+
langs = Array(I18n.locale) # for now we use only one
|
15
|
+
|
16
|
+
# Create models for it and en locales
|
17
|
+
langs.each do |lang|
|
18
|
+
filename = "#{Padrino.root}/app/locale/models/#{m}/#{lang}.yml"
|
19
|
+
columns = klass.properties.collect(&:name)
|
20
|
+
# If the lang file already exist we need to check it
|
21
|
+
if File.exist?(filename)
|
22
|
+
locale = File.open(filename).read
|
23
|
+
columns.each do |c|
|
24
|
+
locale += "\n #{c}: #{klass.human_local_attribute_name(c)}" unless locale.include?("#{c}:")
|
25
|
+
end
|
26
|
+
print "Lang #{lang.to_s.upcase} already exist ... "; $stdout.flush
|
27
|
+
# Do some ere
|
28
|
+
else
|
29
|
+
locale = "#{lang}:" + "\n" +
|
30
|
+
" models:" + "\n" +
|
31
|
+
" #{m}:" + "\n" +
|
32
|
+
" name: #{klass.human_local_name}" + "\n" +
|
33
|
+
" attributes:" + "\n" +
|
34
|
+
columns.collect { |c| " #{c}: #{klass.human_local_attribute_name(c)}" }.join("\n")
|
35
|
+
print "created a new for #{lang.to_s.upcase} Lang ... "; $stdout.flush
|
36
|
+
end
|
37
|
+
File.open(filename, "w") { |f| f.puts locale }
|
38
|
+
end
|
39
|
+
puts
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
data/padrino-gen.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{padrino-gen}
|
8
|
-
s.version = "0.7.
|
8
|
+
s.version = "0.7.7"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Padrino Team", "Nathan Esquenazi", "Davide D'Agostino", "Arthur Chiu"]
|
12
|
-
s.date = %q{2010-02-
|
12
|
+
s.date = %q{2010-02-11}
|
13
13
|
s.default_executable = %q{padrino-gen}
|
14
14
|
s.description = %q{Generators for easily creating and building padrino applications from the console}
|
15
15
|
s.email = %q{padrinorb@gmail.com}
|
@@ -77,6 +77,7 @@ Gem::Specification.new do |s|
|
|
77
77
|
"lib/padrino-gen/generators/templates/scripts/right.js",
|
78
78
|
"lib/padrino-gen/padrino-tasks/activerecord.rb",
|
79
79
|
"lib/padrino-gen/padrino-tasks/datamapper.rb",
|
80
|
+
"lib/padrino-gen/padrino-tasks/locale.rb",
|
80
81
|
"padrino-gen.gemspec",
|
81
82
|
"test/helper.rb",
|
82
83
|
"test/test_app_generator.rb",
|
@@ -99,7 +100,7 @@ Gem::Specification.new do |s|
|
|
99
100
|
|
100
101
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
101
102
|
s.add_runtime_dependency(%q<sinatra>, [">= 0.9.2"])
|
102
|
-
s.add_runtime_dependency(%q<padrino-core>, ["= 0.7.
|
103
|
+
s.add_runtime_dependency(%q<padrino-core>, ["= 0.7.7"])
|
103
104
|
s.add_runtime_dependency(%q<thor>, [">= 0.13.0"])
|
104
105
|
s.add_runtime_dependency(%q<bundler>, [">= 0.9.3"])
|
105
106
|
s.add_development_dependency(%q<haml>, [">= 2.2.1"])
|
@@ -110,7 +111,7 @@ Gem::Specification.new do |s|
|
|
110
111
|
s.add_development_dependency(%q<fakeweb>, [">= 1.2.3"])
|
111
112
|
else
|
112
113
|
s.add_dependency(%q<sinatra>, [">= 0.9.2"])
|
113
|
-
s.add_dependency(%q<padrino-core>, ["= 0.7.
|
114
|
+
s.add_dependency(%q<padrino-core>, ["= 0.7.7"])
|
114
115
|
s.add_dependency(%q<thor>, [">= 0.13.0"])
|
115
116
|
s.add_dependency(%q<bundler>, [">= 0.9.3"])
|
116
117
|
s.add_dependency(%q<haml>, [">= 2.2.1"])
|
@@ -122,7 +123,7 @@ Gem::Specification.new do |s|
|
|
122
123
|
end
|
123
124
|
else
|
124
125
|
s.add_dependency(%q<sinatra>, [">= 0.9.2"])
|
125
|
-
s.add_dependency(%q<padrino-core>, ["= 0.7.
|
126
|
+
s.add_dependency(%q<padrino-core>, ["= 0.7.7"])
|
126
127
|
s.add_dependency(%q<thor>, [">= 0.13.0"])
|
127
128
|
s.add_dependency(%q<bundler>, [">= 0.9.3"])
|
128
129
|
s.add_dependency(%q<haml>, [">= 2.2.1"])
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: padrino-gen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Padrino Team
|
@@ -12,7 +12,7 @@ autorequire:
|
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
14
|
|
15
|
-
date: 2010-02-
|
15
|
+
date: 2010-02-11 00:00:00 +01:00
|
16
16
|
default_executable: padrino-gen
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
requirements:
|
34
34
|
- - "="
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: 0.7.
|
36
|
+
version: 0.7.7
|
37
37
|
version:
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: thor
|
@@ -183,6 +183,7 @@ files:
|
|
183
183
|
- lib/padrino-gen/generators/templates/scripts/right.js
|
184
184
|
- lib/padrino-gen/padrino-tasks/activerecord.rb
|
185
185
|
- lib/padrino-gen/padrino-tasks/datamapper.rb
|
186
|
+
- lib/padrino-gen/padrino-tasks/locale.rb
|
186
187
|
- padrino-gen.gemspec
|
187
188
|
- test/helper.rb
|
188
189
|
- test/test_app_generator.rb
|