wst 0.10.1 → 0.11.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/lib/{colored.rb → wst/colored.rb} +0 -0
- data/lib/{configuration.rb → wst/configuration.rb} +0 -0
- data/lib/{content.rb → wst/content.rb} +1 -1
- data/lib/{css_renderer.rb → wst/css_renderer.rb} +2 -2
- data/lib/{haml_content.rb → wst/haml_content.rb} +1 -1
- data/lib/{haml_helpers_wlt_extensions.rb → wst/haml_helpers_wlt_extensions.rb} +2 -2
- data/lib/{haml_renderer.rb → wst/haml_renderer.rb} +2 -2
- data/lib/{html_with_pygments.rb → wst/html_with_pygments.rb} +0 -0
- data/lib/{js_renderer.rb → wst/js_renderer.rb} +3 -3
- data/lib/{logging.rb → wst/logging.rb} +1 -1
- data/lib/wst/main.rb +110 -0
- data/lib/{md_content.rb → wst/md_content.rb} +2 -2
- data/lib/{md_renderer.rb → wst/md_renderer.rb} +3 -3
- data/lib/{page.rb → wst/page.rb} +2 -2
- data/lib/{post.rb → wst/post.rb} +1 -1
- data/lib/wst/reader.rb +5 -0
- data/lib/{renderer.rb → wst/renderer.rb} +2 -2
- data/lib/{renderer_factory.rb → wst/renderer_factory.rb} +5 -5
- data/lib/wst.rb +1 -109
- metadata +20 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 723c892f789eacb670ebb1a44dfda254c9bfc918
|
4
|
+
data.tar.gz: c46c1e6e3739c985f9a4113ed334e1a8c6a3bd33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abbcc6b49120ba2cd7c15ae3516876a27b6a0f0fdfd9994e060f568734a03abada64c490aaaf6f099b33c9e8339f9c9feae8cfb6c006494b948ab1d595307018
|
7
|
+
data.tar.gz: 3ca844e17483d1f3eeb4c1d602283dea52563339d7f4c508bd68258d97df87cc74e11a00b0164c13d41fabef25420656a686839f662a966a2136a76fa141f4c6
|
File without changes
|
File without changes
|
File without changes
|
data/lib/wst/main.rb
ADDED
@@ -0,0 +1,110 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'haml_helpers_wlt_extensions'
|
3
|
+
require 'wst/post'
|
4
|
+
require 'wst/page'
|
5
|
+
require 'wst/renderer_factory'
|
6
|
+
require 'wst/css_renderer'
|
7
|
+
require 'wst/js_renderer'
|
8
|
+
require 'wst/configuration'
|
9
|
+
require 'wst/logging'
|
10
|
+
require 'wst/colored'
|
11
|
+
require 'uglifier'
|
12
|
+
|
13
|
+
module Wst
|
14
|
+
class Wst
|
15
|
+
include Logging
|
16
|
+
include Configuration
|
17
|
+
|
18
|
+
def initialize
|
19
|
+
@css_renderer = CssRenderer.new
|
20
|
+
@js_renderer = JsRenderer.new
|
21
|
+
end
|
22
|
+
|
23
|
+
# @param [Boolean] all Generate all content or only published content
|
24
|
+
def generate(all = false)
|
25
|
+
init
|
26
|
+
css
|
27
|
+
js
|
28
|
+
content all
|
29
|
+
pub
|
30
|
+
end
|
31
|
+
|
32
|
+
# Compile all css files
|
33
|
+
def css
|
34
|
+
@css_renderer.generate_all
|
35
|
+
end
|
36
|
+
|
37
|
+
# Compile a single css file
|
38
|
+
# @param [String] css_name Css name to compile
|
39
|
+
def compile_css(css_name)
|
40
|
+
@css_renderer.compile css_name
|
41
|
+
end
|
42
|
+
|
43
|
+
# Compile all js files
|
44
|
+
def js
|
45
|
+
@js_renderer.generate_all
|
46
|
+
end
|
47
|
+
|
48
|
+
# Compile a single js file
|
49
|
+
# @param [String] js_name Js name to compile
|
50
|
+
def compile_js(js_name)
|
51
|
+
@js_renderer.compile js_name
|
52
|
+
end
|
53
|
+
|
54
|
+
private
|
55
|
+
|
56
|
+
def init
|
57
|
+
logger.info 'Clean'.blue
|
58
|
+
FileUtils.mkdir_p File.join config['path'], '_site'
|
59
|
+
FileUtils.rm_rf Dir.glob File.join config['path'], '_site/*'
|
60
|
+
end
|
61
|
+
|
62
|
+
#def kss
|
63
|
+
# return unless config.has_key? 'assets'
|
64
|
+
# return unless config['assets'].has_key? 'css'
|
65
|
+
# css_conf = config['assets']['css']
|
66
|
+
# return unless css_conf.kind_of? Array
|
67
|
+
|
68
|
+
# logger.info 'KSS'.blue
|
69
|
+
# css_conf.each do |css_name|
|
70
|
+
# logger.info " #{css_name}"
|
71
|
+
# compile_css_expanded css_name
|
72
|
+
# end
|
73
|
+
#end
|
74
|
+
|
75
|
+
# @param [Boolean] all Generate all content or only published content
|
76
|
+
def content(all)
|
77
|
+
logger.info 'Content'.blue
|
78
|
+
contents(all).each do |doc|
|
79
|
+
logger.info " #{doc.content_url}"
|
80
|
+
renderer = RendererFactory.for doc
|
81
|
+
renderer.write_to_site
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
def pub
|
86
|
+
logger.info 'Pub'.blue
|
87
|
+
|
88
|
+
out_dir = File.join(config['path'], '_site')
|
89
|
+
in_dir = File.join(config['path'], '_pub', '.')
|
90
|
+
|
91
|
+
FileUtils.cp_r in_dir , out_dir
|
92
|
+
hidden = Dir.glob("#{in_dir}*").select do |file|
|
93
|
+
File.basename(file) != '.' && File.basename(file) != '..'
|
94
|
+
end
|
95
|
+
FileUtils.cp_r hidden , out_dir
|
96
|
+
end
|
97
|
+
|
98
|
+
# @param [Boolean] all Get all content or only published content
|
99
|
+
# @return [Array<Content>] Contents
|
100
|
+
def contents(all)
|
101
|
+
return all_content if all
|
102
|
+
all_content.select { |c| c.published }
|
103
|
+
end
|
104
|
+
|
105
|
+
# @return [Array<Content>] All post and page content
|
106
|
+
def all_content
|
107
|
+
[Post.all, Page.all].flatten
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
data/lib/{page.rb → wst/page.rb}
RENAMED
data/lib/{post.rb → wst/post.rb}
RENAMED
data/lib/wst/reader.rb
ADDED
@@ -1,9 +1,9 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
require 'post'
|
3
|
-
require 'page'
|
4
|
-
require 'haml_content'
|
5
|
-
require 'md_renderer'
|
6
|
-
require 'haml_renderer'
|
2
|
+
require 'wst/post'
|
3
|
+
require 'wst/page'
|
4
|
+
require 'wst/haml_content'
|
5
|
+
require 'wst/md_renderer'
|
6
|
+
require 'wst/haml_renderer'
|
7
7
|
|
8
8
|
module Wst
|
9
9
|
module RendererFactory
|
data/lib/wst.rb
CHANGED
@@ -1,110 +1,2 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
require '
|
3
|
-
require 'post'
|
4
|
-
require 'page'
|
5
|
-
require 'renderer_factory'
|
6
|
-
require 'css_renderer'
|
7
|
-
require 'js_renderer'
|
8
|
-
require 'configuration'
|
9
|
-
require 'logging'
|
10
|
-
require 'colored'
|
11
|
-
require 'uglifier'
|
12
|
-
|
13
|
-
module Wst
|
14
|
-
class Wst
|
15
|
-
include Logging
|
16
|
-
include Configuration
|
17
|
-
|
18
|
-
def initialize
|
19
|
-
@css_renderer = CssRenderer.new
|
20
|
-
@js_renderer = JsRenderer.new
|
21
|
-
end
|
22
|
-
|
23
|
-
# @param [Boolean] all Generate all content or only published content
|
24
|
-
def generate(all = false)
|
25
|
-
init
|
26
|
-
css
|
27
|
-
js
|
28
|
-
content all
|
29
|
-
pub
|
30
|
-
end
|
31
|
-
|
32
|
-
# Compile all css files
|
33
|
-
def css
|
34
|
-
@css_renderer.generate_all
|
35
|
-
end
|
36
|
-
|
37
|
-
# Compile a single css file
|
38
|
-
# @param [String] css_name Css name to compile
|
39
|
-
def compile_css(css_name)
|
40
|
-
@css_renderer.compile css_name
|
41
|
-
end
|
42
|
-
|
43
|
-
# Compile all js files
|
44
|
-
def js
|
45
|
-
@js_renderer.generate_all
|
46
|
-
end
|
47
|
-
|
48
|
-
# Compile a single js file
|
49
|
-
# @param [String] js_name Js name to compile
|
50
|
-
def compile_js(js_name)
|
51
|
-
@js_renderer.compile js_name
|
52
|
-
end
|
53
|
-
|
54
|
-
private
|
55
|
-
|
56
|
-
def init
|
57
|
-
logger.info 'Clean'.blue
|
58
|
-
FileUtils.mkdir_p File.join config['path'], '_site'
|
59
|
-
FileUtils.rm_rf Dir.glob File.join config['path'], '_site/*'
|
60
|
-
end
|
61
|
-
|
62
|
-
#def kss
|
63
|
-
# return unless config.has_key? 'assets'
|
64
|
-
# return unless config['assets'].has_key? 'css'
|
65
|
-
# css_conf = config['assets']['css']
|
66
|
-
# return unless css_conf.kind_of? Array
|
67
|
-
|
68
|
-
# logger.info 'KSS'.blue
|
69
|
-
# css_conf.each do |css_name|
|
70
|
-
# logger.info " #{css_name}"
|
71
|
-
# compile_css_expanded css_name
|
72
|
-
# end
|
73
|
-
#end
|
74
|
-
|
75
|
-
# @param [Boolean] all Generate all content or only published content
|
76
|
-
def content(all)
|
77
|
-
logger.info 'Content'.blue
|
78
|
-
contents(all).each do |doc|
|
79
|
-
logger.info " #{doc.content_url}"
|
80
|
-
renderer = RendererFactory.for doc
|
81
|
-
renderer.write_to_site
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
def pub
|
86
|
-
logger.info 'Pub'.blue
|
87
|
-
|
88
|
-
out_dir = File.join(config['path'], '_site')
|
89
|
-
in_dir = File.join(config['path'], '_pub', '.')
|
90
|
-
|
91
|
-
FileUtils.cp_r in_dir , out_dir
|
92
|
-
hidden = Dir.glob("#{in_dir}*").select do |file|
|
93
|
-
File.basename(file) != '.' && File.basename(file) != '..'
|
94
|
-
end
|
95
|
-
FileUtils.cp_r hidden , out_dir
|
96
|
-
end
|
97
|
-
|
98
|
-
# @param [Boolean] all Get all content or only published content
|
99
|
-
# @return [Array<Content>] Contents
|
100
|
-
def contents(all)
|
101
|
-
return all_content if all
|
102
|
-
all_content.select { |c| c.published }
|
103
|
-
end
|
104
|
-
|
105
|
-
# @return [Array<Content>] All post and page content
|
106
|
-
def all_content
|
107
|
-
[Post.all, Page.all].flatten
|
108
|
-
end
|
109
|
-
end
|
110
|
-
end
|
2
|
+
require 'wst/main'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wst
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yves Brissaud
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: haml
|
@@ -133,23 +133,25 @@ files:
|
|
133
133
|
- bin/wst
|
134
134
|
- bin/wst-serve
|
135
135
|
- lib/.editorconfig
|
136
|
-
- lib/colored.rb
|
137
|
-
- lib/configuration.rb
|
138
|
-
- lib/content.rb
|
139
|
-
- lib/css_renderer.rb
|
140
|
-
- lib/haml_content.rb
|
141
|
-
- lib/haml_helpers_wlt_extensions.rb
|
142
|
-
- lib/haml_renderer.rb
|
143
|
-
- lib/html_with_pygments.rb
|
144
|
-
- lib/js_renderer.rb
|
145
|
-
- lib/logging.rb
|
146
|
-
- lib/md_content.rb
|
147
|
-
- lib/md_renderer.rb
|
148
|
-
- lib/page.rb
|
149
|
-
- lib/post.rb
|
150
|
-
- lib/renderer.rb
|
151
|
-
- lib/renderer_factory.rb
|
152
136
|
- lib/wst.rb
|
137
|
+
- lib/wst/colored.rb
|
138
|
+
- lib/wst/configuration.rb
|
139
|
+
- lib/wst/content.rb
|
140
|
+
- lib/wst/css_renderer.rb
|
141
|
+
- lib/wst/haml_content.rb
|
142
|
+
- lib/wst/haml_helpers_wlt_extensions.rb
|
143
|
+
- lib/wst/haml_renderer.rb
|
144
|
+
- lib/wst/html_with_pygments.rb
|
145
|
+
- lib/wst/js_renderer.rb
|
146
|
+
- lib/wst/logging.rb
|
147
|
+
- lib/wst/main.rb
|
148
|
+
- lib/wst/md_content.rb
|
149
|
+
- lib/wst/md_renderer.rb
|
150
|
+
- lib/wst/page.rb
|
151
|
+
- lib/wst/post.rb
|
152
|
+
- lib/wst/reader.rb
|
153
|
+
- lib/wst/renderer.rb
|
154
|
+
- lib/wst/renderer_factory.rb
|
153
155
|
homepage: https://github.com/eunomie/wst
|
154
156
|
licenses:
|
155
157
|
- MIT
|