gentheme 0.1.2 → 0.1.3
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.
- checksums.yaml +4 -4
- data/bin/gentheme +3 -3
- data/lib/gentheme.rb +6 -4
- data/lib/gentheme/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31c8ef6b0823241573b905dec9ca98159764f9f8
|
4
|
+
data.tar.gz: cb38435ec1aad149aa29026fd141256868283ceb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb9b59df98f2293afeec80836e2cc41b104827dd59385a9c2ee388b7be04debf542a876b0a816bf7f62169f1be9b98babea350a099c21c0e9e2e64eaa87d7014
|
7
|
+
data.tar.gz: 879f1f06a661535a6abbe90ed02d488095db708bcbc9968d7cde5ee9cf6ecdb200b1bc178421a481f8c87acb33d8aed131194ded61459f88eefe6eb0507220da
|
data/bin/gentheme
CHANGED
@@ -11,7 +11,7 @@ opts.separator ""
|
|
11
11
|
opts.separator "\tinstall themename: start installing a theme inside a folder named themename"
|
12
12
|
opts.separator ""
|
13
13
|
opts.separator "Available options:"
|
14
|
-
opts.string "-p", "--path", "a path", default:
|
14
|
+
opts.string "-p", "--path", "a path", default: Dir.getwd
|
15
15
|
opts.bool "-v", "--verbose", "enable verbose mode", default: true
|
16
16
|
opts.on '--version', 'print the version' do
|
17
17
|
puts Gentheme::VERSION
|
@@ -21,8 +21,8 @@ parser = Slop::Parser.new(opts)
|
|
21
21
|
options = parser.parse(ARGV)
|
22
22
|
command = options.arguments[0] rescue nil
|
23
23
|
if command.nil?
|
24
|
-
puts
|
25
|
-
puts
|
24
|
+
puts "Gentheme version #{Gentheme::VERSION}"
|
25
|
+
puts "Current working directory: #{Dir.getwd}"
|
26
26
|
puts opts
|
27
27
|
exit
|
28
28
|
end
|
data/lib/gentheme.rb
CHANGED
@@ -102,7 +102,7 @@ module Gentheme
|
|
102
102
|
|
103
103
|
def get_status(field, namespace)
|
104
104
|
if read_status && !namespace.nil? && !field.nil?
|
105
|
-
@status[namespace.to_sym][field.to_sym]
|
105
|
+
@status[namespace.to_sym][field.to_sym] rescue nil
|
106
106
|
else
|
107
107
|
nil
|
108
108
|
end
|
@@ -168,15 +168,17 @@ module Gentheme
|
|
168
168
|
db_pass = get_status(:db_pass, :mysql)
|
169
169
|
db_name = get_status(:db_name, :mysql)
|
170
170
|
client = Mysql2::Client.new(:host => db_host, :username => db_user, :password => db_pass)
|
171
|
-
|
171
|
+
|
172
|
+
if client && (!db_host.nil? && !db_user.nil?)
|
172
173
|
#client.query("DROP DATABASE IF EXISTS #{db_name}")
|
173
|
-
client.query("CREATE DATABASE #{db_name}
|
174
|
+
client.query("CREATE DATABASE #{db_name}") rescue 'DB already exists'
|
174
175
|
client.close
|
175
176
|
puts "Database #{name} created successfully."
|
176
177
|
set_status(:create_database, true, :packages)
|
177
178
|
else
|
178
179
|
puts "Can't connect to your database."
|
179
|
-
puts "Please edit #{@base_root}/gentheme.conf your mysql account connection
|
180
|
+
puts "Please edit #{@base_root}/gentheme.conf your mysql account connection and add the mysql lines:"
|
181
|
+
puts @default_status.to_yaml
|
180
182
|
end
|
181
183
|
else
|
182
184
|
puts "Database already created!"
|
data/lib/gentheme/version.rb
CHANGED