Permalink
Browse files

Merge branch 'master' of github.com:dazoakley/biomart

* '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...
2 parents 814be72 + b34181b commit 12f4581ac7bda443e92d3295f3bc3f23c8929acd @dazoakley committed Oct 30, 2011
Showing with 18 additions and 7 deletions.
  1. +2 −0 Gemfile.lock
  2. +7 −1 History.txt
  3. +1 −0 biomart.gemspec
  4. +4 −4 lib/biomart/dataset.rb
  5. +1 −1 lib/biomart/version.rb
  6. +2 −1 test/test_biomart_dataset.rb
  7. +1 −0 test/test_helper.rb
View
2 Gemfile.lock
@@ -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)
@@ -24,6 +25,7 @@ PLATFORMS
ruby
DEPENDENCIES
+ awesome_print
biomart!
rake
shoulda (>= 2.10)
View
8 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.
View
1 biomart.gemspec
@@ -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
View
8 lib/biomart/dataset.rb
@@ -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
@@ -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
@@ -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
View
2 lib/biomart/version.rb
@@ -1,3 +1,3 @@
module Biomart
- VERSION = "0.2.2"
+ VERSION = "0.2.3"
end
View
3 test/test_biomart_dataset.rb
@@ -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 = {}
View
1 test/test_helper.rb
@@ -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|

0 comments on commit 12f4581

Please sign in to comment.