lib/jini.rb in jini-0.1.3 vs lib/jini.rb in jini-0.1.4

- old
+ new

@@ -1,10 +1,10 @@ # frozen_string_literal: true # (The MIT License) # -# Copyright (c) 2022-2022 Ivanchuk Ivan +# Copyright (c) 2022 Ivanchuk Ivan # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the 'Software'), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell @@ -26,11 +26,11 @@ # Author:: Ivan Ivanchuk (clicker.heroes.acg@gmail.com) # Copyright:: Copyright (c) 2022 Ivan Ivanchuck # License:: MIT # # It's a simple XPATH builder. -# +# <p></p> # require 'jini' # xpath = Jini.new('parent') # .add_node('child') # .add_attr('toy', 'plane') # .to_s // parent/child[@toy="plane"] @@ -219,10 +219,10 @@ # regex: '[' or ']' or '@' or '//' # @param node [String] # @return [Boolean] matching regex def bad_symbols?(node) - node.match %r{[|]|@|//} + !!node.match(%r{[|]|@|//}) unless node.nil? end # regex: '[' or ']' or '@' or '=' or '<' or '>' # @param node [String] node for check # @return [Boolean] matching regex