gentheme 0.1.2 → 0.1.3

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: 9d3eb7b7b77bb4153ae5cb92f57038e1a82fc509
4
- data.tar.gz: cd583fcf252921612c69a37c46bf20a1fd1d54c3
3
+ metadata.gz: 31c8ef6b0823241573b905dec9ca98159764f9f8
4
+ data.tar.gz: cb38435ec1aad149aa29026fd141256868283ceb
5
5
  SHA512:
6
- metadata.gz: ca1a5ece4943221f34bc3c61349b2cf07f7708669a32e8cd16a3f04de60474a7be34afe129e541c3a1ed548d79f5cf9098faecbd7ad21d978e97bac9951afbf1
7
- data.tar.gz: f7b8fab31ca14bbfa09d331b6de8f5a56793ed32f1965dbb2ffba73ad719802e18c5217385577e5ee0aad732059af13535e838494d9f337f415c34f7b13e7fbd
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: `pwd`.strip
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 options.to_hash
25
- puts options.arguments
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
- if client
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} IF NOT EXISTS")
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!"
@@ -1,3 +1,3 @@
1
1
  module Gentheme
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gentheme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michele Gobbi