theme-juice 0.13.1 → 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: 65212adcefc4b732027bbdcb09cbcbc0ee8af4a5
4
- data.tar.gz: 505725fbd6aa3dd5fe6a49e77f6f0dd039a106e6
3
+ metadata.gz: b1b967ed98fbadf66564f9084cb66a47e4c32573
4
+ data.tar.gz: 86e70617bb1137eb761f1d669dc3a44c24fe8334
5
5
  SHA512:
6
- metadata.gz: 26785dee61329861f52407fc69164c75c8a7da4ea0a807d13e3b837daf53889cc0eb2814f081c6e359ff79cea36b810a2d2f2d10997458423e76ba545893f818
7
- data.tar.gz: 629282e40a62f7c4fdc736b7da586d2231813bd75c106004e175d2c8818e5d9716a44a27b5c7c9f562a960e9483f471f741ff028fe87fe34504db6f61febd8af
6
+ metadata.gz: b8c892a3e15b552ca5cf90e4026994437881f7f64f9ddace30b71bb0636075730d38f44b16e33ff843fa692875089a4c2519861b3c49f4a3a154bd964c3e3ac1
7
+ data.tar.gz: 65b912fa74bb0d166f6003b9edeac4e55dd708219a46e7db2c64bc93f168dfea43934cf71d5d5375e529c3b34e835658aed525b7a531419010a7c4152b05696f
@@ -47,14 +47,6 @@ module ThemeJuice
47
47
  map %w[up init] => :setup
48
48
  map %w[rm remove trash] => :delete
49
49
  map %w[ls projects apps sites] => :list
50
- map %w[build] => :install
51
- map %w[dev] => :watch
52
- map %w[asset] => :assets
53
- map %w[deps] => :vendor
54
- map %w[zip package pkg] => :dist
55
- map %w[wordpress] => :wp
56
- map %w[bk] => :backup
57
- map %w[tests spec specs] => :test
58
50
  map %w[server remote] => :deploy
59
51
  map %w[vagrant vvv] => :vm
60
52
 
@@ -157,51 +149,20 @@ module ThemeJuice
157
149
  @io.error "Not implemented"
158
150
  end
159
151
 
160
- desc "install", "Run theme installation"
161
- def install(*args)
162
- @config.command :install, args
163
- end
164
-
165
- desc "watch [ARGS]", "Manage development build tools"
166
- def watch(*args)
167
- @config.command :watch, args
168
- end
169
-
170
- desc "assets [ARGS]", "Manage front-end dependencies"
171
- def assets(*args)
172
- @config.command :assets, args
173
- end
174
-
175
- desc "vendor [ARGS]", "Manage back-end dependencies"
176
- def vendor(*args)
177
- @config.command :vendor, args
178
- end
179
-
180
- desc "dist [ARGS]", "Package project for distribution"
181
- def dist(*args)
182
- @config.command :dist, args
183
- end
184
-
185
- desc "wp [ARGS]", "Manage WordPress installation"
186
- def wp(*args)
187
- @config.command :wp, args
188
- end
189
-
190
- desc "backup [ARGS]", "Backup project"
191
- def backup(*args)
192
- @config.command :backup, args
193
- end
194
-
195
- desc "test [ARGS]", "Manage and run project tests"
196
- def test(*args)
197
- @config.command :test, args
198
- end
199
-
200
152
  desc "vm [ARGS]", "Manage development environment"
201
153
  def vm(*args)
202
154
  @util.inside @env.vm_path do
203
155
  @util.run "vagrant #{args.join(" ")}", :verbose => @env.verbose
204
156
  end
205
157
  end
158
+
159
+ # For dynamic methods defined within the config
160
+ def method_missing(method, *args, &block)
161
+ if @config.commands.has_key? "#{method}"
162
+ @config.command method.to_sym, args
163
+ else
164
+ super
165
+ end
166
+ end
206
167
  end
207
168
  end
@@ -6,17 +6,23 @@ module ThemeJuice
6
6
  @io = IO
7
7
  @project = Project
8
8
  @util = Util.new
9
+ @config = nil
9
10
 
10
- def command(sequence, *args)
11
+ def command(cmd, *args)
11
12
  begin
12
- config.commands.fetch("#{sequence}") {
13
- @io.error "Command '#{sequence}' not found in config", NotImplementedError }
13
+ config.commands.fetch("#{cmd}") {
14
+ @io.error "Command '#{cmd}' not found in config", NotImplementedError }
14
15
  .each { |c| run format_command(c, *args) }
15
16
  rescue NoMethodError
16
17
  @io.say "Skipping...", :color => :yellow, :icon => :notice
17
18
  end
18
19
  end
19
20
 
21
+ def commands
22
+ config.commands ||
23
+ @io.error("No commands found in config", NotImplementedError)
24
+ end
25
+
20
26
  def deployment
21
27
  config.deployment ||
22
28
  @io.error("Deployment settings not found in config", NotImplementedError)
@@ -43,6 +49,11 @@ module ThemeJuice
43
49
  end
44
50
 
45
51
  def config
52
+ @config = read_config if @config.nil?
53
+ @config
54
+ end
55
+
56
+ def read_config
46
57
  begin
47
58
  @project.location ||= Dir.pwd
48
59
 
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "TJ" "1" "August 2015" "" "Theme Juice Manual"
4
+ .TH "TJ" "1" "September 2015" "" "Theme Juice Manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBtj\fR \- WordPress development made easy
@@ -112,38 +112,38 @@ List all projects
112
112
  Manage development environment via vagrant(1)\. Commands are proxied to your Vagrant installation so that they can be run from any directory\.
113
113
  .
114
114
  .SH "CONFIG COMMANDS"
115
- These run the corresponding command from your project\'s config file\. They accept any number of arguments, since the behavior and handling of input is defined within the config file itself\.
115
+ These run the corresponding command from your project\'s config file\. They accept any number of arguments, since the behavior and handling of input is defined within the config file itself\. Below are the commands defined within the Theme Juice starter template\.
116
116
  .
117
117
  .TP
118
- \fBinstall\fR, \fBbuild\fR=[\fIarg\fR[,\fIarg\fR]\.\.\.]
118
+ \fBinstall\fR=[\fIarg\fR[,\fIarg\fR]\.\.\.]
119
119
  Run installation for project
120
120
  .
121
121
  .TP
122
- \fBwatch\fR, \fBdev\fR=[\fIarg\fR[,\fIarg\fR]\.\.\.]
122
+ \fBwatch\fR=[\fIarg\fR[,\fIarg\fR]\.\.\.]
123
123
  Manage and run development build tools
124
124
  .
125
125
  .TP
126
- \fBassets\fR, \fBasset\fR=[\fIarg\fR[,\fIarg\fR]\.\.\.]
126
+ \fBassets\fR=[\fIarg\fR[,\fIarg\fR]\.\.\.]
127
127
  Manage front\-end dependencies for project
128
128
  .
129
129
  .TP
130
- \fBvendor\fR, \fBdeps\fR=[\fIarg\fR[,\fIarg\fR]\.\.\.]
130
+ \fBvendor\fR=[\fIarg\fR[,\fIarg\fR]\.\.\.]
131
131
  Manage back\-end dependencies for project
132
132
  .
133
133
  .TP
134
- \fBdist\fR, \fBpkg\fR, \fBpackage\fR, \fBzip\fR=[\fIarg\fR[,\fIarg\fR]\.\.\.]
134
+ \fBdist\fR=[\fIarg\fR[,\fIarg\fR]\.\.\.]
135
135
  Package project for distribution
136
136
  .
137
137
  .TP
138
- \fBwp\fR, \fBwordpress\fR=[\fIarg\fR[,\fIarg\fR]\.\.\.]
138
+ \fBwp\fR=[\fIarg\fR[,\fIarg\fR]\.\.\.]
139
139
  Manage project\'s wordpress(7) installation with wp\-cli(1)
140
140
  .
141
141
  .TP
142
- \fBbackup\fR, \fBbk\fR=[\fIarg\fR[,\fIarg\fR]\.\.\.]
142
+ \fBbackup\fR=[\fIarg\fR[,\fIarg\fR]\.\.\.]
143
143
  Backup project
144
144
  .
145
145
  .TP
146
- \fBtest\fR, \fBtests\fR, \fBspec\fR, \fBspecs\fR=[\fIarg\fR[,\fIarg\fR]\.\.\.]
146
+ \fBtest\fR=[\fIarg\fR[,\fIarg\fR]\.\.\.]
147
147
  Manage and run project tests
148
148
  .
149
149
  .SH "CONFIG FILE"
@@ -93,37 +93,38 @@ SECONDARY COMMANDS
93
93
  CONFIG COMMANDS
94
94
  These run the corresponding command from your project's config file.
95
95
  They accept any number of arguments, since the behavior and handling of
96
- input is defined within the config file itself.
96
+ input is defined within the config file itself. Below are the commands
97
+ defined within the Theme Juice starter template.
97
98
 
98
- install, build=[arg[,arg]...]
99
+ install=[arg[,arg]...]
99
100
  Run installation for project
100
101
 
101
- watch, dev=[arg[,arg]...]
102
+ watch=[arg[,arg]...]
102
103
  Manage and run development build tools
103
104
 
104
- assets, asset=[arg[,arg]...]
105
+ assets=[arg[,arg]...]
105
106
  Manage front-end dependencies for project
106
107
 
107
- vendor, deps=[arg[,arg]...]
108
+ vendor=[arg[,arg]...]
108
109
  Manage back-end dependencies for project
109
110
 
110
- dist, pkg, package, zip=[arg[,arg]...]
111
+ dist=[arg[,arg]...]
111
112
  Package project for distribution
112
113
 
113
- wp, wordpress=[arg[,arg]...]
114
+ wp=[arg[,arg]...]
114
115
  Manage project's wordpress(7) installation with wp-cli(1)
115
116
 
116
- backup, bk=[arg[,arg]...]
117
+ backup=[arg[,arg]...]
117
118
  Backup project
118
119
 
119
- test, tests, spec, specs=[arg[,arg]...]
120
+ test=[arg[,arg]...]
120
121
  Manage and run project tests
121
122
 
122
123
  CONFIG FILE
123
- A YAML Juicefile(5) configuration can be used to store commonly-used
124
- build scripts, similar to npm(1) scripts. Each command block sequence
124
+ A YAML Juicefile(5) configuration can be used to store commonly-used
125
+ build scripts, similar to npm(1) scripts. Each command block sequence
125
126
  can be mapped to an individual project's build tool, allowing a stream-
126
- lined set of commands to be used across multiple projects that utilize
127
+ lined set of commands to be used across multiple projects that utilize
127
128
  different tools.
128
129
 
129
130
  commands
@@ -153,7 +154,7 @@ CONFIG FILE
153
154
  commands.test
154
155
  Command used to manage and run project tests
155
156
 
156
- Placeholder arguments can be used within any command block sequence to
157
+ Placeholder arguments can be used within any command block sequence to
157
158
  allow splat or indexed arguments to be passed to the corresponding com-
158
159
  mand when executed.
159
160
 
@@ -163,8 +164,8 @@ CONFIG FILE
163
164
  %argN%, %argumentN%
164
165
  Where n is the argument index e.g. cmd %arg1% | cmd %arg2%
165
166
 
166
- When naming your configuration file, use the recommended Juicefile, or
167
- .tj.yaml naming convention. The raw filename regex matcher is below if
167
+ When naming your configuration file, use the recommended Juicefile, or
168
+ .tj.yaml naming convention. The raw filename regex matcher is below if
168
169
  you want to be a little different.
169
170
 
170
171
  /^(((\.)?(tj)|((J|j)uicefile))(\.y(a)?ml)?$)/
@@ -172,7 +173,7 @@ CONFIG FILE
172
173
  ENVIRONMENT
173
174
  All of the global options have a corresponding ENV variable that can be
174
175
  set to permanently use the specified value each time tj(1) is run. This
175
- is useful if you're using an alternate vagrant(1) box, or if you need
176
+ is useful if you're using an alternate vagrant(1) box, or if you need
176
177
  to disable certain features due to limited support e.g. on Windows.
177
178
 
178
179
  TJ_VM_BOX=repository
@@ -188,7 +189,7 @@ ENVIRONMENT
188
189
  Force directory prefix for project in VM
189
190
 
190
191
  TJ_YOLO=bool
191
- Say yes to anything and everything, and maybe even get a few
192
+ Say yes to anything and everything, and maybe even get a few
192
193
  surprises
193
194
 
194
195
  TJ_BORING=bool
@@ -227,4 +228,4 @@ ENVIRONMENT
227
228
 
228
229
 
229
230
 
230
- August 2015 TJ(1)
231
+ September 2015 TJ(1)
@@ -16,7 +16,11 @@ namespace :rsync do
16
16
 
17
17
  after "deploy:finished", :clean do
18
18
  run_locally do
19
- execute :rm, "-rf", fetch(:rsync_stage)
19
+ return if Pathname.new(fetch(:rsync_stage)).absolute?
20
+
21
+ if fetch(:clean_tmp, true)
22
+ execute :rm, "-rf", fetch(:rsync_stage)
23
+ end
20
24
  end
21
25
  end
22
26
 
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  module ThemeJuice
4
- VERSION = "0.13.1"
4
+ VERSION = "0.14.0"
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.13.1
4
+ version: 0.14.0
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-09-01 00:00:00.000000000 Z
11
+ date: 2015-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor