Skip to content

Commit d5df084

Browse files
committed
fix bug caused due to outdated daru API
1 parent 4fd1606 commit d5df084

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
/html/
99
/spec/reports/
1010
/tmp/
11-
/.idea/
11+
/.idea/
12+
*.gem

lib/gnuplotrb/staff/dataset.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,9 @@ def init_dblock(data, options)
249249
# Create new value for 'using' option based on column count
250250
def get_daru_columns(data, cnt)
251251
new_opt = (2..cnt).to_a.join(':')
252-
if data.index.key(0).is_a?(DateTime) || data.index.key(0).is_a?(Numeric)
252+
# check if DateTimeIndex. If not, assume it is Daru::Index and check for
253+
# numeric value in the index.
254+
if data.index.instance_of?(Daru::DateTimeIndex) || data.index.first[0].is_a?(Numeric)
253255
"1:#{new_opt}"
254256
else
255257
"#{new_opt}:xtic(1)"

0 commit comments

Comments
 (0)