konstruct 0.7.0 → 0.8.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 +6 -6
- data/lib/cli/{gulp.rb → develop.rb} +20 -3
- data/lib/konstruct.rb +8 -7
- data/lib/konstruct/version.rb +1 -1
- data/lib/utilities/gulp.rb +12 -2
- data/lib/utilities/utils.rb +14 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 448b0f15ca6388daa5f14b522de161da3a593872
|
4
|
+
data.tar.gz: ef2afffd57c2a69661a19142d2d997e73e8ac3ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3453f66ccb87e815b13d7607bcf9aa87d2bfa31306819990416f193bfc389f0e74c96e528703d1d4e1024b7b33de8ace618b24c0ef200559339d9818ca5feb69
|
7
|
+
data.tar.gz: 308f0a1e7c288e73cee9dffaa1e5276b284fabcec93a9fa7498d5b7f9c48ce712c17a03c2aef40a9e8fa5222c7773c8d67899de5b25c86230131295418e1c1ba
|
data/README.md
CHANGED
@@ -24,17 +24,17 @@ The Cli has a few very simple commands. If you get stuck simply `$ konstruct --h
|
|
24
24
|
|
25
25
|
This feature is coming soon.
|
26
26
|
|
27
|
-
####
|
27
|
+
#### Develop
|
28
28
|
|
29
|
-
$ konstruct
|
29
|
+
$ konstruct develop
|
30
30
|
|
31
|
-
|
31
|
+
Determines the type of site you are building, and runs gulp tasks accordingly.
|
32
32
|
|
33
|
-
####
|
33
|
+
#### Project
|
34
34
|
|
35
|
-
$ konstruct
|
35
|
+
$ konstruct project
|
36
36
|
|
37
|
-
The
|
37
|
+
The project command builds a basic starter project template for common website projects. It builds common folders to ensure your project is tidy and organised.
|
38
38
|
|
39
39
|
#### Stat
|
40
40
|
|
@@ -12,7 +12,7 @@ module Konstruct
|
|
12
12
|
|
13
13
|
class Cli
|
14
14
|
|
15
|
-
def
|
15
|
+
def develop(path)
|
16
16
|
|
17
17
|
# B.1. INITIALISE FUNCTIONS -------------------------------------------------------------------------------
|
18
18
|
|
@@ -22,9 +22,26 @@ module Konstruct
|
|
22
22
|
|
23
23
|
# B.1. END ------------------------------------------------------------------------------------------------
|
24
24
|
|
25
|
-
# B.2.
|
25
|
+
# B.2. DETERMINE WHAT TOOL TO RUN -------------------------------------------------------------------------
|
26
26
|
|
27
|
-
|
27
|
+
site = fs.read_json(path)
|
28
|
+
type = site['type']
|
29
|
+
|
30
|
+
if type == "Default" || type == "Angular"
|
31
|
+
|
32
|
+
serving = true
|
33
|
+
|
34
|
+
gulp.default(path, serving)
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
if type == "Jekyll"
|
39
|
+
|
40
|
+
serving = false
|
41
|
+
|
42
|
+
gulp.default(path, serving)
|
43
|
+
|
44
|
+
end
|
28
45
|
|
29
46
|
# B.2. END ------------------------------------------------------------------------------------------------
|
30
47
|
|
data/lib/konstruct.rb
CHANGED
@@ -18,6 +18,7 @@ require 'paint'
|
|
18
18
|
require 'launchy'
|
19
19
|
require 'minigit'
|
20
20
|
require 'json'
|
21
|
+
require 'pp'
|
21
22
|
|
22
23
|
# A.1. END ------------------------------------------------------------------------------------------------------------
|
23
24
|
|
@@ -35,7 +36,7 @@ require_relative 'cli/scaffold'
|
|
35
36
|
require_relative 'cli/project'
|
36
37
|
require_relative 'cli/documentation'
|
37
38
|
require_relative 'cli/init'
|
38
|
-
require_relative 'cli/
|
39
|
+
require_relative 'cli/develop'
|
39
40
|
|
40
41
|
# A.2. END ------------------------------------------------------------------------------------------------------------
|
41
42
|
|
@@ -137,14 +138,14 @@ end
|
|
137
138
|
|
138
139
|
# -- USAGE: $ konstruct documentation
|
139
140
|
|
140
|
-
command :
|
141
|
+
command :develop do |c|
|
141
142
|
|
142
|
-
c.syntax = 'konstruct
|
143
|
-
c.summary = 'Launches Konstruct
|
144
|
-
c.description = 'Launches Konstruct
|
143
|
+
c.syntax = 'konstruct develop'
|
144
|
+
c.summary = 'Launches Konstruct dev tools to help you build things quicker.'
|
145
|
+
c.description = 'Launches Konstruct dev tools to help you build things quicker.'
|
145
146
|
c.action do |args, options|
|
146
|
-
|
147
|
-
cli.
|
147
|
+
|
148
|
+
cli.develop(projectDir)
|
148
149
|
|
149
150
|
end
|
150
151
|
|
data/lib/konstruct/version.rb
CHANGED
data/lib/utilities/gulp.rb
CHANGED
@@ -16,7 +16,7 @@ module Util
|
|
16
16
|
|
17
17
|
# A.1.1. GULP DEFAULT
|
18
18
|
|
19
|
-
def default(path)
|
19
|
+
def default(path, serving)
|
20
20
|
|
21
21
|
gulp = Util::Gulp.new()
|
22
22
|
msg = Util::Message.new()
|
@@ -24,8 +24,18 @@ module Util
|
|
24
24
|
gulp_path = File.expand_path('~/.konstruct/gulp')
|
25
25
|
|
26
26
|
FileUtils.cd(gulp_path) do
|
27
|
+
|
28
|
+
if serving == true
|
27
29
|
|
28
|
-
|
30
|
+
exec "gulp --path #{path}"
|
31
|
+
|
32
|
+
else
|
33
|
+
|
34
|
+
msg.heading("Run `$ jekyll serve --watch` in a new terminal window.")
|
35
|
+
|
36
|
+
exec "gulp --noserve --path #{path}"
|
37
|
+
|
38
|
+
end
|
29
39
|
|
30
40
|
end
|
31
41
|
|
data/lib/utilities/utils.rb
CHANGED
@@ -177,7 +177,7 @@ module Util
|
|
177
177
|
|
178
178
|
# B.2.3. END
|
179
179
|
|
180
|
-
# B.2.3.
|
180
|
+
# B.2.3. MAKE DIRECTORY
|
181
181
|
|
182
182
|
def make_dir(dir)
|
183
183
|
|
@@ -194,6 +194,19 @@ module Util
|
|
194
194
|
|
195
195
|
# B.2.3. END
|
196
196
|
|
197
|
+
# B.2.4. READ JSON FILE
|
198
|
+
|
199
|
+
def read_json(path)
|
200
|
+
|
201
|
+
msg = Util::Message.new()
|
202
|
+
|
203
|
+
json = File.read("#{path}/.konstruct/data.json")
|
204
|
+
obj = JSON.parse(json)
|
205
|
+
|
206
|
+
end
|
207
|
+
|
208
|
+
# B.2.4. END
|
209
|
+
|
197
210
|
end
|
198
211
|
|
199
212
|
# B.2. END --------------------------------------------------------------------------------------------------------
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: konstruct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrian Kirsten
|
@@ -130,8 +130,8 @@ files:
|
|
130
130
|
- bin/konstruct
|
131
131
|
- bin/setup
|
132
132
|
- konstruct.gemspec
|
133
|
+
- lib/cli/develop.rb
|
133
134
|
- lib/cli/documentation.rb
|
134
|
-
- lib/cli/gulp.rb
|
135
135
|
- lib/cli/init.rb
|
136
136
|
- lib/cli/project.rb
|
137
137
|
- lib/cli/scaffold.rb
|