quandl_data 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -53,17 +53,27 @@ module Operations
53
53
  end
54
54
 
55
55
  def trim_start(date)
56
+ # date format
56
57
  date = Date.parse(date) if date.is_a?(String)
57
58
  date = date.jd if date.respond_to?(:jd)
59
+ # find index
58
60
  index = data_array.rindex{|r| r[0] == date }
59
- @data_array = @data_array[index..-1]
61
+ # trim if index is valid
62
+ @data_array = @data_array[index..-1] if @data_array[index]
63
+ # chainable
64
+ self
60
65
  end
61
66
 
62
67
  def trim_end(date)
68
+ # date format
63
69
  date = Date.parse(date) if date.is_a?(String)
64
70
  date = date.jd if date.respond_to?(:jd)
71
+ # find index
65
72
  index = data_array.rindex{|r| r[0] == date }
66
- @data_array = @data_array[0..index]
73
+ # trim if index is valid
74
+ @data_array = @data_array[0..index] if @data_array[index]
75
+ # chainable
76
+ self
67
77
  end
68
78
 
69
79
  def limit(amount)
@@ -1,5 +1,5 @@
1
1
  module Quandl
2
2
  module Data
3
- VERSION = "0.0.10"
3
+ VERSION = "0.0.11"
4
4
  end
5
5
  end
data/quandl_data.gemspec CHANGED
@@ -22,5 +22,5 @@ Gem::Specification.new do |s|
22
22
  s.add_development_dependency "fivemat", "~> 1.2"
23
23
 
24
24
  s.add_runtime_dependency "activesupport", ">= 3.0.0"
25
- s.add_runtime_dependency "quandl_operation", ">= 0.0.15"
25
+ s.add_runtime_dependency "quandl_operation", ">= 0.0.16"
26
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quandl_data
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -82,7 +82,7 @@ dependencies:
82
82
  requirements:
83
83
  - - '>='
84
84
  - !ruby/object:Gem::Version
85
- version: 0.0.15
85
+ version: 0.0.16
86
86
  type: :runtime
87
87
  prerelease: false
88
88
  version_requirements: !ruby/object:Gem::Requirement
@@ -90,7 +90,7 @@ dependencies:
90
90
  requirements:
91
91
  - - '>='
92
92
  - !ruby/object:Gem::Version
93
- version: 0.0.15
93
+ version: 0.0.16
94
94
  description: Data will be interfaced
95
95
  email:
96
96
  - blake@hilscher.ca