padrino-gen 0.13.3 → 0.13.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/padrino-gen/generators/actions.rb +5 -5
- data/lib/padrino-gen/generators/cli.rb +1 -1
- data/lib/padrino-gen/generators/component.rb +2 -2
- data/lib/padrino-gen/generators/runner.rb +1 -1
- data/lib/padrino-gen/padrino-tasks/activerecord.rb +2 -2
- data/lib/padrino-gen/padrino-tasks/sql-helpers.rb +4 -4
- data/lib/padrino-gen.rb +2 -2
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67b06756e1fe1f0e22530b73a638af3a544fae41
|
4
|
+
data.tar.gz: be966e3a491af5889250e0d0aec0fce731d1b6d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5b48162c06b15e0e5607634ce96dafa719e3859184416c85fe443495ee3de34f70c8c02e08a97f0bb655dcda88c84761b3d3480d52dc042f28570cc4ecb96c7
|
7
|
+
data.tar.gz: baf2a475a95874fb86f4fd16e45fc7949a54ceb31b60fb2d6c2b80057afae521bc0e402f3e93d77faa52e560f8738458e78d7678fbeab74b435a7d2a4dfa6137
|
@@ -168,7 +168,7 @@ module Padrino
|
|
168
168
|
# valid_choice?(:mock, 'rr')
|
169
169
|
#
|
170
170
|
def valid_choice?(component, choice)
|
171
|
-
choice
|
171
|
+
choice && self.class.available_choices_for(component).include?(choice.to_sym)
|
172
172
|
end
|
173
173
|
|
174
174
|
##
|
@@ -328,8 +328,8 @@ WARNING
|
|
328
328
|
after_pattern = options[:group] ? "#{options[:group].to_s.capitalize} requirements\n" : "Component requirements\n"
|
329
329
|
version = options.delete(:version)
|
330
330
|
gem_options = options.map { |k, v| k.to_s == 'require' && [true,false].include?(v) ? ":#{k} => #{v}" : ":#{k} => '#{v}'" }.join(", ")
|
331
|
-
write_option = gem_options.
|
332
|
-
write_version = version
|
331
|
+
write_option = gem_options.empty? ? '' : ", #{gem_options}"
|
332
|
+
write_version = version ? ", '#{version}'" : ''
|
333
333
|
include_text = "gem '#{name}'" << write_version << write_option << "\n"
|
334
334
|
inject_into_file('Gemfile', include_text, :after => after_pattern)
|
335
335
|
end
|
@@ -359,7 +359,7 @@ WARNING
|
|
359
359
|
# insert_middleware(ActiveRecord::ConnectionAdapters::ConnectionManagement)
|
360
360
|
#
|
361
361
|
def insert_middleware(include_text, app=nil)
|
362
|
-
name = app || (options[:name]
|
362
|
+
name = app || (options[:name] ? @app_name.downcase : 'app')
|
363
363
|
inject_into_file("#{name}/app.rb", " use #{include_text}\n", :after => "Padrino::Application\n")
|
364
364
|
end
|
365
365
|
|
@@ -455,7 +455,7 @@ WARNING
|
|
455
455
|
default_text = default ? " (leave blank for #{default}):" : nil
|
456
456
|
say("#{statement}#{default_text} ", color)
|
457
457
|
result = $stdin.gets.strip
|
458
|
-
result.
|
458
|
+
result.empty? ? default : result
|
459
459
|
end
|
460
460
|
|
461
461
|
##
|
@@ -42,7 +42,7 @@ module Padrino
|
|
42
42
|
def setup
|
43
43
|
Padrino::Generators.load_components!
|
44
44
|
|
45
|
-
generator_kind = ARGV.delete_at(0).to_s.downcase.to_sym if ARGV[0].
|
45
|
+
generator_kind = ARGV.delete_at(0).to_s.downcase.to_sym if ARGV[0] && !ARGV[0].empty?
|
46
46
|
generator_class = Padrino::Generators.mappings[generator_kind]
|
47
47
|
|
48
48
|
if generator_class
|
@@ -31,7 +31,7 @@ module Padrino
|
|
31
31
|
if in_app_root?
|
32
32
|
@_components = options.class.new options.select{ |key,_| self.class.component_types.include?(key.to_sym) }
|
33
33
|
@app_name = (options[:app] || "App").gsub(/\W/, '_').camelize
|
34
|
-
if @_components.values.delete_if(&:
|
34
|
+
if @_components.values.delete_if(&:empty?).empty?
|
35
35
|
self.class.start(["-h"])
|
36
36
|
say
|
37
37
|
say "Current Selected Components:"
|
@@ -44,7 +44,7 @@ module Padrino
|
|
44
44
|
end
|
45
45
|
|
46
46
|
self.class.component_types.each do |comp|
|
47
|
-
next if @_components[comp].
|
47
|
+
next if @_components[comp].empty?
|
48
48
|
|
49
49
|
choice = @_components[comp] = resolve_valid_choice(comp)
|
50
50
|
existing = fetch_component_choice(comp)
|
@@ -127,7 +127,7 @@ module Padrino
|
|
127
127
|
when template_file =~ /gist/ && template_file !~ /raw/
|
128
128
|
raw_link, _ = *open(template_file).read.scan(/<a\s+href\s?\=\"(.*?)\"\>raw/)
|
129
129
|
raw_link ? "https://gist.github.com#{raw_link[0]}" : template_file
|
130
|
-
when File.extname(template_file).
|
130
|
+
when File.extname(template_file).empty? # referencing official plugin (i.e hoptoad)
|
131
131
|
"https://raw.github.com/padrino/padrino-recipes/master/#{kind.to_s.pluralize}/#{template_file}_#{kind}.rb"
|
132
132
|
else # local file on system
|
133
133
|
File.expand_path(template_file)
|
@@ -114,7 +114,7 @@ if PadrinoTasks.load?(:activerecord, defined?(ActiveRecord))
|
|
114
114
|
end
|
115
115
|
|
116
116
|
def local_database?(config, &block)
|
117
|
-
if %w( 127.0.0.1 localhost ).include?(config[:host]) || config[:host]
|
117
|
+
if %w( 127.0.0.1 localhost ).include?(config[:host]) || !config[:host]
|
118
118
|
yield
|
119
119
|
else
|
120
120
|
puts "This task only modifies local databases. #{config[:database]} is on a remote host."
|
@@ -243,7 +243,7 @@ if PadrinoTasks.load?(:activerecord, defined?(ActiveRecord))
|
|
243
243
|
ENV['PGPORT'] = config[:port].to_s if config[:port]
|
244
244
|
ENV['PGPASSWORD'] = config[:password].to_s if config[:password]
|
245
245
|
search_path = config[:schema_search_path]
|
246
|
-
|
246
|
+
if search_path
|
247
247
|
search_path = search_path.split(",").map{|search_path| "--schema=#{search_path.strip}" }.join(" ")
|
248
248
|
end
|
249
249
|
`pg_dump -i -U "#{config[:username]}" -s -x -O -f db/#{Padrino.env}_structure.sql #{search_path} #{config[:database]}`
|
@@ -7,7 +7,7 @@ module Padrino
|
|
7
7
|
case adapter
|
8
8
|
when 'postgres'
|
9
9
|
environment = {}
|
10
|
-
environment['PGPASSWORD'] = password unless password.
|
10
|
+
environment['PGPASSWORD'] = password unless password.empty?
|
11
11
|
|
12
12
|
arguments = []
|
13
13
|
arguments << "--encoding=#{charset}" if charset
|
@@ -18,7 +18,7 @@ module Padrino
|
|
18
18
|
Process.wait Process.spawn(environment, 'createdb', *arguments)
|
19
19
|
when 'mysql', 'mysql2'
|
20
20
|
environment = {}
|
21
|
-
environment['MYSQL_PWD'] = password unless password.
|
21
|
+
environment['MYSQL_PWD'] = password unless password.empty?
|
22
22
|
|
23
23
|
arguments = []
|
24
24
|
arguments << "--user=#{user}" if user
|
@@ -41,7 +41,7 @@ module Padrino
|
|
41
41
|
case adapter
|
42
42
|
when 'postgres'
|
43
43
|
environment = {}
|
44
|
-
environment['PGPASSWORD'] = password unless password.
|
44
|
+
environment['PGPASSWORD'] = password unless password.empty?
|
45
45
|
|
46
46
|
arguments = []
|
47
47
|
arguments << "--host=#{host}" if host
|
@@ -51,7 +51,7 @@ module Padrino
|
|
51
51
|
Process.wait Process.spawn(environment, 'dropdb', *arguments)
|
52
52
|
when 'mysql', 'mysql2'
|
53
53
|
environment = {}
|
54
|
-
environment['MYSQL_PWD'] = password unless password.
|
54
|
+
environment['MYSQL_PWD'] = password unless password.empty?
|
55
55
|
|
56
56
|
arguments = []
|
57
57
|
arguments << "--user=#{user}" if user
|
data/lib/padrino-gen.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'padrino-core/tasks'
|
2
2
|
require 'padrino-gen/command'
|
3
|
-
require '
|
3
|
+
require 'yaml'
|
4
4
|
|
5
5
|
module Padrino
|
6
6
|
##
|
@@ -33,7 +33,7 @@ module Padrino
|
|
33
33
|
# Return an ordered list of task with their class.
|
34
34
|
#
|
35
35
|
def mappings
|
36
|
-
@_mappings ||=
|
36
|
+
@_mappings ||= {}
|
37
37
|
end
|
38
38
|
|
39
39
|
##
|
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.13.3
|
4
|
+
version: 0.13.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Padrino Team
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2016-08-
|
14
|
+
date: 2016-08-30 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: padrino-core
|
@@ -19,14 +19,14 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - '='
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.13.3
|
22
|
+
version: 0.13.3.1
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - '='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.13.3
|
29
|
+
version: 0.13.3.1
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: bundler
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -47,28 +47,28 @@ dependencies:
|
|
47
47
|
requirements:
|
48
48
|
- - '='
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: 0.13.3
|
50
|
+
version: 0.13.3.1
|
51
51
|
type: :development
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
54
54
|
requirements:
|
55
55
|
- - '='
|
56
56
|
- !ruby/object:Gem::Version
|
57
|
-
version: 0.13.3
|
57
|
+
version: 0.13.3.1
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: padrino-mailer
|
60
60
|
requirement: !ruby/object:Gem::Requirement
|
61
61
|
requirements:
|
62
62
|
- - '='
|
63
63
|
- !ruby/object:Gem::Version
|
64
|
-
version: 0.13.3
|
64
|
+
version: 0.13.3.1
|
65
65
|
type: :development
|
66
66
|
prerelease: false
|
67
67
|
version_requirements: !ruby/object:Gem::Requirement
|
68
68
|
requirements:
|
69
69
|
- - '='
|
70
70
|
- !ruby/object:Gem::Version
|
71
|
-
version: 0.13.3
|
71
|
+
version: 0.13.3.1
|
72
72
|
description: Generators for easily creating and building padrino applications from
|
73
73
|
the console
|
74
74
|
email: padrinorb@gmail.com
|
@@ -215,7 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
215
215
|
version: 1.3.6
|
216
216
|
requirements: []
|
217
217
|
rubyforge_project: padrino-gen
|
218
|
-
rubygems_version: 2.
|
218
|
+
rubygems_version: 2.5.1
|
219
219
|
signing_key:
|
220
220
|
specification_version: 4
|
221
221
|
summary: Generators for easily creating and building padrino applications
|