Sha256: dc08dd963fa316d233ae292dc8cca6b99a2ab7bf5b0951d8fe31c7b41e091d37

Contents?: true

Size: 1.83 KB

Versions: 2

Compression:

Stored size: 1.83 KB

Contents

def fixtures_data
  return @fixtures_data if @fixtures_data
  @fixtures_data = {}
  Dir.glob( File.join( File.dirname(__FILE__), 'data/**/*.qdf' ) ).each{|f|
    name = File.basename(f, '.qdf').to_s
    @fixtures_data[name] = File.read(f)
  }
  @fixtures_data
end

def qdf_format
%Q{
# first dataset
source_code: NSE
code: OIL
name: Oil India Limited
description: |-
  Here is a description with multiple lines.
  This is the second line.
-
Date, Value, High, Low
2013-11-20,9.99470588235294,11.003235294117646,14.00164705882353
2013-11-19,10.039388096885814,,14.09718770934256

# Second dataset
code:           DATASET_CODE_2
source_code:    SOURCE_CODE_2
name:           Test Dataset Name 2
description:    Here is a description with multiple lines.
-
Date, Value, High, Low
2013-11-20,9.99470588235294,11.003235294117646,14.00164705882353
2013-11-19,10.039388096885814,,14.09718770934256
2013-11-18,11.039388096885814,,15.09718770934256
}
end

def qdf_attributes
  {
    code:           'DATASET_CODE_2',
    source_code:    'SOURCE_CODE',
    name:           'Test Dataset Name 2',
    description:    "Here is a description with multiple lines.\n This is the second line.",
    column_names:   ['Date', 'Value', 'High', 'Low'],
    private:        false,
    display_url:    'http://test.com/',
    data:           Quandl::Data.new([["2013-11-20", "9.99470588235294", "11.003235294117646", "14.00164705882353"],["2013-11-19", "10.039388096885814", nil, "14.09718770934256"]]),
  }
end

def qdf_attributes_to_format
%Q{source_code: SOURCE_CODE
code: DATASET_CODE_2
name: Test Dataset Name 2
description: |-
  Here is a description with multiple lines.
   This is the second line.
private: false
display_url: http://test.com/
-
Date,Value,High,Low
2013-11-20,9.99470588235294,11.003235294117646,14.00164705882353
2013-11-19,10.039388096885814,,14.09718770934256
}
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
quandl_format-0.1.1 spec/fixtures/format.rb
quandl_format-0.1.0 spec/fixtures/format.rb