Sha256: 91af7d34ada1d4c5d7dbd3933c25543b5d6b644f72296572c07f68f6273a1255

Contents?: true

Size: 301 Bytes

Versions: 14

Compression:

Stored size: 301 Bytes

Contents

# frozen_string_literal: true

module Nanoc::CLI
  # @api private
  module Transform
    module Port
      RANGE = (0x0001..0xffff).freeze

      def self.call(data)
        Integer(data).tap do |int|
          raise 'not a valid port' unless RANGE.cover?(int)
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
nanoc-4.11.12 lib/nanoc/cli/transform.rb
nanoc-4.11.11 lib/nanoc/cli/transform.rb
nanoc-4.11.10 lib/nanoc/cli/transform.rb
nanoc-4.11.9 lib/nanoc/cli/transform.rb
nanoc-4.11.8 lib/nanoc/cli/transform.rb
nanoc-4.11.7 lib/nanoc/cli/transform.rb
nanoc-4.11.6 lib/nanoc/cli/transform.rb
nanoc-4.11.5 lib/nanoc/cli/transform.rb
nanoc-4.11.4 lib/nanoc/cli/transform.rb
nanoc-4.11.3 lib/nanoc/cli/transform.rb
nanoc-4.11.2 lib/nanoc/cli/transform.rb
nanoc-4.11.1 lib/nanoc/cli/transform.rb
nanoc-4.11.0 lib/nanoc/cli/transform.rb
nanoc-4.10.4 lib/nanoc/cli/transform.rb