opulent 1.1.7 → 1.1.9
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/Rakefile +6 -0
- data/lib/opulent/parser.rb +4 -3
- data/lib/opulent/parser/node.rb +1 -1
- data/lib/opulent/parser/require.rb +4 -2
- data/lib/opulent/parser/root.rb +3 -0
- data/lib/opulent/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ddc258c62764fc5d4682a818b54020aa9b0cedb3
|
4
|
+
data.tar.gz: a6b329acbba5dff20e8d5a66ec7894077bd2d8ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ad7aa47c0dc555fb42de99c7da3a361464c99ac4bbc2b2582a6b4396cf67852c6bb974e922f1b3a63dea6460028445f554b043634ad6de4e9c3f6a27c94ced9
|
7
|
+
data.tar.gz: f0cf7b68a4d0846aa75447e5d50d6da271152dcf65e3bfc956b307658cc177461a592cebdd2d0c142cecb12de2fef1a59b98bd2726010be3b3b80ac2f36195cf
|
data/Rakefile
ADDED
data/lib/opulent/parser.rb
CHANGED
@@ -30,9 +30,10 @@ module Opulent
|
|
30
30
|
@children = 3
|
31
31
|
@indent = 4
|
32
32
|
|
33
|
-
# Set current compiled file
|
34
|
-
|
35
|
-
|
33
|
+
# Set current compiled file as the first in the file stack together with
|
34
|
+
# its base indentation. The stack is used to allow require directives to
|
35
|
+
# be used with the last parent path found
|
36
|
+
@file = [[file, -1]]
|
36
37
|
|
37
38
|
# Initialize definitions for the parser
|
38
39
|
@definitions = definitions
|
data/lib/opulent/parser/node.rb
CHANGED
@@ -48,7 +48,7 @@ module Opulent
|
|
48
48
|
current_node = [:node, node_name, options, [], indent]
|
49
49
|
|
50
50
|
# Check if the node is explicitly self enclosing
|
51
|
-
if(close = accept_stripped :self_enclosing) || Settings::SelfEnclosing.include?(node_name)
|
51
|
+
if(close = accept_stripped :self_enclosing) || (!@definitions.keys.include?(node_name) && Settings::SelfEnclosing.include?(node_name))
|
52
52
|
current_node[@options][:self_enclosing] = true
|
53
53
|
|
54
54
|
unless close.nil? || close.strip.empty?
|
@@ -25,7 +25,7 @@ module Opulent
|
|
25
25
|
end
|
26
26
|
|
27
27
|
# Get the complete file path based on the current file being compiled
|
28
|
-
require_path = File.expand_path name[1..-2], @
|
28
|
+
require_path = File.expand_path name[1..-2], File.dirname(@file[-1][0])
|
29
29
|
|
30
30
|
# Try to see if it has any existing extension, otherwise add .op
|
31
31
|
require_path += '.op' unless Settings::Extensions.include? File.extname require_path
|
@@ -36,7 +36,9 @@ module Opulent
|
|
36
36
|
# Require entire directory tree
|
37
37
|
Dir[require_path].each do |file|
|
38
38
|
# Skip current file when including from same directory
|
39
|
-
next if file == @file
|
39
|
+
next if file == @file[-1][0]
|
40
|
+
|
41
|
+
@file << [require_path, indent]
|
40
42
|
|
41
43
|
# Throw an error if the file doesn't exist
|
42
44
|
error :require_dir, file if File.directory? file
|
data/lib/opulent/parser/root.rb
CHANGED
@@ -26,6 +26,9 @@ module Opulent
|
|
26
26
|
@i -= 1; break
|
27
27
|
end
|
28
28
|
|
29
|
+
# If last require path had a greater indentation, pop the last file path
|
30
|
+
@file.pop if @file[-1][1] > indent
|
31
|
+
|
29
32
|
# Try the main Opulent node types and process each one of them using
|
30
33
|
# their matching evaluation procedure
|
31
34
|
current_node = node(parent, indent) ||
|
data/lib/opulent/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opulent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Grozav
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -129,6 +129,7 @@ files:
|
|
129
129
|
- Gemfile
|
130
130
|
- LICENSE
|
131
131
|
- README.md
|
132
|
+
- Rakefile
|
132
133
|
- benchmark/benchmark.rb
|
133
134
|
- benchmark/cases/node/node.haml
|
134
135
|
- benchmark/cases/node/node.op
|