Skip to content

Commit

Permalink
Handle the case when the application class is two words separated by …
Browse files Browse the repository at this point in the history
…an underscore.
  • Loading branch information
Phil Crosby authored and philc committed Feb 24, 2011
1 parent e9b38ac commit 64b85d1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/shotgun/loader.rb
Expand Up @@ -118,11 +118,15 @@ def inner_app
Sinatra::Application.set :raise_errors, true
Sinatra::Application
else
Object.const_get(File.basename(rackup_file, '.rb').capitalize)
Object.const_get(camel_case(File.basename(rackup_file, '.rb')))
end
end
end

def camel_case(string)
string.split("_").map { |part| part.capitalize }.join
end

def spec_body(body)
if body.respond_to? :to_str
[body]
Expand Down

0 comments on commit 64b85d1

Please sign in to comment.