-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
157 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
APP_ROOT = Pathname.new(File.expand_path('..', __FILE__)).expand_path | ||
|
||
class AppRootFilter < SimpleCov::Filter | ||
def matches?(source_file) | ||
source_file.filename.sub(/^#{excluded_path.to_s}.*/, '').empty? | ||
end | ||
|
||
def excluded_path | ||
APP_ROOT.join(filter_argument).expand_path | ||
end | ||
end | ||
|
||
def app_root | ||
Pathname.new(File.expand_path('../../', __FILE__)) | ||
end | ||
|
||
def gemset_definition_file | ||
rbenv = app_root.join('.rbenv-gemsets') | ||
rbenv if rbenv.exist? | ||
end | ||
|
||
def gemsets | ||
file = gemset_definition_file | ||
if File.exist? file.to_s | ||
file.readlines.map(&:strip).select { |line| !line.empty? } | ||
else | ||
[] | ||
end | ||
end | ||
|
||
if ENV['COVERAGE'] | ||
SimpleCov.start do | ||
add_group "Controllers", "app/controllers" | ||
add_group "FakeRecords", "app/fake_records" | ||
add_group "Helpers", "app/helpers" | ||
add_group "Models", "app/models" | ||
add_group "Serializers", "app/serializers" | ||
add_group "ViewHelpers", "app/viewhelpers" | ||
add_group "Lib", "lib" | ||
|
||
add_filter AppRootFilter.new('config/') | ||
add_filter AppRootFilter.new('spec/') | ||
add_filter AppRootFilter.new('test/') | ||
|
||
gemsets.each do |gemset| | ||
add_filter AppRootFilter.new("#{gemset}/") | ||
end | ||
|
||
# Set timeout for merging coverage results to 30 minutes | ||
merge_timeout(30 * 60) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class AddIndexOnSineCommonness < ActiveRecord::Migration | ||
def change | ||
# We only want to send queries like | ||
# SELECT "symbols".*, "sine_symbol_commonnesses".* | ||
# FROM "symbols" LEFT OUTER JOIN "sine_symbol_commonnesses" ON "sine_symbol_commonnesses"."symbol_id" = "symbols"."id" | ||
# ORDER BY sine_symbol_commonnesses.commonness ASC LIMIT 1 | ||
# Thus, we also add an index on the commonness. | ||
add_index :sine_symbol_commonnesses, :commonness | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters