Sha256: c486c42942bb047e1012ea912869458aa71599a05e76947328b54abd4c4c523e

Contents?: true

Size: 630 Bytes

Versions: 35

Compression:

Stored size: 630 Bytes

Contents

module Jets
  class Inflections
    class << self
      def load!
        ActiveSupport::Inflector.inflections(:en) do |inflect|
          load(inflect, base)
          load(inflect, custom)
        end
      end

      def load(inflect, inflections)
        inflections.each do |k,v|
          inflect.irregular k,v
        end
      end

      # base custom inflections
      def base
        {
          sns: 'sns'
        }
      end

      # User defined custom inflections
      def custom
        path = "#{Jets.root}config/inflections.yml"
        File.exist?(path) ? YAML.load_file(path) : {}
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
jets-1.3.8 lib/jets/inflections.rb
jets-1.3.7 lib/jets/inflections.rb
jets-1.3.6 lib/jets/inflections.rb
jets-1.3.5 lib/jets/inflections.rb
jets-1.3.4 lib/jets/inflections.rb
jets-1.3.3 lib/jets/inflections.rb
jets-1.3.2 lib/jets/inflections.rb
jets-1.3.1 lib/jets/inflections.rb
jets-1.3.0 lib/jets/inflections.rb
jets-1.2.1 lib/jets/inflections.rb
jets-1.2.0 lib/jets/inflections.rb
jets-1.1.5 lib/jets/inflections.rb
jets-1.1.4 lib/jets/inflections.rb
jets-1.1.3 lib/jets/inflections.rb
jets-1.1.2 lib/jets/inflections.rb
jets-1.1.1 lib/jets/inflections.rb
jets-1.1.0 lib/jets/inflections.rb
jets-1.0.18 lib/jets/inflections.rb
jets-1.0.17 lib/jets/inflections.rb
jets-1.0.16 lib/jets/inflections.rb