Skip to content
This repository has been archived by the owner on Jan 31, 2018. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:dazoakley/biomart
Browse files Browse the repository at this point in the history
* 'master' of github.com:dazoakley/biomart:
  Version bump to 0.2.3
  Bugfix - we were creating too many filter objects as the catch for the pointer filters was wrong.
  Update builder dependency.
  Make the TSV parsing a little more robust...

Conflicts:
	Gemfile.lock
	biomart.gemspec
	test/test_biomart.rb
	test/test_helper.rb
  • Loading branch information
dazoakley committed Oct 30, 2011
2 parents 814be72 + b34181b commit 12f4581
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 7 deletions.
2 changes: 2 additions & 0 deletions Gemfile.lock
Expand Up @@ -11,6 +11,7 @@ GEM
builder (3.0.0)
crack (0.1.8)
rake (0.8.7)
awesome_print (0.4.0)
shoulda (2.11.3)
simplecov (0.4.0)
simplecov-html (~> 0.4.0)
Expand All @@ -24,6 +25,7 @@ PLATFORMS
ruby

DEPENDENCIES
awesome_print
biomart!
rake
shoulda (>= 2.10)
Expand Down
8 changes: 7 additions & 1 deletion History.txt
@@ -1,4 +1,10 @@
=== 0.2.1 2011-02-18
=== 0.2.3 2011-07-14

* 2 minor bugfixes:
* More robust parsing of the TSV from biomart
* Stop creating lots of unnecessary filter objects

=== 0.2.2 2011-02-18

* 1 major bugfix:
* More forceful filter checking in 0.2.1 was causing queries on 'pointerFilters' to error out unnecessarily.
Expand Down
1 change: 1 addition & 0 deletions biomart.gemspec
Expand Up @@ -23,6 +23,7 @@ Gem::Specification.new do |s|
s.add_development_dependency("rake", [">= 0"])
s.add_development_dependency("shoulda", [">= 2.10"])
s.add_development_dependency("simplecov", [">= 0"])
s.add_development_dependency("awesome_print", [">= 0"])
s.add_development_dependency("vcr", [">= 0"])
s.add_development_dependency("webmock", [">= 0"])
end
8 changes: 4 additions & 4 deletions lib/biomart/dataset.rb
Expand Up @@ -223,7 +223,7 @@ def fetch_configuration
if f.attributes["displayType"] != nil
next if f.attributes["displayType"] == "container"
@filters[ f.attributes["internalName"] ] = Filter.new( f.attributes )
else f.attributes["pointerFilter"] != nil
elsif f.attributes["pointerFilter"] != nil
pointer_filter = Filter.new( f.attributes )
@filters[ pointer_filter.name ] = pointer_filter
@filters[ pointer_filter.pointer_filter ] = pointer_filter
Expand Down Expand Up @@ -337,7 +337,7 @@ def process_tsv( args, tsv )
else
# Ruby >= 1.9 CSV code
begin
parsed_data = CSV.parse( tsv, { :col_sep => "\t" } )
parsed_data = CSV.parse( tsv, { :col_sep => "\t", :skip_blanks => true } )
rescue CSV::MalformedCSVError => e
parsed_data = parse_tsv_line_by_line( headers.size, tsv )
end
Expand Down Expand Up @@ -378,11 +378,11 @@ def parse_tsv_line_by_line( expected_row_size, tsv )

if CSV.const_defined? :Reader
# Ruby < 1.9 CSV code
elements = CSV::parse_line( line, "\t" )
elements = CSV::parse_line( line, "\t" ) || []
else
# Ruby >= 1.9 CSV code
begin
elements = CSV::parse_line( line, { :col_sep => "\t" } )
elements = CSV::parse_line( line, { :col_sep => "\t" } ) || []
rescue CSV::MalformedCSVError => e
elements = []
end
Expand Down
2 changes: 1 addition & 1 deletion lib/biomart/version.rb
@@ -1,3 +1,3 @@
module Biomart
VERSION = "0.2.2"
VERSION = "0.2.3"
end
3 changes: 2 additions & 1 deletion test/test_biomart_dataset.rb
Expand Up @@ -231,7 +231,8 @@ def teardown
search_opts = {
:filters => { 'with_variation_annotation' => true, 'ensembl_gene' => 'ENSG00000244734' },
:attributes => [ 'refsnp_id','chr_name','chrom_start' ],
:process_results => true
:process_results => true,
:timeout => 2000
}

true_results = {}
Expand Down
1 change: 1 addition & 0 deletions test/test_helper.rb
Expand Up @@ -15,6 +15,7 @@
require 'biomart'
require 'shoulda'
require 'vcr'
require 'awesome_print'

# Set-up VCR for mocking up web requests.
VCR.config do |c|
Expand Down

0 comments on commit 12f4581

Please sign in to comment.