marv 0.6.5 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,7 +16,7 @@ module Marv
16
16
  @name = dir
17
17
  @path = server_path
18
18
  @config_file = config_file
19
- @options = server_options
19
+ @options = {}
20
20
  @config = server_config
21
21
  @host = server_host
22
22
  @port = server_port
@@ -26,6 +26,11 @@ module Marv
26
26
  @global.clean_broken_links(server_projects_paths)
27
27
  end
28
28
 
29
+ # Server exists
30
+ def exists?
31
+ ::File.exists?(server_path)
32
+ end
33
+
29
34
  # Server path
30
35
  def server_path
31
36
  ::File.join(@global.servers_path, @name)
@@ -98,8 +103,8 @@ module Marv
98
103
  options = {}
99
104
 
100
105
  unless ::File.exists?(@config_file)
101
- @task.say "This will create a new development server.", :cyan
102
- @task.say "Please enter server settings below."
106
+ @task.say_info "This will create a new development server."
107
+ @task.say_warning "Please enter server settings below:"
103
108
 
104
109
  options.merge!(ask_server_details)
105
110
  options.merge!(ask_database_details)
@@ -112,8 +117,8 @@ module Marv
112
117
  # Server details
113
118
  def ask_server_details
114
119
  options = {}
115
- options[:server_host] = @task.ask "Where do you want to run the server?", :default => @global.config[:server_host]
116
- options[:server_port] = @task.ask "Which port do you want to use?", :default => @global.config[:server_port]
120
+ options[:server_host] = @task.ask_input "Where do you want to run the server?", :default => @global.config[:server_host]
121
+ options[:server_port] = @task.ask_input "Which port do you want to use?", :default => @global.config[:server_port]
117
122
 
118
123
  return options
119
124
  end
@@ -121,10 +126,10 @@ module Marv
121
126
  # Database details
122
127
  def ask_database_details
123
128
  options = {}
124
- options[:db_user] = @task.ask "MySQL database username?", :default => @global.config[:db_user]
125
- options[:db_password] = @task.ask "MySQL database password?", :default => @global.config[:db_password]
126
- options[:db_host] = @task.ask "MySQL database host?", :default => @global.config[:db_host]
127
- options[:db_port] = @task.ask "MySQL database port?", :default => @global.config[:db_port]
129
+ options[:db_user] = @task.ask_input "MySQL database username:", :default => @global.config[:db_user]
130
+ options[:db_password] = @task.ask_input "MySQL database password:", :default => @global.config[:db_password]
131
+ options[:db_host] = @task.ask_input "MySQL database host:", :default => @global.config[:db_host]
132
+ options[:db_port] = @task.ask_input "MySQL database port:", :default => @global.config[:db_port]
128
133
 
129
134
  return options
130
135
  end
@@ -132,14 +137,19 @@ module Marv
132
137
  # Wordpress details
133
138
  def ask_wordpress_details
134
139
  options = {}
135
- options[:wp_version] = @task.ask "WordPress version to install?", :default => @global.config[:wp_version]
140
+ options[:wp_version] = @task.ask_input "WordPress version to install:", :default => @global.config[:wp_version]
136
141
 
137
142
  return options
138
143
  end
139
144
 
140
145
  # Server database
141
146
  def db_client
142
- ::Mysql2::Client.new(:host => db_host, :port => db_port, :username => db_user, :password => db_password)
147
+ begin
148
+ ::Mysql2::Client.new(:host => db_host, :port => db_port, :username => db_user, :password => db_password)
149
+ rescue Mysql2::Error::ConnectionError
150
+ @task.say_error "Not able to connect to the database.", "Start the database if it is not running.", false
151
+ abort
152
+ end
143
153
  end
144
154
 
145
155
  # MySQL create database
@@ -154,12 +164,12 @@ module Marv
154
164
 
155
165
  # MySQL grant all privileges
156
166
  def db_client_grant_all
157
- @database.query("GRANT ALL PRIVILEGES ON #{db_name}.* TO '#{@db_user}'@'#{db_host}'")
167
+ @database.query("GRANT ALL PRIVILEGES ON #{db_name}.* TO '#{db_user}'@'#{db_host}'")
158
168
  end
159
169
 
160
170
  # MySQL revoke all privileges
161
171
  def db_client_revoke_all
162
- @database.query("REVOKE ALL PRIVILEGES ON #{db_name}.* FROM '#{@db_user}'@'#{db_host}'")
172
+ @database.query("REVOKE ALL PRIVILEGES ON #{db_name}.* FROM '#{db_user}'@'#{db_host}'")
163
173
  end
164
174
 
165
175
  # MySQL flush privileges
@@ -175,8 +185,7 @@ module Marv
175
185
  db_client_flush_priv
176
186
  @database.close
177
187
  rescue Exception => e
178
- @task.say "An error occured while creating database", :red
179
- @task.say e.message
188
+ @task.say_error "An error occured while creating the database:", e.message, false, true
180
189
  end
181
190
  end
182
191
 
@@ -188,8 +197,7 @@ module Marv
188
197
  db_client_flush_priv
189
198
  @database.close
190
199
  rescue Exception => e
191
- @task.say "An error occured while removing database", :red
192
- @task.say e.message
200
+ @task.say_error "An error occured while removing the database:", e.message, false, true
193
201
  end
194
202
  end
195
203
 
@@ -208,4 +216,4 @@ module Marv
208
216
 
209
217
  end
210
218
  end
211
- end
219
+ end
@@ -0,0 +1,3 @@
1
+ module Marv
2
+ VERSION = "0.7.0"
3
+ end
Binary file
Binary file
metadata CHANGED
@@ -1,36 +1,36 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonian Guveli
8
8
  - Olibia Tsati
9
9
  autorequire:
10
- bindir: bin
10
+ bindir: exe
11
11
  cert_chain: []
12
- date: 2018-01-11 00:00:00.000000000 Z
12
+ date: 2018-12-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: guard
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "<"
19
- - !ruby/object:Gem::Version
20
- version: '2.9'
21
18
  - - "~>"
22
19
  - !ruby/object:Gem::Version
23
20
  version: '2.8'
21
+ - - "<"
22
+ - !ruby/object:Gem::Version
23
+ version: '2.9'
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
- - - "<"
29
- - !ruby/object:Gem::Version
30
- version: '2.9'
31
28
  - - "~>"
32
29
  - !ruby/object:Gem::Version
33
30
  version: '2.8'
31
+ - - "<"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.9'
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: guard-livereload
36
36
  requirement: !ruby/object:Gem::Requirement
@@ -65,14 +65,14 @@ dependencies:
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '2.12'
68
+ version: '3.7'
69
69
  type: :runtime
70
70
  prerelease: false
71
71
  version_requirements: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '2.12'
75
+ version: '3.7'
76
76
  - !ruby/object:Gem::Dependency
77
77
  name: childprocess
78
78
  requirement: !ruby/object:Gem::Requirement
@@ -107,14 +107,14 @@ dependencies:
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '2.7'
110
+ version: '4.1'
111
111
  type: :runtime
112
112
  prerelease: false
113
113
  version_requirements: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '2.7'
117
+ version: '4.1'
118
118
  - !ruby/object:Gem::Dependency
119
119
  name: sass
120
120
  requirement: !ruby/object:Gem::Requirement
@@ -158,19 +158,19 @@ dependencies:
158
158
  - !ruby/object:Gem::Version
159
159
  version: '2.3'
160
160
  - !ruby/object:Gem::Dependency
161
- name: therubyracer
161
+ name: mini_racer
162
162
  requirement: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: '0.12'
166
+ version: '0.2'
167
167
  type: :runtime
168
168
  prerelease: false
169
169
  version_requirements: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: '0.12'
173
+ version: '0.2'
174
174
  - !ruby/object:Gem::Dependency
175
175
  name: rubyzip
176
176
  requirement: !ruby/object:Gem::Requirement
@@ -191,75 +191,94 @@ dependencies:
191
191
  requirements:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
- version: '7.2'
194
+ version: '9.3'
195
195
  type: :runtime
196
196
  prerelease: false
197
197
  version_requirements: !ruby/object:Gem::Requirement
198
198
  requirements:
199
199
  - - "~>"
200
200
  - !ruby/object:Gem::Version
201
- version: '7.2'
201
+ version: '9.3'
202
202
  - !ruby/object:Gem::Dependency
203
- name: rdoc
203
+ name: tilt
204
204
  requirement: !ruby/object:Gem::Requirement
205
205
  requirements:
206
- - - ">="
206
+ - - "!="
207
207
  - !ruby/object:Gem::Version
208
- version: '0'
209
- type: :development
208
+ version: '1.3'
209
+ - - "~>"
210
+ - !ruby/object:Gem::Version
211
+ version: '1.1'
212
+ type: :runtime
210
213
  prerelease: false
211
214
  version_requirements: !ruby/object:Gem::Requirement
212
215
  requirements:
213
- - - ">="
216
+ - - "!="
217
+ - !ruby/object:Gem::Version
218
+ version: '1.3'
219
+ - - "~>"
214
220
  - !ruby/object:Gem::Version
215
- version: '0'
221
+ version: '1.1'
216
222
  - !ruby/object:Gem::Dependency
217
223
  name: bundler
218
224
  requirement: !ruby/object:Gem::Requirement
219
225
  requirements:
220
- - - ">="
226
+ - - "~>"
227
+ - !ruby/object:Gem::Version
228
+ version: '1.15'
229
+ type: :development
230
+ prerelease: false
231
+ version_requirements: !ruby/object:Gem::Requirement
232
+ requirements:
233
+ - - "~>"
234
+ - !ruby/object:Gem::Version
235
+ version: '1.15'
236
+ - !ruby/object:Gem::Dependency
237
+ name: rake
238
+ requirement: !ruby/object:Gem::Requirement
239
+ requirements:
240
+ - - "~>"
221
241
  - !ruby/object:Gem::Version
222
- version: '0'
242
+ version: '12.3'
223
243
  type: :development
224
244
  prerelease: false
225
245
  version_requirements: !ruby/object:Gem::Requirement
226
246
  requirements:
227
- - - ">="
247
+ - - "~>"
228
248
  - !ruby/object:Gem::Version
229
- version: '0'
249
+ version: '12.3'
230
250
  - !ruby/object:Gem::Dependency
231
- name: jeweler
251
+ name: rspec
232
252
  requirement: !ruby/object:Gem::Requirement
233
253
  requirements:
234
- - - ">="
254
+ - - "~>"
235
255
  - !ruby/object:Gem::Version
236
- version: '0'
256
+ version: '3.0'
237
257
  type: :development
238
258
  prerelease: false
239
259
  version_requirements: !ruby/object:Gem::Requirement
240
260
  requirements:
241
- - - ">="
261
+ - - "~>"
242
262
  - !ruby/object:Gem::Version
243
- version: '0'
263
+ version: '3.0'
244
264
  description: A toolkit for bootstrapping and developing WordPress themes and plugins
245
265
  using Sass, LESS, and CoffeeScript.
246
- email: info@hardpixel.eu
266
+ email:
267
+ - info@hardpixel.eu
247
268
  executables:
248
269
  - marv
249
270
  extensions: []
250
- extra_rdoc_files:
251
- - LICENSE.txt
252
- - README.md
271
+ extra_rdoc_files: []
253
272
  files:
254
- - ".document"
255
273
  - CHANGELOG.md
256
274
  - Gemfile
257
275
  - Gemfile.lock
258
276
  - LICENSE.txt
259
277
  - README.md
260
278
  - Rakefile
261
- - VERSION
262
- - bin/marv
279
+ - bin/console
280
+ - bin/setup
281
+ - exe/marv
263
282
  - layouts/config/global.rb
264
283
  - layouts/config/project.rb
265
284
  - layouts/config/router.php
@@ -301,6 +320,7 @@ files:
301
320
  - layouts/theme/templates/single.php
302
321
  - lib/marv.rb
303
322
  - lib/marv/cli.rb
323
+ - lib/marv/cli/base.rb
304
324
  - lib/marv/cli/project.rb
305
325
  - lib/marv/cli/server.rb
306
326
  - lib/marv/global.rb
@@ -313,15 +333,19 @@ files:
313
333
  - lib/marv/project/create.rb
314
334
  - lib/marv/project/guard.rb
315
335
  - lib/marv/project/guard/assets.rb
336
+ - lib/marv/project/guard/commander.rb
316
337
  - lib/marv/project/guard/config.rb
317
338
  - lib/marv/project/guard/functions.rb
339
+ - lib/marv/project/guard/pry.rb
318
340
  - lib/marv/project/guard/templates.rb
319
341
  - lib/marv/project/project.rb
320
342
  - lib/marv/server/actions.rb
321
343
  - lib/marv/server/create.rb
322
344
  - lib/marv/server/server.rb
323
- - marv.gemspec
324
- homepage: http://hardpixel.github.io/marv
345
+ - lib/marv/version.rb
346
+ - pkg/marv-0.6.5.gem
347
+ - pkg/marv-0.7.0.gem
348
+ homepage: https://hardpixel.github.io/marv
325
349
  licenses:
326
350
  - MIT
327
351
  metadata: {}
@@ -341,8 +365,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
341
365
  version: '0'
342
366
  requirements: []
343
367
  rubyforge_project:
344
- rubygems_version: 2.7.3
368
+ rubygems_version: 2.7.7
345
369
  signing_key:
346
370
  specification_version: 4
347
- summary: A command-line tool for developing wordpress themes and plugins
371
+ summary: Toolkit for developing WordPress themes and plugins
348
372
  test_files: []
data/.document DELETED
@@ -1,5 +0,0 @@
1
- lib/**/*.rb
2
- bin/*
3
- -
4
- features/**/*.feature
5
- LICENSE.txt
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.6.5
@@ -1,156 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
- # -*- encoding: utf-8 -*-
5
- # stub: marv 0.6.5 ruby lib
6
-
7
- Gem::Specification.new do |s|
8
- s.name = "marv".freeze
9
- s.version = "0.6.5"
10
-
11
- s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
- s.require_paths = ["lib".freeze]
13
- s.authors = ["Jonian Guveli".freeze, "Olibia Tsati".freeze]
14
- s.date = "2018-01-11"
15
- s.description = "A toolkit for bootstrapping and developing WordPress themes and plugins using Sass, LESS, and CoffeeScript.".freeze
16
- s.email = "info@hardpixel.eu".freeze
17
- s.executables = ["marv".freeze]
18
- s.extra_rdoc_files = [
19
- "LICENSE.txt",
20
- "README.md"
21
- ]
22
- s.files = [
23
- ".document",
24
- "CHANGELOG.md",
25
- "Gemfile",
26
- "Gemfile.lock",
27
- "LICENSE.txt",
28
- "README.md",
29
- "Rakefile",
30
- "VERSION",
31
- "bin/marv",
32
- "layouts/config/global.rb",
33
- "layouts/config/project.rb",
34
- "layouts/config/router.php",
35
- "layouts/config/server.rb",
36
- "layouts/config/wp-config.php",
37
- "layouts/plugin/assets/images/screenshot.png",
38
- "layouts/plugin/assets/javascripts/admin.coffee",
39
- "layouts/plugin/assets/javascripts/admin.js",
40
- "layouts/plugin/assets/javascripts/plugin.coffee",
41
- "layouts/plugin/assets/javascripts/plugin.js",
42
- "layouts/plugin/assets/stylesheets/plugin.scss",
43
- "layouts/plugin/functions/plugin.php",
44
- "layouts/theme/assets/images/screenshot.png",
45
- "layouts/theme/assets/javascripts/admin.coffee",
46
- "layouts/theme/assets/javascripts/admin.js",
47
- "layouts/theme/assets/javascripts/theme.coffee",
48
- "layouts/theme/assets/javascripts/theme.js",
49
- "layouts/theme/assets/stylesheets/_header.scss",
50
- "layouts/theme/assets/stylesheets/style.scss",
51
- "layouts/theme/functions/functions.php",
52
- "layouts/theme/includes/filters-admin.php",
53
- "layouts/theme/includes/filters.php",
54
- "layouts/theme/includes/helpers.php",
55
- "layouts/theme/templates/footer.php",
56
- "layouts/theme/templates/header.php",
57
- "layouts/theme/templates/index.php",
58
- "layouts/theme/templates/page.php",
59
- "layouts/theme/templates/pages/404.php",
60
- "layouts/theme/templates/pages/archive.php",
61
- "layouts/theme/templates/pages/author.php",
62
- "layouts/theme/templates/pages/search.php",
63
- "layouts/theme/templates/partials/comments.php",
64
- "layouts/theme/templates/partials/content-none.php",
65
- "layouts/theme/templates/partials/content-page.php",
66
- "layouts/theme/templates/partials/content-single.php",
67
- "layouts/theme/templates/partials/content.php",
68
- "layouts/theme/templates/partials/searchform.php",
69
- "layouts/theme/templates/partials/sidebar.php",
70
- "layouts/theme/templates/single.php",
71
- "lib/marv.rb",
72
- "lib/marv/cli.rb",
73
- "lib/marv/cli/project.rb",
74
- "lib/marv/cli/server.rb",
75
- "lib/marv/global.rb",
76
- "lib/marv/project/actions.rb",
77
- "lib/marv/project/builder.rb",
78
- "lib/marv/project/builder/assets.rb",
79
- "lib/marv/project/builder/engines.rb",
80
- "lib/marv/project/builder/functions.rb",
81
- "lib/marv/project/builder/templates.rb",
82
- "lib/marv/project/create.rb",
83
- "lib/marv/project/guard.rb",
84
- "lib/marv/project/guard/assets.rb",
85
- "lib/marv/project/guard/config.rb",
86
- "lib/marv/project/guard/functions.rb",
87
- "lib/marv/project/guard/templates.rb",
88
- "lib/marv/project/project.rb",
89
- "lib/marv/server/actions.rb",
90
- "lib/marv/server/create.rb",
91
- "lib/marv/server/server.rb",
92
- "marv.gemspec"
93
- ]
94
- s.homepage = "http://hardpixel.github.io/marv".freeze
95
- s.licenses = ["MIT".freeze]
96
- s.rubygems_version = "2.7.3".freeze
97
- s.summary = "A command-line tool for developing wordpress themes and plugins".freeze
98
-
99
- if s.respond_to? :specification_version then
100
- s.specification_version = 4
101
-
102
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
103
- s.add_runtime_dependency(%q<guard>.freeze, ["< 2.9", "~> 2.8"])
104
- s.add_runtime_dependency(%q<guard-livereload>.freeze, ["~> 2.4"])
105
- s.add_runtime_dependency(%q<thor>.freeze, ["~> 0.19"])
106
- s.add_runtime_dependency(%q<sprockets>.freeze, ["~> 2.12"])
107
- s.add_runtime_dependency(%q<childprocess>.freeze, ["~> 0.5"])
108
- s.add_runtime_dependency(%q<mysql2>.freeze, ["~> 0.3"])
109
- s.add_runtime_dependency(%q<uglifier>.freeze, ["~> 2.7"])
110
- s.add_runtime_dependency(%q<sass>.freeze, ["~> 3.4"])
111
- s.add_runtime_dependency(%q<less>.freeze, ["~> 2.6"])
112
- s.add_runtime_dependency(%q<coffee-script>.freeze, ["~> 2.3"])
113
- s.add_runtime_dependency(%q<therubyracer>.freeze, ["~> 0.12"])
114
- s.add_runtime_dependency(%q<rubyzip>.freeze, ["~> 1.1"])
115
- s.add_runtime_dependency(%q<autoprefixer-rails>.freeze, ["~> 7.2"])
116
- s.add_development_dependency(%q<rdoc>.freeze, [">= 0"])
117
- s.add_development_dependency(%q<bundler>.freeze, [">= 0"])
118
- s.add_development_dependency(%q<jeweler>.freeze, [">= 0"])
119
- else
120
- s.add_dependency(%q<guard>.freeze, ["< 2.9", "~> 2.8"])
121
- s.add_dependency(%q<guard-livereload>.freeze, ["~> 2.4"])
122
- s.add_dependency(%q<thor>.freeze, ["~> 0.19"])
123
- s.add_dependency(%q<sprockets>.freeze, ["~> 2.12"])
124
- s.add_dependency(%q<childprocess>.freeze, ["~> 0.5"])
125
- s.add_dependency(%q<mysql2>.freeze, ["~> 0.3"])
126
- s.add_dependency(%q<uglifier>.freeze, ["~> 2.7"])
127
- s.add_dependency(%q<sass>.freeze, ["~> 3.4"])
128
- s.add_dependency(%q<less>.freeze, ["~> 2.6"])
129
- s.add_dependency(%q<coffee-script>.freeze, ["~> 2.3"])
130
- s.add_dependency(%q<therubyracer>.freeze, ["~> 0.12"])
131
- s.add_dependency(%q<rubyzip>.freeze, ["~> 1.1"])
132
- s.add_dependency(%q<autoprefixer-rails>.freeze, ["~> 7.2"])
133
- s.add_dependency(%q<rdoc>.freeze, [">= 0"])
134
- s.add_dependency(%q<bundler>.freeze, [">= 0"])
135
- s.add_dependency(%q<jeweler>.freeze, [">= 0"])
136
- end
137
- else
138
- s.add_dependency(%q<guard>.freeze, ["< 2.9", "~> 2.8"])
139
- s.add_dependency(%q<guard-livereload>.freeze, ["~> 2.4"])
140
- s.add_dependency(%q<thor>.freeze, ["~> 0.19"])
141
- s.add_dependency(%q<sprockets>.freeze, ["~> 2.12"])
142
- s.add_dependency(%q<childprocess>.freeze, ["~> 0.5"])
143
- s.add_dependency(%q<mysql2>.freeze, ["~> 0.3"])
144
- s.add_dependency(%q<uglifier>.freeze, ["~> 2.7"])
145
- s.add_dependency(%q<sass>.freeze, ["~> 3.4"])
146
- s.add_dependency(%q<less>.freeze, ["~> 2.6"])
147
- s.add_dependency(%q<coffee-script>.freeze, ["~> 2.3"])
148
- s.add_dependency(%q<therubyracer>.freeze, ["~> 0.12"])
149
- s.add_dependency(%q<rubyzip>.freeze, ["~> 1.1"])
150
- s.add_dependency(%q<autoprefixer-rails>.freeze, ["~> 7.2"])
151
- s.add_dependency(%q<rdoc>.freeze, [">= 0"])
152
- s.add_dependency(%q<bundler>.freeze, [">= 0"])
153
- s.add_dependency(%q<jeweler>.freeze, [">= 0"])
154
- end
155
- end
156
-