swiftly 4.0.0 → 4.0.1

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: d920ce23bc206002d40268d1dea454b6d82b7d87
4
- data.tar.gz: 934149c743f4039d829c6a5d635e85b5342d1b1a
3
+ metadata.gz: 3a49b797b143b1083d3ba630b306558b632f8b5d
4
+ data.tar.gz: 95443497949365f74775f08bb2135caf0a3cf0d9
5
5
  SHA512:
6
- metadata.gz: 99de03c5e7da92d0f66966e1475236f4a0fc93825ffe7261746160caa6ec637f96e291ace162900a3562edbdf31d284c95cc35490d28040ddcfaece60ea63bd5
7
- data.tar.gz: dc0ae651c5dabba3197debe8a7232c861a14e5be3df674d0932cc901f35bd34ff6a41c6fa48ef5ff8be19853dbbb7708ae5d67f85ec2b783fc8b7d5e4f134626
6
+ metadata.gz: e323166837244ed8817e5eff2d3c420068a4a3c2b034fabc81317ab0eb9d3a8f75444347a51b62f93e9bcd439ffb2e544dd13daff7741552e2c1a1524987a67a
7
+ data.tar.gz: a1ebbc8a798cf15d560c43e399efd20735daacb672d4c4624032b8687db0e06808339580f56a6886100f12d3ab9c78b4423877481374b8cf5c0da2d4d4950d16
@@ -215,65 +215,6 @@ module Swiftly
215
215
  end
216
216
  end
217
217
 
218
- def update_setting_dialog( environment, setting, value )
219
-
220
- nouns = {
221
- domain: 'domain',
222
- db_host: 'host',
223
- db_user: 'username',
224
- db_pass: 'password'
225
- }
226
-
227
- say # spacer
228
-
229
- swiftly_setting = Swiftly::Config.load :swiftly
230
- current_setting = swiftly[environment][setting]
231
- current_value = current_setting.nil? ? 'nothing' : current_setting
232
-
233
- say_status "#{APP_NAME}:", "The staging #{nouns[setting]} is currently set to #{current_value}.", :yellow
234
-
235
- say # spacer
236
-
237
- if value
238
-
239
- if yes? "Are you sure you want to set it to (#{value})? [Y|n]", :yellow
240
-
241
- update_setting environment, setting, value
242
-
243
- new_swiftly_setting = Swiftly::Config.load :swiftly
244
- new_setting = new_swiftly_setting[environment][setting]
245
-
246
- say # spacer
247
-
248
- say_status "#{APP_NAME}:", "Change successful! The value is set to #{new_setting}"
249
-
250
- end
251
-
252
- else
253
-
254
- value = ask "\n--> What would you like to set it to?", :yellow
255
-
256
- say # spacer
257
-
258
- if value == ""
259
-
260
- say_status "#{APP_NAME}:", "Change unsuccessful, #{nouns[setting]} is still set to #{current_value}", :yellow
261
-
262
- else
263
-
264
- update_setting environment, setting, value
265
-
266
- new_swiftly_setting = Swiftly::Config.load :swiftly
267
- new_setting = new_swiftly_setting[environment][setting]
268
-
269
- say # spacer
270
-
271
- say_status "#{APP_NAME}:", "Change successful! #{nouns[setting]} is now set to #{new_setting}"
272
-
273
- end
274
- end
275
- end
276
-
277
218
  def fix_serialization file
278
219
 
279
220
  Encoding.default_external = Encoding::UTF_8
data/lib/swiftly/cli.rb CHANGED
@@ -20,7 +20,7 @@ module Swiftly
20
20
  include Thor::Actions
21
21
  include Helpers
22
22
 
23
- register Swiftly::Create, "create", "Create COMMAND PROJECT_NAME", "Create projects by passing a project name"
23
+ register Swiftly::Create, "create", "create COMMAND PROJECT_NAME", "Create projects by passing a project name"
24
24
  register Swiftly::Configure, "configure", "configure COMMAND", "Configure settings"
25
25
  register Swiftly::Setup, "setup", "setup COMMAND PROJECT_NAME", "Setup [environment] on server"
26
26
  register Swiftly::Push, "push", "push COMMAND PROJECT_NAME", "Push [environment] database and files to server"
@@ -12,7 +12,7 @@ module Swiftly
12
12
 
13
13
  include Helpers
14
14
 
15
- desc "create project PROJECT_NAME", "Create a create project"
15
+ desc "create project PROJECT_NAME", "Create an empty project"
16
16
 
17
17
  def project( project_name )
18
18
 
@@ -28,7 +28,7 @@ module Swiftly
28
28
 
29
29
  end
30
30
 
31
- desc "create git PROJECT_NAME", "Create a create git enabled project"
31
+ desc "create git PROJECT_NAME", "Create an empty (git enabled) project"
32
32
 
33
33
  def git( project_name )
34
34
 
@@ -50,7 +50,7 @@ module Swiftly
50
50
 
51
51
  end
52
52
 
53
- desc "create git PROJECT_NAME", "Create a create wordpress (git enabled) project"
53
+ desc "create wordpress PROJECT_NAME", "Create a wordpress (git enabled) project"
54
54
  method_option :template, aliases: '-t', type: :string, default: :default, desc: 'Provide the name of the template to use'
55
55
 
56
56
 
data/lib/swiftly/init.rb CHANGED
@@ -94,8 +94,6 @@ module Swiftly
94
94
 
95
95
  unless type === :db_pass
96
96
 
97
-
98
-
99
97
  if responses.include? ask( "\n--> Got it! Is this correct? \e[32;m#{answer}\e[0;m [Y|n]")
100
98
 
101
99
  confirm = true
@@ -108,7 +106,7 @@ module Swiftly
108
106
 
109
107
  end
110
108
 
111
- say_status "\n\s\s\s\sThats it!", "You can now run `#{APP_NAME} help` for more options."
109
+ say_status "\n\s\s\s\sThats it!", "You can now run [#{APP_NAME} help] for more options."
112
110
 
113
111
  end
114
112
 
@@ -1,4 +1,4 @@
1
1
  module Swiftly
2
2
  APP_NAME = 'swiftly'
3
- VERSION = '4.0.0'
3
+ VERSION = '4.0.1'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swiftly
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mic Alexander
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-22 00:00:00.000000000 Z
11
+ date: 2015-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: git
@@ -114,23 +114,14 @@ files:
114
114
  - lib/swiftly/cli.rb
115
115
  - lib/swiftly/config.rb
116
116
  - lib/swiftly/config_global_generator.rb
117
- - lib/swiftly/config_plugins_generator.rb
118
117
  - lib/swiftly/config_project_generator.rb
119
118
  - lib/swiftly/config_swiftlyfile_generator.rb
120
- - lib/swiftly/config_templates_generator.rb
121
- - lib/swiftly/configure.rb
122
- - lib/swiftly/configure_all.rb
123
- - lib/swiftly/configure_local.rb
124
- - lib/swiftly/configure_production.rb
125
- - lib/swiftly/configure_staging.rb
126
119
  - lib/swiftly/create.rb
127
120
  - lib/swiftly/create_git.rb
128
121
  - lib/swiftly/create_project.rb
129
122
  - lib/swiftly/create_wordpress.rb
130
123
  - lib/swiftly/database.rb
131
124
  - lib/swiftly/destroy.rb
132
- - lib/swiftly/enable.rb
133
- - lib/swiftly/enable_wordpress.rb
134
125
  - lib/swiftly/generate.rb
135
126
  - lib/swiftly/generate_post_type.rb
136
127
  - lib/swiftly/init.rb
@@ -1,33 +0,0 @@
1
- require "thor/group"
2
-
3
- module Swiftly
4
- class ConfigPluginsGenerator < Thor::Group
5
-
6
- include Thor::Actions
7
-
8
- desc "Handles the creation of the _plugins file."
9
-
10
- def self.source_root
11
- File.dirname(__FILE__)
12
- end
13
-
14
- def create
15
-
16
- settings = Swiftly::Config.load :global
17
-
18
- template(
19
- File.join(
20
- "templates",
21
- "config_plugins.erb"
22
- ),
23
- File.join(
24
- settings[:sites_path],
25
- 'config',
26
- 'plugins',
27
- '_plugins.yml'
28
- )
29
- )
30
-
31
- end
32
- end
33
- end
@@ -1,33 +0,0 @@
1
- require "thor/group"
2
-
3
- module Swiftly
4
- class ConfigTemplateGenerator < Thor::Group
5
-
6
- include Thor::Actions
7
-
8
- desc "Handles the creation of the _templates file."
9
-
10
- def self.source_root
11
- File.dirname(__FILE__)
12
- end
13
-
14
- def create
15
-
16
- settings = Swiftly::Config.load :global
17
-
18
- template(
19
- File.join(
20
- 'templates',
21
- 'config_templates.erb'
22
- ),
23
- File.join(
24
- settings[:sites_path],
25
- 'config',
26
- 'templates',
27
- '_templates.yml'
28
- )
29
- )
30
-
31
- end
32
- end
33
- end
@@ -1,27 +0,0 @@
1
- require 'yaml'
2
- require 'swiftly/configure_all'
3
- require 'swiftly/configure_local'
4
- require 'swiftly/configure_staging'
5
- require 'swiftly/configure_production'
6
- require 'swiftly/app_module'
7
-
8
- module Swiftly
9
- class Configure < Thor
10
-
11
- include Thor::Actions
12
- include Helpers
13
-
14
- desc "local [COMMAND]", "Configure local settings"
15
- subcommand "local", Local
16
-
17
- desc "staging [COMMAND]", "configure staging settings"
18
- subcommand "staging", Staging
19
-
20
- desc "production [COMMAND]", "configure production settings"
21
- subcommand "production", Production
22
-
23
- desc "all", "Configure all"
24
- subcommand "all", All
25
-
26
- end
27
- end
@@ -1,181 +0,0 @@
1
- require 'yaml'
2
- require 'swiftly/app_module'
3
- require 'swiftly/configure'
4
-
5
- module Swiftly
6
- class All < Thor
7
-
8
- include Helpers
9
-
10
- desc "all", "Configure all"
11
-
12
- def all()
13
-
14
- say # spacer
15
-
16
- say "\t\t#{APP_NAME} #{VERSION} Development Manager\n\n", :blue
17
-
18
- say_status "#{APP_NAME}:", "Thanks for trying out #{APP_NAME}. Lets get started!", :green
19
-
20
- current = Swiftly::Config.load :global
21
-
22
- global_settings = {
23
- version: VERSION,
24
- sites_path: current[:sites_path].nil? ? 'not set' : current[:sites_path],
25
- }
26
-
27
- swiftly_settings = {
28
- local: {
29
- db_host: current[:local][:db_host].nil? ? 'not set' : current[:local][:db_host],
30
- db_user: current[:local][:db_user].nil? ? 'not set' : current[:local][:db_user],
31
- db_pass: current[:local][:db_pass].nil? ? 'not set' : current[:local][:db_pass]
32
- },
33
- staging: {
34
- domain: current[:staging][:domain].nil? ? 'not set' : current[:staging][:domain],
35
- db_host: current[:staging][:db_host].nil? ? 'not set' : current[:staging][:db_host],
36
- db_user: current[:staging][:db_user].nil? ? 'not set' : current[:staging][:db_user],
37
- db_pass: current[:staging][:db_pass].nil? ? 'not set' : current[:staging][:db_pass]
38
- },
39
- production: {
40
- domain: current[:production][:domain].nil? ? 'not set' : current[:production][:domain],
41
- db_host: current[:production][:db_host].nil? ? 'not set' : current[:production][:db_host],
42
- db_user: current[:production][:db_user].nil? ? 'not set' : current[:production][:db_user],
43
- db_pass: current[:production][:db_pass].nil? ? 'not set' : current[:production][:db_pass]
44
- }
45
- }
46
-
47
- questions = {
48
- sites_path: "\n\n--> What is the absolute path to the folder \n\s\s\s\swhere you keep all of your sites? Currently: (\e[0;m#{global_settings[:sites_path]}\e[33;m):",
49
- local_db_host: "\n--> What is your local hostname? Currently: (\e[0;m#{swiftly_settings[:local][:db_host]}\e[33;m):",
50
- local_db_user: "\n--> What is your local mysql username? Currently: (\e[0;m#{swiftly_settings[:local][:db_user]}\e[33;m):",
51
- local_db_pass: "\n--> What is your local mysql password?",
52
- staging_server_domain: "\n--> What is your staging server domain? Currently: (\e[0;m#{swiftly_settings[:staging][:domain]}\e[33;m):",
53
- staging_db_host: "\n--> What is your staging server hostname? Currently: (\e[0;m#{swiftly_settings[:staging][:db_host]}\e[33;m):",
54
- staging_db_user: "\n--> What is your staging server mysql username? Currently: (\e[0;m#{swiftly_settings[:staging][:db_user]}\e[33;m):",
55
- staging_db_pass: "\n--> What is your staging server mysql password?",
56
- production_server_domain: "\n--> What is your production server domain? Currently: (\e[0;m#{swiftly_settings[:production][:domain]}\e[33;m):",
57
- production_db_host: "\n--> What is your production server hostname? Currently: (\e[0;m#{swiftly_settings[:production][:db_host]}\e[33;m):",
58
- production_db_user: "\n--> What is your production server mysql username? Currently: (\e[0;m#{swiftly_settings[:production][:db_user]}\e[33;m):",
59
- production_db_pass: "\n--> What is your production server mysql password?"
60
- }
61
-
62
- responses = ['y','Y','']
63
-
64
- questions.each do |type, question|
65
-
66
- confirm = false
67
-
68
- until confirm == true do
69
-
70
- if type === :sites_path
71
-
72
- answer = File.expand_path( ask question, :yellow, :path => true )
73
-
74
- elsif type === :local_db_pass ||
75
- type === :staging_db_pass ||
76
- type === :production_db_pass
77
-
78
- answer = ask question, :yellow, :echo => false
79
-
80
- else
81
-
82
- answer = ask question, :yellow
83
-
84
- end
85
-
86
- if type === :sites_path && answer == ''
87
-
88
- answer = global_settings[:sites_path]
89
-
90
- elsif type === :local_db_pass ||
91
- type === :staging_db_pass ||
92
- type === :production_db_pass
93
-
94
- password = ask "\n\n--> Please re-enter your password?", :yellow, :echo => false
95
-
96
- say #spacer
97
-
98
- until password == answer
99
-
100
- say_status "#{APP_NAME}:", "Passwords did not match please try again.\n", :yellow
101
-
102
- answer = ask question, :yellow, :echo => false
103
-
104
- password = ask "\n--> Please re-enter your password?\n", :yellow, :echo => false
105
-
106
- end
107
-
108
- if password == answer
109
-
110
- if answer == ''
111
-
112
- answer = nil
113
-
114
- end
115
-
116
- confirm = true
117
-
118
- end
119
-
120
- elsif answer == ''
121
-
122
- if question[/\e\[[0-9;]*[a-zA-Z](.*)\e\[[0-9;]*[a-zA-Z]/, 1] == ''
123
-
124
- answer = nil
125
-
126
- else
127
-
128
- answer = question[/\e\[[0-9;]*[a-zA-Z](.*)\e\[[0-9;]*[a-zA-Z]/, 1]
129
-
130
- end
131
- end
132
-
133
- unless type === :local_db_pass ||
134
- type === :staging_db_pass ||
135
- type === :production_db_pass
136
-
137
- if responses.include? ask( "\n--> Got it! Is this correct? \e[32;m#{answer}\e[0;m [Y|n]")
138
-
139
- confirm = true
140
-
141
- end
142
- end
143
-
144
- end
145
-
146
- if type === :sites_path
147
-
148
- global_settings[type] = answer
149
-
150
- else
151
-
152
- split = type.to_s.split('_')
153
- environment = split.first.to_sym
154
- setting = split[1] + '_' + split.last
155
-
156
- if type === :staging_server_domain ||
157
- type === :production_server_domain
158
-
159
- setting = split.last
160
-
161
- end
162
-
163
- swiftly_settings[environment][setting.to_sym] = answer
164
-
165
- end
166
-
167
- end
168
-
169
- say_status "\n\s\s\s\sAll done thanks!", "From now on I will use your new settings."
170
-
171
- File.open(Swiftly::Config.global_file,'w') do |h|
172
-
173
- h.write swiftly_settings.to_yaml
174
-
175
- end
176
- end
177
-
178
- default_task :all
179
-
180
- end
181
- end
@@ -1,34 +0,0 @@
1
- require 'yaml'
2
- require 'swiftly/app_module'
3
- require 'swiftly/configure'
4
-
5
- module Swiftly
6
- class Local < Thor
7
-
8
- include Helpers
9
-
10
- desc "configure local host", "Configure local hostname"
11
-
12
- def host( value = false )
13
-
14
- update_setting_dialog( :local, :db_host, value )
15
-
16
- end
17
-
18
- desc "configure local username", "Configure local database username"
19
-
20
- def username( value = false )
21
-
22
- update_setting_dialog( :local, :db_user, value )
23
-
24
- end
25
-
26
- desc "configure local password", "Configure local database password"
27
-
28
- def password( value = false )
29
-
30
- update_setting_dialog( :local, :db_pass, value )
31
-
32
- end
33
- end
34
- end
@@ -1,42 +0,0 @@
1
- require 'yaml'
2
- require 'swiftly/app_module'
3
- require 'swiftly/configure'
4
-
5
- module Swiftly
6
- class Production < Thor
7
-
8
- include Helpers
9
-
10
- desc "configure production domain", "Configure production domain"
11
-
12
- def domain( value = false )
13
-
14
- update_setting_dialog( :production, :domain, value )
15
-
16
- end
17
-
18
- desc "configure production host", "Configure production hostname"
19
-
20
- def host( value = false )
21
-
22
- update_setting_dialog( :production, :db_host, value )
23
-
24
- end
25
-
26
- desc "configure production username", "Configure production database username"
27
-
28
- def username( value = false )
29
-
30
- update_setting_dialog( :production, :db_user, value )
31
-
32
- end
33
-
34
- desc "configure production password", "Configure production database password"
35
-
36
- def password( value = false )
37
-
38
- update_setting_dialog( :production, :db_pass, value )
39
-
40
- end
41
- end
42
- end
@@ -1,41 +0,0 @@
1
- require 'yaml'
2
- require 'swiftly/app_module'
3
-
4
- module Swiftly
5
- class Staging < Thor
6
-
7
- include Helpers
8
-
9
- desc "configure staging domain", "Configure staging domain"
10
-
11
- def domain( value = false )
12
-
13
- update_setting_dialog( :staging, :domain, value)
14
-
15
- end
16
-
17
- desc "configure staging host", "Configure staging hostname"
18
-
19
- def host( hostname = false )
20
-
21
- update_setting_dialog( :staging, :db_host, value)
22
-
23
- end
24
-
25
- desc "configure staging username", "Configure staging database username"
26
-
27
- def username( username = false )
28
-
29
- update_setting_dialog( :staging, :db_user, value)
30
-
31
- end
32
-
33
- desc "configure staging password", "Configure staging database password"
34
-
35
- def password( password = false )
36
-
37
- update_setting_dialog( :staging, :db_pass, value)
38
-
39
- end
40
- end
41
- end
@@ -1,13 +0,0 @@
1
- require 'swiftly/app_module'
2
- require 'swiftly/enable_wordpress'
3
-
4
- module Swiftly
5
- class Enable < Thor
6
- include Thor::Actions
7
- include Helpers
8
-
9
- desc "wordpress [COMMAND]", "Enable wordpress intergrations"
10
- subcommand "wordpress", Wordpress
11
-
12
- end
13
- end
@@ -1,22 +0,0 @@
1
- require "swiftly/config_templates_generator"
2
- require "swiftly/config_plugins_generator"
3
-
4
- module Swiftly
5
- class Wordpress < Thor
6
-
7
- desc "plugins", "Enable plugins for intergration"
8
- def plugins()
9
-
10
- ConfigPluginsGenerator.new.create
11
-
12
- end
13
-
14
- desc "templates", "Enable templates for intergrations"
15
-
16
- def templates()
17
-
18
- ConfigTemplateGenerator.new.create
19
-
20
- end
21
- end
22
- end