New Upstream Release - ruby-jmespath

Ready changes

Summary

Merged new upstream version: 1.6.2 (was: 1.6.1).

Resulting package

Built on 2022-12-21T12:33 (took 2m56s)

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-releases ruby-jmespath

Lintian Result

Diff

diff --git a/VERSION b/VERSION
index 9c6d629..fdd3be6 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.6.1
+1.6.2
diff --git a/bin/jmespath.rb b/bin/jmespath.rb
new file mode 100755
index 0000000..bf1c2a8
--- /dev/null
+++ b/bin/jmespath.rb
@@ -0,0 +1,12 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+
+require 'jmespath'
+require 'json'
+
+expression = ARGV[0]
+json = JSON.parse(STDIN.read)
+
+$stdout.puts(JSON.dump(JMESPath.search(expression, json)))
diff --git a/debian/changelog b/debian/changelog
index b8a481e..f1cb274 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+ruby-jmespath (1.6.2-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Wed, 21 Dec 2022 12:30:43 -0000
+
 ruby-jmespath (1.6.1-1) unstable; urgency=medium
 
   * Team Upload
diff --git a/jmespath.gemspec b/jmespath.gemspec
index 2ff3ac7..7c8dd9f 100644
--- a/jmespath.gemspec
+++ b/jmespath.gemspec
@@ -2,19 +2,20 @@
 # This file has been automatically generated by gem2tgz #
 #########################################################
 # -*- encoding: utf-8 -*-
-# stub: jmespath 1.6.1 ruby lib
+# stub: jmespath 1.6.2 ruby lib
 
 Gem::Specification.new do |s|
   s.name = "jmespath".freeze
-  s.version = "1.6.1"
+  s.version = "1.6.2"
 
   s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
   s.require_paths = ["lib".freeze]
   s.authors = ["Trevor Rowe".freeze]
-  s.date = "2022-03-07"
+  s.date = "2022-11-25"
   s.description = "Implements JMESPath for Ruby".freeze
   s.email = "trevorrowe@gmail.com".freeze
-  s.files = ["LICENSE.txt".freeze, "VERSION".freeze, "lib/jmespath.rb".freeze, "lib/jmespath/caching_parser.rb".freeze, "lib/jmespath/errors.rb".freeze, "lib/jmespath/lexer.rb".freeze, "lib/jmespath/nodes.rb".freeze, "lib/jmespath/nodes/and.rb".freeze, "lib/jmespath/nodes/comparator.rb".freeze, "lib/jmespath/nodes/condition.rb".freeze, "lib/jmespath/nodes/current.rb".freeze, "lib/jmespath/nodes/expression.rb".freeze, "lib/jmespath/nodes/field.rb".freeze, "lib/jmespath/nodes/flatten.rb".freeze, "lib/jmespath/nodes/function.rb".freeze, "lib/jmespath/nodes/index.rb".freeze, "lib/jmespath/nodes/literal.rb".freeze, "lib/jmespath/nodes/multi_select_hash.rb".freeze, "lib/jmespath/nodes/multi_select_list.rb".freeze, "lib/jmespath/nodes/not.rb".freeze, "lib/jmespath/nodes/or.rb".freeze, "lib/jmespath/nodes/pipe.rb".freeze, "lib/jmespath/nodes/projection.rb".freeze, "lib/jmespath/nodes/slice.rb".freeze, "lib/jmespath/nodes/subexpression.rb".freeze, "lib/jmespath/parser.rb".freeze, "lib/jmespath/runtime.rb".freeze, "lib/jmespath/token.rb".freeze, "lib/jmespath/token_stream.rb".freeze, "lib/jmespath/util.rb".freeze, "lib/jmespath/version.rb".freeze]
+  s.executables = ["jmespath.rb".freeze]
+  s.files = ["LICENSE.txt".freeze, "VERSION".freeze, "bin/jmespath.rb".freeze, "lib/jmespath.rb".freeze, "lib/jmespath/caching_parser.rb".freeze, "lib/jmespath/errors.rb".freeze, "lib/jmespath/lexer.rb".freeze, "lib/jmespath/nodes.rb".freeze, "lib/jmespath/nodes/and.rb".freeze, "lib/jmespath/nodes/comparator.rb".freeze, "lib/jmespath/nodes/condition.rb".freeze, "lib/jmespath/nodes/current.rb".freeze, "lib/jmespath/nodes/expression.rb".freeze, "lib/jmespath/nodes/field.rb".freeze, "lib/jmespath/nodes/flatten.rb".freeze, "lib/jmespath/nodes/function.rb".freeze, "lib/jmespath/nodes/index.rb".freeze, "lib/jmespath/nodes/literal.rb".freeze, "lib/jmespath/nodes/multi_select_hash.rb".freeze, "lib/jmespath/nodes/multi_select_list.rb".freeze, "lib/jmespath/nodes/not.rb".freeze, "lib/jmespath/nodes/or.rb".freeze, "lib/jmespath/nodes/pipe.rb".freeze, "lib/jmespath/nodes/projection.rb".freeze, "lib/jmespath/nodes/slice.rb".freeze, "lib/jmespath/nodes/subexpression.rb".freeze, "lib/jmespath/parser.rb".freeze, "lib/jmespath/runtime.rb".freeze, "lib/jmespath/token.rb".freeze, "lib/jmespath/token_stream.rb".freeze, "lib/jmespath/util.rb".freeze, "lib/jmespath/version.rb".freeze]
   s.homepage = "http://github.com/trevorrowe/jmespath.rb".freeze
   s.licenses = ["Apache-2.0".freeze]
   s.rubygems_version = "3.2.5".freeze
diff --git a/lib/jmespath.rb b/lib/jmespath.rb
index aa54a1e..3c2e269 100644
--- a/lib/jmespath.rb
+++ b/lib/jmespath.rb
@@ -1,9 +1,9 @@
+# frozen_string_literal: true
 require 'json'
 require 'stringio'
 require 'pathname'
 
 module JMESPath
-
   require 'jmespath/caching_parser'
   require 'jmespath/errors'
   require 'jmespath/lexer'
@@ -16,7 +16,6 @@ module JMESPath
   require 'jmespath/version'
 
   class << self
-
     # @param [String] expression A valid
     #   [JMESPath](https://github.com/boto/jmespath) expression.
     # @param [Hash] data
@@ -24,18 +23,17 @@ module JMESPath
     #   expression does not resolve inside `data`.
     def search(expression, data, runtime_options = {})
       data = case data
-        when Hash, Struct then data # check for most common case first
-        when Pathname then load_json(data)
-        when IO, StringIO then JSON.parse(data.read)
-        else data
+             when Hash, Struct then data # check for most common case first
+             when Pathname then load_json(data)
+             when IO, StringIO then JSON.parse(data.read)
+             else data
         end
       Runtime.new(runtime_options).search(expression, data)
     end
 
     # @api private
     def load_json(path)
-      JSON.parse(File.open(path, 'r', encoding: 'UTF-8') { |f| f.read })
+      JSON.parse(File.open(path, 'r', encoding: 'UTF-8', &:read))
     end
-
   end
 end
diff --git a/lib/jmespath/caching_parser.rb b/lib/jmespath/caching_parser.rb
index ffcc74d..2bb4ad0 100644
--- a/lib/jmespath/caching_parser.rb
+++ b/lib/jmespath/caching_parser.rb
@@ -1,8 +1,8 @@
+# frozen_string_literal: true
 require 'thread'
 
 module JMESPath
   class CachingParser
-
     def initialize(options = {})
       @parser = options[:parser] || Parser.new(options)
       @mutex = Mutex.new
@@ -25,6 +25,5 @@ module JMESPath
         @cache[expression] = @parser.parse(expression)
       end
     end
-
   end
 end
diff --git a/lib/jmespath/errors.rb b/lib/jmespath/errors.rb
index 7374d7b..a46f099 100644
--- a/lib/jmespath/errors.rb
+++ b/lib/jmespath/errors.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
+
 module JMESPath
   module Errors
-
     class Error < StandardError; end
 
     class RuntimeError < Error; end
@@ -14,6 +15,5 @@ module JMESPath
     class InvalidArityError < Error; end
 
     class UnknownFunctionError < Error; end
-
   end
 end
diff --git a/lib/jmespath/lexer.rb b/lib/jmespath/lexer.rb
index f12097b..b3bacd5 100644
--- a/lib/jmespath/lexer.rb
+++ b/lib/jmespath/lexer.rb
@@ -1,10 +1,10 @@
+# frozen_string_literal: true
 require 'json'
 require 'set'
 
 module JMESPath
   # @api private
   class Lexer
-
     T_DOT = :dot
     T_STAR = :star
     T_COMMA = :comma
@@ -134,14 +134,14 @@ module JMESPath
       'w'  => STATE_IDENTIFIER,
       'x'  => STATE_IDENTIFIER,
       'y'  => STATE_IDENTIFIER,
-      'z'  => STATE_IDENTIFIER,
-    }
+      'z'  => STATE_IDENTIFIER
+    }.freeze
 
     VALID_IDENTIFIERS = Set.new(%w(
-      A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
-      a b c d e f g h i j k l m n o p q r s t u v w x y z
-      _ 0 1 2 3 4 5 6 7 8 9
-    ))
+                                  A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
+                                  a b c d e f g h i j k l m n o p q r s t u v w x y z
+                                  _ 0 1 2 3 4 5 6 7 8 9
+                                ))
 
     NUMBERS = Set.new(%w(0 1 2 3 4 5 6 7 8 9))
 
@@ -155,13 +155,12 @@ module JMESPath
       '(' => T_LPAREN,
       ')' => T_RPAREN,
       '{' => T_LBRACE,
-      '}' => T_RBRACE,
-    }
+      '}' => T_RBRACE
+    }.freeze
 
     # @param [String<JMESPath>] expression
     # @return [Array<Hash>]
     def tokenize(expression)
-
       tokens = []
       chars = CharacterStream.new(expression.chars.to_a)
 
@@ -253,7 +252,7 @@ module JMESPath
           tokens << match_or(chars, '&', '&', T_AND, T_EXPREF)
         when STATE_NOT
           # consume not equals
-          tokens << match_or(chars, '!', '=', T_COMPARATOR, T_NOT);
+          tokens << match_or(chars, '!', '=', T_COMPARATOR, T_NOT)
         else
           # either '<' or '>'
           # consume less than and greater than
@@ -321,11 +320,9 @@ module JMESPath
     # if we have to wrap scalar JSON values to parse them or not.
     # @api private
     def self.requires_wrapping?
-      begin
-        JSON.parse('false')
-      rescue JSON::ParserError
-        true
-      end
+      JSON.parse('false')
+    rescue JSON::ParserError
+      true
     end
 
     if requires_wrapping?
@@ -351,7 +348,11 @@ module JMESPath
           if quoted
             token.value = JSON.parse(token.value)
           else
-            token.value = JSON.parse(token.value) rescue JSON.parse(sprintf('"%s"', token.value.lstrip))
+            token.value = begin
+                            JSON.parse(token.value)
+                          rescue
+                            JSON.parse(sprintf('"%s"', token.value.lstrip))
+                          end
           end
         rescue JSON::ParserError
           token.type = T_UNKNOWN
@@ -361,7 +362,6 @@ module JMESPath
     end
 
     class CharacterStream
-
       def initialize(chars)
         @chars = chars
         @position = 0
@@ -376,10 +376,7 @@ module JMESPath
         @chars[@position]
       end
 
-      def position
-        @position
-      end
-
+      attr_reader :position
     end
   end
 end
diff --git a/lib/jmespath/nodes.rb b/lib/jmespath/nodes.rb
index e9ba80e..b65677f 100644
--- a/lib/jmespath/nodes.rb
+++ b/lib/jmespath/nodes.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
 module JMESPath
   # @api private
   module Nodes
@@ -9,11 +10,11 @@ module JMESPath
         self
       end
 
-      def chains_with?(other)
+      def chains_with?(_other)
         false
       end
     end
-    
+
     require  'jmespath/nodes/subexpression'
     require  'jmespath/nodes/and'
     require  'jmespath/nodes/comparator'
@@ -35,7 +36,5 @@ module JMESPath
     require  'jmespath/nodes/projection'
     require  'jmespath/nodes/projection'
     require  'jmespath/nodes/slice'
-
-
   end
 end
diff --git a/lib/jmespath/nodes/and.rb b/lib/jmespath/nodes/and.rb
index 63c621f..2ec1816 100644
--- a/lib/jmespath/nodes/and.rb
+++ b/lib/jmespath/nodes/and.rb
@@ -1,7 +1,7 @@
+# frozen_string_literal: true
 module JMESPath
   module Nodes
     class And < Node
-
       def initialize(left, right)
         @left = left
         @right = right
@@ -19,7 +19,6 @@ module JMESPath
       def optimize
         self.class.new(@left.optimize, @right.optimize)
       end
-
     end
   end
 end
diff --git a/lib/jmespath/nodes/comparator.rb b/lib/jmespath/nodes/comparator.rb
index 1e49c44..5b69d8e 100644
--- a/lib/jmespath/nodes/comparator.rb
+++ b/lib/jmespath/nodes/comparator.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
 module JMESPath
   # @api private
   module Nodes
@@ -35,7 +36,7 @@ module JMESPath
 
       private
 
-      def check(left_value, right_value)
+      def check(_left_value, _right_value)
         nil
       end
 
@@ -47,7 +48,6 @@ module JMESPath
     end
 
     module Comparators
-
       class Eq < Comparator
         def check(left_value, right_value)
           Util.as_json(left_value) == Util.as_json(right_value)
@@ -62,41 +62,25 @@ module JMESPath
 
       class Gt < Comparator
         def check(left_value, right_value)
-          if comparable?(left_value, right_value)
-            left_value > right_value
-          else
-            nil
-          end
+          left_value > right_value if comparable?(left_value, right_value)
         end
       end
 
       class Gte < Comparator
         def check(left_value, right_value)
-          if comparable?(left_value, right_value)
-            left_value >= right_value
-          else
-            nil
-          end
+          left_value >= right_value if comparable?(left_value, right_value)
         end
       end
 
       class Lt < Comparator
         def check(left_value, right_value)
-          if comparable?(left_value, right_value)
-            left_value < right_value
-          else
-            nil
-          end
+          left_value < right_value if comparable?(left_value, right_value)
         end
       end
 
       class Lte < Comparator
         def check(left_value, right_value)
-          if comparable?(left_value, right_value)
-            left_value <= right_value
-          else
-            nil
-          end
+          left_value <= right_value if comparable?(left_value, right_value)
         end
       end
     end
diff --git a/lib/jmespath/nodes/condition.rb b/lib/jmespath/nodes/condition.rb
index 5b39a69..9dd8e19 100644
--- a/lib/jmespath/nodes/condition.rb
+++ b/lib/jmespath/nodes/condition.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
 module JMESPath
   # @api private
   module Nodes
@@ -27,7 +28,7 @@ module JMESPath
 
     class ComparatorCondition < Node
       COMPARATOR_TO_CONDITION = {}
-      COMPARABLE_TYPES = [Integer, String].freeze
+      COMPARABLE_TYPES = [Numeric, String].freeze
 
       def initialize(left, right, child)
         @left = left
@@ -35,7 +36,7 @@ module JMESPath
         @child = child
       end
 
-      def visit(value)
+      def visit(_value)
         nil
       end
 
diff --git a/lib/jmespath/nodes/current.rb b/lib/jmespath/nodes/current.rb
index 8e37ac3..915bc65 100644
--- a/lib/jmespath/nodes/current.rb
+++ b/lib/jmespath/nodes/current.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
 module JMESPath
   # @api private
   module Nodes
diff --git a/lib/jmespath/nodes/expression.rb b/lib/jmespath/nodes/expression.rb
index 218fc02..15f5750 100644
--- a/lib/jmespath/nodes/expression.rb
+++ b/lib/jmespath/nodes/expression.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
 module JMESPath
   # @api private
   module Nodes
@@ -8,7 +9,7 @@ module JMESPath
         @expression = expression
       end
 
-      def visit(value)
+      def visit(_value)
         self
       end
 
@@ -22,4 +23,3 @@ module JMESPath
     end
   end
 end
-
diff --git a/lib/jmespath/nodes/field.rb b/lib/jmespath/nodes/field.rb
index 0f2df46..d1c1327 100644
--- a/lib/jmespath/nodes/field.rb
+++ b/lib/jmespath/nodes/field.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
 module JMESPath
   # @api private
   module Nodes
@@ -41,9 +42,7 @@ module JMESPath
       def initialize(keys)
         @keys = keys
         @key_syms = keys.each_with_object({}) do |k, syms|
-          if k.respond_to?(:to_sym)
-            syms[k] = k.to_sym
-          end
+          syms[k] = k.to_sym if k.respond_to?(:to_sym)
         end
       end
 
@@ -70,10 +69,7 @@ module JMESPath
 
       private
 
-      def keys
-        @keys
-      end
-
+      attr_reader :keys
     end
   end
 end
diff --git a/lib/jmespath/nodes/flatten.rb b/lib/jmespath/nodes/flatten.rb
index 7d46ece..d83c6ee 100644
--- a/lib/jmespath/nodes/flatten.rb
+++ b/lib/jmespath/nodes/flatten.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
 module JMESPath
   # @api private
   module Nodes
@@ -16,8 +17,6 @@ module JMESPath
               values.push(v)
             end
           end
-        else
-          nil
         end
       end
 
diff --git a/lib/jmespath/nodes/function.rb b/lib/jmespath/nodes/function.rb
index 6dfd3d1..9d23e41 100644
--- a/lib/jmespath/nodes/function.rb
+++ b/lib/jmespath/nodes/function.rb
@@ -1,8 +1,8 @@
+# frozen_string_literal: true
 module JMESPath
   # @api private
   module Nodes
     class Function < Node
-
       FUNCTIONS = {}
 
       def initialize(children, options = {})
@@ -38,12 +38,10 @@ module JMESPath
       private
 
       def maybe_raise(error_type, message)
-        unless @disable_visit_errors
-          raise error_type, message
-        end
+        raise error_type, message unless @disable_visit_errors
       end
 
-      def call(args)
+      def call(_args)
         nil
       end
     end
@@ -54,7 +52,7 @@ module JMESPath
           STRING_TYPE
         elsif value == true || value == false
           BOOLEAN_TYPE
-        elsif value == nil
+        elsif value.nil?
           NULL_TYPE
         elsif value.is_a?(Numeric)
           NUMBER_TYPE
@@ -82,7 +80,7 @@ module JMESPath
         NULL_TYPE => 'null',
         NUMBER_TYPE => 'number',
         OBJECT_TYPE => 'object',
-        STRING_TYPE => 'string',
+        STRING_TYPE => 'string'
       }.freeze
     end
 
@@ -93,12 +91,12 @@ module JMESPath
         if args.count == 1
           value = args.first
         else
-          return maybe_raise Errors::InvalidArityError, "function abs() expects one argument"
+          return maybe_raise Errors::InvalidArityError, 'function abs() expects one argument'
         end
         if Numeric === value
           value.abs
         else
-          return maybe_raise Errors::InvalidTypeError, "function abs() expects a number"
+          return maybe_raise Errors::InvalidTypeError, 'function abs() expects a number'
         end
       end
     end
@@ -110,20 +108,20 @@ module JMESPath
         if args.count == 1
           values = args.first
         else
-          return maybe_raise Errors::InvalidArityError, "function avg() expects one argument"
+          return maybe_raise Errors::InvalidArityError, 'function avg() expects one argument'
         end
         if values.respond_to?(:to_ary)
           values = values.to_ary
           return nil if values.empty?
-          values.inject(0) do |total,n|
+          values.inject(0) do |total, n|
             if Numeric === n
               total + n
             else
-              return maybe_raise Errors::InvalidTypeError, "function avg() expects numeric values"
+              return maybe_raise Errors::InvalidTypeError, 'function avg() expects numeric values'
             end
           end / values.size.to_f
         else
-          return maybe_raise Errors::InvalidTypeError, "function avg() expects a number"
+          return maybe_raise Errors::InvalidTypeError, 'function avg() expects a number'
         end
       end
     end
@@ -135,12 +133,12 @@ module JMESPath
         if args.count == 1
           value = args.first
         else
-          return maybe_raise Errors::InvalidArityError, "function ceil() expects one argument"
+          return maybe_raise Errors::InvalidArityError, 'function ceil() expects one argument'
         end
         if Numeric === value
           value.ceil
         else
-          return maybe_raise Errors::InvalidTypeError, "function ceil() expects a numeric value"
+          return maybe_raise Errors::InvalidTypeError, 'function ceil() expects a numeric value'
         end
       end
     end
@@ -157,10 +155,10 @@ module JMESPath
           elsif haystack.respond_to?(:to_ary)
             haystack.to_ary.any? { |e| Util.as_json(e) == needle }
           else
-            return maybe_raise Errors::InvalidTypeError, "contains expects 2nd arg to be a list"
+            return maybe_raise Errors::InvalidTypeError, 'contains expects 2nd arg to be a list'
           end
         else
-          return maybe_raise Errors::InvalidArityError, "function contains() expects 2 arguments"
+          return maybe_raise Errors::InvalidArityError, 'function contains() expects 2 arguments'
         end
       end
     end
@@ -172,12 +170,12 @@ module JMESPath
         if args.count == 1
           value = args.first
         else
-          return maybe_raise Errors::InvalidArityError, "function floor() expects one argument"
+          return maybe_raise Errors::InvalidArityError, 'function floor() expects one argument'
         end
         if Numeric === value
           value.floor
         else
-          return maybe_raise Errors::InvalidTypeError, "function floor() expects a numeric value"
+          return maybe_raise Errors::InvalidTypeError, 'function floor() expects a numeric value'
         end
       end
     end
@@ -189,7 +187,7 @@ module JMESPath
         if args.count == 1
           value = args.first
         else
-          return maybe_raise Errors::InvalidArityError, "function length() expects one argument"
+          return maybe_raise Errors::InvalidArityError, 'function length() expects one argument'
         end
         if value.respond_to?(:to_hash)
           value.to_hash.size
@@ -198,32 +196,30 @@ module JMESPath
         elsif value.respond_to?(:to_str)
           value.to_str.size
         else
-          return maybe_raise Errors::InvalidTypeError, "function length() expects string, array or object"
+          return maybe_raise Errors::InvalidTypeError, 'function length() expects string, array or object'
         end
       end
     end
 
     class Map < Function
-
       FUNCTIONS['map'] = self
 
       def call(args)
         if args.count != 2
-          return maybe_raise Errors::InvalidArityError, "function map() expects two arguments"
+          return maybe_raise Errors::InvalidArityError, 'function map() expects two arguments'
         end
         if Nodes::Expression === args[0]
           expr = args[0]
         else
-          return maybe_raise Errors::InvalidTypeError, "function map() expects the first argument to be an expression"
+          return maybe_raise Errors::InvalidTypeError, 'function map() expects the first argument to be an expression'
         end
         if args[1].respond_to?(:to_ary)
           list = args[1].to_ary
         else
-          return maybe_raise Errors::InvalidTypeError, "function map() expects the second argument to be an list"
+          return maybe_raise Errors::InvalidTypeError, 'function map() expects the second argument to be an list'
         end
         list.map { |value| expr.eval(value) }
       end
-
     end
 
     class MaxFunction < Function
@@ -235,7 +231,7 @@ module JMESPath
         if args.count == 1
           values = args.first
         else
-          return maybe_raise Errors::InvalidArityError, "function max() expects one argument"
+          return maybe_raise Errors::InvalidArityError, 'function max() expects one argument'
         end
         if values.respond_to?(:to_ary)
           values = values.to_ary
@@ -243,7 +239,7 @@ module JMESPath
           first = values.first
           first_type = get_type(first)
           unless first_type == NUMBER_TYPE || first_type == STRING_TYPE
-            msg = "function max() expects numeric or string values"
+            msg = String.new('function max() expects numeric or string values')
             return maybe_raise Errors::InvalidTypeError, msg
           end
           values.inject([first, first_type]) do |(max, max_type), v|
@@ -251,13 +247,13 @@ module JMESPath
             if max_type == v_type
               v > max ? [v, v_type] : [max, max_type]
             else
-              msg = "function max() encountered a type mismatch in sequence: "
+              msg = String.new('function max() encountered a type mismatch in sequence: ')
               msg << "#{max_type}, #{v_type}"
               return maybe_raise Errors::InvalidTypeError, msg
             end
           end.first
         else
-          return maybe_raise Errors::InvalidTypeError, "function max() expects an array"
+          return maybe_raise Errors::InvalidTypeError, 'function max() expects an array'
         end
       end
     end
@@ -271,7 +267,7 @@ module JMESPath
         if args.count == 1
           values = args.first
         else
-          return maybe_raise Errors::InvalidArityError, "function min() expects one argument"
+          return maybe_raise Errors::InvalidArityError, 'function min() expects one argument'
         end
         if values.respond_to?(:to_ary)
           values = values.to_ary
@@ -279,7 +275,7 @@ module JMESPath
           first = values.first
           first_type = get_type(first)
           unless first_type == NUMBER_TYPE || first_type == STRING_TYPE
-            msg = "function min() expects numeric or string values"
+            msg = String.new('function min() expects numeric or string values')
             return maybe_raise Errors::InvalidTypeError, msg
           end
           values.inject([first, first_type]) do |(min, min_type), v|
@@ -287,13 +283,13 @@ module JMESPath
             if min_type == v_type
               v < min ? [v, v_type] : [min, min_type]
             else
-              msg = "function min() encountered a type mismatch in sequence: "
+              msg = String.new('function min() encountered a type mismatch in sequence: ')
               msg << "#{min_type}, #{v_type}"
               return maybe_raise Errors::InvalidTypeError, msg
             end
           end.first
         else
-          return maybe_raise Errors::InvalidTypeError, "function min() expects an array"
+          return maybe_raise Errors::InvalidTypeError, 'function min() expects an array'
         end
       end
     end
@@ -307,7 +303,7 @@ module JMESPath
         if args.count == 1
           TYPE_NAMES[get_type(args.first)]
         else
-          return maybe_raise Errors::InvalidArityError, "function type() expects one argument"
+          return maybe_raise Errors::InvalidArityError, 'function type() expects one argument'
         end
       end
     end
@@ -323,10 +319,10 @@ module JMESPath
           elsif value.is_a?(Struct)
             value.members.map(&:to_s)
           else
-            return maybe_raise Errors::InvalidTypeError, "function keys() expects a hash"
+            return maybe_raise Errors::InvalidTypeError, 'function keys() expects a hash'
           end
         else
-          return maybe_raise Errors::InvalidArityError, "function keys() expects one argument"
+          return maybe_raise Errors::InvalidArityError, 'function keys() expects one argument'
         end
       end
     end
@@ -344,10 +340,10 @@ module JMESPath
           elsif value.respond_to?(:to_ary)
             value.to_ary
           else
-            return maybe_raise Errors::InvalidTypeError, "function values() expects an array or a hash"
+            return maybe_raise Errors::InvalidTypeError, 'function values() expects an array or a hash'
           end
         else
-          return maybe_raise Errors::InvalidArityError, "function values() expects one argument"
+          return maybe_raise Errors::InvalidArityError, 'function values() expects one argument'
         end
       end
     end
@@ -360,14 +356,14 @@ module JMESPath
           glue = args[0]
           values = args[1]
           if !glue.respond_to?(:to_str)
-            return maybe_raise Errors::InvalidTypeError, "function join() expects the first argument to be a string"
+            return maybe_raise Errors::InvalidTypeError, 'function join() expects the first argument to be a string'
           elsif values.respond_to?(:to_ary) && values.to_ary.all? { |v| v.respond_to?(:to_str) }
             values.to_ary.join(glue)
           else
-            return maybe_raise Errors::InvalidTypeError, "function join() expects values to be an array of strings"
+            return maybe_raise Errors::InvalidTypeError, 'function join() expects values to be an array of strings'
           end
         else
-          return maybe_raise Errors::InvalidArityError, "function join() expects an array of strings"
+          return maybe_raise Errors::InvalidArityError, 'function join() expects an array of strings'
         end
       end
     end
@@ -380,7 +376,7 @@ module JMESPath
           value = args.first
           value.respond_to?(:to_str) ? value.to_str : value.to_json
         else
-          return maybe_raise Errors::InvalidArityError, "function to_string() expects one argument"
+          return maybe_raise Errors::InvalidArityError, 'function to_string() expects one argument'
         end
       end
     end
@@ -397,7 +393,7 @@ module JMESPath
             nil
           end
         else
-          return maybe_raise Errors::InvalidArityError, "function to_number() expects one argument"
+          return maybe_raise Errors::InvalidArityError, 'function to_number() expects one argument'
         end
       end
     end
@@ -407,15 +403,15 @@ module JMESPath
 
       def call(args)
         if args.count == 1 && args.first.respond_to?(:to_ary)
-          args.first.to_ary.inject(0) do |sum,n|
+          args.first.to_ary.inject(0) do |sum, n|
             if Numeric === n
               sum + n
             else
-              return maybe_raise Errors::InvalidTypeError, "function sum() expects values to be numeric"
+              return maybe_raise Errors::InvalidTypeError, 'function sum() expects values to be numeric'
             end
           end
         else
-          return maybe_raise Errors::InvalidArityError, "function sum() expects one argument"
+          return maybe_raise Errors::InvalidArityError, 'function sum() expects one argument'
         end
       end
     end
@@ -427,7 +423,7 @@ module JMESPath
         if args.count > 0
           args.find { |value| !value.nil? }
         else
-          return maybe_raise Errors::InvalidArityError, "function not_null() expects one or more arguments"
+          return maybe_raise Errors::InvalidArityError, 'function not_null() expects one or more arguments'
         end
       end
     end
@@ -444,26 +440,26 @@ module JMESPath
             value = value.to_ary
             # every element in the list must be of the same type
             array_type = get_type(value[0])
-            if array_type == STRING_TYPE || array_type == NUMBER_TYPE || value.size == 0
+            if array_type == STRING_TYPE || array_type == NUMBER_TYPE || value.empty?
               # stable sort
               n = 0
               value.sort_by do |v|
                 value_type = get_type(v)
                 if value_type != array_type
-                  msg = "function sort() expects values to be an array of only numbers, or only integers"
+                  msg = 'function sort() expects values to be an array of only numbers, or only integers'
                   return maybe_raise Errors::InvalidTypeError, msg
                 end
                 n += 1
                 [v, n]
               end
             else
-              return maybe_raise Errors::InvalidTypeError, "function sort() expects values to be an array of numbers or integers"
+              return maybe_raise Errors::InvalidTypeError, 'function sort() expects values to be an array of numbers or integers'
             end
           else
-            return maybe_raise Errors::InvalidTypeError, "function sort() expects values to be an array of numbers or integers"
+            return maybe_raise Errors::InvalidTypeError, 'function sort() expects values to be an array of numbers or integers'
           end
         else
-          return maybe_raise Errors::InvalidArityError, "function sort() expects one argument"
+          return maybe_raise Errors::InvalidArityError, 'function sort() expects one argument'
         end
       end
     end
@@ -479,27 +475,27 @@ module JMESPath
             values = args[0].to_ary
             expression = args[1]
             array_type = get_type(expression.eval(values[0]))
-            if array_type == STRING_TYPE || array_type == NUMBER_TYPE || values.size == 0
+            if array_type == STRING_TYPE || array_type == NUMBER_TYPE || values.empty?
               # stable sort the list
               n = 0
               values.sort_by do |value|
                 value = expression.eval(value)
                 value_type = get_type(value)
                 if value_type != array_type
-                  msg = "function sort() expects values to be an array of only numbers, or only integers"
+                  msg = 'function sort() expects values to be an array of only numbers, or only integers'
                   return maybe_raise Errors::InvalidTypeError, msg
                 end
                 n += 1
                 [value, n]
               end
             else
-              return maybe_raise Errors::InvalidTypeError, "function sort() expects values to be an array of numbers or integers"
+              return maybe_raise Errors::InvalidTypeError, 'function sort() expects values to be an array of numbers or integers'
             end
           else
-            return maybe_raise Errors::InvalidTypeError, "function sort_by() expects an array and an expression"
+            return maybe_raise Errors::InvalidTypeError, 'function sort_by() expects an array and an expression'
           end
         else
-          return maybe_raise Errors::InvalidArityError, "function sort_by() expects two arguments"
+          return maybe_raise Errors::InvalidArityError, 'function sort_by() expects two arguments'
         end
       end
     end
@@ -522,7 +518,7 @@ module JMESPath
               value = expression.eval(entry)
               value_type = get_type(value)
               if value_type != type
-                msg = "function #{mode}() encountered a type mismatch in "
+                msg = String.new("function #{mode}() encountered a type mismatch in ")
                 msg << "sequence: #{type}, #{value_type}"
                 return maybe_raise Errors::InvalidTypeError, msg
               end
@@ -570,16 +566,16 @@ module JMESPath
           search_type = get_type(search)
           suffix_type = get_type(suffix)
           if search_type != STRING_TYPE
-            msg = "function ends_with() expects first argument to be a string"
+            msg = 'function ends_with() expects first argument to be a string'
             return maybe_raise Errors::InvalidTypeError, msg
           end
           if suffix_type != STRING_TYPE
-            msg = "function ends_with() expects second argument to be a string"
+            msg = 'function ends_with() expects second argument to be a string'
             return maybe_raise Errors::InvalidTypeError, msg
           end
           search.end_with?(suffix)
         else
-          msg = "function ends_with() expects two arguments"
+          msg = 'function ends_with() expects two arguments'
           return maybe_raise Errors::InvalidArityError, msg
         end
       end
@@ -596,16 +592,16 @@ module JMESPath
           search_type = get_type(search)
           prefix_type = get_type(prefix)
           if search_type != STRING_TYPE
-            msg = "function starts_with() expects first argument to be a string"
+            msg = 'function starts_with() expects first argument to be a string'
             return maybe_raise Errors::InvalidTypeError, msg
           end
           if prefix_type != STRING_TYPE
-            msg = "function starts_with() expects second argument to be a string"
+            msg = 'function starts_with() expects second argument to be a string'
             return maybe_raise Errors::InvalidTypeError, msg
           end
           search.start_with?(prefix)
         else
-          msg = "function starts_with() expects two arguments"
+          msg = 'function starts_with() expects two arguments'
           return maybe_raise Errors::InvalidArityError, msg
         end
       end
@@ -616,7 +612,7 @@ module JMESPath
 
       def call(args)
         if args.count == 0
-          msg = "function merge() expects 1 or more arguments"
+          msg = 'function merge() expects 1 or more arguments'
           return maybe_raise Errors::InvalidArityError, msg
         end
         args.inject({}) do |h, v|
@@ -630,7 +626,7 @@ module JMESPath
 
       def call(args)
         if args.count == 0
-          msg = "function reverse() expects 1 or more arguments"
+          msg = 'function reverse() expects 1 or more arguments'
           return maybe_raise Errors::InvalidArityError, msg
         end
         value = args.first
@@ -639,7 +635,7 @@ module JMESPath
         elsif value.respond_to?(:to_str)
           value.to_str.reverse
         else
-          msg = "function reverse() expects an array or string"
+          msg = 'function reverse() expects an array or string'
           return maybe_raise Errors::InvalidTypeError, msg
         end
       end
diff --git a/lib/jmespath/nodes/index.rb b/lib/jmespath/nodes/index.rb
index 5cf4120..5066c1a 100644
--- a/lib/jmespath/nodes/index.rb
+++ b/lib/jmespath/nodes/index.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
 module JMESPath
   # @api private
   module Nodes
diff --git a/lib/jmespath/nodes/literal.rb b/lib/jmespath/nodes/literal.rb
index b73baa9..238958f 100644
--- a/lib/jmespath/nodes/literal.rb
+++ b/lib/jmespath/nodes/literal.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
 module JMESPath
   # @api private
   module Nodes
@@ -8,7 +9,7 @@ module JMESPath
         @value = value
       end
 
-      def visit(value)
+      def visit(_value)
         @value
       end
     end
diff --git a/lib/jmespath/nodes/multi_select_hash.rb b/lib/jmespath/nodes/multi_select_hash.rb
index 38bb295..1f90a8a 100644
--- a/lib/jmespath/nodes/multi_select_hash.rb
+++ b/lib/jmespath/nodes/multi_select_hash.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
 module JMESPath
   # @api private
   module Nodes
diff --git a/lib/jmespath/nodes/multi_select_list.rb b/lib/jmespath/nodes/multi_select_list.rb
index 66ffc7b..a7b8dd9 100644
--- a/lib/jmespath/nodes/multi_select_list.rb
+++ b/lib/jmespath/nodes/multi_select_list.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
 module JMESPath
   # @api private
   module Nodes
diff --git a/lib/jmespath/nodes/not.rb b/lib/jmespath/nodes/not.rb
index 4af3b1a..d1e86f9 100644
--- a/lib/jmespath/nodes/not.rb
+++ b/lib/jmespath/nodes/not.rb
@@ -1,7 +1,7 @@
+# frozen_string_literal: true
 module JMESPath
   module Nodes
     class Not < Node
-
       def initialize(expression)
         @expression = expression
       end
@@ -13,7 +13,6 @@ module JMESPath
       def optimize
         self.class.new(@expression.optimize)
       end
-
     end
   end
 end
diff --git a/lib/jmespath/nodes/or.rb b/lib/jmespath/nodes/or.rb
index 42114ec..af2b87f 100644
--- a/lib/jmespath/nodes/or.rb
+++ b/lib/jmespath/nodes/or.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
 module JMESPath
   # @api private
   module Nodes
diff --git a/lib/jmespath/nodes/pipe.rb b/lib/jmespath/nodes/pipe.rb
index 44c8023..d0fdafc 100644
--- a/lib/jmespath/nodes/pipe.rb
+++ b/lib/jmespath/nodes/pipe.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
 module JMESPath
   # @api private
   module Nodes
diff --git a/lib/jmespath/nodes/projection.rb b/lib/jmespath/nodes/projection.rb
index bed2090..871dd13 100644
--- a/lib/jmespath/nodes/projection.rb
+++ b/lib/jmespath/nodes/projection.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
 module JMESPath
   # @api private
   module Nodes
@@ -12,9 +13,7 @@ module JMESPath
           list = []
           targets.each do |v|
             vv = @projection.visit(v)
-            unless vv.nil?
-              list << vv
-            end
+            list << vv unless vv.nil?
           end
           list
         end
@@ -30,7 +29,7 @@ module JMESPath
 
       private
 
-      def extract_targets(left_value)
+      def extract_targets(_left_value)
         nil
       end
     end
@@ -45,11 +44,7 @@ module JMESPath
 
     class ArrayProjection < Projection
       def extract_targets(target)
-        if target.respond_to?(:to_ary)
-          target.to_ary
-        else
-          nil
-        end
+        target.to_ary if target.respond_to?(:to_ary)
       end
 
       def fast_instance
@@ -67,8 +62,6 @@ module JMESPath
           target.to_hash.values
         elsif target.is_a?(Struct)
           target.values
-        else
-          nil
         end
       end
 
diff --git a/lib/jmespath/nodes/slice.rb b/lib/jmespath/nodes/slice.rb
index 2db7461..1f6a8c5 100644
--- a/lib/jmespath/nodes/slice.rb
+++ b/lib/jmespath/nodes/slice.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
 module JMESPath
   # @api private
   module Nodes
@@ -6,7 +7,7 @@ module JMESPath
         @start = start
         @stop = stop
         @step = step
-        raise Errors::InvalidValueError.new('slice step cannot be 0') if @step == 0
+        raise Errors::InvalidValueError, 'slice step cannot be 0' if @step == 0
       end
 
       def visit(value)
@@ -27,8 +28,6 @@ module JMESPath
             end
           end
           value.respond_to?(:to_str) ? result.join : result
-        else
-          nil
         end
       end
 
@@ -43,21 +42,19 @@ module JMESPath
       private
 
       def adjust_slice(length, start, stop, step)
-        if step.nil?
-          step = 1
-        end
+        step = 1 if step.nil?
 
-        if start.nil?
-          start = step < 0 ? length - 1 : 0
-        else
-          start = adjust_endpoint(length, start, step)
-        end
+        start = if start.nil?
+                  step < 0 ? length - 1 : 0
+                else
+                  adjust_endpoint(length, start, step)
+                end
 
-        if stop.nil?
-          stop = step < 0 ? -1 : length
-        else
-          stop = adjust_endpoint(length, stop, step)
-        end
+        stop = if stop.nil?
+                 step < 0 ? -1 : length
+               else
+                 adjust_endpoint(length, stop, step)
+               end
         [start, stop, step]
       end
 
@@ -82,8 +79,6 @@ module JMESPath
       def visit(value)
         if (value = value.respond_to?(:to_str) ? value.to_str : value.respond_to?(:to_ary) ? value.to_ary : nil)
           value[@start, @stop - @start]
-        else
-          nil
         end
       end
     end
diff --git a/lib/jmespath/nodes/subexpression.rb b/lib/jmespath/nodes/subexpression.rb
index 81e23dd..398fa02 100644
--- a/lib/jmespath/nodes/subexpression.rb
+++ b/lib/jmespath/nodes/subexpression.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
 module JMESPath
   # @api private
   module Nodes
diff --git a/lib/jmespath/parser.rb b/lib/jmespath/parser.rb
index 8d0960d..adceafd 100644
--- a/lib/jmespath/parser.rb
+++ b/lib/jmespath/parser.rb
@@ -1,28 +1,28 @@
+# frozen_string_literal: true
 require 'set'
 
 module JMESPath
   # @api private
   class Parser
-
     AFTER_DOT = Set.new([
-      Lexer::T_IDENTIFIER,        # foo.bar
-      Lexer::T_QUOTED_IDENTIFIER, # foo."bar"
-      Lexer::T_STAR,              # foo.*
-      Lexer::T_LBRACE,            # foo{a: 0}
-      Lexer::T_LBRACKET,          # foo[1]
-      Lexer::T_FILTER,            # foo.[?bar==10]
-    ])
+                          Lexer::T_IDENTIFIER, # foo.bar
+                          Lexer::T_QUOTED_IDENTIFIER, # foo."bar"
+                          Lexer::T_STAR,              # foo.*
+                          Lexer::T_LBRACE,            # foo{a: 0}
+                          Lexer::T_LBRACKET,          # foo[1]
+                          Lexer::T_FILTER,            # foo.[?bar==10]
+                        ])
 
     NUM_COLON_RBRACKET = Set.new([
-      Lexer::T_NUMBER,
-      Lexer::T_COLON,
-      Lexer::T_RBRACKET,
-    ])
+                                   Lexer::T_NUMBER,
+                                   Lexer::T_COLON,
+                                   Lexer::T_RBRACKET
+                                 ])
 
     COLON_RBRACKET = Set.new([
-      Lexer::T_COLON,
-      Lexer::T_RBRACKET,
-    ])
+                               Lexer::T_COLON,
+                               Lexer::T_RBRACKET
+                             ])
 
     CURRENT_NODE = Nodes::Current.new
 
@@ -34,7 +34,7 @@ module JMESPath
 
     # @param [String<JMESPath>] expression
     def parse(expression)
-      tokens =  @lexer.tokenize(expression)
+      tokens = @lexer.tokenize(expression)
       stream = TokenStream.new(expression, tokens)
       result = expr(stream)
       if stream.token.type != Lexer::T_EOF
@@ -110,13 +110,11 @@ module JMESPath
 
     def nud_lbrace(stream)
       valid_keys = Set.new([:quoted_identifier, :identifier])
-      stream.next(match:valid_keys)
+      stream.next(match: valid_keys)
       pairs = []
       begin
         pairs << parse_key_value_pair(stream)
-        if stream.token.type == :comma
-          stream.next(match:valid_keys)
-        end
+        stream.next(match: valid_keys) if stream.token.type == :comma
       end while stream.token.type != :rbrace
       stream.next
       Nodes::MultiSelectHash.new(pairs)
@@ -167,7 +165,7 @@ module JMESPath
     end
 
     def led_dot(stream, left)
-      stream.next(match:AFTER_DOT)
+      stream.next(match: AFTER_DOT)
       if stream.token.type == :star
         parse_wildcard_object(stream, left)
       else
@@ -217,12 +215,10 @@ module JMESPath
       stream.next
       while stream.token.type != :rparen
         args << expr(stream, 0)
-        if stream.token.type == :comma
-          stream.next
-        end
+        stream.next if stream.token.type == :comma
       end
       stream.next
-      Nodes::Function.create(name, args, :disable_visit_errors => @disable_visit_errors)
+      Nodes::Function.create(name, args, disable_visit_errors: @disable_visit_errors)
     end
 
     def led_or(stream, left)
@@ -286,7 +282,7 @@ module JMESPath
 
     def parse_key_value_pair(stream)
       key = stream.token.value
-      stream.next(match:Set.new([:colon]))
+      stream.next(match: Set.new([:colon]))
       stream.next
       Nodes::MultiSelectHash::KeyValuePair.new(key, expr(stream))
     end
@@ -311,7 +307,7 @@ module JMESPath
       if stream.token.binding_power < 10
         CURRENT_NODE
       elsif type == :dot
-        stream.next(match:AFTER_DOT)
+        stream.next(match: AFTER_DOT)
         parse_dot(stream, binding_power)
       elsif type == :lbracket || type == :filter
         expr(stream, binding_power)
@@ -321,7 +317,7 @@ module JMESPath
     end
 
     def parse_wildcard_array(stream, left = nil)
-      stream.next(match:Set.new([:rbracket]))
+      stream.next(match: Set.new([:rbracket]))
       stream.next
       left ||= CURRENT_NODE
       right = parse_projection(stream, Token::BINDING_POWER[:star])
@@ -334,6 +330,5 @@ module JMESPath
       right = parse_projection(stream, Token::BINDING_POWER[:star])
       Nodes::ObjectProjection.new(left, right)
     end
-
   end
 end
diff --git a/lib/jmespath/runtime.rb b/lib/jmespath/runtime.rb
index 171cfa7..2ee1873 100644
--- a/lib/jmespath/runtime.rb
+++ b/lib/jmespath/runtime.rb
@@ -1,7 +1,7 @@
+# frozen_string_literal: true
 module JMESPath
   # @api private
   class Runtime
-
     # @api private
     DEFAULT_PARSER = CachingParser
 
@@ -66,6 +66,5 @@ module JMESPath
         DEFAULT_PARSER.new(options)
       end
     end
-
   end
 end
diff --git a/lib/jmespath/token.rb b/lib/jmespath/token.rb
index 303d5e9..f6fbd6a 100644
--- a/lib/jmespath/token.rb
+++ b/lib/jmespath/token.rb
@@ -1,7 +1,7 @@
+# frozen_string_literal: true
 module JMESPath
   # @api private
   class Token < Struct.new(:type, :value, :position, :binding_power)
-
     NULL_TOKEN = Token.new(:eof, '', nil)
 
     BINDING_POWER = {
@@ -28,8 +28,8 @@ module JMESPath
       Lexer::T_NOT               => 45,
       Lexer::T_LBRACE            => 50,
       Lexer::T_LBRACKET          => 55,
-      Lexer::T_LPAREN            => 60,
-    }
+      Lexer::T_LPAREN            => 60
+    }.freeze
 
     # @param [Symbol] type
     # @param [Mixed] value
@@ -37,6 +37,5 @@ module JMESPath
     def initialize(type, value, position)
       super(type, value, position, BINDING_POWER[type])
     end
-
   end
 end
diff --git a/lib/jmespath/token_stream.rb b/lib/jmespath/token_stream.rb
index 76f5f0b..02295f1 100644
--- a/lib/jmespath/token_stream.rb
+++ b/lib/jmespath/token_stream.rb
@@ -1,7 +1,7 @@
+# frozen_string_literal: true
 module JMESPath
   # @api private
   class TokenStream
-
     # @param [String<JMESPath>] expression
     # @param [Array<Token>] tokens
     def initialize(expression, tokens)
@@ -35,8 +35,8 @@ module JMESPath
     def inspect
       str = []
       @tokens.each do |token|
-        str << "%3d  %-15s %s" %
-         [token.position, token.type, token.value.inspect]
+        str << '%3d  %-15s %s' %
+               [token.position, token.type, token.value.inspect]
       end
       str.join("\n")
     end
@@ -50,11 +50,10 @@ module JMESPath
 
     def validate_match(token, match)
       if match && !match.include?(token.type)
-        raise Errors::SyntaxError, "type missmatch"
+        raise Errors::SyntaxError, 'type missmatch'
       else
         token
       end
     end
-
   end
 end
diff --git a/lib/jmespath/util.rb b/lib/jmespath/util.rb
index 73ac86d..682bc6f 100644
--- a/lib/jmespath/util.rb
+++ b/lib/jmespath/util.rb
@@ -1,18 +1,18 @@
+# frozen_string_literal: true
 module JMESPath
   # @api private
   module Util
     class << self
-
       # Determines if a value is false as defined by JMESPath:
       #
       #   https://github.com/jmespath/jmespath.site/blob/master/docs/proposals/improved-filters.rst#and-expressions-1
       #
       def falsey?(value)
         !value ||
-        (value.respond_to?(:to_ary) && value.to_ary.empty?) ||
-        (value.respond_to?(:to_hash) && value.to_hash.empty?) ||
-        (value.respond_to?(:to_str) && value.to_str.empty?) ||
-        (value.respond_to?(:entries) && !value.entries.any?)
+          (value.respond_to?(:to_ary) && value.to_ary.empty?) ||
+          (value.respond_to?(:to_hash) && value.to_hash.empty?) ||
+          (value.respond_to?(:to_str) && value.to_str.empty?) ||
+          (value.respond_to?(:entries) && !value.entries.any?)
         # final case necessary to support Enumerable and Struct
       end
 
diff --git a/lib/jmespath/version.rb b/lib/jmespath/version.rb
index e372ea3..485a143 100644
--- a/lib/jmespath/version.rb
+++ b/lib/jmespath/version.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
 module JMESPath
   VERSION = File.read(File.expand_path('../../../VERSION', __FILE__)).strip
 end

Debdiff

[The following lists of changes regard files as different if they have different names, permissions or owners.]

Files in second set of .debs but not in first

-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/VERSION
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath/caching_parser.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath/errors.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath/lexer.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath/nodes.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath/nodes/and.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath/nodes/comparator.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath/nodes/condition.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath/nodes/current.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath/nodes/expression.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath/nodes/field.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath/nodes/flatten.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath/nodes/function.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath/nodes/index.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath/nodes/literal.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath/nodes/multi_select_hash.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath/nodes/multi_select_list.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath/nodes/not.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath/nodes/or.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath/nodes/pipe.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath/nodes/projection.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath/nodes/slice.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath/nodes/subexpression.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath/parser.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath/runtime.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath/token.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath/token_stream.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath/util.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/lib/jmespath/version.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/specifications/jmespath-1.6.2.gemspec
-rwxr-xr-x  root/root   /usr/bin/jmespath.rb
-rwxr-xr-x  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.2/bin/jmespath.rb

Files in first set of .debs but not in second

-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/VERSION
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath/caching_parser.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath/errors.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath/lexer.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath/nodes.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath/nodes/and.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath/nodes/comparator.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath/nodes/condition.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath/nodes/current.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath/nodes/expression.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath/nodes/field.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath/nodes/flatten.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath/nodes/function.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath/nodes/index.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath/nodes/literal.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath/nodes/multi_select_hash.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath/nodes/multi_select_list.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath/nodes/not.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath/nodes/or.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath/nodes/pipe.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath/nodes/projection.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath/nodes/slice.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath/nodes/subexpression.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath/parser.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath/runtime.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath/token.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath/token_stream.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath/util.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/jmespath-1.6.1/lib/jmespath/version.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/specifications/jmespath-1.6.1.gemspec

Control files: lines which differ (wdiff format)

  • Depends: ruby

More details

Full run details