Sha256: b5fa7321af55cd18ba4ac76140344ee3002c5d6d12c1545e05aab0414a96f93a

Contents?: true

Size: 787 Bytes

Versions: 96

Compression:

Stored size: 787 Bytes

Contents

require 'iconv'

module Six
  module Query
    class Base
      include ActionView::Helpers::SanitizeHelper
      include ActionView::Helpers::TextHelper
      extend ActionView::Helpers::SanitizeHelper::ClassMethods

      attr_reader(:ic)

      class TimeoutError < StandardError
      end

      #def strip_tags(c); c.strip; end

      def logger
        ActionController::Base.logger
      end

      def ic
        @ic ||= Iconv.new('UTF-8//IGNORE', 'UTF-8')
      end

      def clean(value)
        case value
          when /\A-?[0-9][0-9]*\.[0-9]*\Z/
            value.to_f
          when /\A-?[0-9][0-9]*\Z/
            value.to_i
          else
            strip_tags(ic.iconv(value + ' ')[0..-2])
        end
      end
    end
  end
end

Version data entries

96 entries across 96 versions & 1 rubygems

Version Path
six-updater-web-0.14.1 lib/six-updater-web/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.13.6 lib/six-updater-web/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.13.5 lib/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.13.4 lib/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.13.3 lib/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.13.2 lib/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.13.1 lib/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.12.7 lib/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.12.6 lib/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.12.5 lib/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.12.4 lib/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.12.3 lib/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.12.2 lib/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.12.1 lib/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.11.2 lib/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.11.1 lib/vendor/plugins/six-query/lib/six/query/base.rb