hamlit 2.14.0 → 2.14.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/hamlit/cli.rb +17 -1
- data/lib/hamlit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a301e3719b15a8bd389c69273087c6133a0f64a50794e256106c65fb402a652
|
4
|
+
data.tar.gz: f5548a7ca946d6339a4767c13fc4dfcf8779274a95d179dccabf4ceb269aa35e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5858d26f7573e085d1da827a3d9eee1a6c8252e8a6a0459a8e1022dc99a2cb15cce1bd4931ffc2df26815e85a717df0fd119f3585d605aaeb67a5c7c38021df
|
7
|
+
data.tar.gz: 6fa9187e20778096808fce4e997df74c67b9d980ba4219baf55b64f9930b87c3b35b21a74c50355c6a443750e6d5465d6b6977dd322aeea5bdc7ecdb57d44519
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. This
|
|
4
4
|
project adheres to [Semantic Versioning](http://semver.org/). This change log is based upon
|
5
5
|
[keep-a-changelog](https://github.com/olivierlacan/keep-a-changelog).
|
6
6
|
|
7
|
+
## [2.14.1](https://github.com/k0kubun/hamlit/compare/v2.14.0...v2.14.1) - 2021-01-07
|
8
|
+
|
9
|
+
### Added
|
10
|
+
|
11
|
+
- Add `-c` option to `hamlit compile` that works like `haml -c` [#166](https://github.com/k0kubun/hamlit/issues/166)
|
12
|
+
*Thanks to @knightq*
|
13
|
+
|
7
14
|
## [2.14.0](https://github.com/k0kubun/hamlit/compare/v2.13.2...v2.14.0) - 2021-01-07
|
8
15
|
|
9
16
|
### Changed
|
data/lib/hamlit/cli.rb
CHANGED
@@ -13,14 +13,22 @@ module Hamlit
|
|
13
13
|
def render(file)
|
14
14
|
process_load_options
|
15
15
|
code = generate_code(file)
|
16
|
-
puts eval(code)
|
16
|
+
puts eval(code, binding, file)
|
17
17
|
end
|
18
18
|
|
19
19
|
desc 'compile HAML', 'Show compile result'
|
20
20
|
option :actionview, type: :boolean, default: false, aliases: %w[-a]
|
21
21
|
option :color, type: :boolean, default: true
|
22
|
+
option :check, type: :boolean, default: false, aliases: %w[-c]
|
22
23
|
def compile(file)
|
23
24
|
code = generate_code(file)
|
25
|
+
if options[:check]
|
26
|
+
if error = validate_ruby(code, file)
|
27
|
+
abort error.message.split("\n").first
|
28
|
+
end
|
29
|
+
puts "Syntax OK"
|
30
|
+
return
|
31
|
+
end
|
24
32
|
puts_code(code, color: options[:color])
|
25
33
|
end
|
26
34
|
|
@@ -134,5 +142,13 @@ module Hamlit
|
|
134
142
|
pp(arg)
|
135
143
|
end
|
136
144
|
end
|
145
|
+
|
146
|
+
def validate_ruby(code, file)
|
147
|
+
begin
|
148
|
+
eval("BEGIN {return nil}; #{code}", binding, file)
|
149
|
+
rescue ::SyntaxError # Not to be confused with Hamlit::SyntaxError
|
150
|
+
$!
|
151
|
+
end
|
152
|
+
end
|
137
153
|
end
|
138
154
|
end
|
data/lib/hamlit/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hamlit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.14.
|
4
|
+
version: 2.14.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi Kokubun
|
@@ -391,7 +391,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
391
391
|
- !ruby/object:Gem::Version
|
392
392
|
version: '0'
|
393
393
|
requirements: []
|
394
|
-
rubygems_version: 3.
|
394
|
+
rubygems_version: 3.3.0.dev
|
395
395
|
signing_key:
|
396
396
|
specification_version: 4
|
397
397
|
summary: High Performance Haml Implementation
|