sass-embedded 0.9.1 → 0.11.0

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.
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Sass
4
- class Embedded
5
- class Error < StandardError; end
6
-
7
- class ProtocolError < Error; end
8
-
9
- # The {Error} raised by {Embedded#render}.
10
- class RenderError < Error
11
- attr_reader :formatted, :file, :line, :column, :status
12
-
13
- def initialize(message, formatted, file, line, column, status)
14
- super(message)
15
- @formatted = formatted
16
- @file = file
17
- @line = line
18
- @column = column
19
- @status = status
20
- end
21
-
22
- def backtrace
23
- return nil if super.nil?
24
-
25
- ["#{@file}:#{@line}:#{@column}"] + super
26
- end
27
- end
28
- end
29
- end
@@ -1,34 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'struct'
4
-
5
- module Sass
6
- class Embedded
7
- # The {RenderResult} of {Embedded#render}.
8
- class RenderResult
9
- include Struct
10
-
11
- attr_reader :css, :map, :stats
12
-
13
- def initialize(css, map, stats)
14
- @css = css
15
- @map = map
16
- @stats = stats
17
- end
18
- end
19
-
20
- # The {RenderResultStats} of {Embedded#render}.
21
- class RenderResultStats
22
- include Struct
23
-
24
- attr_reader :entry, :start, :end, :duration
25
-
26
- def initialize(entry, start, finish, duration)
27
- @entry = entry
28
- @start = start
29
- @end = finish
30
- @duration = duration
31
- end
32
- end
33
- end
34
- end
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Sass
4
- class Embedded
5
- # The {Struct} module.
6
- module Struct
7
- def [](key)
8
- instance_variable_get("@#{key}".to_sym)
9
- end
10
-
11
- def to_h
12
- instance_variables.map do |variable|
13
- [variable[1..].to_sym, instance_variable_get(variable)]
14
- end.to_h
15
- end
16
-
17
- def to_s
18
- to_h.to_s
19
- end
20
- end
21
- end
22
- end
@@ -1,33 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'pathname'
4
- require 'uri'
5
-
6
- module Sass
7
- class Embedded
8
- # The {Util} module.
9
- module Util
10
- URI_PARSER = URI::Parser.new({ RESERVED: ';/?:@&=+$,' })
11
-
12
- private_constant :URI_PARSER
13
-
14
- module_function
15
-
16
- def file_uri_from_path(path)
17
- "file://#{Platform::OS == 'windows' ? File::SEPARATOR : ''}#{URI_PARSER.escape(path)}"
18
- end
19
-
20
- def path_from_file_uri(file_uri)
21
- URI_PARSER.unescape(file_uri[(Platform::OS == 'windows' ? 8 : 7)..])
22
- end
23
-
24
- def relative_path(from, to)
25
- Pathname.new(File.absolute_path(to)).relative_path_from(Pathname.new(File.absolute_path(from))).to_s
26
- end
27
-
28
- def now
29
- (Time.now.to_f * 1000).to_i
30
- end
31
- end
32
- end
33
- end