Skip to content

Commit

Permalink
Fix Ruby 2.7 warning
Browse files Browse the repository at this point in the history
warning: Using the last argument as keyword parameters is deprecated
  • Loading branch information
zeisler committed Jun 10, 2020
1 parent 1e9dd48 commit 6385126
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions graphviz.gemspec
Expand Up @@ -18,12 +18,10 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]

spec.has_rdoc = 'yard'

spec.add_dependency 'process-pipeline'

spec.add_development_dependency "yard"
spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "bundler", "~> 2.1.2"
spec.add_development_dependency "rspec", "~> 3.6"
spec.add_development_dependency "rake"
end
4 changes: 2 additions & 2 deletions lib/graphviz/graph.rb
Expand Up @@ -46,7 +46,7 @@ def initialize(name = 'G', parent = nil, **attributes)
def add_node(name = nil, **attributes)
name ||= "#{@name}N#{@nodes.count}"

Node.new(name, self, attributes)
Node.new(name, self, **attributes)
end

# Add a subgraph with a given name and attributes.
Expand Down Expand Up @@ -131,7 +131,7 @@ def dump_graph(buffer, indent = "", **options)
node.dump_graph(buffer, indent + "\t", options)
end

dump_edges(buffer, indent + "\t", options)
dump_edges(buffer, indent + "\t", **options)

buffer.puts "#{indent}}"
end
Expand Down
4 changes: 2 additions & 2 deletions spec/graphviz/graph_spec.rb
Expand Up @@ -47,7 +47,7 @@
end

it "gets a node" do
foo = subject.add_node('Foo')
subject.add_node('Foo')
bar = subject.add_node('Bar')
bar.add_node('Baz')
expect(subject.get_node('Baz')).to be_an(Array)
Expand All @@ -58,7 +58,7 @@
end

it "checks if a node exists" do
foo = subject.add_node('Foo')
subject.add_node('Foo')
bar = subject.add_node('Bar')
bar.add_node('Baz')
expect(subject.node_exists?('Baz')).to be true
Expand Down

0 comments on commit 6385126

Please sign in to comment.