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.24.15 lib/six-updater-web/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.24.14 lib/six-updater-web/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.24.13 lib/six-updater-web/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.24.12 lib/six-updater-web/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.24.11 lib/six-updater-web/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.24.10 lib/six-updater-web/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.24.9 lib/six-updater-web/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.24.8 lib/six-updater-web/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.24.7 lib/six-updater-web/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.24.6 lib/six-updater-web/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.24.5 lib/six-updater-web/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.24.4 lib/six-updater-web/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.24.3 lib/six-updater-web/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.24.2 lib/six-updater-web/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.24.1 lib/six-updater-web/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.24.0 lib/six-updater-web/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.23.7 lib/six-updater-web/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.23.6 lib/six-updater-web/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.23.5 lib/six-updater-web/vendor/plugins/six-query/lib/six/query/base.rb
six-updater-web-0.23.4 lib/six-updater-web/vendor/plugins/six-query/lib/six/query/base.rb