theme-juice 0.7.2 → 0.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6509e418159bf7e3d436c6b5be1368223c3901a8
4
- data.tar.gz: 1daf41ef193c92564795ac6c724ff07d1d77aad9
3
+ metadata.gz: 991650b2f8489bbf3583aec1b8fad17215c6e708
4
+ data.tar.gz: dfd1e0ec39d06a3fc7690bc16dd4894980e34391
5
5
  SHA512:
6
- metadata.gz: f51682465a715e92554a08b1073e4fadc65c4bad6e2f81370e2d494dd6cc2a7ec8eb5ed7d964387e7b5d4a9023aef12aaf199a845d0e2459b429c986a05913ae
7
- data.tar.gz: 1974e585d8ecc3adab7fa5eb4e0075a95d35cb6144599a388edc3fe5f22bad588e0e6250c0908321a4907de08912b56ca553aa309ba75071a9098143387620ad
6
+ metadata.gz: 31e023c021d1620d886269e87f13a8e1f309c964a92f80846b761bc1a4697e02427064c1c5d257643ca6355637fcfaf531f62af1a0be33639e2f3eac44dfb77f
7
+ data.tar.gz: 0f19081e3fcbea70c81d8f14091721b7966cf57a99f1b4e032f8bdfffea8991b7a865c1295a1d0d31cb9cde4c5aa6d25f28e5c7a659003d2944c9061c8b8a76c
@@ -171,20 +171,20 @@ module ThemeJuice
171
171
  @list.new(options).list :projects
172
172
  end
173
173
 
174
- desc "install", "Run installation for project"
174
+ desc "update", "Update tj and its dependencies"
175
175
  #
176
176
  # @return {Void}
177
177
  #
178
- def install
179
- @config.install
178
+ def update(*commands)
179
+ @io.error "Not implemented"
180
180
  end
181
181
 
182
- desc "update", "Update tj and its dependencies"
182
+ desc "install", "Run installation for project"
183
183
  #
184
184
  # @return {Void}
185
185
  #
186
- def update
187
- @io.error "Not implemented"
186
+ def install(*commands)
187
+ @config.install commands
188
188
  end
189
189
 
190
190
  desc "watch [COMMANDS]", "Watch and compile assets"
@@ -192,7 +192,7 @@ module ThemeJuice
192
192
  # @return {Void}
193
193
  #
194
194
  def watch(*commands)
195
- @config.watch *commands
195
+ @config.watch commands
196
196
  end
197
197
 
198
198
  desc "vendor [COMMANDS]", "Manage vendor dependencies"
@@ -200,7 +200,7 @@ module ThemeJuice
200
200
  # @return {Void}
201
201
  #
202
202
  def vendor(*commands)
203
- @config.vendor *commands
203
+ @config.vendor commands
204
204
  end
205
205
 
206
206
  desc "dist [COMMANDS]", "Package project for distribution"
@@ -208,7 +208,7 @@ module ThemeJuice
208
208
  # @return {Void}
209
209
  #
210
210
  def dist(*commands)
211
- @config.dist *commands
211
+ @config.dist commands
212
212
  end
213
213
 
214
214
  desc "wp [COMMANDS]", "Manage WordPress installation"
@@ -216,7 +216,7 @@ module ThemeJuice
216
216
  # @return {Void}
217
217
  #
218
218
  def wp(*commands)
219
- @config.wp *commands
219
+ @config.wp commands
220
220
  end
221
221
 
222
222
  desc "backup [COMMANDS]", "Backup project"
@@ -224,7 +224,7 @@ module ThemeJuice
224
224
  # @return {Void}
225
225
  #
226
226
  def backup(*commands)
227
- @config.backup *commands
227
+ @config.backup commands
228
228
  end
229
229
 
230
230
  desc "test [COMMANDS]", "Manage and run project tests"
@@ -232,7 +232,7 @@ module ThemeJuice
232
232
  # @return {Void}
233
233
  #
234
234
  def test(*commands)
235
- @config.test *commands
235
+ @config.test commands
236
236
  end
237
237
 
238
238
  desc "vm [COMMANDS]", "Manage development environment"
@@ -12,7 +12,7 @@ module ThemeJuice
12
12
 
13
13
  config.fetch("commands", {})
14
14
  .fetch(method.to_s) { @io.error("Command '#{method}' not found in config") }
15
- .each { |cmd| run "#{cmd} #{args.join(" ") unless args.empty?}" }
15
+ .each { |cmd| run format_command(cmd, *args) }
16
16
  end
17
17
 
18
18
  private
@@ -23,6 +23,19 @@ module ThemeJuice
23
23
  end
24
24
  end
25
25
 
26
+ def format_command(cmd, args)
27
+
28
+ if %r{(%args%)|(%arguments%)} =~ cmd
29
+ cmd.gsub! %r{(%args%)|(%arguments%)}, args.join(" ")
30
+ else
31
+ args.to_enum.with_index(1).each do |arg, i|
32
+ cmd.gsub! %r{(%arg#{i}%)|(%argument#{i}%)}, arg
33
+ end
34
+ end
35
+
36
+ cmd
37
+ end
38
+
26
39
  def config
27
40
  begin
28
41
  YAML.load_file Dir["#{@project.location}/*"].select { |f| regex =~ File.basename(f) }.last ||
@@ -35,7 +48,7 @@ module ThemeJuice
35
48
  end
36
49
 
37
50
  def regex
38
- %r{^((\.)?(tj.y(a)?ml)|((J|j)uicefile(.y(a)?ml)?))}
51
+ %r{^(((\.)?(tj)|((J|j)uicefile))(.y(a)?ml)?$)}
39
52
  end
40
53
 
41
54
  extend self
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  module ThemeJuice
4
- VERSION = "0.7.2"
4
+ VERSION = "0.7.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: theme-juice
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ezekiel Gabrielse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-05 00:00:00.000000000 Z
11
+ date: 2015-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor