theme-juice 0.27.2 → 0.28.0

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: 32fee2e62fadfd00f2871e61601722a792c50944
4
- data.tar.gz: 824b5b9d58bb04fe429c652f86e61999a062d1bf
3
+ metadata.gz: 9a776df3c544a31881c70f1bdd63fdc32ff50423
4
+ data.tar.gz: c3b26a31fdfde2b1ce69a6ff44d4abb0f2fe5766
5
5
  SHA512:
6
- metadata.gz: e7ea805859bc8db64710bcc205928af4e8c059099ec91e20ae52e51cc6d08f1ff887e3c112d6f7cb6198fbb4137f9cb6d10e1cc411c29094885d31ca8469348f
7
- data.tar.gz: 7c39334015d4900513419b405a9e8cff43addf43918acec03fa47645e985e9488fc0419bd87101e18517b7ed657564835d7a39fedf5bfefa9adada120ba59aa6
6
+ metadata.gz: a2c2fcde5aec836834b7fbe77faf5bc71187d14b24891f93506c77a9b8aba46eee3e645b95dba08acfafe6f11dd569122b6e31c47ee2609000a559bab1423c57
7
+ data.tar.gz: bff98273a3d544cc258a500908857ba01d0cc54e112ccc1e1c41193dd9bf9633274912cf03b5e9625fe4ca0116a226948421ff72d9eaeb7485379dd390483fbf
data/lib/theme-juice.rb CHANGED
@@ -53,9 +53,11 @@ require "theme-juice/tasks/vm_stage"
53
53
  require "theme-juice/tasks/settings"
54
54
  require "theme-juice/tasks/load"
55
55
  require "theme-juice/tasks/invoke"
56
+ require "theme-juice/tasks/vm_update_box"
56
57
  require "theme-juice/command"
57
58
  require "theme-juice/commands/init"
58
59
  require "theme-juice/commands/create"
59
60
  require "theme-juice/commands/delete"
60
61
  require "theme-juice/commands/deploy"
62
+ require "theme-juice/commands/update"
61
63
  require "theme-juice/cli"
@@ -17,6 +17,7 @@ module ThemeJuice
17
17
  @create = Commands::Create
18
18
  @delete = Commands::Delete
19
19
  @deploy = Commands::Deploy
20
+ @update = Commands::Update
20
21
 
21
22
  init_env
22
23
  end
@@ -27,6 +28,7 @@ module ThemeJuice
27
28
  @env.vm_path = options[:vm_path]
28
29
  @env.vm_ip = options[:vm_ip]
29
30
  @env.vm_prefix = options[:vm_prefix]
31
+ @env.vm_revision = options[:vm_revision]
30
32
  @env.from_path = options[:from_path]
31
33
  @env.from_srv = options[:from_srv]
32
34
  @env.inside_vm = options[:inside_vm]
@@ -62,6 +64,7 @@ module ThemeJuice
62
64
  class_option :vm_path, :type => :string, :default => nil, :desc => ""
63
65
  class_option :vm_ip, :type => :string, :default => nil, :desc => ""
64
66
  class_option :vm_prefix, :type => :string, :default => nil, :desc => ""
67
+ class_option :vm_revision, :type => :string, :default => nil, :desc => ""
65
68
  class_option :from_path, :type => :string, :aliases => "--in-path", :default => nil, :desc => ""
66
69
  class_option :from_srv, :type => :string, :aliases => "--in-srv", :default => nil, :desc => ""
67
70
  class_option :inside_vm, :type => :boolean, :aliases => "--in-vm", :desc => ""
@@ -131,23 +134,24 @@ module ThemeJuice
131
134
  end
132
135
 
133
136
  desc "create", "Create new project"
134
- method_option :name, :type => :string, :aliases => "-n", :default => nil, :desc => ""
135
- method_option :location, :type => :string, :aliases => "-l", :default => nil, :desc => ""
136
- method_option :template, :type => :string, :aliases => "-t", :default => nil, :desc => ""
137
- method_option :url, :type => :string, :aliases => "-u", :default => nil, :desc => ""
138
- method_option :repository, :type => :string, :aliases => "-r", :desc => ""
139
- method_option :db_import, :type => :string, :aliases => %w[-i --import-db], :desc => ""
140
- method_option :bare, :type => :boolean, :aliases => %w[--no-template], :desc => ""
141
- method_option :skip_repo, :type => :boolean, :desc => ""
142
- method_option :skip_db, :type => :boolean, :desc => ""
143
- method_option :use_defaults, :type => :boolean, :desc => ""
144
- method_option :no_wp, :type => :boolean, :desc => ""
145
- method_option :no_wp_cli, :type => :boolean, :aliases => %w[--no-wp-cli-config], :desc => ""
146
- method_option :no_db, :type => :boolean, :desc => ""
147
- method_option :no_env, :type => :boolean, :desc => ""
148
- method_option :no_config, :type => :boolean, :aliases => %w[--no-juicefile], :desc => ""
149
- method_option :wp_config_modify, :type => :boolean, :aliases => %w[--modify-wp-config], :desc => ""
150
- method_option :no_ssl, :type => :boolean, :aliases => %w[--no-https], :desc => ""
137
+ method_option :name, :type => :string, :aliases => "-n", :default => nil, :desc => ""
138
+ method_option :location, :type => :string, :aliases => "-l", :default => nil, :desc => ""
139
+ method_option :template, :type => :string, :aliases => "-t", :default => nil, :desc => ""
140
+ method_option :template_revision, :type => :string, :aliases => %w[--template-branch], :default => nil, :desc => ""
141
+ method_option :url, :type => :string, :aliases => "-u", :default => nil, :desc => ""
142
+ method_option :repository, :type => :string, :aliases => "-r", :desc => ""
143
+ method_option :db_import, :type => :string, :aliases => %w[-i --import-db], :desc => ""
144
+ method_option :bare, :type => :boolean, :aliases => %w[--no-template], :desc => ""
145
+ method_option :skip_repo, :type => :boolean, :desc => ""
146
+ method_option :skip_db, :type => :boolean, :desc => ""
147
+ method_option :use_defaults, :type => :boolean, :desc => ""
148
+ method_option :no_wp, :type => :boolean, :desc => ""
149
+ method_option :no_wp_cli, :type => :boolean, :aliases => %w[--no-wp-cli-config], :desc => ""
150
+ method_option :no_db, :type => :boolean, :desc => ""
151
+ method_option :no_env, :type => :boolean, :desc => ""
152
+ method_option :no_config, :type => :boolean, :aliases => %w[--no-juicefile], :desc => ""
153
+ method_option :wp_config_modify, :type => :boolean, :aliases => %w[--modify-wp-config], :desc => ""
154
+ method_option :no_ssl, :type => :boolean, :aliases => %w[--no-https], :desc => ""
151
155
  def create
152
156
  @io.hello
153
157
  @create.new(options).execute
@@ -197,7 +201,7 @@ module ThemeJuice
197
201
 
198
202
  desc "update", "Update tj and its dependencies"
199
203
  def update(*args)
200
- @io.error "Not implemented"
204
+ @update.new(options).execute
201
205
  end
202
206
 
203
207
  desc "vm [ARGS]", "Manage development environment"
@@ -71,15 +71,16 @@ module ThemeJuice
71
71
  @io.notice "Project location is not empty. Assuming you meant to run a setup..."
72
72
  end
73
73
 
74
- @project.url = @opts.fetch("url") { url }
75
- @project.xip_url = @opts.fetch("xip_url") { xip_url }
76
- @project.template = @opts.fetch("template") { template }
77
- @project.repository = @opts.fetch("repository") { repository }
78
- @project.db_host = @opts.fetch("db_host") { db_host }
79
- @project.db_name = @opts.fetch("db_name") { db_name }
80
- @project.db_user = @opts.fetch("db_user") { db_user }
81
- @project.db_pass = @opts.fetch("db_pass") { db_pass }
82
- @project.db_import = @opts.fetch("db_import") { db_import }
74
+ @project.url = @opts.fetch("url") { url }
75
+ @project.xip_url = @opts.fetch("xip_url") { xip_url }
76
+ @project.template = @opts.fetch("template") { template }
77
+ @project.template_revision = @opts.fetch("template_revision") { nil }
78
+ @project.repository = @opts.fetch("repository") { repository }
79
+ @project.db_host = @opts.fetch("db_host") { db_host }
80
+ @project.db_name = @opts.fetch("db_name") { db_name }
81
+ @project.db_user = @opts.fetch("db_user") { db_user }
82
+ @project.db_pass = @opts.fetch("db_pass") { db_pass }
83
+ @project.db_import = @opts.fetch("db_import") { db_import }
83
84
  @project.vm_root
84
85
  @project.vm_location
85
86
  @project.vm_srv
@@ -0,0 +1,16 @@
1
+ # encoding: UTF-8
2
+
3
+ module ThemeJuice
4
+ module Commands
5
+ class Update < Command
6
+
7
+ def initialize(opts = {})
8
+ super
9
+
10
+ runner do |tasks|
11
+ tasks << Tasks::VMUpdateBox.new
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -8,6 +8,7 @@ module ThemeJuice
8
8
  attr_accessor :vm_path
9
9
  attr_accessor :vm_ip
10
10
  attr_accessor :vm_prefix
11
+ attr_accessor :vm_revision
11
12
  attr_accessor :from_path
12
13
  attr_accessor :from_srv
13
14
  attr_accessor :inside_vm
@@ -45,6 +46,10 @@ module ThemeJuice
45
46
  @vm_prefix = val || ENV.fetch("TJ_VM_PREFIX") { "tj-" }
46
47
  end
47
48
 
49
+ def vm_revision=(val)
50
+ @vm_revision = val || ENV.fetch("TJ_VM_REVISION") { nil }
51
+ end
52
+
48
53
  def from_path=(val)
49
54
  @from_path = val || ENV.fetch("TJ_FROM_PATH") { nil }
50
55
  end
@@ -28,6 +28,10 @@ Force IP address of VM*
28
28
  Force directory prefix for project in VM*
29
29
  .
30
30
  .TP
31
+ \fB\-\-vm\-revision\fR
32
+ Revision hash or branch to checkout for VM (default is master)
33
+ .
34
+ .TP
31
35
  \fB\-\-from\-path\fR, \fB\-\-in\-path\fR=\fIpath\fR
32
36
  Run Juicefile(5) commands from the passed path instead of from the current directory\.
33
37
  .
@@ -120,6 +124,10 @@ Delete a project
120
124
  deploy(1), \fBserver\fR, \fBremote\fR
121
125
  Deploy and manage a project
122
126
  .
127
+ .TP
128
+ \fBupdate\fR
129
+ Update virtual machine and dependencies
130
+ .
123
131
  .SH "SECONDARY COMMANDS"
124
132
  .
125
133
  .TP
@@ -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\-CREATE" "1" "July 2016" "" "Theme Juice Manual"
4
+ .TH "TJ\-CREATE" "1" "August 2016" "" "Theme Juice Manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBtj\-create\fR \- Create a new project
@@ -59,6 +59,10 @@ Location of the local project
59
59
  Starter template to install
60
60
  .
61
61
  .TP
62
+ \fB\-\-template\-revision\fR, \fB\-\-template\-branch\fR
63
+ Revision hash or branch to checkout for starter template (default is master)
64
+ .
65
+ .TP
62
66
  \fB\-u\fR, \fB\-\-url\fR=\fIurl\fR
63
67
  Development URL for the project
64
68
  .
@@ -49,6 +49,10 @@ GLOBAL OPTIONS
49
49
  -t, --template=repository
50
50
  Starter template to install
51
51
 
52
+ --template-revision, --template-branch
53
+ Revision hash or branch to checkout for starter template
54
+ (default is master)
55
+
52
56
  -u, --url=url
53
57
  Development URL for the project
54
58
 
@@ -86,7 +90,7 @@ GLOBAL OPTIONS
86
90
  Project does not have a Juicefile(5) config
87
91
 
88
92
  --modify-wp-config, --wp-config-modify
89
- Modify wp-config.php file contents with project configuration
93
+ Modify wp-config.php file contents with project configuration
90
94
  (this flag automatically disables the .env file when used)
91
95
 
92
96
  --no-ssl, --no-https
@@ -95,4 +99,4 @@ GLOBAL OPTIONS
95
99
 
96
100
 
97
101
 
98
- July 2016 TJ-CREATE(1)
102
+ August 2016 TJ-CREATE(1)
@@ -21,6 +21,9 @@ GLOBAL OPTIONS
21
21
  --vm-prefix=string
22
22
  Force directory prefix for project in VM*
23
23
 
24
+ --vm-revision
25
+ Revision hash or branch to checkout for VM (default is master)
26
+
24
27
  --from-path, --in-path=path
25
28
  Run Juicefile(5) commands from the passed path instead of from
26
29
  the current directory.
@@ -97,6 +100,8 @@ PRIMARY COMMANDS
97
100
  deploy(1), server, remote
98
101
  Deploy and manage a project
99
102
 
103
+ update Update virtual machine and dependencies
104
+
100
105
  SECONDARY COMMANDS
101
106
  version, --version, -v
102
107
  Print the current version
@@ -9,6 +9,7 @@ module ThemeJuice
9
9
  attr_accessor :url
10
10
  attr_accessor :xip_url
11
11
  attr_accessor :template
12
+ attr_accessor :template_revision
12
13
  attr_accessor :vm_root
13
14
  attr_accessor :vm_location
14
15
  attr_accessor :vm_srv
@@ -21,8 +21,13 @@ module ThemeJuice
21
21
  def clone_template
22
22
  @io.log "Cloning template"
23
23
  @util.inside @project.location do
24
- @util.run "git clone --depth 1 #{@project.template} .", {
25
- :verbose => @env.verbose, :capture => @env.quiet }
24
+ @util.run [], { :verbose => @env.verbose,
25
+ :capture => @env.quiet } do |cmds|
26
+ cmds << "git clone #{@project.template} ."
27
+ if @project.template_revision
28
+ cmds << "git checkout #{@project.template_revision}"
29
+ end
30
+ end
26
31
  end
27
32
  end
28
33
 
@@ -23,8 +23,13 @@ module ThemeJuice
23
23
 
24
24
  @io.log "Installing Vagrant box"
25
25
  @util.inside @env.vm_path do
26
- @util.run "git clone #{@env.vm_box} . --depth 1", {
27
- :verbose => @env.verbose, :capture => @env.quiet }
26
+ @util.run [], { :verbose => @env.verbose,
27
+ :capture => @env.quiet } do |cmds|
28
+ cmds << "git clone #{@env.vm_box} ."
29
+ if @env.vm_revision
30
+ cmds << "git checkout #{@env.vm_revision}"
31
+ end
32
+ end
28
33
  end
29
34
  end
30
35
  end
@@ -0,0 +1,39 @@
1
+ # encoding: UTF-8
2
+
3
+ module ThemeJuice
4
+ module Tasks
5
+ class VMUpdateBox < Task
6
+
7
+ def initialize(opts = {})
8
+ super
9
+ end
10
+
11
+ def execute
12
+ update_box
13
+ end
14
+
15
+ private
16
+
17
+ def box_is_installed?
18
+ File.exist? "#{@env.vm_path}/Vagrantfile"
19
+ end
20
+
21
+ def update_box
22
+ return unless box_is_installed?
23
+
24
+ @io.log "Updating Vagrant box"
25
+ @util.inside @env.vm_path do
26
+ @util.run [], { :verbose => @env.verbose,
27
+ :capture => @env.quiet } do |cmds|
28
+ cmds << "git fetch"
29
+ if @env.vm_revision
30
+ cmds << "git checkout #{@env.vm_revision}"
31
+ else
32
+ cmds << "git checkout master"
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  module ThemeJuice
4
- VERSION = "0.27.2"
4
+ VERSION = "0.28.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.27.2
4
+ version: 0.28.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: 2016-08-12 00:00:00.000000000 Z
11
+ date: 2016-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -154,6 +154,7 @@ files:
154
154
  - lib/theme-juice/commands/delete.rb
155
155
  - lib/theme-juice/commands/deploy.rb
156
156
  - lib/theme-juice/commands/init.rb
157
+ - lib/theme-juice/commands/update.rb
157
158
  - lib/theme-juice/config.rb
158
159
  - lib/theme-juice/env.rb
159
160
  - lib/theme-juice/helpers/hash_helper.rb
@@ -210,6 +211,7 @@ files:
210
211
  - lib/theme-juice/tasks/vm_provision.rb
211
212
  - lib/theme-juice/tasks/vm_restart.rb
212
213
  - lib/theme-juice/tasks/vm_stage.rb
214
+ - lib/theme-juice/tasks/vm_update_box.rb
213
215
  - lib/theme-juice/tasks/wp_cli.rb
214
216
  - lib/theme-juice/tasks/wp_config.rb
215
217
  - lib/theme-juice/util.rb