konstruct 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ee931a7380555cf3c1c3c8a22b7c7738250d53ab
4
- data.tar.gz: 10b2369bca9a06902c37284a4915fd2847da42ac
3
+ metadata.gz: 448b0f15ca6388daa5f14b522de161da3a593872
4
+ data.tar.gz: ef2afffd57c2a69661a19142d2d997e73e8ac3ad
5
5
  SHA512:
6
- metadata.gz: c52c6f189a2c3bc867018411f1a93feecfd30c864df5e084de51731b54eedba130ac3049d47d8ede6b9cb01d0442a99b8defdb2e8ff715495bfbd02b3dd095bb
7
- data.tar.gz: 9124dff1088f4daee812fd655eab1c1515bec873e3b2084405011e36bce143314262b93ace76b5bba73c3ffe51cda17662834a8dc524bca5a2c3fee6fdf4b2ea
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
- #### Gulp
27
+ #### Develop
28
28
 
29
- $ konstruct gulp
29
+ $ konstruct develop
30
30
 
31
- Runs a default Gulp
31
+ Determines the type of site you are building, and runs gulp tasks accordingly.
32
32
 
33
- #### Skeleton
33
+ #### Project
34
34
 
35
- $ konstruct skeleton
35
+ $ konstruct project
36
36
 
37
- The skeleton command builds a basic starter project template for common website projects. It builds common folders to ensure your project is tidy and organised.
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 gulp(path)
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. RUN DEFAULT WATCH TASK -----------------------------------------------------------------------------
25
+ # B.2. DETERMINE WHAT TOOL TO RUN -------------------------------------------------------------------------
26
26
 
27
- gulp.default(path)
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
 
@@ -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/gulp'
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 :gulp do |c|
141
+ command :develop do |c|
141
142
 
142
- c.syntax = 'konstruct gulp'
143
- c.summary = 'Launches Konstruct Gulp tasks while you develop.'
144
- c.description = 'Launches Konstruct Gulp tasks while you develop.'
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.gulp(projectDir)
147
+
148
+ cli.develop(projectDir)
148
149
 
149
150
  end
150
151
 
@@ -1,3 +1,3 @@
1
1
  module Konstruct
2
- VERSION = "0.7.0"
2
+ VERSION = "0.8.0"
3
3
  end
@@ -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
- exec "gulp --path #{path}"
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
 
@@ -177,7 +177,7 @@ module Util
177
177
 
178
178
  # B.2.3. END
179
179
 
180
- # B.2.3. CLEAN DIRECTORY
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.7.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