Sha256: 6e90ebe8063750c5efd35d3dca1fa4df41c572ee28c155df5f394a7438d1f15c

Contents?: true

Size: 770 Bytes

Versions: 5

Compression:

Stored size: 770 Bytes

Contents

require 'tmpdir'
module Shutterbug
  module Handlers
    module FileHandlers
      class Base
        attr_accessor :config

        def self.instance
          return @instance || self.new
        end

        def initialize(_config = Configuration.instance)
          self.config = _config
        end

        def urlify(name)
          "#{self.config.uri_prefix}#{self.path_prefix}/#{name}"
        end

        def path_prefix
          "#{self.config.path_prefix}/get_#{file_extension}"
        end

        def filename_matcher
          "(([^\/|\.]+)\.?([^\/]+))?"
        end

        def regex
          /#{path_prefix}\/#{filename_matcher}/
        end

        def filename(base)
          "#{base}.#{file_extension}"
        end

      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
shutterbug-0.2.5 lib/shutterbug/handlers/file_handlers/base.rb
shutterbug-0.2.1 lib/shutterbug/handlers/file_handlers/base.rb
shutterbug-0.2.0 lib/shutterbug/handlers/file_handlers/base.rb
shutterbug-0.1.2 lib/shutterbug/handlers/file_handlers/base.rb
shutterbug-0.1.1 lib/shutterbug/handlers/file_handlers/base.rb