temple 0.10.5 → 0.10.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 991a0b24405b8214645f3587f421886aa2f70d5e1dcb7a60e63174e8314bf0cd
4
- data.tar.gz: 04ab064c8aa17d4baf2457cc6f97ae4f71ee801eeaa50ad0e2a1b4537e953bbc
3
+ metadata.gz: 36199c665624018e6c8bfec5ff6d1e19bcd8015ee4aeedd7800b264136227b7b
4
+ data.tar.gz: f70ee914c911f6f7ad17c84f81fd88dc5cc6d974c37b2d773995bbcc03b17c5b
5
5
  SHA512:
6
- metadata.gz: ba9e9141c61962b62b87247a77e70415145681ed35b590ba649781750098813597c40a334d45cfe7e3ae24a15cfe1d09ee32f6788c1aa600851432a8b6fe2c60
7
- data.tar.gz: 88b97523630a72fa8d61d46a8e857cb3aaa26db025f0f919a52afef3b89fb372f89f3dafdfa4f2ce18a3c823003fad985f1a5d6516bbf8c63223f26a0159e302
6
+ metadata.gz: f3661349e66534eaed2be550577677c3a4457ed0fe4e2ec5c3b8a6dced46fa45d5aa6be774662cf84186ead6954ebcb51ff53357abf93c64093b559fb22f22ec
7
+ data.tar.gz: 4e81de0ec56c60964b9363bf87b270191a39d19a0fd0710dc9e07b0baaadf273a8a84d6c37a733edd55ab55f90bba7d4a1b676b50817f1ba1566efdb29e8a911
@@ -25,10 +25,11 @@ jobs:
25
25
  - '3.2'
26
26
  - '3.3'
27
27
  - '3.4'
28
+ - '4.0'
28
29
  - jruby
29
30
  - truffleruby-head
30
31
  steps:
31
- - uses: actions/checkout@v6
32
+ - uses: actions/checkout@v7
32
33
  - name: Set up Ruby
33
34
  uses: ruby/setup-ruby@v1
34
35
  with:
data/CHANGES CHANGED
@@ -1,3 +1,7 @@
1
+ 0.10.6
2
+
3
+ * Make StaticAnalyzer recognize shorthand syntax as dynamic (#149)
4
+
1
5
  0.10.5
2
6
 
3
7
  * Allow using prism as the parser engine (#156)
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  Temple
2
2
  ======
3
3
 
4
- [![test](https://github.com/judofyr/temple/actions/workflows/test.yml/badge.svg)](https://github.com/judofyr/temple/actions/workflows/test.yml) [![Code Climate](https://codeclimate.com/github/judofyr/temple.svg)](https://codeclimate.com/github/judofyr/temple) [![Gem Version](https://badge.fury.io/rb/temple.svg)](https://rubygems.org/gems/temple) [![Yard Docs](https://img.shields.io/badge/yard-docs-blue.svg)](http://rubydoc.info/gems/temple/frames)
4
+ [![test](https://github.com/judofyr/temple/actions/workflows/test.yml/badge.svg)](https://github.com/judofyr/temple/actions/workflows/test.yml) [![Maintainability](https://qlty.sh/gh/judofyr/projects/temple/maintainability.svg)](https://qlty.sh/gh/judofyr/projects/temple) [![Gem Version](https://badge.fury.io/rb/temple.svg)](https://rubygems.org/gems/temple) [![Yard Docs](https://img.shields.io/badge/yard-docs-blue.svg)](http://rubydoc.info/gems/temple/frames)
5
5
 
6
6
  Temple is an abstraction and a framework for compiling templates to pure Ruby.
7
7
  It's all about making it easier to experiment, implement and optimize template
@@ -93,7 +93,8 @@ module Temple
93
93
  return false
94
94
  end
95
95
  end
96
- true
96
+
97
+ !ShorthandSyntaxChecker.shorthand?(code)
97
98
  end
98
99
 
99
100
  def syntax_error?(code)
@@ -112,6 +113,29 @@ module Temple
112
113
  raise ParseError
113
114
  end
114
115
  end
116
+
117
+ class ShorthandSyntaxChecker < Ripper
118
+ class << self
119
+ def shorthand?(code)
120
+ instance = new(code)
121
+ instance.parse
122
+ instance.shorthand
123
+ end
124
+ end
125
+
126
+ attr_reader :shorthand
127
+
128
+ def initialize(*)
129
+ super
130
+ @shorthand = nil
131
+ end
132
+
133
+ private
134
+
135
+ def on_assoc_new(key, value)
136
+ @shorthand = true if value.nil?
137
+ end
138
+ end
115
139
  end
116
140
  else
117
141
  class << self
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Temple
3
- VERSION = '0.10.5'
3
+ VERSION = '0.10.6'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: temple
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.5
4
+ version: 0.10.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Magnus Holm