nanoc 2.2.1 → 2.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  module Nanoc
2
2
 
3
3
  # The current nanoc version.
4
- VERSION = '2.2.1'
4
+ VERSION = '2.2.2'
5
5
 
6
6
  # Generic error. Superclass for all nanoc-specific errors.
7
7
  class Error < RuntimeError ; end
@@ -108,6 +108,10 @@ module Nanoc
108
108
  end
109
109
  end
110
110
 
111
+ def inspect
112
+ "<#{self.class} path=#{self.path}>"
113
+ end
114
+
111
115
  end
112
116
 
113
117
  end
@@ -203,13 +203,14 @@ module Nanoc
203
203
  private
204
204
 
205
205
  # Computes and returns the MD5 digest for the given file.
206
- def digest(file)
206
+ def digest(filename)
207
207
  # Create hash
208
208
  incr_digest = Digest::MD5.new()
209
209
 
210
210
  # Collect data
211
- file.rewind
212
- incr_digest << file.read(1000) until file.eof?
211
+ File.open(filename, 'r') do |io|
212
+ incr_digest << io.read(1000) until io.eof?
213
+ end
213
214
 
214
215
  # Calculate hex hash
215
216
  incr_digest.hexdigest
@@ -218,7 +219,7 @@ module Nanoc
218
219
  # Compiles the asset rep, treating its contents as binary data.
219
220
  def compile_binary
220
221
  # Calculate digest before
221
- digest_before = File.file?(disk_path) ? digest(File.open(disk_path, 'r')) : nil
222
+ digest_before = File.file?(disk_path) ? digest(disk_path) : nil
222
223
 
223
224
  # Run filters
224
225
  current_file = @asset.file
@@ -242,7 +243,7 @@ module Nanoc
242
243
  FileUtils.cp(current_file.path, disk_path)
243
244
 
244
245
  # Calculate digest after
245
- digest_after = digest(current_file)
246
+ digest_after = digest(disk_path)
246
247
  @modified = (digest_after != digest_before)
247
248
  end
248
249
 
@@ -272,6 +273,10 @@ module Nanoc
272
273
  File.open(self.disk_path, 'w') { |io| io.write(current_content) }
273
274
  end
274
275
 
276
+ def inspect
277
+ "<#{self.class} name=#{self.name} asset.path=#{self.asset.path}>"
278
+ end
279
+
275
280
  end
276
281
 
277
282
  end
@@ -82,6 +82,10 @@ module Nanoc
82
82
  end
83
83
  end
84
84
 
85
+ def inspect
86
+ "<#{self.class} path=#{self.path}>"
87
+ end
88
+
85
89
  end
86
90
 
87
91
  end
@@ -123,6 +123,10 @@ module Nanoc
123
123
  end
124
124
  end
125
125
 
126
+ def inspect
127
+ "<#{self.class} path=#{self.path}>"
128
+ end
129
+
126
130
  end
127
131
 
128
132
  end
@@ -315,6 +315,10 @@ module Nanoc
315
315
  end
316
316
  end
317
317
 
318
+ def inspect
319
+ "<#{self.class} name=#{self.name} page.path=#{self.page.path}>"
320
+ end
321
+
318
322
  end
319
323
 
320
324
  end
@@ -216,7 +216,7 @@ module Nanoc::DataSources
216
216
 
217
217
  # Get content file
218
218
  content_filename = content_filename_for_dir(File.dirname(meta_filename))
219
- content_file = File.new(content_filename)
219
+ content_file = Nanoc::Extra::FileProxy.new(content_filename)
220
220
 
221
221
  # Get attributes
222
222
  attributes = { 'extension' => File.extname(content_filename)[1..-1] }.merge(meta)
@@ -9,6 +9,7 @@ require 'nanoc/filters/rainpress'
9
9
  require 'nanoc/filters/rdiscount'
10
10
  require 'nanoc/filters/rdoc'
11
11
  require 'nanoc/filters/redcloth'
12
+ require 'nanoc/filters/relativize_paths'
12
13
  require 'nanoc/filters/relativize_paths_in_css'
13
14
  require 'nanoc/filters/relativize_paths_in_html'
14
15
  require 'nanoc/filters/rubypants'
@@ -0,0 +1,16 @@
1
+ module Nanoc::Filters
2
+ class RelativizePaths < Nanoc::Filter
3
+
4
+ identifier :relativize_paths
5
+
6
+ def run(content)
7
+ raise RuntimeError.new(
8
+ "The relativize_paths filter itself does not exist anymore. " +
9
+ "If you want to relativize paths in HTML, use the " +
10
+ "relativize_paths_in_html filter; if you want to relativize paths " +
11
+ "in CSS, use the relativize_paths_in_css filter."
12
+ )
13
+ end
14
+
15
+ end
16
+ end
@@ -1,7 +1,7 @@
1
1
  module Nanoc::Filters
2
2
  class RelativizePathsInHTML < Nanoc::Filter
3
3
 
4
- identifiers :relativize_paths, :relativize_paths_in_html
4
+ identifier :relativize_paths_in_html
5
5
 
6
6
  require 'nanoc/helpers/link_to'
7
7
  include Nanoc::Helpers::LinkTo
@@ -89,7 +89,7 @@ module Nanoc::Helpers
89
89
 
90
90
  # Get source and destination paths
91
91
  dst_path = Pathname.new(path)
92
- src_path = Pathname.new((@page || @asset).path)
92
+ src_path = Pathname.new((defined?(@page) ? @page : @asset).path)
93
93
 
94
94
  # Calculate elative path (method depends on whether destination is a
95
95
  # directory or not).
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nanoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Defreyne
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-08 00:00:00 +02:00
12
+ date: 2009-05-18 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -27,15 +27,12 @@ files:
27
27
  - ChangeLog
28
28
  - Rakefile
29
29
  - bin/nanoc
30
- - lib/nanoc
31
- - lib/nanoc/base
32
30
  - lib/nanoc/base/asset.rb
33
31
  - lib/nanoc/base/asset_defaults.rb
34
32
  - lib/nanoc/base/asset_rep.rb
35
33
  - lib/nanoc/base/binary_filter.rb
36
34
  - lib/nanoc/base/code.rb
37
35
  - lib/nanoc/base/compiler.rb
38
- - lib/nanoc/base/core_ext
39
36
  - lib/nanoc/base/core_ext/hash.rb
40
37
  - lib/nanoc/base/core_ext/string.rb
41
38
  - lib/nanoc/base/core_ext.rb
@@ -48,7 +45,6 @@ files:
48
45
  - lib/nanoc/base/page_defaults.rb
49
46
  - lib/nanoc/base/page_rep.rb
50
47
  - lib/nanoc/base/plugin.rb
51
- - lib/nanoc/base/proxies
52
48
  - lib/nanoc/base/proxies/asset_proxy.rb
53
49
  - lib/nanoc/base/proxies/asset_rep_proxy.rb
54
50
  - lib/nanoc/base/proxies/layout_proxy.rb
@@ -60,12 +56,9 @@ files:
60
56
  - lib/nanoc/base/site.rb
61
57
  - lib/nanoc/base/template.rb
62
58
  - lib/nanoc/base.rb
63
- - lib/nanoc/binary_filters
64
59
  - lib/nanoc/binary_filters/image_science_thumbnail.rb
65
60
  - lib/nanoc/binary_filters.rb
66
- - lib/nanoc/cli
67
61
  - lib/nanoc/cli/base.rb
68
- - lib/nanoc/cli/commands
69
62
  - lib/nanoc/cli/commands/autocompile.rb
70
63
  - lib/nanoc/cli/commands/compile.rb
71
64
  - lib/nanoc/cli/commands/create_layout.rb
@@ -79,20 +72,16 @@ files:
79
72
  - lib/nanoc/cli/commands.rb
80
73
  - lib/nanoc/cli/logger.rb
81
74
  - lib/nanoc/cli.rb
82
- - lib/nanoc/data_sources
83
75
  - lib/nanoc/data_sources/filesystem.rb
84
76
  - lib/nanoc/data_sources/filesystem_combined.rb
85
77
  - lib/nanoc/data_sources.rb
86
- - lib/nanoc/extra
87
78
  - lib/nanoc/extra/auto_compiler.rb
88
79
  - lib/nanoc/extra/context.rb
89
- - lib/nanoc/extra/core_ext
90
80
  - lib/nanoc/extra/core_ext/hash.rb
91
81
  - lib/nanoc/extra/core_ext/time.rb
92
82
  - lib/nanoc/extra/core_ext.rb
93
83
  - lib/nanoc/extra/file_proxy.rb
94
84
  - lib/nanoc/extra/vcs.rb
95
- - lib/nanoc/extra/vcses
96
85
  - lib/nanoc/extra/vcses/bazaar.rb
97
86
  - lib/nanoc/extra/vcses/dummy.rb
98
87
  - lib/nanoc/extra/vcses/git.rb
@@ -100,7 +89,6 @@ files:
100
89
  - lib/nanoc/extra/vcses/subversion.rb
101
90
  - lib/nanoc/extra/vcses.rb
102
91
  - lib/nanoc/extra.rb
103
- - lib/nanoc/filters
104
92
  - lib/nanoc/filters/bluecloth.rb
105
93
  - lib/nanoc/filters/erb.rb
106
94
  - lib/nanoc/filters/erubis.rb
@@ -112,12 +100,12 @@ files:
112
100
  - lib/nanoc/filters/rdiscount.rb
113
101
  - lib/nanoc/filters/rdoc.rb
114
102
  - lib/nanoc/filters/redcloth.rb
103
+ - lib/nanoc/filters/relativize_paths.rb
115
104
  - lib/nanoc/filters/relativize_paths_in_css.rb
116
105
  - lib/nanoc/filters/relativize_paths_in_html.rb
117
106
  - lib/nanoc/filters/rubypants.rb
118
107
  - lib/nanoc/filters/sass.rb
119
108
  - lib/nanoc/filters.rb
120
- - lib/nanoc/helpers
121
109
  - lib/nanoc/helpers/blogging.rb
122
110
  - lib/nanoc/helpers/capturing.rb
123
111
  - lib/nanoc/helpers/filtering.rb
@@ -128,19 +116,14 @@ files:
128
116
  - lib/nanoc/helpers/text.rb
129
117
  - lib/nanoc/helpers/xml_sitemap.rb
130
118
  - lib/nanoc/helpers.rb
131
- - lib/nanoc/routers
132
119
  - lib/nanoc/routers/default.rb
133
120
  - lib/nanoc/routers/no_dirs.rb
134
121
  - lib/nanoc/routers/versioned.rb
135
122
  - lib/nanoc/routers.rb
136
123
  - lib/nanoc.rb
137
- - vendor/cri
138
124
  - vendor/cri/ChangeLog
139
- - vendor/cri/lib
140
- - vendor/cri/lib/cri
141
125
  - vendor/cri/lib/cri/base.rb
142
126
  - vendor/cri/lib/cri/command.rb
143
- - vendor/cri/lib/cri/core_ext
144
127
  - vendor/cri/lib/cri/core_ext/string.rb
145
128
  - vendor/cri/lib/cri/core_ext.rb
146
129
  - vendor/cri/lib/cri/option_parser.rb
@@ -149,13 +132,14 @@ files:
149
132
  - vendor/cri/NEWS
150
133
  - vendor/cri/Rakefile
151
134
  - vendor/cri/README
152
- - vendor/cri/test
153
135
  - vendor/cri/test/test_base.rb
154
136
  - vendor/cri/test/test_command.rb
155
137
  - vendor/cri/test/test_core_ext.rb
156
138
  - vendor/cri/test/test_option_parser.rb
157
139
  has_rdoc: true
158
140
  homepage: http://nanoc.stoneship.org/
141
+ licenses: []
142
+
159
143
  post_install_message: |-
160
144
  ------------------------------------------------------------------------------
161
145
  Thanks for installing nanoc 2.2! Here are some resources to help you get started:
@@ -208,9 +192,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
192
  requirements: []
209
193
 
210
194
  rubyforge_project: nanoc
211
- rubygems_version: 1.3.1
195
+ rubygems_version: 1.3.3
212
196
  signing_key:
213
- specification_version: 2
197
+ specification_version: 3
214
198
  summary: a tool that runs on your local computer and compiles Markdown, Textile, Haml, ... documents into static web pages
215
199
  test_files: []
216
200