Skip to content

Commit

Permalink
Use a hash for options (future proof)
Browse files Browse the repository at this point in the history
  • Loading branch information
elia committed Sep 29, 2013
1 parent c8e4301 commit be7012e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/opal/sprockets/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,18 @@ class Server

attr_accessor :debug, :index_path, :main, :public_dir, :sprockets

def initialize debug = true
def initialize debug_or_options = {}
unless Hash === debug_or_options
warn "passing a boolean to control debug is deprecated.\n"+
"Please pass an Hash instead: Server.new(debug: true)"
options = {debug: debug_or_options}
else
options = debug_or_options
end

@public_dir = '.'
@sprockets = Environment.new
@debug = debug
@debug = options.fetch(:debug, true)

yield self if block_given?
create_app
Expand Down

0 comments on commit be7012e

Please sign in to comment.