theme-juice 0.7.14 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,8 +6,8 @@ module ThemeJuice
6
6
 
7
7
  THEMES = {
8
8
  "theme-juice/trellis" => "https://github.com/ezekg/theme-juice-starter.git",
9
- "roots/bedrock" => "https://github.com/roots/bedrock.git",
10
- "other" => nil,
9
+ "wordpress/wordpress" => "https://github.com/WordPress/WordPress.git",
10
+ "other (specify)" => nil,
11
11
  "none" => false
12
12
  }
13
13
 
@@ -42,25 +42,22 @@ module ThemeJuice
42
42
  private
43
43
 
44
44
  def init_project
45
- @project.use_defaults = @opts.fetch("use_defaults", false)
46
- @project.bare = @opts.fetch("bare", false)
47
- @project.skip_repo = @opts.fetch("skip_repo", false)
48
- @project.skip_db = @opts.fetch("skip_db", false)
49
- @project.no_wp = @opts.fetch("no_wp", false)
50
- @project.no_db = @opts.fetch("no_db", false)
51
- @project.name = @opts.fetch("name") { name }
52
- @project.location = @opts.fetch("location") { location }
53
- @project.url = @opts.fetch("url") { url }
54
- @project.theme = @opts.fetch("theme") { theme }
55
- @project.repository = @opts.fetch("repository") { repository }
56
- @project.db_host = @opts.fetch("db_host") { db_host }
57
- @project.db_name = @opts.fetch("db_name") { db_name }
58
- @project.db_user = @opts.fetch("db_user") { db_user }
59
- @project.db_pass = @opts.fetch("db_pass") { db_pass }
60
- @project.db_import = @opts.fetch("db_import") { db_import }
61
- @project.vm_root = vm_root
62
- @project.vm_location = vm_location
63
- @project.vm_srv = vm_srv
45
+ @project.use_defaults = @opts.fetch("use_defaults") { false }
46
+ @project.bare = @opts.fetch("bare") { false }
47
+ @project.skip_repo = @opts.fetch("skip_repo") { false }
48
+ @project.skip_db = @opts.fetch("skip_db") { false }
49
+ @project.no_wp = @opts.fetch("no_wp") { false }
50
+ @project.no_db = @opts.fetch("no_db") { false }
51
+ @project.name = @opts.fetch("name") { name }
52
+ @project.location = @opts.fetch("location") { location }
53
+ @project.url = @opts.fetch("url") { url }
54
+ @project.theme = @opts.fetch("theme") { theme }
55
+ @project.repository = @opts.fetch("repository") { repository }
56
+ @project.db_host = @opts.fetch("db_host") { db_host }
57
+ @project.db_name = @opts.fetch("db_name") { db_name }
58
+ @project.db_user = @opts.fetch("db_user") { db_user }
59
+ @project.db_pass = @opts.fetch("db_pass") { db_pass }
60
+ @project.db_import = @opts.fetch("db_import") { db_import }
64
61
  end
65
62
 
66
63
  def name
@@ -95,7 +92,7 @@ module ThemeJuice
95
92
  path = "#{Dir.pwd}/"
96
93
 
97
94
  if @project.use_defaults
98
- location = File.expand_path path
95
+ location = File.expand_path path + @project.name
99
96
  else
100
97
  location = File.expand_path @io.prompt("Where do you want to setup the project?", :default => path, :path => true)
101
98
  end
@@ -127,16 +124,18 @@ module ThemeJuice
127
124
  return false if @project.bare
128
125
 
129
126
  if @project.use_defaults
130
- theme = THEMES["theme-juice/theme-juice-starter"]
127
+ theme = THEMES["theme-juice/trellis"]
131
128
  else
132
129
  choice = @io.choose "Which starter theme would you like to use?", :blue, THEMES.keys
133
130
 
134
131
  case choice
135
- when "theme-juice/trellis"
132
+ when /(theme-juice)/
136
133
  @io.success "Awesome choice!"
137
- when "other"
134
+ when /(wordpress)/
135
+ @io.notice "This is a stock WordPress install, so things such as the '.env' file will not be set up. You'll need to input your database information manually after the setup."
136
+ when /(other)/
138
137
  THEMES[choice] = @io.prompt "What is the repository URL for the starter theme that you would like to clone?"
139
- when "none"
138
+ when /(none)/
140
139
  @io.notice "Next time you need to create a project without a starter theme, you can just run the 'setup' command instead."
141
140
  @project.bare = true
142
141
  end
@@ -151,7 +150,7 @@ module ThemeJuice
151
150
  return false if @project.skip_repo || @project.use_defaults
152
151
 
153
152
  if @io.agree? "Would you like to initialize a new Git repository?"
154
- repo = @io.prompt "What is the repository's remote URL?", :indent => 2
153
+ repo = @io.prompt "What is the repository URL?", :indent => 2
155
154
  else
156
155
  repo = false
157
156
  end
@@ -23,13 +23,10 @@ module ThemeJuice
23
23
  private
24
24
 
25
25
  def init_project
26
- @project.name = @opts.fetch("name") { name }
27
- @project.url = @opts.fetch("url") { url }
28
- @project.db_drop = @opts.fetch("db_drop", false)
29
- @project.vm_restart = @opts.fetch("vm_restart", false)
30
- @project.vm_root = vm_root
31
- @project.vm_location = vm_location
32
- @project.vm_srv = vm_srv
26
+ @project.name = @opts.fetch("name") { name }
27
+ @project.url = @opts.fetch("url") { url }
28
+ @project.db_drop = @opts.fetch("db_drop") { false }
29
+ @project.vm_restart = @opts.fetch("vm_restart") { false }
33
30
  end
34
31
 
35
32
  def name
@@ -6,20 +6,7 @@ module ThemeJuice
6
6
 
7
7
  def initialize(opts = {})
8
8
  super
9
-
10
- init_project
11
-
12
- runner do |tasks|
13
- @io.error "Not implemented"
14
- end
15
- end
16
-
17
- private
18
-
19
- def init_project
20
- @project.vm_root = vm_root
21
- @project.vm_location = vm_location
22
- @project.vm_srv = vm_srv
9
+ runner { @io.error "Not implemented" }
23
10
  end
24
11
  end
25
12
  end
@@ -3,18 +3,67 @@
3
3
  module ThemeJuice
4
4
  module Env
5
5
  include SingletonHelper
6
-
6
+
7
+ attr_accessor :vm_box
7
8
  attr_accessor :vm_path
8
9
  attr_accessor :vm_ip
9
10
  attr_accessor :vm_prefix
11
+ attr_accessor :yolo
12
+ attr_accessor :boring
10
13
  attr_accessor :no_unicode
11
14
  attr_accessor :no_colors
12
15
  attr_accessor :no_animations
13
16
  attr_accessor :no_landrush
14
- attr_accessor :boring
15
- attr_accessor :yolo
16
17
  attr_accessor :verbose
17
18
  attr_accessor :dryrun
19
+
20
+ def vm_box=(val)
21
+ @vm_box = val ||= ENV.fetch("TJ_VM_BOX") { "https://github.com/Varying-Vagrant-Vagrants/VVV.git" }
22
+ end
23
+
24
+ def vm_path=(val)
25
+ @vm_path = val ||= ENV.fetch("TJ_VM_PATH") { File.expand_path("~/vagrant") }
26
+ end
27
+
28
+ def vm_ip=(val)
29
+ @vm_ip = val ||= ENV.fetch("TJ_VM_IP") { "192.168.50.4" }
30
+ end
31
+
32
+ def vm_prefix=(val)
33
+ @vm_prefix = val ||= ENV.fetch("TJ_VM_PREFIX") { "tj-" }
34
+ end
35
+
36
+ def yolo=(val)
37
+ @yolo = val ||= ENV.fetch("TJ_YOLO") { false }
38
+ end
39
+
40
+ def boring=(val)
41
+ @boring = val ||= ENV.fetch("TJ_BORING") { false }
42
+ end
43
+
44
+ def no_unicode=(val)
45
+ @no_unicode = val ||= ENV.fetch("TJ_NO_UNICODE") { boring }
46
+ end
47
+
48
+ def no_colors=(val)
49
+ @no_colors = val ||= ENV.fetch("TJ_NO_COLORS") { boring }
50
+ end
51
+
52
+ def no_animations=(val)
53
+ @no_animations = val ||= ENV.fetch("TJ_NO_ANIMATIONS") { boring }
54
+ end
55
+
56
+ def no_landrush=(val)
57
+ @no_landrush = val ||= ENV.fetch("TJ_NO_LANDRUSH") { false }
58
+ end
59
+
60
+ def verbose=(val)
61
+ @verbose = val ||= ENV.fetch("TJ_VERBOSE") { false }
62
+ end
63
+
64
+ def dryrun=(val)
65
+ @dryrun = val ||= ENV.fetch("TJ_DRYRUN") { false }
66
+ end
18
67
 
19
68
  extend self
20
69
  end
@@ -2,7 +2,14 @@ module ThemeJuice
2
2
  module SingletonHelper
3
3
  def inspect
4
4
  res = []
5
- self.instance_variables.each { |k, _| res << "#{k[1..-1]}: #{instance_variable_get(k)}" }
5
+
6
+ self.instance_variables.each do |k, _|
7
+ str = ""
8
+ str << "#{k[1..-1]}: #{instance_variable_get(k)}"
9
+ str << " (#{instance_variable_get(k).class})" if Env.verbose
10
+ res << str
11
+ end
12
+
6
13
  res.sort
7
14
  end
8
15
  end
@@ -0,0 +1,212 @@
1
+ .\" generated with Ronn/v0.7.3
2
+ .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
+ .
4
+ .TH "TJ" "1" "June 2015" "" "Theme Juice Manual"
5
+ .
6
+ .SH "NAME"
7
+ \fBtj\fR \- WordPress development made easy
8
+ .
9
+ .SH "SYNOPSIS"
10
+ \fBtj\fR [\fIcommand\fR] [\-\-flag=\fIarg\fR] [\-\-flag]
11
+ .
12
+ .SH "DESCRIPTION"
13
+ \fBTheme Juice\fR is a WordPress development command line utility that allows
14
+ .
15
+ .br
16
+ you to scaffold out entire Vagrant development environments in seconds
17
+ .
18
+ .br
19
+ (using VVV \fIhttps://github\.com/Varying\-Vagrant\-Vagrants/VVV\fR as the VM),
20
+ .
21
+ .br
22
+ manage dependencies and build tools, and even handle deployments\.
23
+ .
24
+ .SH "GLOBAL OPTIONS"
25
+ .
26
+ .TP
27
+ \fB\-\-vm\-box\fR=\fIrepository\fR:
28
+ .
29
+ .br
30
+ Force Vagrant box to use for VM
31
+
32
+ .
33
+ .TP
34
+ \fB\-\-vm\-path\fR=\fIpath\fR:
35
+ .
36
+ .br
37
+ Force path to VM
38
+
39
+ .
40
+ .TP
41
+ \fB\-\-vm\-ip\fR=\fIip\fR:
42
+ .
43
+ .br
44
+ Force IP address of VM
45
+
46
+ .
47
+ .TP
48
+ \fB\-\-vm\-prefix\fR=\fIstring\fR:
49
+ .
50
+ .br
51
+ Force directory prefix for project in VM
52
+
53
+ .
54
+ .TP
55
+ \fB\-\-yolo\fR:
56
+ .
57
+ .br
58
+ Say yes to anything and everything
59
+
60
+ .
61
+ .TP
62
+ \fB\-\-boring\fR:
63
+ .
64
+ .br
65
+ Prints all output without any fancy formatting
66
+
67
+ .
68
+ .TP
69
+ \fB\-\-no\-unicode\fR:
70
+ .
71
+ .br
72
+ Prints all output without unicode characters
73
+
74
+ .
75
+ .TP
76
+ \fB\-\-no\-colors\fR, \fB\-\-no\-color\fR:
77
+ .
78
+ .br
79
+ Prints all output without color
80
+
81
+ .
82
+ .TP
83
+ \fB\-\-no\-animations\fR:
84
+ .
85
+ .br
86
+ Prints all output without animations (coming soon)
87
+
88
+ .
89
+ .TP
90
+ \fB\-\-no\-landrush\fR:
91
+ .
92
+ .br
93
+ Disable the \fBlandrush\fR gem for managing DNS
94
+
95
+ .
96
+ .TP
97
+ \fB\-\-verbose\fR:
98
+ .
99
+ .br
100
+ Prints out additional logging information
101
+
102
+ .
103
+ .TP
104
+ \fB\-\-dryrun\fR, \fB\-\-dry\-run\fR:
105
+ .
106
+ .br
107
+ Run a command without actually doing anything
108
+
109
+ .
110
+ .SH "PRIMARY COMMANDS"
111
+ Run \fBtj help\fR [\fIcommand\fR] to view an individual command\'s man page\.
112
+ .
113
+ .TP
114
+ \fBversion\fR, \fB\-\-version\fR, \fB\-v\fR:
115
+ .
116
+ .br
117
+ Print the current version
118
+
119
+ .
120
+ .TP
121
+ \fBcreate\fR, \fBnew\fR, \fBmk\fR:
122
+ .
123
+ .br
124
+ Create a new project
125
+
126
+ .
127
+ .TP
128
+ \fBsetup\fR, \fBup\fR, \fBinit\fR:
129
+ .
130
+ .br
131
+ Setup an existing project
132
+
133
+ .
134
+ .TP
135
+ \fBdelete\fR, \fBrm\fR, \fBremove\fR, \fBtrash\fR:
136
+ .
137
+ .br
138
+ Delete a project
139
+
140
+ .
141
+ .TP
142
+ \fBlist\fR, \fBls\fR, \fBprojects\fR, \fBapps\fR, \fBsites\fR:
143
+ .
144
+ .br
145
+ List all projects
146
+
147
+ .
148
+ .SH "CONFIG COMMANDS"
149
+ These run the corresponding command from your project\'s config file\. They
150
+ .
151
+ .br
152
+ accept any number of commands, since the behavior and handling of input
153
+ .
154
+ .br
155
+ is defined within the config file itself\.
156
+ .
157
+ .TP
158
+ \fBinstall\fR, \fBbuild\fR=[\fIcommand\fR[,\fIcommand\fR]\.\.\.]:
159
+ .
160
+ .br
161
+ Run installation for project
162
+
163
+ .
164
+ .TP
165
+ \fBwatch\fR, \fBdev\fR=[\fIcommand\fR[,\fIcommand\fR]\.\.\.]:
166
+ .
167
+ .br
168
+ Manage and run development build tools
169
+
170
+ .
171
+ .TP
172
+ \fBvendor\fR, \fBdeps\fR=[\fIcommand\fR[,\fIcommand\fR]\.\.\.]:
173
+ .
174
+ .br
175
+ Manage PHP vendor dependencies
176
+
177
+ .
178
+ .TP
179
+ \fBdist\fR, \fBpkg\fR, \fBpackage\fR, \fBzip\fR=[\fIcommand\fR[,\fIcommand\fR]\.\.\.]:
180
+ .
181
+ .br
182
+ Package project for distribution
183
+
184
+ .
185
+ .TP
186
+ \fBwp\fR, \fBwordpress\fR=[\fIcommand\fR[,\fIcommand\fR]\.\.\.]:
187
+ .
188
+ .br
189
+ Manage WordPress installation
190
+
191
+ .
192
+ .TP
193
+ \fBbackup\fR, \fBbk\fR=[\fIcommand\fR[,\fIcommand\fR]\.\.\.]:
194
+ .
195
+ .br
196
+ Backup project
197
+
198
+ .
199
+ .TP
200
+ \fBtest\fR, \fBtests\fR, \fBspec\fR, \fBspecs\fR=[\fIcommand\fR[,\fIcommand\fR]\.\.\.]:
201
+ .
202
+ .br
203
+ Manage and run project tests
204
+
205
+ .
206
+ .TP
207
+ \fBvm\fR, \fBvagrant\fR, \fBvvv\fR=[\fIcommand\fR[,\fIcommand\fR]\.\.\.]:
208
+ .
209
+ .br
210
+ Manage development environment
211
+
212
+
@@ -0,0 +1,115 @@
1
+ .\" generated with Ronn/v0.7.3
2
+ .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
+ .
4
+ .TH "TJ\-CREATE" "1" "June 2015" "" "Theme Juice Manual"
5
+ .
6
+ .SH "NAME"
7
+ \fBtj\-create\fR \- Create a new project
8
+ .
9
+ .SH "SYNOPSIS"
10
+ \fBtj create\fR [\-\-flag=\fIarg\fR] [\-\-flag]
11
+ .
12
+ .SH "DESCRIPTION"
13
+ Creates a new project\. It will lead the user through a series of prompts to
14
+ .
15
+ .br
16
+ set up required project information, such as name, location, theme, database
17
+ .
18
+ .br
19
+ info, etc\. Using the specified information, it will run the installation
20
+ .
21
+ .br
22
+ process and set up a local development environment, if it hasn\'t already
23
+ .
24
+ .br
25
+ been set up\. It will sync your local project location with the project
26
+ .
27
+ .br
28
+ location within the VM\.
29
+ .
30
+ .SH "GLOBAL OPTIONS"
31
+ .
32
+ .TP
33
+ \fB\-n\fR, \fB\-\-name\fR=\fIstring\fR:
34
+ .
35
+ .br
36
+ Name of the project
37
+
38
+ .
39
+ .TP
40
+ \fB\-l\fR, \fB\-\-location\fR=\fIpath\fR:
41
+ .
42
+ .br
43
+ Location of the local project
44
+
45
+ .
46
+ .TP
47
+ \fB\-t\fR, \fB\-\-theme\fR=\fIrepository\fR:
48
+ .
49
+ .br
50
+ Starter theme to install
51
+
52
+ .
53
+ .TP
54
+ \fB\-u\fR, \fB\-\-url\fR=\fIurl\fR:
55
+ .
56
+ .br
57
+ Development URL for the project
58
+
59
+ .
60
+ .TP
61
+ \fB\-r\fR, \fB\-\-repository\fR=\fIrepository\fR:
62
+ .
63
+ .br
64
+ Initialize a new Git remote repository
65
+
66
+ .
67
+ .TP
68
+ \fB\-i\fR, \fB\-\-import\-db\fR=\fIpath\fR:
69
+ .
70
+ .br
71
+ Import an existing database
72
+
73
+ .
74
+ .TP
75
+ \fB\-\-bare\fR, \fB\-\-no\-theme\fR:
76
+ .
77
+ .br
78
+ Create a project without a starter theme
79
+
80
+ .
81
+ .TP
82
+ \fB\-\-skip\-repo\fR:
83
+ .
84
+ .br
85
+ Skip repository prompts and use default settings
86
+
87
+ .
88
+ .TP
89
+ \fB\-\-skip\-db\fR:
90
+ .
91
+ .br
92
+ Skip database prompts and use default settings
93
+
94
+ .
95
+ .TP
96
+ \fB\-\-use\-defaults\fR:
97
+ .
98
+ .br
99
+ Skip all prompts and use default settings
100
+
101
+ .
102
+ .TP
103
+ \fB\-\-no\-wp\fR:
104
+ .
105
+ .br
106
+ Project is not a WordPress install
107
+
108
+ .
109
+ .TP
110
+ \fB\-\-no\-db\fR:
111
+ .
112
+ .br
113
+ Project does not need a database
114
+
115
+