theme-juice 0.6.17 → 0.6.18

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: 861d3d2efbeb83173900e744154c99d6988d4865
4
- data.tar.gz: e659c97a76c127e5d262bbf7fa32c5c82620259f
3
+ metadata.gz: 319a340bbbfc7655feb9b0d983bf71e2ebbe8d4d
4
+ data.tar.gz: c6180a536324a018aa1d0046984cf0fe6a9d3116
5
5
  SHA512:
6
- metadata.gz: ba71b391b7b2e18e5e9bbe7be90e4313aa8562cca7863e7dd9f182a049db24a55b278a01f9a84c1a2e90a564ceec8d1377f9b3b317535d18cb7d03748252f6b7
7
- data.tar.gz: 74d547daf3de5ac28859d4c04ad0393687d91181c776e53931a7404f223107c9dbc5bbfb2c6fd1a4ee2667e44d094224983dd8ee836e947ae6cc090a244b48da
6
+ metadata.gz: d16f8f8d494d69a691aeb83efe89156b7e5ee99c9f306755e37280e5c7d68378e11f781ba88db6fda35a3d5fc86bccaf7ec6f46f339bfdf38e95d71d11a144a1
7
+ data.tar.gz: 0f4ebf24bdcbc7a6ae3706d56122cfcdbc16ad73c8adb1437a3b1c4c96b7b871f451e1e22abcdb2a180cd1b638cec57d83058042aac12b75f6ba2049b9a05ef4
data/README.md CHANGED
@@ -47,9 +47,11 @@ tj --version # Aliases: -v, version
47
47
 
48
48
  ### Global flags:
49
49
  | Flag | Type | Description |
50
- |:--------------------|:------ |:------------------------------------------ |
50
+ |:------------------- |:------ |:------------------------------------------ |
51
51
  | `[--no-unicode]` | Bool | Disable all unicode characters |
52
52
  | `[--no-colors]` | Bool | Disable colored output |
53
+ <!-- | `[--no-animations]` | Bool | Disable animations | -->
54
+ <!-- | `[--no-deployer]` | Bool | Disable deployer | -->
53
55
  | `[--vvv-path=PATH]` | String | Force custom path to your VVV installation |
54
56
 
55
57
  ### Creating a new development site:
@@ -24,7 +24,8 @@ module ThemeJuice
24
24
  class_option :boring, :type => :boolean, :desc => "Disable all the coolness"
25
25
  class_option :no_unicode, :type => :boolean, :desc => "Disable all unicode characters"
26
26
  class_option :no_colors, :type => :boolean, :desc => "Disable all colored output"
27
- class_option :no_animations, :type => :boolean, :desc => "Disable all animations"
27
+ # class_option :no_animations, :type => :boolean, :desc => "Disable all animations"
28
+ # class_option :no_deployer, :type => :boolean, :desc => "Disable deployer"
28
29
 
29
30
  desc "--version, -v", "Print current version"
30
31
  #
@@ -248,40 +249,48 @@ module ThemeJuice
248
249
  # @return {Void}
249
250
  #
250
251
  def set_environment
251
- @version = ::ThemeJuice::VERSION
252
- @environment = ::ThemeJuice::Environment
253
- @interaction = ::ThemeJuice::Interaction
254
- @create = ::ThemeJuice::Command::Create
255
- @delete = ::ThemeJuice::Command::Delete
256
- @list = ::ThemeJuice::Command::List
257
- @install = ::ThemeJuice::Command::Install
258
- @subcommand = ::ThemeJuice::Command::Subcommand
259
-
260
- @environment.no_colors = if self.boring? then true else options[:no_colors] end
261
- @environment.no_unicode = if self.boring? then true else options[:no_unicode] end
262
- @environment.no_animations = if self.boring? then true else options[:no_animations] end
252
+ @version = ::ThemeJuice::VERSION
253
+ @environment = ::ThemeJuice::Environment
254
+ @interaction = ::ThemeJuice::Interaction
255
+ @create = ::ThemeJuice::Command::Create
256
+ @delete = ::ThemeJuice::Command::Delete
257
+ @list = ::ThemeJuice::Command::List
258
+ @install = ::ThemeJuice::Command::Install
259
+ @subcommand = ::ThemeJuice::Command::Subcommand
263
260
 
264
261
  self.force_vvv_path?
265
- self.yolo?
266
- end
267
262
 
268
- #
269
- # Enable boring-mode
270
- #
271
- # @return {Bool}
272
- #
273
- def boring?
274
- @environment.boring = options[:boring]
263
+ @environment.yolo = options[:yolo]
264
+ @environment.boring = options[:boring]
265
+ # @environment.no_deployer = options[:no_deployer]
266
+ @environment.no_colors = if @environment.boring then true else options[:no_colors] end
267
+ @environment.no_unicode = if @environment.boring then true else options[:no_unicode] end
268
+ # @environment.no_animations = if @environment.boring then true else options[:no_animations] end
269
+
270
+ # if self.deployer?
271
+ # @deployer = ::ThemeJuiceDeploy::Deployer
272
+ # else
273
+ # @deployer = nil
274
+ # end
275
275
  end
276
276
 
277
- #
278
- # Enable yolo-mode
279
- #
280
- # @return {Bool}
281
- #
282
- def yolo?
283
- @environment.yolo = options[:yolo]
284
- end
277
+ # #
278
+ # # Load deployer if installed
279
+ # #
280
+ # # @return {Bool}
281
+ # #
282
+ # def deployer?
283
+ # if @environment.no_deployer
284
+ # false
285
+ # else
286
+ # begin
287
+ # require "theme-juice-deploy"
288
+ # true
289
+ # rescue LoadError
290
+ # false
291
+ # end
292
+ # end
293
+ # end
285
294
 
286
295
  #
287
296
  # Set VVV path
@@ -6,7 +6,8 @@ module ThemeJuice
6
6
  attr_accessor :vvv_path
7
7
  attr_accessor :no_unicode
8
8
  attr_accessor :no_colors
9
- attr_accessor :no_animations
9
+ # attr_accessor :no_animations
10
+ # attr_accessor :no_deployer
10
11
  attr_accessor :boring
11
12
  attr_accessor :yolo
12
13
  end
@@ -38,11 +38,11 @@ module ThemeJuice
38
38
  end
39
39
 
40
40
  #
41
- # Verify config is properly setup, set global var
41
+ # Verify config is properly setup and load it
42
42
  #
43
43
  # @return {Void}
44
44
  #
45
- def use_config
45
+ def load_config
46
46
 
47
47
  if config_is_setup?
48
48
  @config = YAML.load_file(Dir["#{@config_path}/*"].select { |f| @config_regex =~ File.basename(f) }.last)
@@ -75,6 +75,8 @@ module ThemeJuice
75
75
  ], false
76
76
  end
77
77
 
78
+ #
79
+ # Test if site creation was successful
78
80
  #
79
81
  # @return {Bool}
80
82
  #
@@ -82,6 +84,9 @@ module ThemeJuice
82
84
  vvv_is_setup? and dev_site_is_setup? and hosts_is_setup? and database_is_setup? and nginx_is_setup?
83
85
  end
84
86
 
87
+ #
88
+ # Test if site removal was successful. This just reverses the check
89
+ # for a successful setup.
85
90
  #
86
91
  # @return {Bool}
87
92
  #
@@ -89,6 +94,8 @@ module ThemeJuice
89
94
  !setup_was_successful?
90
95
  end
91
96
 
97
+ #
98
+ # Test if project directory tree has been created
92
99
  #
93
100
  # @return {Bool}
94
101
  #
@@ -96,13 +103,17 @@ module ThemeJuice
96
103
  Dir.exist? "#{@opts[:site_location]}"
97
104
  end
98
105
 
106
+ #
107
+ # Test if config file is in current working directory
99
108
  #
100
109
  # @return {Bool}
101
110
  #
102
111
  def config_is_setup?
103
- !Dir["#{@config_path}/*"].select { |f| File.basename(f) =~ @config_regex }.empty?
112
+ !Dir["#{@config_path}/*"].select { |f| @config_regex =~ File.basename(f) }.empty?
104
113
  end
105
114
 
115
+ #
116
+ # Test if VVV has been cloned
106
117
  #
107
118
  # @return {Bool}
108
119
  #
@@ -110,6 +121,8 @@ module ThemeJuice
110
121
  File.exist? File.expand_path(@environment.vvv_path)
111
122
  end
112
123
 
124
+ #
125
+ # Test if landrush block has been placed
113
126
  #
114
127
  # @return {Bool}
115
128
  #
@@ -117,6 +130,8 @@ module ThemeJuice
117
130
  File.readlines(File.expand_path("#{@environment.vvv_path}/Vagrantfile")).grep(/(config.landrush.enabled = true)/m).any?
118
131
  end
119
132
 
133
+ #
134
+ # Test if VVV development location has been created
120
135
  #
121
136
  # @return {Bool}
122
137
  #
@@ -124,6 +139,8 @@ module ThemeJuice
124
139
  File.exist? "#{@opts[:site_dev_location]}"
125
140
  end
126
141
 
142
+ #
143
+ # Test if hosts file has been created
127
144
  #
128
145
  # @return {Bool}
129
146
  #
@@ -131,6 +148,8 @@ module ThemeJuice
131
148
  File.exist? "#{@opts[:site_location]}/vvv-hosts"
132
149
  end
133
150
 
151
+ #
152
+ # Test if database block has been placed
134
153
  #
135
154
  # @return {Bool}
136
155
  #
@@ -138,6 +157,8 @@ module ThemeJuice
138
157
  File.readlines(File.expand_path("#{@environment.vvv_path}/database/init-custom.sql")).grep(/(### Begin '#{@opts[:site_name]}')/m).any?
139
158
  end
140
159
 
160
+ #
161
+ # Test if nginx config has been created
141
162
  #
142
163
  # @return {Bool}
143
164
  #
@@ -145,13 +166,18 @@ module ThemeJuice
145
166
  File.exist? "#{@opts[:site_location]}/vvv-nginx.conf"
146
167
  end
147
168
 
169
+ #
170
+ # Test if starter theme has been set up by checking for common
171
+ # WordPress directories
148
172
  #
149
173
  # @return {Bool}
150
174
  #
151
175
  def starter_theme_is_setup?
152
- !Dir["#{@opts[:site_location]}/*"].select { |f| File.basename(f) =~ %r{wp(-content)?|wordpress|app|public|web|content} }.empty?
176
+ !Dir["#{@opts[:site_location]}/*"].select { |f| %r{wp(-content)?|wordpress|app|public|web|content} =~ File.basename(f) }.empty?
153
177
  end
154
178
 
179
+ #
180
+ # Test if synced folder block has been placed
155
181
  #
156
182
  # @return {Bool}
157
183
  #
@@ -159,6 +185,8 @@ module ThemeJuice
159
185
  File.readlines(File.expand_path("#{@environment.vvv_path}/Vagrantfile")).grep(/(### Begin '#{@opts[:site_name]}')/m).any?
160
186
  end
161
187
 
188
+ #
189
+ # Test if repository has been set up
162
190
  #
163
191
  # @return {Bool}
164
192
  #
@@ -166,6 +194,8 @@ module ThemeJuice
166
194
  File.exist? File.expand_path("#{@opts[:site_location]}/.git")
167
195
  end
168
196
 
197
+ #
198
+ # Test if .env file has been created
169
199
  #
170
200
  # @return {Bool}
171
201
  #
@@ -173,6 +203,8 @@ module ThemeJuice
173
203
  File.exist? File.expand_path("#{@opts[:site_location]}/.env.development")
174
204
  end
175
205
 
206
+ #
207
+ # Test if local wp-cli file has been created
176
208
  #
177
209
  # @return {Bool}
178
210
  #
@@ -180,6 +212,8 @@ module ThemeJuice
180
212
  File.exist? File.expand_path("#{@opts[:site_location]}/wp-cli.local.yml")
181
213
  end
182
214
 
215
+ #
216
+ # Test if we're initializing a new repository
183
217
  #
184
218
  # @return {Bool}
185
219
  #
@@ -16,7 +16,7 @@ module ThemeJuice
16
16
  # @return {Void}
17
17
  #
18
18
  def install
19
- use_config
19
+ load_config
20
20
 
21
21
  @config["commands"]["install"].each do |command|
22
22
  run ["cd #{@config_path}", command], false
@@ -32,7 +32,7 @@ module ThemeJuice
32
32
  # @return {Void}
33
33
  #
34
34
  def subcommand(subcommand, command)
35
- use_config
35
+ load_config
36
36
 
37
37
  if @config["commands"][subcommand]
38
38
  run ["#{@config["commands"][subcommand]} #{command}"], false
@@ -364,7 +364,7 @@ module ThemeJuice
364
364
  # @return {Void}
365
365
  #
366
366
  def install_starter_theme_dependencies
367
- use_config
367
+ load_config
368
368
 
369
369
  @interaction.log "Installing theme dependencies"
370
370
 
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  module ThemeJuice
4
- VERSION = "0.6.17"
4
+ VERSION = "0.6.18"
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.6.17
4
+ version: 0.6.18
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-02-17 00:00:00.000000000 Z
11
+ date: 2015-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faker