Sha256: 75416cb7450ad89b33159bea6fe36f41974911f720df4e7911ba88a906a9536e

Contents?: true

Size: 653 Bytes

Versions: 135

Compression:

Stored size: 653 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',
          sqs: 'sqs'
        }
      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

135 entries across 135 versions & 4 rubygems

Version Path
jets-3.2.2 lib/jets/inflections.rb
jets-3.2.1 lib/jets/inflections.rb
jets.benforeva-3.0.17.pre.mount.pre.fix lib/jets/inflections.rb
jets-3.2.0 lib/jets/inflections.rb
jets-3.1.5 lib/jets/inflections.rb
jets-3.1.4 lib/jets/inflections.rb
jets-3.1.3 lib/jets/inflections.rb
jets-3.1.2 lib/jets/inflections.rb
jets-3.1.1 lib/jets/inflections.rb
jets-3.1.0 lib/jets/inflections.rb
jets-3.0.23 lib/jets/inflections.rb
jets-3.0.22 lib/jets/inflections.rb
jets-3.0.21 lib/jets/inflections.rb
jets-3.0.20 lib/jets/inflections.rb
jets-3.0.19 lib/jets/inflections.rb
jets-3.0.18 lib/jets/inflections.rb
jets-3.0.17 lib/jets/inflections.rb
jets-3.0.16 lib/jets/inflections.rb
jets-3.0.15 lib/jets/inflections.rb
jets-3.0.14 lib/jets/inflections.rb