gumdrop 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog.md +6 -1
- data/lib/gumdrop.rb +1 -1
- data/lib/gumdrop/cli.rb +2 -2
- data/lib/gumdrop/content.rb +2 -2
- data/lib/gumdrop/generator.rb +5 -1
- data/lib/gumdrop/site.rb +12 -7
- data/lib/gumdrop/version.rb +2 -2
- metadata +2 -2
data/ChangeLog.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
|
+
# v0.7.1
|
2
|
+
- Ignore/skip (greylist/blacklist) will now include/skip generated content too.
|
3
|
+
- Quiet mode will actually be quiet.
|
4
|
+
- Made build log output more consistent.
|
5
|
+
|
1
6
|
# v0.7.0
|
2
|
-
- Initial support for sprockets js generator
|
7
|
+
- Initial support for sprockets js generator.
|
3
8
|
|
4
9
|
# v0.6.4
|
5
10
|
- Callbacks are cleared on each `Site#rescan()` to prevent duplicates.
|
data/lib/gumdrop.rb
CHANGED
data/lib/gumdrop/cli.rb
CHANGED
@@ -11,8 +11,8 @@ EOS
|
|
11
11
|
opts = Trollop::options do
|
12
12
|
banner banner_text
|
13
13
|
|
14
|
-
opt :verbose,"Verbose output"
|
15
|
-
opt :debug, "Enable debugging output"
|
14
|
+
# opt :verbose,"Verbose output"
|
15
|
+
# opt :debug, "Enable debugging output"
|
16
16
|
opt :quiet, "No console output"
|
17
17
|
|
18
18
|
if Gumdrop.in_site_folder?
|
data/lib/gumdrop/content.rb
CHANGED
@@ -58,7 +58,7 @@ module Gumdrop
|
|
58
58
|
|
59
59
|
def renderTo(context, output_path, filters=[], opts={})
|
60
60
|
return copyTo(output_path, opts) unless useLayout?
|
61
|
-
@site.report "
|
61
|
+
@site.report " rendering: #{@uri}", :warning
|
62
62
|
output= render(context)
|
63
63
|
filters.each {|f| output= f.call(output, self) }
|
64
64
|
File.open output_path, 'w' do |f|
|
@@ -74,7 +74,7 @@ module Gumdrop
|
|
74
74
|
true
|
75
75
|
end
|
76
76
|
if do_copy
|
77
|
-
@site.report "
|
77
|
+
@site.report " copying: #{@uri}", :warning
|
78
78
|
FileUtils.cp_r @full_path, output, opts
|
79
79
|
else
|
80
80
|
@site.report " (same): #{@uri}", :info
|
data/lib/gumdrop/generator.rb
CHANGED
@@ -58,7 +58,11 @@ module Gumdrop
|
|
58
58
|
@site.layouts[ "#{opts[:template]}.template" ]
|
59
59
|
end.template
|
60
60
|
end
|
61
|
-
|
61
|
+
content.ignored= site.greylist.any? {|pattern| site.path_match name, pattern }
|
62
|
+
unless content.ignored
|
63
|
+
content.ignored= site.blacklist.any? {|pattern| site.path_match name, pattern }
|
64
|
+
end
|
65
|
+
@site.report " generated: #{content.uri}", :info
|
62
66
|
@site.node_tree[content.uri]= content
|
63
67
|
end
|
64
68
|
|
data/lib/gumdrop/site.rb
CHANGED
@@ -114,6 +114,10 @@ module Gumdrop
|
|
114
114
|
@context
|
115
115
|
end
|
116
116
|
|
117
|
+
# Match a path using a glob-like file pattern
|
118
|
+
def path_match(path, pattern)
|
119
|
+
File.fnmatch pattern, path, File::FNM_PATHNAME | File::FNM_DOTMATCH | File::FNM_CASEFOLD
|
120
|
+
end
|
117
121
|
|
118
122
|
private
|
119
123
|
|
@@ -161,8 +165,13 @@ module Gumdrop
|
|
161
165
|
begin
|
162
166
|
@log = Logger.new @config.log, 'daily'
|
163
167
|
rescue
|
164
|
-
@
|
165
|
-
|
168
|
+
target= if @opts[:quiet] or @opts[:quiet_given]
|
169
|
+
nil
|
170
|
+
else
|
171
|
+
STDOUT
|
172
|
+
end
|
173
|
+
@log = Logger.new target
|
174
|
+
report "Using STDOUT for logging because of exception: #{ $! }" unless target.nil?
|
166
175
|
end
|
167
176
|
@log.formatter = proc do |severity, datetime, progname, msg|
|
168
177
|
"#{datetime}: #{msg}\n"
|
@@ -247,17 +256,13 @@ module Gumdrop
|
|
247
256
|
FileUtils.mkdir_p File.dirname(output_path)
|
248
257
|
node.renderTo render_context, output_path, content_filters
|
249
258
|
else
|
250
|
-
report "
|
259
|
+
report " ignoring: #{node.to_s}", :info
|
251
260
|
end
|
252
261
|
end
|
253
262
|
on_render(self)
|
254
263
|
end
|
255
264
|
end
|
256
265
|
|
257
|
-
# Match a path using a glob-like file pattern
|
258
|
-
def path_match(path, pattern)
|
259
|
-
File.fnmatch pattern, path, File::FNM_PATHNAME | File::FNM_DOTMATCH | File::FNM_CASEFOLD
|
260
|
-
end
|
261
266
|
end
|
262
267
|
|
263
268
|
class Sitefile
|
data/lib/gumdrop/version.rb
CHANGED