arbre 2.0.0 → 2.0.1

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
2
  SHA256:
3
- metadata.gz: '0665748c1473cada55c30990ab9f793067a8a5e35b9b18196806ae6a1f9bb93e'
4
- data.tar.gz: afa9e30b8d3152dbfef8d2fccbdf15dda7a314b90ed8e5ae9b44f45b92f977ee
3
+ metadata.gz: c4f7707f8598e3efa9a8c3369e48c32b94a0900a549ea1f01e63fd12e35dee08
4
+ data.tar.gz: c6997649086caa1522daa3aa72af24d6d4595af9ecaf0e83cdd68a63f5c25548
5
5
  SHA512:
6
- metadata.gz: 1343be599798c86f1f37e161f8c3ac8a437bac46d7f278eff760cd9876755b7017774097d92594f9daa1929745322330f823bc19640c09666bb4cb775ba75875
7
- data.tar.gz: f5751659a62d3451018bee66c14e8160267c4af97c2cc74846933383de1dd12de1bd93a1e9ccf8732f755ca43b1794b4a5a5be32c17991d27ab179a16d53f880
6
+ metadata.gz: da6f9a42e7a4cad3523230bbcdf2dec90ff5e688e0d8fd75dd00d066bd04084a14edfb726cee86ddb54b09b0dd8fd1326ef348c18f03702abb962d3c5d8339af
7
+ data.tar.gz: ef4ee4698a798da1faa86412258b3cde5bc0d37394a999499c98bc67d1cdcee1533220ab4f288edc4769beb3e389c87266f4a4902ab7350c83785b7b3d0669f8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.0.1 [☰](https://github.com/activeadmin/arbre/compare/v2.0.0...v2.0.1)
4
+
5
+ * Drop dependency on ruby2_keywords. [#578][] by [@Earlopain][]
6
+ * Performance improvements in HTML generation. [#562][], [#617][] by [@tagliala][]
7
+
3
8
  ## 2.0.0 [☰](https://github.com/activeadmin/arbre/compare/v1.7.0...v2.0.0)
4
9
 
5
10
  * Include empty attributes in HTML output. [#543][] by [@javierjulio][]
@@ -99,7 +104,6 @@ _No changes_.
99
104
 
100
105
  Initial release and extraction from Active Admin
101
106
 
102
- <!--- The following link definition list is generated by PimpMyChangelog --->
103
107
  [#4]: https://github.com/activeadmin/arbre/issues/4
104
108
  [#6]: https://github.com/activeadmin/arbre/issues/6
105
109
  [#7]: https://github.com/activeadmin/arbre/issues/7
@@ -134,6 +138,9 @@ Initial release and extraction from Active Admin
134
138
  [#542]: https://github.com/activeadmin/arbre/pull/542
135
139
  [#543]: https://github.com/activeadmin/arbre/pull/543
136
140
  [#545]: https://github.com/activeadmin/arbre/pull/545
141
+ [#562]: https://github.com/activeadmin/arbre/pull/562
142
+ [#578]: https://github.com/activeadmin/arbre/pull/578
143
+ [#617]: https://github.com/activeadmin/arbre/pull/617
137
144
 
138
145
  [@aramvisser]: https://github.com/aramvisser
139
146
  [@LTe]: https://github.com/LTe
@@ -157,3 +164,4 @@ Initial release and extraction from Active Admin
157
164
  [@ngan]: https://github.com/ngan
158
165
  [@tomascco]: https://github.com/tomascco
159
166
  [@javierjulio]: https://github.com/javierjulio
167
+ [@Earlopain]: https://github.com/Earlopain
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Arbre - HTML Views in Ruby
2
2
 
3
- [Arbre][docs] makes it easy to generate HTML directly in Ruby. This gem was extracted from [Active Admin](https://github.com/activeadmin/active_admin).
3
+ [Arbre][docs] makes it easy to generate HTML directly in Ruby. This gem was extracted from [Active Admin](https://github.com/activeadmin/activeadmin).
4
4
 
5
5
  [![Version ][rubygems_badge]][rubygems]
6
6
  [![Github Actions ][actions_badge]][actions]
@@ -31,7 +31,7 @@ Subscribe to [Tidelift][tidelift] to support Arbre and get licensing assurances
31
31
  Please use the Tidelift security contact to [report a security vulnerability][Tidelift security contact].
32
32
  Tidelift will coordinate the fix and disclosure.
33
33
 
34
- [rubygems_badge]: http://img.shields.io/gem/v/arbre.svg
34
+ [rubygems_badge]: https://img.shields.io/gem/v/arbre.svg
35
35
  [rubygems]: https://rubygems.org/gems/arbre
36
36
  [actions_badge]: https://github.com/activeadmin/arbre/workflows/ci/badge.svg
37
37
  [actions]: https://github.com/activeadmin/arbre/actions
@@ -39,5 +39,5 @@ Tidelift will coordinate the fix and disclosure.
39
39
  [tidelift]: https://tidelift.com/subscription/pkg/rubygems-arbre?utm_source=rubygems-arbre&utm_medium=referral&utm_campaign=readme
40
40
 
41
41
  [docs]: https://activeadmin.github.io/arbre/
42
- [stackoverflow]: http://stackoverflow.com/questions/tagged/arbre
42
+ [stackoverflow]: https://stackoverflow.com/questions/tagged/arbre
43
43
  [Tidelift security contact]: https://tidelift.com/security
data/lib/arbre/context.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  require 'arbre/element'
3
- require 'ruby2_keywords'
4
3
 
5
4
  module Arbre
6
5
 
@@ -28,7 +27,7 @@ module Arbre
28
27
  class Context < Element
29
28
  # Initialize a new Arbre::Context
30
29
  #
31
- # @param [Hash] assigns A hash of objecs that you would like to be
30
+ # @param [Hash] assigns A hash of objects that you would like to be
32
31
  # available as local variables within the Context
33
32
  #
34
33
  # @param [Object] helpers An object that has methods on it which will become
data/lib/arbre/element.rb CHANGED
@@ -2,7 +2,6 @@
2
2
  require 'arbre/element/builder_methods'
3
3
  require 'arbre/element/proxy'
4
4
  require 'arbre/element_collection'
5
- require 'ruby2_keywords'
6
5
 
7
6
  module Arbre
8
7
 
@@ -6,7 +6,7 @@ module Arbre
6
6
  def to_s
7
7
  flatten_hash.compact.map do |name, value|
8
8
  "#{html_escape(name)}=\"#{html_escape(value)}\""
9
- end.compact.join ' '
9
+ end.join ' '
10
10
  end
11
11
 
12
12
  protected
@@ -7,7 +7,7 @@ module Arbre
7
7
  class Tag < Element
8
8
  attr_reader :attributes
9
9
 
10
- # See: http://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements
10
+ # See: https://html.spec.whatwg.org/multipage/syntax.html#void-elements
11
11
  SELF_CLOSING_ELEMENTS = [ :area, :base, :br, :col, :embed, :hr, :img, :input, :keygen, :link,
12
12
  :menuitem, :meta, :param, :source, :track, :wbr ]
13
13
 
@@ -116,25 +116,23 @@ module Arbre
116
116
  def indent(open_tag, child_content, close_tag)
117
117
  spaces = ' ' * indent_level * INDENT_SIZE
118
118
 
119
- html = ""
119
+ html = +""
120
120
 
121
121
  if no_child? || child_is_text?
122
122
  if self_closing_tag?
123
- html += spaces + open_tag.sub( />$/, '/>' )
123
+ html << spaces << open_tag.sub( />$/, '/>' )
124
124
  else
125
125
  # one line
126
- html += spaces + open_tag + child_content + close_tag
126
+ html << spaces << open_tag << child_content << close_tag
127
127
  end
128
128
  else
129
129
  # multiple lines
130
- html += spaces + open_tag + "\n"
131
- html += child_content # the child takes care of its own spaces
132
- html += spaces + close_tag
130
+ html << spaces << open_tag << "\n"
131
+ html << child_content # the child takes care of its own spaces
132
+ html << spaces << close_tag
133
133
  end
134
134
 
135
- html += "\n"
136
-
137
- html
135
+ html << "\n"
138
136
  end
139
137
 
140
138
  def self_closing_tag?
data/lib/arbre/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Arbre
3
- VERSION = "2.0.0"
3
+ VERSION = "2.0.1"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arbre
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Bell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-06 00:00:00.000000000 Z
11
+ date: 2024-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 3.0.0
27
- - !ruby/object:Gem::Dependency
28
- name: ruby2_keywords
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 0.0.2
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: 0.0.2
41
27
  description: Arbre makes it easy to generate HTML directly in Ruby
42
28
  email:
43
29
  - gregdbell@gmail.com
@@ -98,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
84
  - !ruby/object:Gem::Version
99
85
  version: '0'
100
86
  requirements: []
101
- rubygems_version: 3.4.13
87
+ rubygems_version: 3.5.18
102
88
  signing_key:
103
89
  specification_version: 4
104
90
  summary: An Object Oriented DOM Tree in Ruby