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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9ce9cad7af3d838b31a0f21ed5e047c2af3ce0b6
4
- data.tar.gz: 8aea999b606391dd5ce9229b6a813d171bb6ea0f
3
+ metadata.gz: 67b06756e1fe1f0e22530b73a638af3a544fae41
4
+ data.tar.gz: be966e3a491af5889250e0d0aec0fce731d1b6d1
5
5
  SHA512:
6
- metadata.gz: 25a987d2393a1bd5d90f69b8d10b24bce0992feb12b33b6e88873c8e4c7df9ea58b195744aade49fa780a3db1dea6a7b4e77b91d66331c2929d7fea9a4319b1b
7
- data.tar.gz: 69ff8f7aaa59c744b89f5ef0639feb0319ad719d2572d337381fd708a467445bf1a41c07fb46dec92c25551b3e0c6c7e9fee49779aaf138cf8e58ec5e54a4a31
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.present? && self.class.available_choices_for(component).include?(choice.to_sym)
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.present? ? ", #{gem_options}" : ''
332
- write_version = version.present? ? ", '#{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].present? ? @app_name.downcase : 'app')
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.blank? ? default : 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].present?
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(&:blank?).empty?
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].blank?
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).blank? # referencing official plugin (i.e hoptoad)
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].blank?
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
- unless search_path.blank?
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.blank?
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.blank?
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.blank?
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.blank?
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 'active_support/ordered_hash'
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 ||= ActiveSupport::OrderedHash.new
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-17 00:00:00.000000000 Z
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.6.4
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