pith 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -188,6 +188,8 @@ module Pith
188
188
  end
189
189
  end
190
190
 
191
+ YamlParseError = defined?(Psych) ? Psych::SyntaxError : ArgumentError
192
+
191
193
  def read_meta(io)
192
194
  header = io.gets
193
195
  if header =~ /^---/
@@ -197,7 +199,7 @@ module Pith
197
199
  end
198
200
  begin
199
201
  @meta = YAML.load(header)
200
- rescue ArgumentError, SyntaxError
202
+ rescue YamlParseError
201
203
  logger.warn "#{file}:1: badly-formed YAML header"
202
204
  end
203
205
  else
@@ -116,7 +116,7 @@ module Pith
116
116
 
117
117
  def sync_input_files
118
118
  @mtimes ||= {}
119
- removed_file_paths = @mtimes.keys
119
+ removed_paths = @mtimes.keys
120
120
  Pathname.glob(input_dir + "**/*", File::FNM_DOTMATCH) do |file|
121
121
  next unless file.file?
122
122
  next if file.in?(output_dir)
@@ -124,20 +124,21 @@ module Pith
124
124
  path = file.relative_path_from(input_dir)
125
125
  if @mtimes.has_key?(path)
126
126
  if @mtimes[path] < mtime
127
- when_file_modified(path)
127
+ file_modified(path)
128
128
  end
129
129
  else
130
- when_file_added(path)
130
+ file_added(path)
131
131
  end
132
132
  @mtimes[path] = mtime
133
- removed_file_paths.delete(path)
133
+ removed_paths.delete(path)
134
134
  end
135
- removed_file_paths.each do |path|
136
- when_file_removed(path)
135
+ removed_paths.each do |path|
136
+ @mtimes.delete(path)
137
+ file_removed(path)
137
138
  end
138
139
  end
139
140
 
140
- def when_file_added(path)
141
+ def file_added(path)
141
142
  i = Input.new(self, path)
142
143
  i.when_added
143
144
  @input_map[path] = i
@@ -146,11 +147,11 @@ module Pith
146
147
  end
147
148
  end
148
149
 
149
- def when_file_modified(path)
150
+ def file_modified(path)
150
151
  @input_map[path].when_modified
151
152
  end
152
153
 
153
- def when_file_removed(path)
154
+ def file_removed(path)
154
155
  i = @input_map.delete(path)
155
156
  i.when_removed
156
157
  if o = i.output
@@ -1,3 +1,3 @@
1
1
  module Pith
2
- VERSION = "0.3.3".freeze
2
+ VERSION = "0.3.4".freeze
3
3
  end
@@ -108,6 +108,10 @@ describe Pith::Project do
108
108
  end
109
109
  end
110
110
 
111
+ it "doesn't confuse subsequent calls to #sync" do
112
+ proc { @project.sync }.should_not raise_error
113
+ end
114
+
111
115
  end
112
116
 
113
117
  end
metadata CHANGED
@@ -1,71 +1,80 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pith
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Mike Williams
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-03-30 00:00:00.000000000 Z
12
+ date: 2013-05-18 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
- prerelease: false
15
- version_requirements: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ! '>='
18
- - !ruby/object:Gem::Version
19
- version: '1.3'
20
15
  name: tilt
21
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
22
18
  requirements:
23
19
  - - ! '>='
24
20
  - !ruby/object:Gem::Version
25
21
  version: '1.3'
26
22
  type: :runtime
27
- - !ruby/object:Gem::Dependency
28
23
  prerelease: false
29
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
30
26
  requirements:
31
27
  - - ! '>='
32
28
  - !ruby/object:Gem::Version
33
- version: 1.2.1
29
+ version: '1.3'
30
+ - !ruby/object:Gem::Dependency
34
31
  name: rack
35
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
36
34
  requirements:
37
35
  - - ! '>='
38
36
  - !ruby/object:Gem::Version
39
37
  version: 1.2.1
40
38
  type: :runtime
41
- - !ruby/object:Gem::Dependency
42
39
  prerelease: false
43
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
44
42
  requirements:
45
43
  - - ! '>='
46
44
  - !ruby/object:Gem::Version
47
- version: 1.2.7
45
+ version: 1.2.1
46
+ - !ruby/object:Gem::Dependency
48
47
  name: thin
49
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
50
  requirements:
51
51
  - - ! '>='
52
52
  - !ruby/object:Gem::Version
53
53
  version: 1.2.7
54
54
  type: :runtime
55
- - !ruby/object:Gem::Dependency
56
55
  prerelease: false
57
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
58
  requirements:
59
59
  - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
- version: 0.3.0
61
+ version: 1.2.7
62
+ - !ruby/object:Gem::Dependency
62
63
  name: clamp
63
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
64
66
  requirements:
65
67
  - - ! '>='
66
68
  - !ruby/object:Gem::Version
67
69
  version: 0.3.0
68
70
  type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: 0.3.0
69
78
  description: ! 'Pith builds static websites, using markup/template languages including
70
79
  Haml, Sass, ERb, Liquid, Markdown and Textile.
71
80
 
@@ -160,26 +169,33 @@ files:
160
169
  - bin/pith
161
170
  homepage: http://github.com/mdub/pith
162
171
  licenses: []
163
- metadata: {}
164
172
  post_install_message:
165
173
  rdoc_options: []
166
174
  require_paths:
167
175
  - lib
168
176
  required_ruby_version: !ruby/object:Gem::Requirement
177
+ none: false
169
178
  requirements:
170
179
  - - ! '>='
171
180
  - !ruby/object:Gem::Version
172
181
  version: '0'
182
+ segments:
183
+ - 0
184
+ hash: -677330549993554291
173
185
  required_rubygems_version: !ruby/object:Gem::Requirement
186
+ none: false
174
187
  requirements:
175
188
  - - ! '>='
176
189
  - !ruby/object:Gem::Version
177
190
  version: '0'
191
+ segments:
192
+ - 0
193
+ hash: -677330549993554291
178
194
  requirements: []
179
195
  rubyforge_project:
180
- rubygems_version: 2.0.0
196
+ rubygems_version: 1.8.23
181
197
  signing_key:
182
- specification_version: 4
198
+ specification_version: 3
183
199
  summary: A static website generator
184
200
  test_files:
185
201
  - Rakefile
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YTFhNTdhNzIzMjAzYTVlYmNmNTc3OTNjNjhmYjJkYTQ0ZmNlNGQ4YQ==
5
- data.tar.gz: !binary |-
6
- NzYwZmEyZWU2NWFhNDc0NTZjZjY5YWZhZWRjMzg1NjgzMTcyNzhmZA==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- ZWZkZDcxYjBlNjZkNDJmNzcxZjBhYTc3OWJiZjZkOWU5ZWYyYjU1MWMyMTI4
10
- ZTAwNDhmZWM2ZjQ3MGVlYTMxMDU0ZmJiZjkxMzJkNjJiNGExZWQzMzY3ZjZm
11
- NTgxMTcwMjQwYTY4OWJlMmRhMzRhMDg5OTIzNjc4ODJiZDM5MTA=
12
- data.tar.gz: !binary |-
13
- MjEwNmJlMmRhMjM1YWI1OWI3NDQ0OTU3YzIyMDFkOTdkZTcwMTA3YmNkNDRl
14
- MmE0YzA2MzNlNTZmZDlmYjVjNTdmNmFjNGVkMTBiMzA2YTdhMjBmMGU4ZWM1
15
- OTVmZTQ3MDJhYTgxNjdlZDM3ZGY2OWE1MWVmZjIzNGFmMzg3N2I=