html2haml 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 6eafad574519456fe8650f7fbcbf58827cf25b52
4
- data.tar.gz: f4fe8909bb86ba40db7b85b7894e04038b04cbb1
2
+ SHA256:
3
+ metadata.gz: 2dcfae96b25443e16ee6148e085a6e544ef7ed31a71ab6842e91adf7a1c8b8dd
4
+ data.tar.gz: bb855c6b054a108c847ede14bd5bf17a723908ef8ac74b5c2daf9ab1fe231313
5
5
  SHA512:
6
- metadata.gz: bb573d6a7d7af653a3d90e83b38ed2fbef33777944c66f7fa137190c2fc831dfa7af918de7e63ee641ead20ab7cbe88cbf370d99d9374e5d9f4e4c4b0d70405d
7
- data.tar.gz: 6fcedbe8c9c81e9641dbab74464a9a13dc31beffbb153a15018b4e548bc63a79fe6bade20bcd1b00b8c6a753e3c98316c08cbaa2f8558fa3b9f6b65c2587e5cf
6
+ metadata.gz: 94d0f1ed89b8321a9d3eaa6bf899d18b8cb840980b6c63aec9c72b9ed211f40e435f05080fe5497061bb34eae69804ab60c47395bb68b3db70405cb53d5798f3
7
+ data.tar.gz: 23477a707ca4f07c5f25fc71dcd2572c08622fb2b7a539fc29e561244a98050d67f839e10f07a57234eaaf41de22b8585a68b526b92b02633c7a5908ac8dc462
@@ -0,0 +1,38 @@
1
+ name: test
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ tests:
7
+ runs-on: ubuntu-18.04
8
+ strategy:
9
+ fail-fast: false
10
+
11
+ matrix:
12
+ ruby-version:
13
+ - '1.9'
14
+ - '2.0'
15
+ - '2.1'
16
+ - '2.2'
17
+ - '2.3'
18
+ - '2.4'
19
+ - '2.5'
20
+ - '2.6'
21
+ - '2.7'
22
+ - '3.0'
23
+ - '3.1'
24
+ - ruby-head
25
+ - jruby
26
+
27
+ steps:
28
+ - uses: actions/checkout@v3
29
+
30
+ - uses: ruby/setup-ruby@v1
31
+ with:
32
+ ruby-version: ${{ matrix.ruby-version }}
33
+ bundler-cache: true
34
+ continue-on-error: ${{ matrix.ruby-version == 'ruby-head' }}
35
+
36
+ - run: |
37
+ bundle exec rake
38
+ continue-on-error: ${{ (matrix.ruby-version == 'ruby-head') || (matrix.ruby-version == 'jruby') }}
data/Changelog.markdown CHANGED
@@ -1,5 +1,11 @@
1
1
  # HTML2Haml Changelog
2
2
 
3
+ ## 2.3.0
4
+
5
+ * Haml 6+ support.
6
+
7
+ * Fixed a bug that embedded ruby code was not parsed with the current version of ruby.
8
+
3
9
  ## 2.2.0
4
10
 
5
11
  * Haml 5 support.
data/Gemfile CHANGED
@@ -3,3 +3,13 @@ source 'https://rubygems.org'
3
3
  gemspec
4
4
 
5
5
  gem 'nokogiri', RUBY_VERSION < '2.1' ? '~> 1.6.0' : '>= 1.7'
6
+
7
+ if RUBY_VERSION < '2.1'
8
+ gem 'ruby_parser', '< 3.14'
9
+ elsif RUBY_VERSION < '2.3'
10
+ gem 'ruby_parser', '< 3.18'
11
+ else
12
+ gem 'ruby_parser', '>= 3.18'
13
+ end
14
+
15
+ gem 'sexp_processor', RUBY_VERSION < '2.1' ? '< 4.14.0' : '> 4.14.0'
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Html2haml
2
2
 
3
- [![Build Status](https://travis-ci.org/haml/html2haml.svg?branch=master)](https://travis-ci.org/haml/html2haml)
3
+ [![Build Status](https://github.com/haml/html2haml/workflows/test/badge.svg)](https://github.com/haml/html2haml/actions)
4
4
  [![Code Climate](https://codeclimate.com/github/haml/html2haml.svg)](https://codeclimate.com/github/haml/html2haml)
5
5
  [![Gem Version](https://badge.fury.io/rb/html2haml.svg)](https://rubygems.org/gems/html2haml)
6
6
 
data/html2haml.gemspec CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |gem|
21
21
  gem.add_dependency 'nokogiri', '>= 1.6.0'
22
22
  gem.add_dependency 'erubis', '~> 2.7.0'
23
23
  gem.add_dependency 'ruby_parser', '~> 3.5'
24
- gem.add_dependency 'haml', ['>= 4.0', '< 6']
24
+ gem.add_dependency 'haml', '>= 4.0'
25
25
  gem.add_development_dependency 'simplecov', '~> 0.7.1'
26
26
  gem.add_development_dependency 'minitest', '>= 4.4.0'
27
27
  gem.add_development_dependency 'rake'
@@ -98,7 +98,7 @@ module Html2haml
98
98
  # @param code [String] Ruby code to check
99
99
  # @return [Boolean]
100
100
  def valid_ruby?(code)
101
- RubyParser.new.parse(code)
101
+ RubyParser.for_current_ruby.parse(code)
102
102
  rescue Racc::ParseError, RubyParser::SyntaxError
103
103
  false
104
104
  end
@@ -439,18 +439,17 @@ module Html2haml
439
439
 
440
440
  def attribute_value_can_be_bare_ruby?(value)
441
441
  begin
442
- ruby = RubyParser.new.parse(value)
442
+ ruby = RubyParser.for_current_ruby.parse(value)
443
443
  rescue Racc::ParseError, RubyParser::SyntaxError
444
444
  return false
445
445
  end
446
446
 
447
447
  return false if ruby.nil?
448
- return true if ruby.sexp_type == :str #regular string
449
- return true if ruby.sexp_type == :dstr #string with interpolation
450
- return true if ruby.sexp_type == :lit #symbol
451
- return true if ruby.sexp_type == :call && ruby.mass == 1 #local var or method with no params
452
448
 
453
- false
449
+ (ruby.sexp_type == :str) || #regular string
450
+ (ruby.sexp_type == :dstr) || #string with interpolation
451
+ (ruby.sexp_type == :lit) || #symbol
452
+ (ruby.sexp_type == :call && ruby.mass == 1) #local var or method with no params
454
453
  end
455
454
 
456
455
 
@@ -1,3 +1,3 @@
1
1
  module Html2haml
2
- VERSION = "2.2.0"
2
+ VERSION = "2.3.0"
3
3
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html2haml
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akira Matsuda
8
8
  - Stefan Natchev
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-04-30 00:00:00.000000000 Z
12
+ date: 2022-10-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -60,9 +60,6 @@ dependencies:
60
60
  - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: '4.0'
63
- - - "<"
64
- - !ruby/object:Gem::Version
65
- version: '6'
66
63
  type: :runtime
67
64
  prerelease: false
68
65
  version_requirements: !ruby/object:Gem::Requirement
@@ -70,9 +67,6 @@ dependencies:
70
67
  - - ">="
71
68
  - !ruby/object:Gem::Version
72
69
  version: '4.0'
73
- - - "<"
74
- - !ruby/object:Gem::Version
75
- version: '6'
76
70
  - !ruby/object:Gem::Dependency
77
71
  name: simplecov
78
72
  requirement: !ruby/object:Gem::Requirement
@@ -124,8 +118,8 @@ executables:
124
118
  extensions: []
125
119
  extra_rdoc_files: []
126
120
  files:
121
+ - ".github/workflows/main.yml"
127
122
  - ".gitignore"
128
- - ".travis.yml"
129
123
  - ".yardopts"
130
124
  - Changelog.markdown
131
125
  - Gemfile
@@ -148,7 +142,7 @@ homepage: http://haml.info
148
142
  licenses:
149
143
  - MIT
150
144
  metadata: {}
151
- post_install_message:
145
+ post_install_message:
152
146
  rdoc_options: []
153
147
  require_paths:
154
148
  - lib
@@ -163,9 +157,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
157
  - !ruby/object:Gem::Version
164
158
  version: '0'
165
159
  requirements: []
166
- rubyforge_project:
167
- rubygems_version: 2.6.11
168
- signing_key:
160
+ rubygems_version: 3.4.0.dev
161
+ signing_key:
169
162
  specification_version: 4
170
163
  summary: Converts HTML into Haml
171
164
  test_files:
data/.travis.yml DELETED
@@ -1,27 +0,0 @@
1
- language: ruby
2
- sudo: false
3
-
4
- before_install: gem update bundler --no-document
5
-
6
- rvm:
7
- - 2.4.1
8
- - 2.3.4
9
- - 2.2.7
10
- - 2.1.10
11
- - 2.0.0
12
- - 1.9.3
13
- - rbx-2
14
- - jruby-9.1.8.0
15
-
16
- gemfile:
17
- - Gemfile
18
-
19
- branches:
20
- only:
21
- - master
22
-
23
- script: "bundle exec rake test"
24
-
25
- matrix:
26
- allow_failures:
27
- - rvm: rbx-2