Skip to content

Commit 875798b

Browse files
committed
update hamster dependency to ~3.0
1 parent 98ce510 commit 875798b

File tree

9 files changed

+15
-15
lines changed

9 files changed

+15
-15
lines changed

gnuplotrb.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
1818
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(/^(test|spec|unimplemented_features|examples|future_work|notebooks|\..+)/) }
1919
spec.require_paths = ['lib']
2020

21-
spec.add_runtime_dependency 'hamster', '~> 1.0'
21+
spec.add_runtime_dependency 'hamster', '~> 3.0'
2222
spec.add_development_dependency 'bundler', '~> 1.7'
2323
spec.add_development_dependency 'rake', '~> 10.0'
2424
spec.add_development_dependency 'rspec', '~> 3.2'

lib/gnuplotrb/multiplot.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Multiplot
2626
# @param options [Hash] see options in top class docs
2727
def initialize(*plots, **options)
2828
@plots = plots[0].is_a?(Hamster::Vector) ? plots[0] : Hamster::Vector.new(plots)
29-
@options = Hamster.hash(options)
29+
@options = Hamster::Hash[options]
3030
OptionHandling.validate_terminal_options(@options)
3131
yield(self) if block_given?
3232
end

lib/gnuplotrb/plot.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ def initialize(*datasets)
4949
# had to relace **options arg with this because in some cases
5050
# Daru::DataFrame was mentioned as hash and added to options
5151
# instead of plots
52-
@options = Hamster.hash
52+
@options = Hamster::Hash.empty
5353
if datasets[-1].is_a?(Hamster::Hash) || datasets[-1].is_a?(Hash)
54-
@options = Hamster.hash(datasets[-1])
54+
@options = Hamster::Hash[datasets[-1]]
5555
datasets = datasets[0..-2]
5656
end
5757
@datasets = parse_datasets_array(datasets)

lib/gnuplotrb/staff/dataset.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,15 +234,15 @@ def new_with_options(options)
234234
# Initialize Dataset from given String
235235
def init_string(data, options)
236236
@type, @data = File.exist?(data) ? [:datafile, "'#{data}'"] : [:math_function, data.clone]
237-
@options = Hamster.hash(options)
237+
@options = Hamster::Hash[options]
238238
end
239239

240240
##
241241
# Initialize Dataset from given Datablock
242242
def init_dblock(data, options)
243243
@type = :datablock
244244
@data = data.clone
245-
@options = Hamster.hash(options)
245+
@options = Hamster::Hash[options]
246246
end
247247

248248
##
@@ -288,7 +288,7 @@ def init_daru_vector(data, options)
288288
def init_default(data, file: false, **options)
289289
@type = :datablock
290290
@data = Datablock.new(data, file)
291-
@options = Hamster.hash(options)
291+
@options = Hamster::Hash[options]
292292
end
293293
end
294294
end

spec/animation_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
context 'option handling' do
3535
before do
36-
@options = Hamster.hash(title: 'GnuplotRB::Animation', yrange: 0..3)
36+
@options = Hamster::Hash[title: 'GnuplotRB::Animation', yrange: 0..3]
3737
@anim = Animation.new(**@options)
3838
end
3939

spec/dataset_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104

105105
context 'options handling' do
106106
before do
107-
@options = Hamster.hash(title: 'GnuplotRB::Dataset', with: 'lines')
107+
@options = Hamster::Hash[title: 'GnuplotRB::Dataset', with: 'lines']
108108
@dataset = Dataset.new('sin(x)', @options)
109109
end
110110

@@ -124,7 +124,7 @@
124124
end
125125

126126
it 'should allow to safely set several options at once' do
127-
new_options = Hamster.hash(title: 'Some new title', with: 'lines', lt: 3)
127+
new_options = Hamster::Hash[title: 'Some new title', with: 'lines', lt: 3]
128128
new_dataset = @dataset.options(new_options)
129129
@options.each { |key, value| expect(@dataset.send(key)).to eql(value) }
130130
new_options.each { |key, value| expect(new_dataset.send(key)).to eql(value) }
@@ -136,15 +136,15 @@
136136
x = (0..10).to_a
137137
y = x.map { |xx| Math.exp(-xx) }
138138
@data = [x, y]
139-
@options = Hamster.hash(title: 'GnuplotRB::Dataset', with: 'lines')
139+
@options = Hamster::Hash[title: 'GnuplotRB::Dataset', with: 'lines']
140140
@sinx = Dataset.new('sin(x)', @options)
141141
@dataset = Dataset.new([x, y])
142142
@temp_file_dataset = Dataset.new([x, y], file: true)
143143
end
144144

145145
it 'should update options' do
146146
# works just as Dataset#options(...)
147-
new_options = Hamster.hash(title: 'Some new title', with: 'lines', lt: 3)
147+
new_options = Hamster::Hash[title: 'Some new title', with: 'lines', lt: 3]
148148
new_dataset = @sinx.update(new_options)
149149
@options.each { |key, value| expect(@sinx.send(key)).to eql(value) }
150150
new_options.each { |key, value| expect(new_dataset.send(key)).to eql(value) }

spec/multiplot_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
context 'option handling' do
3535
before do
36-
@options = Hamster.hash(title: 'GnuplotRB::Multiplot', yrange: 0..3)
36+
@options = Hamster::Hash[title: 'GnuplotRB::Multiplot', yrange: 0..3]
3737
@mp = Multiplot.new(**@options)
3838
end
3939

spec/plot_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
context 'options handling' do
4949
before do
50-
@options = Hamster.hash(title: 'GnuplotRB::Plot', yrange: 0..3)
50+
@options = Hamster::Hash[title: 'GnuplotRB::Plot', yrange: 0..3]
5151
@plot = Plot.new(**@options)
5252
end
5353

spec/splot_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
context 'options handling' do
2929
before do
30-
@options = Hamster.hash(title: 'GnuplotRB::Plot', yrange: 0..3)
30+
@options = Hamster::Hash[title: 'GnuplotRB::Plot', yrange: 0..3]
3131
@plot = Splot.new(**@options)
3232
end
3333

0 commit comments

Comments
 (0)