theme-juice 0.7.10 → 0.7.11

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: f83b8bbe95fb64cf42a9a94d829fa61cdd53535c
4
- data.tar.gz: 20a02695b68b423391286d183e845471549de900
3
+ metadata.gz: f8a40e35767cddfbeb2aab96fce9dd0cf3a509aa
4
+ data.tar.gz: 7dc5c7b4a1c816c61dc3312bd6d17bc52dcacfb8
5
5
  SHA512:
6
- metadata.gz: c07184bc00044beb4610c10b463b16c4925eb82d45c2fcba3115caa3200c7b444ca38fb62acd9b252aad8c5547db0e542cc336a5a9113add09d1cf19d67044b7
7
- data.tar.gz: d7b716f461b6ef926df7ee85632e77d9cd7b85f005a9604b1350b4d7d79a664f99a84cef14c6df8e5d760790cc662372b261aa01dbf82a79455a394c79f3c808
6
+ metadata.gz: 6051a33c1e1d44d2e2cf1023c85e1ecddd88e51c0ace13787a0f2d8ed5f1acef7cb06d20fb96a9875250f09cabec62014c934303172bd34ffd06aeedaee6f8ee
7
+ data.tar.gz: 9f9952d603b915ec5564b3fef51425dfe936d1420ec5fe14b46ebb1023cca8f9942bc0caec7916d9ac201e959c740d925bfee557411556e3a1e3b0c29aba708f
data/README.md CHANGED
@@ -41,6 +41,7 @@ commands:
41
41
  wp:
42
42
  - wp ssh --host=vagrant %args%
43
43
  backup:
44
+ - mkdir -p backup
44
45
  - wp ssh --host=vagrant db export backup/$(date +'%Y-%m-%d-%H-%M-%S').sql
45
46
  dist:
46
47
  - tar -zcvf dist.tar.gz .
@@ -206,9 +207,11 @@ Uses `test` command within your config.
206
207
  tj test # Aliases: tests spec specs
207
208
  ```
208
209
 
209
- ## Contributing
210
+ ## Can I add my starter theme, ________?
211
+ Yes! Just update the `THEMES` constant inside [commands/create.rb](https://github.com/ezekg/theme-juice-cli/blob/master/lib/theme-juice/commands/create.rb#L7-L11) and make a pull request. I'll verify that it includes a `Juicefile`, and that everything looks solid. Until then (or if your theme is private), just run `tj new --theme https://your.repo/link/goes.here` to clone your theme.
210
212
 
211
- 1. First, create an [issue](https://github.com/ezekg/theme-juice-cli/issues) for your proposed feature. If it's a bug fix, go right to step 2.
213
+ ## Contributing
214
+ 1. First, create a _well documented_ [issue](https://github.com/ezekg/theme-juice-cli/issues) for your proposed feature/bug fix.
212
215
  1. [Fork the repository](https://github.com/ezekg/theme-juice-cli/fork).
213
216
  1. Create a new feature branch. (`git checkout -b my-new-feature`)
214
217
  1. Commit your changes. (`git commit -am 'add some feature'`)
data/bin/tj CHANGED
@@ -1,12 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  # encoding: UTF-8
3
3
 
4
- begin
5
- require_relative "../lib/theme-juice"
6
- rescue LoadError => err
7
- warn err
8
- exit 1
9
- end
4
+ require "theme-juice"
10
5
 
11
6
  Signal.trap "INT" do
12
7
  ThemeJuice::IO.goodbye
@@ -9,6 +9,7 @@ module ThemeJuice
9
9
  end
10
10
 
11
11
  require "theme-juice/version"
12
+ require "theme-juice/helpers"
12
13
  require "theme-juice/env"
13
14
  require "theme-juice/project"
14
15
  require "theme-juice/util"
@@ -50,8 +50,9 @@ module ThemeJuice
50
50
  tasks << Tasks::DNS.new
51
51
  tasks << Tasks::WPCLI.new
52
52
  tasks << Tasks::Repo.new
53
- tasks << Tasks::CreateSuccess.new
53
+ tasks << Tasks::VMProvision.new
54
54
  tasks << Tasks::ImportDatabase.new
55
+ tasks << Tasks::CreateSuccess.new
55
56
  end
56
57
  end
57
58
 
@@ -153,54 +154,25 @@ module ThemeJuice
153
154
  repo
154
155
  end
155
156
 
156
- def db_host
157
- return false if @project.no_db || @project.no_wp
158
-
159
- if @project.skip_db || @project.use_defaults
160
- db_host = "vvv"
161
- else
162
- db_host = @io.prompt "Database host", :default => "vvv"
163
- end
164
-
165
- db_host
166
- end
167
-
168
- def db_name
169
- return false if @project.no_db || @project.no_wp
170
-
171
- if @project.skip_db || @project.use_defaults
172
- db_name = "#{clean_name}_db"
173
- else
174
- db_name = @io.prompt "Database name", :default => "#{clean_name}_db"
175
- end
157
+ %w[host name user pass].each do |task|
158
+ define_method "db_#{task}" do
159
+ return false if @project.no_db || @project.no_wp
176
160
 
177
- db_name
178
- end
179
-
180
- def db_user
181
- return false if @project.no_db || @project.no_wp
182
-
183
- if @project.skip_db || @project.use_defaults
184
- db_user = "#{clean_name}_user"
185
- else
186
- db_user = @io.prompt "Database username", :default => "#{clean_name}_user"
187
- end
188
-
189
- db_user
190
- end
191
-
192
- def db_pass
193
- return false if @project.no_db || @project.no_wp
161
+ case task
162
+ when "host" then default = "vvv"
163
+ when "name" then default = "#{clean_name}_db"
164
+ when "user" then default = "#{clean_name}_user"
165
+ when "pass" then default = Faker::Internet.password(24)
166
+ end
194
167
 
195
- pass = Faker::Internet.password 24
168
+ if @project.skip_db || @project.use_defaults
169
+ res = default
170
+ else
171
+ res = @io.prompt "Database #{task}", :default => default
172
+ end
196
173
 
197
- if @project.skip_db || @project.use_defaults
198
- db_pass = pass
199
- else
200
- db_pass = @io.prompt "Database password", :default => pass
174
+ res
201
175
  end
202
-
203
- db_pass
204
176
  end
205
177
 
206
178
  def db_import
@@ -21,6 +21,7 @@ module ThemeJuice
21
21
  tasks << Tasks::VMLocation.new
22
22
  tasks << Tasks::SyncedFolder.new
23
23
  tasks << Tasks::DNS.new
24
+ tasks << Tasks::VMRestart.new
24
25
  tasks << Tasks::DeleteSuccess.new
25
26
  end
26
27
  end
@@ -2,6 +2,8 @@
2
2
 
3
3
  module ThemeJuice
4
4
  module Env
5
+ include Helpers
6
+
5
7
  attr_accessor :vm_path
6
8
  attr_accessor :vm_ip
7
9
  attr_accessor :vm_prefix
@@ -14,12 +16,6 @@ module ThemeJuice
14
16
  attr_accessor :verbose
15
17
  attr_accessor :dryrun
16
18
 
17
- def inspect
18
- res = []
19
- self.instance_variables.each { |k, _| res << "#{k[1..-1]}: #{instance_variable_get(k)}" }
20
- res.sort
21
- end
22
-
23
19
  extend self
24
20
  end
25
21
  end
@@ -0,0 +1,9 @@
1
+ module ThemeJuice
2
+ module Helpers
3
+ def inspect
4
+ res = []
5
+ self.instance_variables.each { |k, _| res << "#{k[1..-1]}: #{instance_variable_get(k)}" }
6
+ res.sort
7
+ end
8
+ end
9
+ end
@@ -2,6 +2,8 @@
2
2
 
3
3
  module ThemeJuice
4
4
  module Project
5
+ include Helpers
6
+
5
7
  attr_accessor :name
6
8
  attr_accessor :location
7
9
  attr_accessor :url
@@ -24,12 +26,6 @@ module ThemeJuice
24
26
  attr_accessor :no_wp
25
27
  attr_accessor :no_db
26
28
 
27
- def inspect
28
- res = []
29
- self.instance_variables.each { |k, _| res << "#{k[1..-1]}: #{instance_variable_get(k)}" }
30
- res.sort
31
- end
32
-
33
29
  extend self
34
30
  end
35
31
  end
@@ -6,25 +6,14 @@ module ThemeJuice
6
6
 
7
7
  def initialize(opts = {})
8
8
  super
9
-
10
- @vm_provision = Tasks::VMProvision.new(opts)
11
9
  end
12
10
 
13
11
  def execute
14
- provision_vm
15
12
  success
16
13
  end
17
14
 
18
15
  private
19
16
 
20
- def provision_vm
21
- if @io.agree? "In order to finish creating your project, you need to provision the VM. Do it now?"
22
- @vm_provision.execute
23
- else
24
- @io.notice "Remember, the VM needs to be provisioned before you can use your new site"
25
- end
26
- end
27
-
28
17
  def success
29
18
  @io.success "Successfully created project '#{@project.name}'"
30
19
  @io.list "Your settings :", :yellow, settings
@@ -6,23 +6,14 @@ module ThemeJuice
6
6
 
7
7
  def initialize(opts = {})
8
8
  super
9
-
10
- @vm_restart = Tasks::VMRestart.new(opts)
11
9
  end
12
10
 
13
11
  def unexecute
14
- restart_vm
15
12
  success
16
13
  end
17
14
 
18
15
  private
19
16
 
20
- def restart_vm
21
- if @project.vm_restart
22
- @vm_restart.execute
23
- end
24
- end
25
-
26
17
  def success
27
18
  @io.success "Successfully removed project '#{@project.name}'"
28
19
  end
@@ -9,6 +9,14 @@ module ThemeJuice
9
9
  end
10
10
 
11
11
  def execute
12
+ if @io.agree? "In order to finish creating your project, you need to provision the VM. Do it now?"
13
+ provision
14
+ else
15
+ @io.notice "Remember, the VM needs to be provisioned before you can use your new site"
16
+ end
17
+ end
18
+
19
+ def unexecute
12
20
  provision
13
21
  end
14
22
 
@@ -12,6 +12,12 @@ module ThemeJuice
12
12
  restart
13
13
  end
14
14
 
15
+ def unexecute
16
+ if @project.vm_restart
17
+ restart
18
+ end
19
+ end
20
+
15
21
  private
16
22
 
17
23
  def restart
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  module ThemeJuice
4
- VERSION = "0.7.10"
4
+ VERSION = "0.7.11"
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.10
4
+ version: 0.7.11
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-14 00:00:00.000000000 Z
11
+ date: 2015-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -128,6 +128,7 @@ files:
128
128
  - lib/theme-juice/commands/deploy.rb
129
129
  - lib/theme-juice/config.rb
130
130
  - lib/theme-juice/env.rb
131
+ - lib/theme-juice/helpers.rb
131
132
  - lib/theme-juice/io.rb
132
133
  - lib/theme-juice/project.rb
133
134
  - lib/theme-juice/task.rb