Class: Rhinestone::Injector

Inherits:
Object
  • Object
show all
Includes:
Dependor::AutoInject
Defined in:
lib/rhinestone/injector.rb

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Injector

Returns a new instance of Injector.



6
7
8
# File 'lib/rhinestone/injector.rb', line 6

def initialize(opts = {})
  @cache_path = opts.fetch(:cache_path, '/tmp/rhinestone/cache')
end

Instance Method Details

#cache_backendObject



10
11
12
# File 'lib/rhinestone/injector.rb', line 10

def cache_backend
  @cache_backend ||= FilesystemCacheBackend.new(@cache_path)
end

#hostnameObject



14
15
16
# File 'lib/rhinestone/injector.rb', line 14

def hostname
  "rubygems.org"
end

#important_headersObject



18
19
20
# File 'lib/rhinestone/injector.rb', line 18

def important_headers
  %w{Content-Type Cache-Control ETag Set-Cookie}
end