grada 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/grada.rb +5 -1
  2. metadata +1 -17
data/lib/grada.rb CHANGED
@@ -1,3 +1,5 @@
1
+ $:.unshift File.expand_path('..', __FILE__)
2
+
1
3
  require_relative 'grada/gnuplot'
2
4
 
3
5
  class Grada
@@ -98,6 +100,7 @@ class Grada
98
100
 
99
101
  if @opts[:graph_type] == :histogram
100
102
  population_data?(@x)
103
+ return nil if @x.empty?
101
104
 
102
105
  plot_histogram do |plot|
103
106
  plot.set "terminal x11 size #{@opts[:width]},#{@opts[:height]}"
@@ -144,6 +147,7 @@ class Grada
144
147
 
145
148
  if @opts[:graph_type] == :histogram
146
149
  population_data?(@x)
150
+ return nil if @x.empty?
147
151
 
148
152
  plot_histogram do |plot|
149
153
  plot.output "#{@opts[:filename]}.#{ext}"
@@ -244,7 +248,7 @@ class Grada
244
248
  def plot_histogram(&block)
245
249
  Gnuplot.open do
246
250
  Gnuplot::Plot.construct do |plot|
247
- block.call plot if block
251
+ block.call plot if block
248
252
 
249
253
  width = ( @x.max - @x.min ) / @x.size
250
254
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grada
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,22 +11,6 @@ bindir: bin
11
11
  cert_chain: []
12
12
  date: 2013-06-20 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: magritte
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '0'
30
14
  - !ruby/object:Gem::Dependency
31
15
  name: rspec
32
16
  requirement: !ruby/object:Gem::Requirement