Permalink
Browse files

Merge "Detect modular Sinatra apps"

  • Loading branch information...
2 parents 3ba3069 + 1fef851 commit 8488787e4b44b65cda9b3f841f0dcc64f9bcd271 Jennifer Hickey committed with Gerrit Code Review Sep 6, 2012
Showing with 7 additions and 2 deletions.
  1. +1 −1 lib/cli/frameworks.rb
  2. +1 −1 spec/assets/tests
  3. +5 −0 spec/unit/frameworks_spec.rb
@@ -86,7 +86,7 @@ def detect(path, available_frameworks)
next if matched_file
File.open(fname, 'r') do |f|
str = f.read # This might want to be limited
- matched_file = fname if (str && str.match(/^\s*require[\s\(]*['"]sinatra['"]/))
+ matched_file = fname if (str && str.match(/^\s*require[\s\(]*['"]sinatra['"(\/base['"])]/))
end
end
if matched_file
Submodule tests updated 492 files
@@ -76,6 +76,11 @@
framework(app).to_s.should =~ /Sinatra/
end
+ it 'should be able to detect a modular Sinatra app' do
+ app = spec_asset('tests/sinatra/app_sinatra_modular')
+ framework(app).to_s.should =~ /Sinatra/
+ end
+
it 'should be able to detect a Rack app' do
app = spec_asset('tests/rack/app_rack_service')
framework(app,false,[["rack"]]).to_s.should =~ /Rack/

0 comments on commit 8488787

Please sign in to comment.