darkroom 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/VERSION +1 -1
- data/lib/darkroom/asset.rb +3 -33
- data/lib/darkroom/darkroom.rb +1 -1
- data/lib/darkroom/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c212cd979a1c11e4eb93a920a0b88bb20aae573fc8a0d290431203b77528eb3
|
4
|
+
data.tar.gz: a20ba0476f0508f574924e5d3d848a29f4adb550b4b5a1dd9e1ae16812c67a4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8b038fe72b9e644eb323d3b2d8afecd3d525e7796687827cc621d556c1e593ffb1b95529e4336070819f837031b8b1ad45d1241465365336ec59f51d494367e
|
7
|
+
data.tar.gz: fc3407836eb5a01317fb20177dc52ac1ea1e8a114cf955c136e46de2cf8d800ed344219e558f2baa5bb3ef1d3bce960d0b34d38f0574d00288de1fbef0fcd7f0
|
data/LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright 2021 Nate Pickens
|
1
|
+
Copyright 2021-2022 Nate Pickens
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
4
4
|
documentation files (the "Software"), to deal in the Software without restriction, including without
|
data/README.md
CHANGED
@@ -237,7 +237,7 @@ optional):
|
|
237
237
|
Darkroom.register('.extension1', 'extension2', '...', 'content/type')
|
238
238
|
|
239
239
|
# Complex type with special behavior.
|
240
|
-
Darkroom
|
240
|
+
Darkroom.register('.extension1', 'extension2', '...',
|
241
241
|
content_type: 'content/type', # HTTP MIME type string
|
242
242
|
import_regex: /import (?<path>.*)/, # Regex for identifying imports for bundling
|
243
243
|
reference_regex: /ref=(?<path>.*)/, # Regex for identifying references to other assets
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
data/lib/darkroom/asset.rb
CHANGED
@@ -66,38 +66,6 @@ class Darkroom
|
|
66
66
|
Delegate = Struct.new(:content_type, :import_regex, :reference_regex, :validate_reference,
|
67
67
|
:reference_content, :compile_lib, :compile, :minify_lib, :minify, keyword_init: true)
|
68
68
|
|
69
|
-
##
|
70
|
-
# DEPRECATED. Use Darkroom.register instead.
|
71
|
-
#
|
72
|
-
# Defines an asset spec.
|
73
|
-
#
|
74
|
-
# * +extensions+ - File extensions to associate with this spec.
|
75
|
-
# * +content_type+ - HTTP MIME type string.
|
76
|
-
# * +other+ - Optional components of the spec (see Spec struct).
|
77
|
-
#
|
78
|
-
def self.add_spec(*extensions, content_type, **other)
|
79
|
-
warn("#{self}.add_spec is deprecated and will be removed soon (use Darkroom.register instead)")
|
80
|
-
|
81
|
-
params = other.dup
|
82
|
-
params[:content_type] = content_type
|
83
|
-
params[:import_regex] = params.delete(:dependency_regex) if params.key?(:dependency_regex)
|
84
|
-
|
85
|
-
Darkroom.register(*extensions, params)
|
86
|
-
end
|
87
|
-
|
88
|
-
##
|
89
|
-
# DEPRECATED. Use Darkroom.delegate instead.
|
90
|
-
#
|
91
|
-
# Returns the spec associated with a file extension.
|
92
|
-
#
|
93
|
-
# * +extension+ - File extension of the desired spec.
|
94
|
-
#
|
95
|
-
def self.spec(extension)
|
96
|
-
warn("#{self}.spec is deprecated and will be removed soon (use Darkroom.delegate instead)")
|
97
|
-
|
98
|
-
Darkroom.delegate(extension)
|
99
|
-
end
|
100
|
-
|
101
69
|
##
|
102
70
|
# Creates a new instance.
|
103
71
|
#
|
@@ -398,7 +366,8 @@ class Darkroom
|
|
398
366
|
value || asset.path_unversioned
|
399
367
|
when 'content-base64'
|
400
368
|
quote = DEFAULT_QUOTE if match[:quote] == ''
|
401
|
-
|
369
|
+
data = Base64.strict_encode64(value || asset.content)
|
370
|
+
"#{quote}data:#{asset.content_type};base64,#{data}#{quote}"
|
402
371
|
when 'content-utf8'
|
403
372
|
quote = DEFAULT_QUOTE if match[:quote] == ''
|
404
373
|
"#{quote}data:#{asset.content_type};utf8,#{value || asset.content}#{quote}"
|
@@ -483,6 +452,7 @@ class Darkroom
|
|
483
452
|
instance_variable_get(:"@own_#{name}").each_with_object([]) do |asset, assets|
|
484
453
|
next if ignore.include?(asset)
|
485
454
|
|
455
|
+
asset.process
|
486
456
|
assets.push(*asset.send(name, ignore), asset)
|
487
457
|
assets.uniq!
|
488
458
|
assets.delete(self)
|
data/lib/darkroom/darkroom.rb
CHANGED
@@ -72,7 +72,7 @@ class Darkroom
|
|
72
72
|
def initialize(*load_paths, host: nil, hosts: nil, prefix: nil, pristine: nil, minify: false,
|
73
73
|
minified_pattern: DEFAULT_MINIFIED_PATTERN, internal_pattern: DEFAULT_INTERNAL_PATTERN,
|
74
74
|
min_process_interval: MIN_PROCESS_INTERVAL)
|
75
|
-
@load_paths = load_paths.map { |load_path|
|
75
|
+
@load_paths = load_paths.map { |load_path| File.expand_path(load_path) }
|
76
76
|
|
77
77
|
@hosts = (Array(host) + Array(hosts)).map! { |host| host.sub(TRAILING_SLASHES, '') }
|
78
78
|
@minify = minify
|
data/lib/darkroom/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: darkroom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nate Pickens
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
94
|
- !ruby/object:Gem::Version
|
95
95
|
version: '0'
|
96
96
|
requirements: []
|
97
|
-
rubygems_version: 3.2.
|
97
|
+
rubygems_version: 3.2.32
|
98
98
|
signing_key:
|
99
99
|
specification_version: 4
|
100
100
|
summary: A fast, lightweight, and straightforward web asset management library.
|