konstruct 0.9.1 → 1.0.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 +4 -4
- data/README.md +33 -27
- data/konstruct.gemspec +6 -6
- data/lib/cli/develop.rb +54 -47
- data/lib/cli/project.rb +333 -81
- data/lib/konstruct.rb +157 -84
- data/lib/konstruct/template.rb +71 -0
- data/lib/konstruct/version.rb +1 -1
- data/lib/utilities/gulp.rb +32 -42
- data/lib/utilities/system.rb +218 -0
- data/lib/utilities/utils.rb +165 -184
- metadata +18 -5
- data/lib/cli/documentation.rb +0 -44
- data/lib/cli/init.rb +0 -195
- data/lib/konstruct/config.rb +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eea3b69e1b18ba332817635e57c28aa3abe6811b
|
4
|
+
data.tar.gz: f999fd8311e6a205ef5397550cb664050768d783
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cbca349807f4f55af993c785186b960318637ffb05284093e595458ebabe4fabb3d8aae49b561d6c7fa32dab4b4109259866571c17119cf5ca5f00199737071
|
7
|
+
data.tar.gz: 418700fe2bfaf813edbbf86631f771b1de014f4acac03d47e5ff2ad1bd97f6289ffd7a218732cc020223553b52898306708f26d9bf1e824fe333d88281eb6a0e
|
data/README.md
CHANGED
@@ -4,13 +4,12 @@
|
|
4
4
|
|
5
5
|
The Konstruct Cli provides tools to make working with Konstruct painless and quick. You can access documentation, build a new project structure and scaffold a new site with simple to use commands.
|
6
6
|
|
7
|
-
### Features
|
7
|
+
### Key Features
|
8
8
|
|
9
9
|
- Set up a new project structure in seconds.
|
10
10
|
- Scaffold out a new HTML, Jekyll or Angular site in seconds.
|
11
11
|
- Gulp in a central location.
|
12
|
-
- Browserify
|
13
|
-
- Usage statistics (local only). *Coming Soon*
|
12
|
+
- Develop with Browserify & PostCSS.
|
14
13
|
- Quick link to Konstruct Documentation.
|
15
14
|
|
16
15
|
## Installation
|
@@ -18,38 +17,51 @@ The Konstruct Cli provides tools to make working with Konstruct painless and qui
|
|
18
17
|
You can install Konstruct Cli by running:
|
19
18
|
|
20
19
|
$ gem install konstruct
|
21
|
-
|
22
|
-
When it's installed simply run:
|
23
|
-
|
24
|
-
$ konstruct
|
25
20
|
|
26
|
-
##
|
21
|
+
## Commands
|
27
22
|
|
28
23
|
The Cli has a few very simple commands. If you get stuck simply `$ konstruct --help` for help. You can also get instructions for every command with `$ konstruct [COMMAND] --help`
|
29
24
|
|
30
|
-
###
|
25
|
+
### Konstruct Commands
|
31
26
|
|
32
|
-
|
33
|
-
|
34
|
-
|
27
|
+
* [$ konstruct folders](#)
|
28
|
+
* [$ konstruct create](#)
|
29
|
+
* [$ konstruct refresh](#)
|
30
|
+
* [$ konstruct watch](#)
|
31
|
+
* [$ konstruct serve](#)
|
32
|
+
* [$ konstruct documentation](#documentation)
|
33
|
+
|
34
|
+
#### Folders
|
35
|
+
|
36
|
+
$ konstruct folders
|
35
37
|
|
36
|
-
Scaffolds
|
38
|
+
Scaffolds a set of project folders from a template to help you organise your project better.
|
39
|
+
|
40
|
+
**Customize Template**: You can customize the folder structure in `~/.konstruct/config.yml`.
|
37
41
|
|
38
|
-
####
|
42
|
+
#### Create
|
43
|
+
|
44
|
+
$ konstruct create [options]
|
39
45
|
|
40
|
-
|
46
|
+
**Options:**
|
47
|
+
* --sudo : Run NPM install as root if your node installation requires root privileges.
|
41
48
|
|
42
|
-
|
49
|
+
Creates a new Konstruct starter project through an interactive wizard.
|
43
50
|
|
44
|
-
####
|
51
|
+
#### Refresh
|
45
52
|
|
46
|
-
$ konstruct
|
53
|
+
$ konstruct refresh [options]
|
54
|
+
|
55
|
+
**Options:**
|
56
|
+
* --sudo : Run NPM install as root if your node installation requires root privileges.
|
47
57
|
|
48
|
-
|
58
|
+
Refreshes the project by installing dependencies again. Useful if you inherit a repo from another developer.
|
59
|
+
|
60
|
+
#### Watch
|
49
61
|
|
50
|
-
|
62
|
+
$ konstruct watch
|
51
63
|
|
52
|
-
|
64
|
+
Runs the global Gulp tools from your current working directory.
|
53
65
|
|
54
66
|
#### Documentation
|
55
67
|
|
@@ -57,12 +69,6 @@ This feature is coming soon.
|
|
57
69
|
|
58
70
|
Loads up the [Konstruct Documentation](http://konstruct.github.io/) in your default browser.
|
59
71
|
|
60
|
-
#### Init
|
61
|
-
|
62
|
-
$ konstruct init
|
63
|
-
|
64
|
-
Initialises the Cli by installing any libraries and extensions you might require to work with Konstruct. This command only runs once (usually when you run `$ konstruct` for the first time), and then simply displays a welcome screen.
|
65
|
-
|
66
72
|
## Contributing
|
67
73
|
|
68
74
|
Bug reports and pull requests are welcome on GitHub at https://github.com/konstruct/konstruct.cli. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
data/konstruct.gemspec
CHANGED
@@ -17,15 +17,15 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.files = `git ls-files`.split("\n")
|
18
18
|
spec.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
19
19
|
spec.require_paths = ['lib']
|
20
|
-
|
21
|
-
dependencies = ['commander', 'minigit', 'paint', 'launchy', 'json']
|
22
|
-
|
20
|
+
|
21
|
+
dependencies = ['commander', 'minigit', 'paint', 'launchy', 'json', 'xml-simple']
|
22
|
+
|
23
23
|
dependencies.each { |d|
|
24
|
-
|
24
|
+
|
25
25
|
spec.add_dependency d
|
26
|
-
|
26
|
+
|
27
27
|
}
|
28
28
|
|
29
29
|
spec.add_development_dependency "bundler", "~> 1.11"
|
30
30
|
spec.add_development_dependency "rake", "~> 10.0"
|
31
|
-
end
|
31
|
+
end
|
data/lib/cli/develop.rb
CHANGED
@@ -1,56 +1,63 @@
|
|
1
|
-
# KONSTRUCT CLI [
|
1
|
+
# KONSTRUCT CLI [ DEVELOPMENT TASKS ] ==========================================
|
2
2
|
|
3
|
-
# ====== INDEX
|
3
|
+
# ====== INDEX ================================================================
|
4
4
|
# ==
|
5
|
-
# ==
|
5
|
+
# == 1. WATCH
|
6
6
|
# ==
|
7
|
-
# ====== INDEX
|
8
|
-
|
9
|
-
# A. SKELETON PROJECT CREATOR +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
7
|
+
# ====== INDEX ================================================================
|
10
8
|
|
11
9
|
module Konstruct
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
10
|
+
|
11
|
+
class Develop
|
12
|
+
|
13
|
+
# 1. WATCH +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
14
|
+
|
15
|
+
def watch(path)
|
16
|
+
|
17
|
+
# 1.1. INITIALISE FUNCTIONS ----------------------------------------------
|
18
|
+
|
19
|
+
msg = Util::Message.new()
|
20
|
+
fs = Util::FS.new()
|
21
|
+
gulp = Util::Gulp.new()
|
22
|
+
|
23
|
+
# 1.1. END ---------------------------------------------------------------
|
24
|
+
|
25
|
+
# 1.2. RUN DEV TASK ------------------------------------------------------
|
26
|
+
|
27
|
+
site = fs.read_project(path)
|
28
|
+
|
29
|
+
type = site['type']
|
30
|
+
|
31
|
+
if type == :html
|
32
|
+
|
33
|
+
stream = "html"
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
if type == :angular
|
38
|
+
|
39
|
+
stream = "angular"
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
if type == :jekyll
|
44
|
+
|
45
|
+
stream = "jekyll"
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
gulp.default(path, stream)
|
50
|
+
|
51
|
+
# 1.2. END ---------------------------------------------------------------
|
52
|
+
|
50
53
|
end
|
51
|
-
|
54
|
+
|
55
|
+
# 1. END +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
56
|
+
|
57
|
+
end
|
58
|
+
|
52
59
|
end
|
53
60
|
|
54
|
-
# B. END
|
61
|
+
# B. END +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
55
62
|
|
56
|
-
# END OF FILE
|
63
|
+
# END OF FILE ==================================================================
|
data/lib/cli/project.rb
CHANGED
@@ -1,90 +1,342 @@
|
|
1
|
-
# KONSTRUCT CLI [ KONSTRUCT MODULE ]
|
1
|
+
# KONSTRUCT CLI [ KONSTRUCT MODULE ] ===========================================
|
2
2
|
|
3
|
-
# ====== INDEX
|
3
|
+
# ====== INDEX ================================================================
|
4
4
|
# ==
|
5
|
-
# ==
|
5
|
+
# == 1. FOLDERS
|
6
|
+
# == 2. CREATE
|
7
|
+
# == 3. REFRESH
|
6
8
|
# ==
|
7
|
-
# ====== INDEX
|
8
|
-
|
9
|
-
# A. SKELETON PROJECT CREATOR +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
9
|
+
# ====== INDEX ================================================================
|
10
10
|
|
11
11
|
module Konstruct
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
12
|
+
|
13
|
+
class Project
|
14
|
+
|
15
|
+
# 1. FOLDERS +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
16
|
+
|
17
|
+
def folders(path)
|
18
|
+
|
19
|
+
# 1.1. INIT FUNCTIONS ----------------------------------------------------
|
20
|
+
|
21
|
+
msg = Util::Message.new()
|
22
|
+
fs = Util::FS.new()
|
23
|
+
|
24
|
+
# 1.1. END ---------------------------------------------------------------
|
25
|
+
|
26
|
+
# 1.2. HEADING -----------------------------------------------------------
|
27
|
+
|
28
|
+
msg.heading("CREATING PROJECT FOLDER STRUCTURE")
|
29
|
+
|
30
|
+
# 1.2. END ---------------------------------------------------------------
|
31
|
+
|
32
|
+
# 1.3. EMPTY DIRECTORY ---------------------------------------------------
|
33
|
+
|
34
|
+
puts fs.clear_directory(path)
|
35
|
+
|
36
|
+
# 1.3. END ---------------------------------------------------------------
|
37
|
+
|
38
|
+
# 1.4. SET FOLDER STRUCTURE ----------------------------------------------
|
39
|
+
|
40
|
+
config_dir = File.expand_path('~/.konstruct')
|
41
|
+
|
42
|
+
hash = YAML.load_file("#{config_dir}/config.yml")
|
43
|
+
|
44
|
+
structure = hash["folders"]
|
45
|
+
|
46
|
+
# 1.4. END ---------------------------------------------------------------
|
47
|
+
|
48
|
+
# 1.5. CONFIRM FOLDER STRUCTURE ------------------------------------------
|
49
|
+
|
50
|
+
puts Paint["Folders location:", "999999"]
|
51
|
+
puts Paint["-- #{ path }", "999999"]
|
52
|
+
puts ""
|
53
|
+
puts Paint["Folder structure:", "999999"]
|
54
|
+
|
55
|
+
structure.each { |f|
|
56
|
+
puts Paint["-- #{ f }", "999999"]
|
57
|
+
}
|
58
|
+
|
59
|
+
puts ""
|
60
|
+
choice = choose("Do you want to install the structure above?", :yes, :no)
|
61
|
+
|
62
|
+
# 1.5. END ---------------------------------------------------------------
|
63
|
+
|
64
|
+
# 1.6. BUILD FOLDERS -----------------------------------------------------
|
65
|
+
|
66
|
+
if choice == :yes
|
67
|
+
|
68
|
+
structure.each { |f|
|
69
|
+
|
70
|
+
Dir.mkdir "#{ path }/#{ f }"
|
71
|
+
|
72
|
+
}
|
73
|
+
|
74
|
+
msg.success('Installed Folders')
|
75
|
+
|
76
|
+
exit(0)
|
77
|
+
|
78
|
+
else
|
79
|
+
|
80
|
+
exit(0)
|
81
|
+
|
82
|
+
end
|
83
|
+
|
84
|
+
# 1.6. END ---------------------------------------------------------------
|
85
|
+
|
86
|
+
end
|
87
|
+
|
88
|
+
# 1. END +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
89
|
+
|
90
|
+
# 2. CREATE ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
91
|
+
|
92
|
+
def create(path, sudo)
|
93
|
+
|
94
|
+
# 2.1. INIT FUNCTIONS ----------------------------------------------------
|
95
|
+
|
96
|
+
msg = Util::Message.new()
|
97
|
+
fs = Util::FS.new()
|
98
|
+
git = Util::Git.new()
|
99
|
+
|
100
|
+
config = fs.read_config
|
101
|
+
|
102
|
+
recipe = config["recipes"]
|
103
|
+
repo = config["repo"]
|
104
|
+
assets = config["paths"]
|
105
|
+
|
106
|
+
# 2.1. END ---------------------------------------------------------------
|
107
|
+
|
108
|
+
# 2.2. HEADING -----------------------------------------------------------
|
109
|
+
|
110
|
+
msg.heading("CREATE NEW KONSTRUCT PROJECT")
|
111
|
+
|
112
|
+
# 2.2. END ---------------------------------------------------------------
|
113
|
+
|
114
|
+
# 2.3. IS YOUR DIRECTORY EMPTY? ------------------------------------------
|
115
|
+
|
116
|
+
fs.clear_directory(path)
|
117
|
+
|
118
|
+
# 2.3. END ---------------------------------------------------------------
|
119
|
+
|
120
|
+
# 2.4. INSTALL BOILERPLATE -----------------------------------------------
|
121
|
+
|
122
|
+
type = choose("What type of site are you building?", :html, :jekyll, :angular)
|
123
|
+
|
124
|
+
if type == :html
|
125
|
+
|
126
|
+
recipe["html"].each do |key, val|
|
127
|
+
git.install("#{path}#{val[0]}", "#{repo}#{val[1]}", val[2], val[3])
|
128
|
+
msg.success("Installed #{ key }");
|
129
|
+
end
|
130
|
+
|
131
|
+
end
|
132
|
+
|
133
|
+
if type == :jekyll
|
134
|
+
|
135
|
+
recipe["jekyll"].each do |key, val|
|
136
|
+
git.install("#{path}#{val[0]}", "#{repo}#{val[1]}", val[2], val[3])
|
137
|
+
msg.success("Installed #{ key }");
|
138
|
+
end
|
139
|
+
|
140
|
+
end
|
141
|
+
|
142
|
+
if type == :angular
|
143
|
+
|
144
|
+
recipe["angular"].each do |key, val|
|
145
|
+
git.install("#{path}#{val[0]}", "#{repo}#{val[1]}", val[2], val[3])
|
146
|
+
msg.success("Installed #{ key }");
|
147
|
+
end
|
148
|
+
|
149
|
+
end
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
# 2.4. END ---------------------------------------------------------------
|
154
|
+
|
155
|
+
# 2.7. INSTALL NPM ASSETS ------------------------------------------------
|
156
|
+
|
157
|
+
if sudo
|
158
|
+
|
159
|
+
msg.warning("Installing NPM as root is not advisable. You should fix
|
160
|
+
your installation of nodeJS to not require root privileges!")
|
161
|
+
msg.paragraph("Installing NPM Assets. This might take a while.")
|
162
|
+
|
163
|
+
FileUtils.cd("#{path}/assets") do
|
164
|
+
`sudo npm install`
|
82
165
|
end
|
83
|
-
|
166
|
+
|
167
|
+
else
|
168
|
+
|
169
|
+
msg.paragraph("Installing NPM Assets. This might take a while.")
|
170
|
+
|
171
|
+
FileUtils.cd("#{path}/assets") do
|
172
|
+
`npm install`
|
173
|
+
end
|
174
|
+
|
175
|
+
end
|
176
|
+
|
177
|
+
msg.success("Installed NPM Assets")
|
178
|
+
|
179
|
+
# 2.7. END ---------------------------------------------------------------
|
180
|
+
|
181
|
+
# 2.8. SET UP NEW GIT REPOSITORY -----------------------------------------
|
182
|
+
|
183
|
+
want_git = choose("Want to initialise a git repository?", :Yes, :No)
|
184
|
+
|
185
|
+
if want_git == :Yes
|
186
|
+
|
187
|
+
git.init(path)
|
188
|
+
|
189
|
+
has_remote = choose("Do you already have a remote git repository?", :Yes, :No)
|
190
|
+
|
191
|
+
if has_remote == :Yes
|
192
|
+
|
193
|
+
remote_url = ask("Remote Url:")
|
194
|
+
|
195
|
+
git.remote(path, remote_url)
|
196
|
+
git.add(path)
|
197
|
+
|
198
|
+
msg.success("Initialised your git repo")
|
199
|
+
|
200
|
+
end
|
201
|
+
|
202
|
+
end
|
203
|
+
|
204
|
+
# 2.8. END ---------------------------------------------------------------
|
205
|
+
|
206
|
+
# 2.9. INSTALL .konstruct ------------------------------------------------
|
207
|
+
|
208
|
+
date = Time.new
|
209
|
+
date_installed = "#{ date.year }-#{ date.month }-#{ date.day }"
|
210
|
+
|
211
|
+
file_data = {
|
212
|
+
|
213
|
+
"konstruct_version" => Konstruct::VERSION,
|
214
|
+
"date_installed" => date_installed,
|
215
|
+
"type" => type
|
216
|
+
|
217
|
+
}
|
218
|
+
|
219
|
+
File.open("#{path}/.konstruct.yml","w") do |f|
|
220
|
+
f.write(file_data.to_yaml)
|
221
|
+
end
|
222
|
+
|
223
|
+
msg.success("Created #{path}/.konstruct.yml")
|
224
|
+
|
225
|
+
# 2.9. END ---------------------------------------------------------------
|
226
|
+
|
227
|
+
# 2.5. SEND BUILD DATA TO ANALYTICS --------------------------------------
|
228
|
+
|
229
|
+
# TODO
|
230
|
+
|
231
|
+
# 2.5. END ---------------------------------------------------------------
|
232
|
+
|
233
|
+
# 2.6. THANKS FOR INSTALLING ---------------------------------------------
|
234
|
+
|
235
|
+
puts ""
|
236
|
+
puts ""
|
237
|
+
puts Paint[' $III7IIIIIIIIIIIIIIIIIIIIIIIIII: ', "#de544b"]
|
238
|
+
puts Paint[' ZZZZZZ$7IIIIIIIIIIIIIIIIIIIIIIII ', "#de544b"]
|
239
|
+
puts Paint[' ZZZZZZZZZZZZ$7IIIIIIIIIIIIIIIIII ', "#de544b"]
|
240
|
+
puts Paint[' ZZZZZZZZZZZZZZZZZZZ$IIIIIIIIIIII~', "#de544b"]
|
241
|
+
puts Paint[' ZZZZZZZZZZZZZZZZZZZZZZZ:,:+IIIIII', "#de544b"]
|
242
|
+
puts Paint[' ZZZZZZZZZZZZZZZZZZZZZZ. :?', "#de544b"]
|
243
|
+
puts Paint[' I$ZZZZZZZZZZZZZZZZZZ7 ', "#de544b"]
|
244
|
+
puts Paint[' III$ZZZZZZZZZZZZZZZ~ ', "#de544b"]
|
245
|
+
puts Paint[' IIIII7ZZZZZZZZZZZZ ', "#de544b"]
|
246
|
+
puts Paint[' IIIIIII7ZZZZZZZZ$ ', "#de544b"]
|
247
|
+
puts Paint[' IIIIIIIIIIZZZZZ: ', "#de544b"]
|
248
|
+
puts Paint[' IIIIIIIIIIIIZI ', "#de544b"]
|
249
|
+
puts Paint[' IIIIIIIIIIIIII ', "#de544b"]
|
250
|
+
puts Paint[' IIIIIIIIIIIIIIII= ', "#de544b"]
|
251
|
+
puts Paint[' IIIIIIIIIIIIIIIII7= ', "#de544b"]
|
252
|
+
puts Paint[' IIIIIIIIIIIIIIIIIIII~ ', "#de544b"]
|
253
|
+
puts Paint[' IIIIIIIIIIIIIIIIIIIIII= ', "#de544b"]
|
254
|
+
puts Paint[' IIIIIIIIIIIIIIIIIIIIIII7~ ', "#de544b"]
|
255
|
+
puts Paint[' IIIIIIIIIIIIIIIIIIIIIIIIIII.. ', "#de544b"]
|
256
|
+
puts Paint[' IIIIIIIIIIIIIIIIIIIIIIIIIIII7 ', "#de544b"]
|
257
|
+
puts Paint[' IIIIIIIIIIIIIIIIIIIIIIIIIIIIIII,.', "#de544b"]
|
258
|
+
puts Paint[' IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII7', "#de544b"]
|
259
|
+
puts ""
|
260
|
+
puts ""
|
261
|
+
puts Paint[" GO BUILD SOMETHING AWESOME!", "#999999"]
|
262
|
+
puts ""
|
263
|
+
puts Paint[" Successfully installed your #{type} site.", "#999999"]
|
264
|
+
puts ""
|
265
|
+
puts Paint[" You can run the developer tools with '$ konstruct watch'
|
266
|
+
or '$ konstruct documentation' to get help.", "#999999"]
|
267
|
+
puts ""
|
268
|
+
|
269
|
+
exit(0)
|
270
|
+
|
271
|
+
# 2.6. END ---------------------------------------------------------------
|
272
|
+
|
273
|
+
end
|
274
|
+
|
275
|
+
# 2. END +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
276
|
+
|
277
|
+
# 3. END +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
278
|
+
|
279
|
+
def refresh(path, sudo)
|
280
|
+
|
281
|
+
# 3.1. INSTALL NPM ASSETS ------------------------------------------------
|
282
|
+
|
283
|
+
if sudo
|
284
|
+
|
285
|
+
msg.warning("Installing NPM as root is not advisable. You should fix your
|
286
|
+
installation of nodeJS to not require root privileges!")
|
287
|
+
msg.paragraph("Refreshing NPM Assets. This might take a while.")
|
288
|
+
|
289
|
+
FileUtils.cd("#{path}/assets") do
|
290
|
+
`sudo npm install`
|
291
|
+
end
|
292
|
+
|
293
|
+
else
|
294
|
+
|
295
|
+
msg.paragraph("Refreshing NPM Assets. This might take a while.")
|
296
|
+
|
297
|
+
FileUtils.cd("#{path}/assets") do
|
298
|
+
`npm install`
|
299
|
+
end
|
300
|
+
|
301
|
+
end
|
302
|
+
|
303
|
+
msg.success("Refreshed NPM Assets")
|
304
|
+
|
305
|
+
# 3.1. END ---------------------------------------------------------------
|
306
|
+
|
84
307
|
end
|
85
|
-
|
86
|
-
end
|
87
308
|
|
88
|
-
#
|
309
|
+
# 3. END +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
310
|
+
|
311
|
+
# 3. END +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
312
|
+
|
313
|
+
def documentation
|
314
|
+
|
315
|
+
# B.1. INITIALISE FUNCTIONS ----------------------------------------------
|
316
|
+
|
317
|
+
msg = Util::Message.new()
|
318
|
+
|
319
|
+
# B.1. END ---------------------------------------------------------------
|
320
|
+
|
321
|
+
msg.heading("KONSTRUCT DOCUMENTATION")
|
322
|
+
|
323
|
+
# B.2. IS YOUR DIRECTORY EMPTY? ------------------------------------------
|
324
|
+
|
325
|
+
puts Paint["Opening documentation in your default browser!", "999999"]
|
326
|
+
puts ""
|
327
|
+
|
328
|
+
Launchy.open( "http://konstruct.github.io/" )
|
329
|
+
|
330
|
+
exit(0)
|
331
|
+
|
332
|
+
# B.3. END ---------------------------------------------------------------
|
333
|
+
|
334
|
+
end
|
335
|
+
|
336
|
+
# 3. END +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
337
|
+
|
338
|
+
end
|
339
|
+
|
340
|
+
end
|
89
341
|
|
90
|
-
# END OF FILE
|
342
|
+
# END OF FILE ==================================================================
|