Sha256: e3f42faa8d8e7c244756a2b7c50d4351d6ba9ccd5f4c7279ea9b3f2b300e5bd1

Contents?: true

Size: 998 Bytes

Versions: 6

Compression:

Stored size: 998 Bytes

Contents

require 'simple_slug/version'
require 'active_support/core_ext'
require 'simple_slug/model_addition'
require 'simple_slug/railtie' if Object.const_defined?(:Rails)

module SimpleSlug
  autoload :Adapter, 'simple_slug/adapter'
  autoload :ModelAddition, 'simple_slug/model_addition'
  autoload :HistorySlug, 'simple_slug/history_slug'

  mattr_accessor :excludes
  @@excludes = %w(new edit show index session login logout sign_in sign_out users admin stylesheets javascripts images fonts assets)

  mattr_accessor :slug_regexp
  @@slug_regexp = /\A(?:\w+[\w\d\-_]*|--\d+)\z/

  mattr_accessor :slug_column
  @@slug_column = 'slug'

  mattr_accessor :min_length
  @@min_length = 3

  mattr_accessor :max_length
  @@max_length = 191

  mattr_accessor :callback_type
  @@callback_type = :before_validation

  mattr_accessor :validation
  @@validation = true

  STARTS_WITH_NUMBER_REGEXP =/\A\d+/
  NUMBER_REGEXP =/\A\d+\z/
  RESOLVE_SUFFIX_REGEXP = /--\d+\z/

  def self.setup
    yield self
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
simple_slug-0.4.5 lib/simple_slug.rb
simple_slug-0.4.4 lib/simple_slug.rb
simple_slug-0.4.3 lib/simple_slug.rb
simple_slug-0.4.2 lib/simple_slug.rb
simple_slug-0.4.1 lib/simple_slug.rb
simple_slug-0.4.0 lib/simple_slug.rb