butler_static 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/lib/butler/static.rb CHANGED
@@ -75,18 +75,13 @@ module Butler
75
75
  # general global HTTP header settings
76
76
  #
77
77
  class Static
78
- def initialize(app, options={})
78
+ def initialize(app, path=nil, options={})
79
79
  @app = app
80
- path = options[:path] || ''
81
- # CLEAN THIS MESS UP
82
80
  path ||= Rails.application.config.paths['public'].first if defined? Rails
83
- @header_rules = {}
84
- if defined? Rails
85
- header_rules = Rails.application.config.assets.header_rules
86
- @header_rules.merge(header_rules) if header_rules
87
- end
88
- @header_rules = @header_rules.merge(options[:header_rules]) if options[:header_rules]
89
- @file_handler = Butler::Handler.new(path, header_rules: @header_rules)
81
+ header_rules = {}
82
+ header_rules = Rails.application.config.assets.header_rules if defined? Rails
83
+ header_rules = options[:header_rules] if options[:header_rules]
84
+ @file_handler = Butler::Handler.new(path, header_rules: header_rules)
90
85
  end
91
86
 
92
87
  def call(env)
@@ -1,3 +1,3 @@
1
1
  module Butler
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -185,7 +185,7 @@ class StaticTest < MiniTest::Unit::TestCase
185
185
  /\.(css|erb)\z/ => {'Cache-Control' => 'public, max-age=600'},
186
186
  }
187
187
 
188
- App = Butler::Static.new(DummyApp, path: "#{FIXTURE_LOAD_PATH}/public", header_rules: header_rules)
188
+ App = Butler::Static.new(DummyApp, "#{FIXTURE_LOAD_PATH}/public", header_rules: header_rules)
189
189
 
190
190
  def setup
191
191
  @app = App
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: butler_static
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: