pith 0.3.4 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +20 -0
- data/README.markdown +9 -7
- data/bin/pith +9 -3
- data/features/cleanup.feature +10 -2
- data/features/incremental_rebuild.feature +31 -0
- data/features/link_attributes.feature +37 -0
- data/features/relative_linking.feature +26 -0
- data/features/step_definitions/build_steps.rb +4 -0
- data/lib/pith/config.rb +2 -2
- data/lib/pith/input.rb +2 -1
- data/lib/pith/plugins/publication/input.rb +6 -4
- data/lib/pith/project.rb +30 -18
- data/lib/pith/render_context.rb +27 -12
- data/lib/pith/server.rb +4 -6
- data/lib/pith/version.rb +1 -1
- data/spec/pith/config_spec.rb +13 -1
- data/spec/pith/plugins/publication_spec.rb +16 -1
- data/spec/pith/server_spec.rb +1 -1
- metadata +43 -7
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2010 Mike Williams <mdub@dogbiscuit.org>
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.markdown
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Pith
|
1
|
+
Pith [![Build Status](https://secure.travis-ci.org/mdub/pith.png?branch=master)](http://travis-ci.org/mdub/pith)
|
2
2
|
====
|
3
3
|
|
4
4
|
Pith is a static website generator, written in Ruby.
|
@@ -159,7 +159,7 @@ Any path beginning with a slash ("/") is resolved relative to the root of the si
|
|
159
159
|
There's also a "`link`" function, for even easier hyper-linking:
|
160
160
|
|
161
161
|
link("other.html", "Other page")
|
162
|
-
|
162
|
+
|
163
163
|
Configuring Pith
|
164
164
|
----------------
|
165
165
|
|
@@ -214,6 +214,8 @@ For even quicker prototyping, Pith includes a simple HTTP server. Start it by u
|
|
214
214
|
|
215
215
|
Pith will incrementally re-build the site as you browse -- that is, if you alter any input files, Pith will regenerate the affected outputs.
|
216
216
|
|
217
|
+
Add the "`--live`" option to "`serve`" to enable [Live.js][livejs]), for live-reloading of HTML, CSS and Javascript.
|
218
|
+
|
217
219
|
Plugins
|
218
220
|
-------
|
219
221
|
|
@@ -221,7 +223,7 @@ Pith includes a couple of optional "plugins". Actually, "plugin" is a bit stron
|
|
221
223
|
|
222
224
|
### Publication plugin
|
223
225
|
|
224
|
-
The 'publication' plugin makes it easier to build a weblog using Pith.
|
226
|
+
The 'publication' plugin makes it easier to build a weblog using Pith.
|
225
227
|
|
226
228
|
Enable it by requiring it in your "`config.rb`", like so:
|
227
229
|
|
@@ -229,12 +231,12 @@ Enable it by requiring it in your "`config.rb`", like so:
|
|
229
231
|
|
230
232
|
Now you can specify a "published" date/time in the metadata of any pages you consider to be "articles", e.g.
|
231
233
|
|
232
|
-
---
|
234
|
+
---
|
233
235
|
title: Introducing ShamRack
|
234
236
|
published: 3-July-2009, 15:50
|
235
237
|
...
|
236
238
|
|
237
|
-
This exposes "`page.published_at`" for use in your templates.
|
239
|
+
This exposes "`page.published_at`" for use in your templates.
|
238
240
|
|
239
241
|
In addition, "`project.published_inputs`" lists all the pages that have such a timestamp, in order of publication, making it easy to build index pages and XML feeds. Here's a example, used to build the article index for [dogbiscuit.org](http://dogbiscuit.org/mdub/weblog):
|
240
242
|
|
@@ -255,11 +257,11 @@ The Compass plugin gives you the full power of [Compass][compass] in your Sass s
|
|
255
257
|
require "pith/plugins/compass"
|
256
258
|
|
257
259
|
Note that if you're using Bundler, you'll also need to include the Compass gem in your `Gemfile`.
|
258
|
-
|
260
|
+
|
259
261
|
gem "compass"
|
260
262
|
|
261
263
|
[tilt]: http://github.com/rtomayko/tilt/
|
262
264
|
[haml]: http://haml-lang.com
|
263
265
|
[sass]: http://sass-lang.com
|
264
266
|
[compass]: http://compass-style.org
|
265
|
-
|
267
|
+
[livejs]: http://livejs.com
|
data/bin/pith
CHANGED
@@ -47,9 +47,13 @@ class PithCommand < Clamp::Command
|
|
47
47
|
end
|
48
48
|
|
49
49
|
subcommand "serve", "Serve the generated website" do
|
50
|
+
|
51
|
+
option ["-L", "--live"], :flag, "automatically reload changes"
|
52
|
+
|
50
53
|
def execute
|
51
|
-
serve
|
54
|
+
serve(:auto_reload => live?)
|
52
55
|
end
|
56
|
+
|
53
57
|
end
|
54
58
|
|
55
59
|
protected
|
@@ -83,9 +87,11 @@ class PithCommand < Clamp::Command
|
|
83
87
|
Pith::Watcher.new(project, :interval => interval).call
|
84
88
|
end
|
85
89
|
|
86
|
-
def serve
|
90
|
+
def serve(options = {})
|
87
91
|
require "pith/server"
|
88
|
-
|
92
|
+
project.sync
|
93
|
+
project.listen_for_changes
|
94
|
+
server = Pith::Server.new(project, options)
|
89
95
|
puts %{>>> Now taking the Pith at "http://localhost:#{port}"}
|
90
96
|
Rack::Handler.get("thin").run(server, :Port => port)
|
91
97
|
end
|
data/features/cleanup.feature
CHANGED
@@ -5,10 +5,18 @@ Feature: automatic cleanup
|
|
5
5
|
|
6
6
|
Scenario: output without matching input
|
7
7
|
|
8
|
+
Given output file "blah.txt" exists
|
9
|
+
|
10
|
+
When I build the site
|
11
|
+
|
12
|
+
Then output file "blah.txt" should not exist
|
13
|
+
|
14
|
+
Scenario: input removed
|
15
|
+
|
8
16
|
Given input file "blah.txt" exists
|
9
|
-
|
17
|
+
|
10
18
|
When I build the site
|
11
19
|
And I remove input file "blah.txt"
|
12
20
|
And I rebuild the site
|
13
|
-
|
21
|
+
|
14
22
|
Then output file "blah.txt" should not exist
|
@@ -70,3 +70,34 @@ Scenario: delete a dependency
|
|
70
70
|
<p>banana</p>
|
71
71
|
"""
|
72
72
|
|
73
|
+
Scenario: alter meta-data
|
74
|
+
|
75
|
+
Given input file "index.html.haml" contains
|
76
|
+
"""
|
77
|
+
- project.inputs.select do |input|
|
78
|
+
- output.record_dependency_on(input)
|
79
|
+
- if input.meta["flavour"]
|
80
|
+
%p= input.meta["flavour"]
|
81
|
+
"""
|
82
|
+
|
83
|
+
And input file "page.html.haml" contains
|
84
|
+
"""
|
85
|
+
---
|
86
|
+
flavour: Chocolate
|
87
|
+
---
|
88
|
+
"""
|
89
|
+
|
90
|
+
When I build the site
|
91
|
+
Then output file "index.html" should contain "<p>Chocolate</p>"
|
92
|
+
|
93
|
+
When I change input file "page.html.haml" to contain
|
94
|
+
"""
|
95
|
+
---
|
96
|
+
flavour: Strawberry
|
97
|
+
---
|
98
|
+
"""
|
99
|
+
|
100
|
+
And I rebuild the site
|
101
|
+
|
102
|
+
Then output file "index.html" should be re-generated
|
103
|
+
Then output file "index.html" should contain "<p>Strawberry</p>"
|
@@ -0,0 +1,37 @@
|
|
1
|
+
Feature: link method with attributes
|
2
|
+
|
3
|
+
I want to be able to pass arguments to the link method
|
4
|
+
So that additional attributes are generated
|
5
|
+
|
6
|
+
Scenario: link with class attribute
|
7
|
+
|
8
|
+
Given input file "index.html.haml" contains
|
9
|
+
"""
|
10
|
+
= link("page.html", "Page", :class => 'active')
|
11
|
+
"""
|
12
|
+
And input file "page.html" exists
|
13
|
+
|
14
|
+
When I build the site
|
15
|
+
Then output file "index.html" should contain /<a [class="active", href="page.html"]/
|
16
|
+
|
17
|
+
Scenario: link with title attribute
|
18
|
+
|
19
|
+
Given input file "index.html.haml" contains
|
20
|
+
"""
|
21
|
+
= link("page.html", "Page", :title => 'click me')
|
22
|
+
"""
|
23
|
+
And input file "page.html" exists
|
24
|
+
|
25
|
+
When I build the site
|
26
|
+
Then output file "index.html" should contain /<a [title="click me", href="page.html"]/
|
27
|
+
|
28
|
+
Scenario: link with title and class attributes
|
29
|
+
|
30
|
+
Given input file "index.html.haml" contains
|
31
|
+
"""
|
32
|
+
= link("page.html", "Page", :title => 'click me', :class => 'active')
|
33
|
+
"""
|
34
|
+
And input file "page.html" exists
|
35
|
+
|
36
|
+
When I build the site
|
37
|
+
Then output file "index.html" should contain /<a [title="click me", class="active", href="page.html"]/
|
@@ -31,6 +31,32 @@ Scenario: link from a sub-directory to a root-level page
|
|
31
31
|
<a href="../help.html">Help</a>
|
32
32
|
"""
|
33
33
|
|
34
|
+
Scenario: link to an absolute url
|
35
|
+
|
36
|
+
Given input file "index.html.haml" contains
|
37
|
+
"""
|
38
|
+
= link("http://example.com", "Go to example.com")
|
39
|
+
"""
|
40
|
+
|
41
|
+
When I build the site
|
42
|
+
Then output file "index.html" should contain
|
43
|
+
"""
|
44
|
+
<a href="http://example.com">Go to example.com</a>
|
45
|
+
"""
|
46
|
+
|
47
|
+
Scenario: link to a (secure) absolute url
|
48
|
+
|
49
|
+
Given input file "index.html.haml" contains
|
50
|
+
"""
|
51
|
+
= link("https://example.com", "Securely go to example.com")
|
52
|
+
"""
|
53
|
+
|
54
|
+
When I build the site
|
55
|
+
Then output file "index.html" should contain
|
56
|
+
"""
|
57
|
+
<a href="https://example.com">Securely go to example.com</a>
|
58
|
+
"""
|
59
|
+
|
34
60
|
Scenario: link to an image
|
35
61
|
|
36
62
|
Given input file "subdir/page.html.haml" contains
|
@@ -10,6 +10,10 @@ Given /^input file "([^\"]*)" exists$/ do |path|
|
|
10
10
|
step %{input file "#{path}" contains "something"}
|
11
11
|
end
|
12
12
|
|
13
|
+
Given /^output file "([^\"]*)" exists$/ do |path|
|
14
|
+
@outputs.write(path, "something", :mtime => (Time.now - 4))
|
15
|
+
end
|
16
|
+
|
13
17
|
Given "the site is up-to-date" do
|
14
18
|
step "I build the site"
|
15
19
|
end
|
data/lib/pith/config.rb
CHANGED
data/lib/pith/input.rb
CHANGED
@@ -188,7 +188,7 @@ module Pith
|
|
188
188
|
end
|
189
189
|
end
|
190
190
|
|
191
|
-
YamlParseError = defined?(Psych) ? Psych::SyntaxError : ArgumentError
|
191
|
+
YamlParseError = defined?(Psych::SyntaxError) ? Psych::SyntaxError : ArgumentError
|
192
192
|
|
193
193
|
def read_meta(io)
|
194
194
|
header = io.gets
|
@@ -212,6 +212,7 @@ module Pith
|
|
212
212
|
def unload
|
213
213
|
logger.debug "unloading #{path}"
|
214
214
|
@load_time = nil
|
215
|
+
@meta = nil
|
215
216
|
end
|
216
217
|
|
217
218
|
def logger
|
@@ -12,17 +12,19 @@ module Pith
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def published_at
|
15
|
-
|
15
|
+
parse_timestamp(meta["published"])
|
16
16
|
end
|
17
17
|
|
18
18
|
def updated_at
|
19
|
-
|
19
|
+
parse_timestamp(meta["updated"]) || published_at
|
20
20
|
end
|
21
21
|
|
22
22
|
private
|
23
23
|
|
24
|
-
def
|
25
|
-
|
24
|
+
def parse_timestamp(arg)
|
25
|
+
return unless arg
|
26
|
+
return arg.to_time if arg.respond_to?(:to_time)
|
27
|
+
Time.parse(arg.to_s)
|
26
28
|
end
|
27
29
|
|
28
30
|
end
|
data/lib/pith/project.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require "listen"
|
1
2
|
require "logger"
|
2
3
|
require "pith/config_provider"
|
3
4
|
require "pith/input"
|
@@ -5,6 +6,7 @@ require "pith/pathname_ext"
|
|
5
6
|
require "pith/reference_error"
|
6
7
|
require "set"
|
7
8
|
require "tilt"
|
9
|
+
require "thread"
|
8
10
|
|
9
11
|
module Pith
|
10
12
|
|
@@ -13,12 +15,15 @@ module Pith
|
|
13
15
|
def initialize(input_dir, output_dir = nil, attributes = {})
|
14
16
|
@input_dir = Pathname(input_dir)
|
15
17
|
@output_dir = output_dir ? Pathname(output_dir) : (@input_dir + "_out")
|
16
|
-
@
|
17
|
-
@output_map = {}
|
18
|
+
@logger = Logger.new(nil)
|
18
19
|
attributes.each do |k,v|
|
19
20
|
send("#{k}=", v)
|
20
21
|
end
|
21
|
-
|
22
|
+
@input_map = {}
|
23
|
+
@output_map = {}
|
24
|
+
@mtimes ||= {}
|
25
|
+
@config_provider ||= Pith::ConfigProvider.new(self)
|
26
|
+
@mutex = Mutex.new
|
22
27
|
end
|
23
28
|
|
24
29
|
attr_reader :input_dir
|
@@ -74,16 +79,18 @@ module Pith
|
|
74
79
|
# Public: re-sync with the file-system.
|
75
80
|
#
|
76
81
|
def sync
|
77
|
-
|
78
|
-
|
82
|
+
@mutex.synchronize do
|
83
|
+
config_provider.sync
|
84
|
+
sync_input_files
|
85
|
+
cleanup_output_files
|
86
|
+
end
|
79
87
|
end
|
80
88
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
89
|
+
# Public: start a Thread to automatically sync when inputs change.
|
90
|
+
#
|
91
|
+
def listen_for_changes
|
92
|
+
Listen.to(input_dir.to_s) do
|
85
93
|
sync
|
86
|
-
@next_sync = now + period
|
87
94
|
end
|
88
95
|
end
|
89
96
|
|
@@ -98,13 +105,8 @@ module Pith
|
|
98
105
|
output_dir.mtime
|
99
106
|
end
|
100
107
|
|
101
|
-
|
102
|
-
|
103
|
-
end
|
104
|
-
|
105
|
-
def config_provider
|
106
|
-
@config_provider ||= Pith::ConfigProvider.new(self)
|
107
|
-
end
|
108
|
+
attr_reader :logger
|
109
|
+
attr_reader :config_provider
|
108
110
|
|
109
111
|
def config
|
110
112
|
config_provider.config
|
@@ -115,7 +117,6 @@ module Pith
|
|
115
117
|
attr_writer :logger
|
116
118
|
|
117
119
|
def sync_input_files
|
118
|
-
@mtimes ||= {}
|
119
120
|
removed_paths = @mtimes.keys
|
120
121
|
Pathname.glob(input_dir + "**/*", File::FNM_DOTMATCH) do |file|
|
121
122
|
next unless file.file?
|
@@ -138,6 +139,17 @@ module Pith
|
|
138
139
|
end
|
139
140
|
end
|
140
141
|
|
142
|
+
def cleanup_output_files
|
143
|
+
Pathname.glob(output_dir + "**/*", File::FNM_DOTMATCH) do |file|
|
144
|
+
next unless file.file?
|
145
|
+
path = file.relative_path_from(output_dir)
|
146
|
+
unless output(path)
|
147
|
+
logger.info "XXX #{path}"
|
148
|
+
FileUtils.rm_f(file)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
141
153
|
def file_added(path)
|
142
154
|
i = Input.new(self, path)
|
143
155
|
i.when_added
|
data/lib/pith/render_context.rb
CHANGED
@@ -32,9 +32,9 @@ module Pith
|
|
32
32
|
|
33
33
|
def render(input, locals = {}, &block)
|
34
34
|
with_input(input) do
|
35
|
-
result
|
35
|
+
result = input.render(self, locals, &block)
|
36
36
|
layout_ref = input.meta["layout"]
|
37
|
-
result
|
37
|
+
result = render_ref(layout_ref) { result } if layout_ref
|
38
38
|
result
|
39
39
|
end
|
40
40
|
end
|
@@ -65,21 +65,36 @@ module Pith
|
|
65
65
|
relative_url_to(resolve_reference(target_ref))
|
66
66
|
end
|
67
67
|
|
68
|
-
def link(target_ref, label = nil)
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
68
|
+
def link(target_ref, label = nil, attrs={})
|
69
|
+
if absolute_url?(target_ref)
|
70
|
+
attrs['href'] = target_ref
|
71
|
+
else
|
72
|
+
target_path = resolve_reference(target_ref)
|
73
|
+
attrs['href'] = relative_url_to(target_path)
|
74
|
+
label ||= begin
|
75
|
+
target_input = input(target_path)
|
76
|
+
output.record_dependency_on(target_input)
|
77
|
+
target_input.title
|
78
|
+
rescue ReferenceError
|
79
|
+
"???"
|
80
|
+
end
|
76
81
|
end
|
77
|
-
|
78
|
-
|
82
|
+
|
83
|
+
# Loop through attrs hash, flatten the key, value
|
84
|
+
# pairs for appending to the dom element/link
|
85
|
+
attrs_flatten = attrs.each_pair.collect do |key, value|
|
86
|
+
%Q{#{key}="#{value}"}
|
87
|
+
end.join(' ')
|
88
|
+
|
89
|
+
"<a #{attrs_flatten}>#{label}</a>"
|
79
90
|
end
|
80
91
|
|
81
92
|
private
|
82
93
|
|
94
|
+
def absolute_url?(ref)
|
95
|
+
ref.respond_to?(:to_str) && ref.to_str =~ %r{^\w+:/}
|
96
|
+
end
|
97
|
+
|
83
98
|
def resolve_reference(ref)
|
84
99
|
if ref.kind_of?(Pith::Input)
|
85
100
|
raise(ReferenceError, %{No output for "#{ref.path}"}) if ref.output.nil?
|
data/lib/pith/server.rb
CHANGED
@@ -1,16 +1,16 @@
|
|
1
|
-
require "rack"
|
2
1
|
require "pathname"
|
3
|
-
require "
|
2
|
+
require "rack"
|
3
|
+
require "rack/livejs"
|
4
4
|
|
5
5
|
module Pith
|
6
6
|
|
7
7
|
module Server
|
8
8
|
|
9
|
-
def new(project)
|
9
|
+
def new(project, options = {})
|
10
10
|
Rack::Builder.new do
|
11
|
-
use Rack::CommonLogger
|
12
11
|
use Rack::ShowExceptions
|
13
12
|
use Rack::Lint
|
13
|
+
use Rack::Livejs if options[:auto_reload]
|
14
14
|
use Pith::Server::OutputFinder, project
|
15
15
|
run Rack::Directory.new(project.output_dir)
|
16
16
|
end
|
@@ -27,8 +27,6 @@ module Pith
|
|
27
27
|
|
28
28
|
def call(env)
|
29
29
|
|
30
|
-
@project.sync_every(1)
|
31
|
-
|
32
30
|
path_info = ::Rack::Utils.unescape(env["PATH_INFO"])
|
33
31
|
ends_with_slash = (path_info[-1] == '/')
|
34
32
|
|
data/lib/pith/version.rb
CHANGED
data/spec/pith/config_spec.rb
CHANGED
@@ -23,7 +23,19 @@ describe Pith::Config do
|
|
23
23
|
|
24
24
|
it "adds to ignore_patterns" do
|
25
25
|
config.ignore("foo")
|
26
|
-
config.ignore_patterns
|
26
|
+
config.ignore_patterns.should be_member('foo')
|
27
|
+
end
|
28
|
+
|
29
|
+
it "adds multiple patterns to ignore_patterns (when passed multiple arguments)" do
|
30
|
+
config.ignore("foo", "bar")
|
31
|
+
config.ignore_patterns.should be_member('foo')
|
32
|
+
config.ignore_patterns.should be_member('bar')
|
33
|
+
end
|
34
|
+
|
35
|
+
it "adds multiple patterns to ignore_patterns (when passed an array)" do
|
36
|
+
config.ignore(["foo", "bar"])
|
37
|
+
config.ignore_patterns.should be_member('foo')
|
38
|
+
config.ignore_patterns.should be_member('bar')
|
27
39
|
end
|
28
40
|
|
29
41
|
end
|
@@ -19,6 +19,16 @@ describe Pith::Plugins::Publication::TemplateMethods do
|
|
19
19
|
@template.published_at.should == Time.local(1999, 12, 25, 22, 30)
|
20
20
|
end
|
21
21
|
|
22
|
+
it "honours any parsing (of Time) that yaml may do on the 'published' meta-field" do
|
23
|
+
@template.meta["published"] = Time.local(1999, 12, 25, 22, 30)
|
24
|
+
@template.published_at.should == Time.local(1999, 12, 25, 22, 30)
|
25
|
+
end
|
26
|
+
|
27
|
+
it "honours any parsing (to Date) of time that yaml may do on the 'published' meta-field" do
|
28
|
+
@template.meta["published"] = Date.new(1999, 12, 25)
|
29
|
+
@template.published_at.should == Time.local(1999, 12, 25)
|
30
|
+
end
|
31
|
+
|
22
32
|
end
|
23
33
|
|
24
34
|
describe "#updated_at" do
|
@@ -30,9 +40,14 @@ describe Pith::Plugins::Publication::TemplateMethods do
|
|
30
40
|
|
31
41
|
it "can be overridden with an 'updated' meta-field" do
|
32
42
|
@template.meta["published"] = "25 Dec 1999 22:30"
|
33
|
-
@template.meta["
|
43
|
+
@template.meta["updated"] = "1 Jan 2000 03:00"
|
34
44
|
@template.updated_at.should == Time.local(2000, 1, 1, 3, 0)
|
35
45
|
end
|
46
|
+
|
47
|
+
it "honours any parsing of time that yaml may do on the 'updated' meta-field" do
|
48
|
+
@template.meta["updated"] = Date.new(2000, 1, 1)
|
49
|
+
@template.updated_at.should == Time.local(2000, 1, 1)
|
50
|
+
end
|
36
51
|
|
37
52
|
end
|
38
53
|
|
data/spec/pith/server_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pith
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,14 +9,14 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-03-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: tilt
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: '1.3'
|
22
22
|
type: :runtime
|
@@ -24,7 +24,7 @@ dependencies:
|
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '1.3'
|
30
30
|
- !ruby/object:Gem::Dependency
|
@@ -75,6 +75,38 @@ dependencies:
|
|
75
75
|
- - ! '>='
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: 0.3.0
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: listen
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ~>
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '1.2'
|
86
|
+
type: :runtime
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '1.2'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: rack-livejs
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: 0.2.1
|
102
|
+
type: :runtime
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 0.2.1
|
78
110
|
description: ! 'Pith builds static websites, using markup/template languages including
|
79
111
|
Haml, Sass, ERb, Liquid, Markdown and Textile.
|
80
112
|
|
@@ -123,6 +155,7 @@ files:
|
|
123
155
|
- sample/index.html.haml
|
124
156
|
- sample/stylesheets/app.css.sass
|
125
157
|
- README.markdown
|
158
|
+
- LICENSE
|
126
159
|
- Rakefile
|
127
160
|
- spec/pith/config_spec.rb
|
128
161
|
- spec/pith/input_spec.rb
|
@@ -148,6 +181,7 @@ files:
|
|
148
181
|
- features/incremental_rebuild.feature~
|
149
182
|
- features/layouts.feature
|
150
183
|
- features/layouts.feature~
|
184
|
+
- features/link_attributes.feature
|
151
185
|
- features/linking.feature~
|
152
186
|
- features/markdown.feature
|
153
187
|
- features/metadata.feature
|
@@ -168,7 +202,8 @@ files:
|
|
168
202
|
- cucumber.yml
|
169
203
|
- bin/pith
|
170
204
|
homepage: http://github.com/mdub/pith
|
171
|
-
licenses:
|
205
|
+
licenses:
|
206
|
+
- MIT
|
172
207
|
post_install_message:
|
173
208
|
rdoc_options: []
|
174
209
|
require_paths:
|
@@ -181,7 +216,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
181
216
|
version: '0'
|
182
217
|
segments:
|
183
218
|
- 0
|
184
|
-
hash: -
|
219
|
+
hash: -2482242163062205897
|
185
220
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
186
221
|
none: false
|
187
222
|
requirements:
|
@@ -190,7 +225,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
190
225
|
version: '0'
|
191
226
|
segments:
|
192
227
|
- 0
|
193
|
-
hash: -
|
228
|
+
hash: -2482242163062205897
|
194
229
|
requirements: []
|
195
230
|
rubyforge_project:
|
196
231
|
rubygems_version: 1.8.23
|
@@ -223,6 +258,7 @@ test_files:
|
|
223
258
|
- features/incremental_rebuild.feature~
|
224
259
|
- features/layouts.feature
|
225
260
|
- features/layouts.feature~
|
261
|
+
- features/link_attributes.feature
|
226
262
|
- features/linking.feature~
|
227
263
|
- features/markdown.feature
|
228
264
|
- features/metadata.feature
|