darkroom 0.0.3 → 0.0.4
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/README.md +127 -41
- data/VERSION +1 -1
- data/lib/darkroom.rb +21 -28
- data/lib/darkroom/asset.rb +247 -82
- data/lib/darkroom/darkroom.rb +54 -13
- data/lib/darkroom/delegates/css.rb +39 -0
- data/lib/darkroom/delegates/html.rb +53 -0
- data/lib/darkroom/delegates/htx.rb +21 -0
- data/lib/darkroom/delegates/javascript.rb +16 -0
- data/lib/darkroom/errors/asset_error.rb +33 -0
- data/lib/darkroom/errors/asset_not_found_error.rb +10 -21
- data/lib/darkroom/errors/circular_reference_error.rb +21 -0
- data/lib/darkroom/errors/duplicate_asset_error.rb +4 -4
- data/lib/darkroom/errors/invalid_path_error.rb +28 -0
- data/lib/darkroom/errors/missing_library_error.rb +3 -3
- data/lib/darkroom/errors/unrecognized_extension_error.rb +21 -0
- data/lib/darkroom/version.rb +1 -1
- metadata +10 -3
- data/lib/darkroom/errors/spec_not_defined_error.rb +0 -28
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative('asset_error')
|
4
|
+
|
5
|
+
class Darkroom
|
6
|
+
##
|
7
|
+
# Error class used when a reference is made to a file with an unrecognized extension.
|
8
|
+
#
|
9
|
+
class UnrecognizedExtensionError < AssetError
|
10
|
+
##
|
11
|
+
# Creates a new instance.
|
12
|
+
#
|
13
|
+
# * +file+ - File with the unrecognized extension.
|
14
|
+
# * +source_path+ - Path of the asset that contains the error (optional).
|
15
|
+
# * +source_line_num+ - Line number in the asset where the error is located (optional).
|
16
|
+
#
|
17
|
+
def initialize(file, source_path = nil, source_line_num = nil)
|
18
|
+
super('File extension not recognized', file, source_path, source_line_num)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nate Pickens
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03
|
11
|
+
date: 2021-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -59,11 +59,18 @@ files:
|
|
59
59
|
- lib/darkroom.rb
|
60
60
|
- lib/darkroom/asset.rb
|
61
61
|
- lib/darkroom/darkroom.rb
|
62
|
+
- lib/darkroom/delegates/css.rb
|
63
|
+
- lib/darkroom/delegates/html.rb
|
64
|
+
- lib/darkroom/delegates/htx.rb
|
65
|
+
- lib/darkroom/delegates/javascript.rb
|
66
|
+
- lib/darkroom/errors/asset_error.rb
|
62
67
|
- lib/darkroom/errors/asset_not_found_error.rb
|
68
|
+
- lib/darkroom/errors/circular_reference_error.rb
|
63
69
|
- lib/darkroom/errors/duplicate_asset_error.rb
|
70
|
+
- lib/darkroom/errors/invalid_path_error.rb
|
64
71
|
- lib/darkroom/errors/missing_library_error.rb
|
65
72
|
- lib/darkroom/errors/processing_error.rb
|
66
|
-
- lib/darkroom/errors/
|
73
|
+
- lib/darkroom/errors/unrecognized_extension_error.rb
|
67
74
|
- lib/darkroom/version.rb
|
68
75
|
homepage: https://github.com/npickens/darkroom
|
69
76
|
licenses:
|
@@ -1,28 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class Darkroom
|
4
|
-
##
|
5
|
-
# Error class used when a spec is not defined for a particular file extension.
|
6
|
-
#
|
7
|
-
class SpecNotDefinedError < StandardError
|
8
|
-
attr_reader(:extension, :file)
|
9
|
-
|
10
|
-
##
|
11
|
-
# Creates a new instance.
|
12
|
-
#
|
13
|
-
# * +extension+ - Extension for which there is no spec defined.
|
14
|
-
# * +file+ - File path of the asset whose loading was attempted.
|
15
|
-
#
|
16
|
-
def initialize(extension, file = nil)
|
17
|
-
@extension = extension
|
18
|
-
@file = file
|
19
|
-
end
|
20
|
-
|
21
|
-
##
|
22
|
-
# Returns a string representation of the error.
|
23
|
-
#
|
24
|
-
def to_s
|
25
|
-
"Spec not defined for #{@extension} files#{" (#{@file})" if @file}"
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|