mill 0.7.3 → 0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mill/resource.rb +1 -5
- data/lib/mill/resources/image.rb +0 -2
- data/lib/mill/site.rb +8 -11
- data/lib/mill/version.rb +1 -1
- data/lib/mill.rb +0 -1
- metadata +2 -3
- data/lib/mill/resources/other.rb +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ae395020f4fd9ce9c4d1f053f8dd2a4c7b5406d29a3724ffab300014aefad48
|
4
|
+
data.tar.gz: d4b9980adee0e3d92421e094db607db2f2caf251f63b98e5b7378614ecb75e15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 880d30ef81989670d560491a64ea40e7546a5624a2369c83f2fdbb7159d38547f839a28d95491e4af07cc08f1b8111fbfe8975e4faf5cab60ab9a701f49008f3
|
7
|
+
data.tar.gz: 56322ec6a0d47677dec50e2418e0e3cd1c02901c5ef6f0baa930b6c0bc76ffb59592009c0bef088de3352b1a98440569b84e4b67e1cfd41ba462bc185915b337
|
data/lib/mill/resource.rb
CHANGED
@@ -6,7 +6,6 @@ module Mill
|
|
6
6
|
|
7
7
|
attr_accessor :input_file
|
8
8
|
attr_accessor :output_file
|
9
|
-
attr_accessor :type
|
10
9
|
attr_accessor :date
|
11
10
|
attr_accessor :public
|
12
11
|
attr_accessor :content
|
@@ -14,7 +13,6 @@ module Mill
|
|
14
13
|
|
15
14
|
def initialize(input_file: nil,
|
16
15
|
output_file: nil,
|
17
|
-
type: nil,
|
18
16
|
date: nil,
|
19
17
|
public: false,
|
20
18
|
content: nil,
|
@@ -26,7 +24,6 @@ module Mill
|
|
26
24
|
@date = DateTime.now
|
27
25
|
end
|
28
26
|
@output_file = Path.new(output_file) if output_file
|
29
|
-
@type = type
|
30
27
|
self.date = date if date
|
31
28
|
self.public = public
|
32
29
|
@content = content
|
@@ -60,11 +57,10 @@ module Mill
|
|
60
57
|
end
|
61
58
|
|
62
59
|
def inspect
|
63
|
-
"<%p> input_file: %p, output_file: %p,
|
60
|
+
"<%p> input_file: %p, output_file: %p, date: %s, public: %p, content: <%p>" % [
|
64
61
|
self.class,
|
65
62
|
@input_file ? @input_file.relative_to(@site.input_dir).to_s : nil,
|
66
63
|
@output_file ? @output_file.relative_to(@site.output_dir).to_s : nil,
|
67
|
-
@type.to_s,
|
68
64
|
@date.to_s,
|
69
65
|
@public,
|
70
66
|
@content && @content.class,
|
data/lib/mill/resources/image.rb
CHANGED
data/lib/mill/site.rb
CHANGED
@@ -265,12 +265,12 @@ module Mill
|
|
265
265
|
private
|
266
266
|
|
267
267
|
def resource_class_for_file(file)
|
268
|
-
MIME::Types.of(file.to_s).
|
269
|
-
|
270
|
-
|
271
|
-
|
268
|
+
type = MIME::Types.of(file.to_s).first
|
269
|
+
if type && (klass = @file_types[type.content_type])
|
270
|
+
klass
|
271
|
+
else
|
272
|
+
Resource
|
272
273
|
end
|
273
|
-
nil
|
274
274
|
end
|
275
275
|
|
276
276
|
def add_files
|
@@ -280,14 +280,11 @@ module Mill
|
|
280
280
|
Find.prune
|
281
281
|
elsif input_file.directory?
|
282
282
|
# skip
|
283
|
-
|
283
|
+
else (klass = resource_class_for_file(input_file))
|
284
284
|
resource = klass.new(
|
285
285
|
input_file: input_file,
|
286
|
-
output_file: @output_dir / input_file.relative_to(@input_dir)
|
287
|
-
type: type)
|
286
|
+
output_file: @output_dir / input_file.relative_to(@input_dir))
|
288
287
|
add_resource(resource)
|
289
|
-
else
|
290
|
-
warn "Warning: can't determine resource of file: #{input_file} (#{MIME::Types.of(input_file.to_s).join(', ').inspect})"
|
291
288
|
end
|
292
289
|
end
|
293
290
|
end
|
@@ -330,7 +327,7 @@ module Mill
|
|
330
327
|
end
|
331
328
|
|
332
329
|
def add_htpasswd
|
333
|
-
resource = Resource
|
330
|
+
resource = Resource.new(
|
334
331
|
input_file: @htpasswd_file,
|
335
332
|
output_file: @output_dir / '.htpasswd')
|
336
333
|
add_resource(resource)
|
data/lib/mill/version.rb
CHANGED
data/lib/mill.rb
CHANGED
@@ -18,7 +18,6 @@ require 'mill/resource'
|
|
18
18
|
require 'mill/resources/feed'
|
19
19
|
require 'mill/resources/google_site_verification'
|
20
20
|
require 'mill/resources/image'
|
21
|
-
require 'mill/resources/other'
|
22
21
|
require 'mill/resources/redirect'
|
23
22
|
require 'mill/resources/robots'
|
24
23
|
require 'mill/resources/sitemap'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mill
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.8'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Labovitz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -200,7 +200,6 @@ files:
|
|
200
200
|
- lib/mill/resources/feed.rb
|
201
201
|
- lib/mill/resources/google_site_verification.rb
|
202
202
|
- lib/mill/resources/image.rb
|
203
|
-
- lib/mill/resources/other.rb
|
204
203
|
- lib/mill/resources/redirect.rb
|
205
204
|
- lib/mill/resources/robots.rb
|
206
205
|
- lib/mill/resources/sitemap.rb
|
data/lib/mill/resources/other.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
module Mill
|
2
|
-
|
3
|
-
class Resource
|
4
|
-
|
5
|
-
class Other < Resource
|
6
|
-
|
7
|
-
FileTypes = %w{
|
8
|
-
application/pdf
|
9
|
-
|
10
|
-
application/x-shockwave-flash
|
11
|
-
|
12
|
-
application/font-sfnt
|
13
|
-
application/x-font-opentype
|
14
|
-
application/x-font-otf
|
15
|
-
application/x-font-truetype
|
16
|
-
application/x-font-ttf
|
17
|
-
|
18
|
-
application/rtf
|
19
|
-
|
20
|
-
application/javascript
|
21
|
-
application/x-javascript
|
22
|
-
text/javascript
|
23
|
-
}
|
24
|
-
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|