padrino-gen 0.14.0.rc2 → 0.14.0

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: e094b4fad7aaec458ffb7fc5af7b3a639737154c
4
- data.tar.gz: 67a01738c4c1455dcee511ebfb743f1e37d24466
3
+ metadata.gz: 4138bbcbdcadc769e9510f5083b5016fd769bf05
4
+ data.tar.gz: 5d6b70a31a26945844aaf168e27d6e7b78fa491f
5
5
  SHA512:
6
- metadata.gz: 9d1430a6fd2045c64d4c172c8b0c795ec471ab40aed1474d2df4e74943276158bac862e9d4f57d82e46b8678d2deff4f59fbdaf767d0aff47b26082be85e5b12
7
- data.tar.gz: 0f41807dc776ecee3f6210a265cf88357640faaf318345c099723c785829a29d93ec6ee3b2ea276516b14332c203798e2975145ec0da33d08b72554e67250770
6
+ metadata.gz: 16fd35b05e17a89c330e31616da496000eff05ab162175924e2ded8771c3a266cb518395650c1ce04cf65dd1c182ded17ace452201a661977328e56a38013891
7
+ data.tar.gz: 5f6bf52c3c151382f67baa20a48036d8cb8e2f0b3d81a0edfbee9d459f8646c60c1809e80cab3e55c9ca5b0cbde6691bd446907c3decc7fc95a052bf11460c19
@@ -1,3 +1,3 @@
1
1
  def setup_renderer
2
- require_dependencies 'erubis', :version => "~> 2.7.0"
2
+ require_dependencies 'erubi', :version => '~> 1.6'
3
3
  end
@@ -70,6 +70,7 @@ module Padrino
70
70
  File.chmod(0755, destination_root("exe/#{name}"))
71
71
  if options.gem?
72
72
  template 'templates/gem/gemspec.tt', destination_root(name + '.gemspec')
73
+ inject_into_file destination_root('Rakefile'), "require 'bundler/gem_tasks'\n", :after => "require 'bundler/setup'\n"
73
74
  template 'templates/gem/README.md.tt', destination_root('README.md')
74
75
  template 'templates/gem/lib/libname.tt', destination_root("lib/#{name}.rb")
75
76
  template 'templates/gem/lib/libname/version.tt', destination_root("lib/#{name}/version.rb")
@@ -7,7 +7,7 @@ module Padrino
7
7
  case adapter
8
8
  when 'postgres'
9
9
  environment = {}
10
- environment['PGPASSWORD'] = password unless password.empty?
10
+ environment['PGPASSWORD'] = password unless password.nil? || 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.empty?
21
+ environment['MYSQL_PWD'] = password unless password.nil? || 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.empty?
44
+ environment['PGPASSWORD'] = password unless password.nil? || 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.empty?
54
+ environment['MYSQL_PWD'] = password unless password.nil? || password.empty?
55
55
 
56
56
  arguments = []
57
57
  arguments << "--user=#{user}" if user
@@ -444,7 +444,7 @@ describe "ProjectGenerator" do
444
444
  it 'should properly generate for erb' do
445
445
  out, err = capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}", '--renderer=erb', '--script=none') }
446
446
  assert_match(/applying.*?erb.*?renderer/, out)
447
- assert_match_in_file(/gem 'erubis'/, "#{@apptmp}/sample_project/Gemfile")
447
+ assert_match_in_file(/gem 'erubi'/, "#{@apptmp}/sample_project/Gemfile")
448
448
  end
449
449
 
450
450
  it 'should properly generate for haml' do
@@ -0,0 +1,105 @@
1
+ require File.expand_path(File.dirname(__FILE__) + "/helper")
2
+ require File.expand_path(File.dirname(__FILE__) + "/../lib/padrino-gen/padrino-tasks/sql-helpers")
3
+
4
+ describe "SqlHelpers" do
5
+ def setup
6
+ Process.expects(:wait)
7
+ end
8
+
9
+ describe "create_db" do
10
+ describe "postgres" do
11
+ it "does not set PGPASSWORD when password is nil" do
12
+ Process.expects(:spawn).with() do |environment, *args|
13
+ environment == {}
14
+ end
15
+ Padrino::Generators::SqlHelpers.create_db("postgres", nil, nil, nil, "database", nil, nil)
16
+ end
17
+
18
+ it "does not set PGPASSWORD when password is blank" do
19
+ Process.expects(:spawn).with() do |environment, *args|
20
+ environment == {}
21
+ end
22
+ Padrino::Generators::SqlHelpers.create_db("postgres", nil, "", nil, "database", nil, nil)
23
+ end
24
+
25
+ it "sets PGPASSWORD when password is present" do
26
+ Process.expects(:spawn).with() do |environment, *args|
27
+ environment == {"PGPASSWORD" => "hunter2"}
28
+ end
29
+ Padrino::Generators::SqlHelpers.create_db("postgres", nil, "hunter2", nil, "database", nil, nil)
30
+ end
31
+ end
32
+
33
+ describe "mysql" do
34
+ it "does not set MYSQL_PWD when password is nil" do
35
+ Process.expects(:spawn).with() do |environment, *args|
36
+ environment == {}
37
+ end
38
+ Padrino::Generators::SqlHelpers.create_db("mysql", nil, nil, nil, "database", nil, nil)
39
+ end
40
+
41
+ it "does not set MYSQL_PWD when password is blank" do
42
+ Process.expects(:spawn).with() do |environment, *args|
43
+ environment == {}
44
+ end
45
+ Padrino::Generators::SqlHelpers.create_db("mysql", nil, "", nil, "database", nil, nil)
46
+ end
47
+
48
+ it "sets MYSQL_PWD when password is present" do
49
+ Process.expects(:spawn).with() do |environment, *args|
50
+ environment == {"MYSQL_PWD" => "hunter2"}
51
+ end
52
+ Padrino::Generators::SqlHelpers.create_db("mysql", nil, "hunter2", nil, "database", nil, nil)
53
+ end
54
+ end
55
+ end
56
+
57
+ describe "drop_db" do
58
+ describe "postgres" do
59
+ it "does not set PGPASSWORD when password is nil" do
60
+ Process.expects(:spawn).with() do |environment, *args|
61
+ environment == {}
62
+ end
63
+ Padrino::Generators::SqlHelpers.drop_db("postgres", nil, nil, nil, "database")
64
+ end
65
+
66
+ it "does not set PGPASSWORD when password is blank" do
67
+ Process.expects(:spawn).with() do |environment, *args|
68
+ environment == {}
69
+ end
70
+ Padrino::Generators::SqlHelpers.drop_db("postgres", nil, "", nil, "database")
71
+ end
72
+
73
+ it "sets PGPASSWORD when password is present" do
74
+ Process.expects(:spawn).with() do |environment, *args|
75
+ environment == {"PGPASSWORD" => "hunter2"}
76
+ end
77
+ Padrino::Generators::SqlHelpers.drop_db("postgres", nil, "hunter2", nil, "database")
78
+ end
79
+ end
80
+
81
+ describe "mysql" do
82
+ it "does not set MYSQL_PWD when password is nil" do
83
+ Process.expects(:spawn).with() do |environment, *args|
84
+ environment == {}
85
+ end
86
+ Padrino::Generators::SqlHelpers.drop_db("mysql", nil, nil, nil, "database")
87
+ end
88
+
89
+ it "does not set MYSQL_PWD when password is blank" do
90
+ Process.expects(:spawn).with() do |environment, *args|
91
+ environment == {}
92
+ end
93
+ Padrino::Generators::SqlHelpers.drop_db("mysql", nil, "", nil, "database")
94
+ end
95
+
96
+ it "sets MYSQL_PWD when password is present" do
97
+ Process.expects(:spawn).with() do |environment, *args|
98
+ environment == {"MYSQL_PWD" => "hunter2"}
99
+ end
100
+ Padrino::Generators::SqlHelpers.drop_db("mysql", nil, "hunter2", nil, "database")
101
+ end
102
+ end
103
+ end
104
+ end
105
+
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.14.0.rc2
4
+ version: 0.14.0
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: 2017-01-19 00:00:00.000000000 Z
14
+ date: 2017-03-15 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.14.0.rc2
22
+ version: 0.14.0
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.14.0.rc2
29
+ version: 0.14.0
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.14.0.rc2
50
+ version: 0.14.0
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.14.0.rc2
57
+ version: 0.14.0
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.14.0.rc2
64
+ version: 0.14.0
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.14.0.rc2
71
+ version: 0.14.0
72
72
  description: Generators for easily creating and building padrino applications from
73
73
  the console
74
74
  email: padrinorb@gmail.com
@@ -194,6 +194,7 @@ files:
194
194
  - test/test_model_generator.rb
195
195
  - test/test_plugin_generator.rb
196
196
  - test/test_project_generator.rb
197
+ - test/test_sql_helpers.rb
197
198
  - test/test_task_generator.rb
198
199
  homepage: http://www.padrinorb.com
199
200
  licenses:
@@ -211,12 +212,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
211
212
  version: '0'
212
213
  required_rubygems_version: !ruby/object:Gem::Requirement
213
214
  requirements:
214
- - - ">"
215
+ - - ">="
215
216
  - !ruby/object:Gem::Version
216
- version: 1.3.1
217
+ version: 1.3.6
217
218
  requirements: []
218
219
  rubyforge_project: padrino-gen
219
- rubygems_version: 2.6.6
220
+ rubygems_version: 2.6.10
220
221
  signing_key:
221
222
  specification_version: 4
222
223
  summary: Generators for easily creating and building padrino applications