Skip to content

Commit

Permalink
Merge pull request #76 from Prakriti-nith/rubocop3
Browse files Browse the repository at this point in the history
Enable RuboCop HandleException in view.rb file
  • Loading branch information
Shekharrajak authored Feb 18, 2018
2 parents 3bc9e6c + 455f8b5 commit 3cb4de9
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions lib/daru/view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@ class << self
# New plotting library is set. Same time Daru::View::Plot.adapter is set.
def plotting_library=(lib)
case lib
when :nyaplot, :highcharts
when :nyaplot, :highcharts, :googlecharts
# plot charts
@plotting_library = lib
Daru::View::Plot.adapter = lib
when :googlecharts
# plot chart and table drawing
@plotting_library = lib
Daru::View::Plot.adapter = lib
Daru::View::Table.adapter = lib
if lib == :googlecharts
# plot table drawing
Daru::View::Table.adapter = lib
end
else
raise ArgumentError, "Unsupported library #{lib}"
end
Expand All @@ -42,7 +41,8 @@ def plotting_library=(lib)
# Since IRuby methods can't work in console.
begin
load_lib_in_iruby lib.to_s if defined? IRuby
rescue NameError # rubocop:disable Lint/HandleExceptions
rescue NameError
return
end
end

Expand All @@ -63,7 +63,8 @@ def table_library=(lib)
# Since IRuby methods can't work in console.
begin
load_lib_in_iruby lib.to_s if defined? IRuby
rescue NameError # rubocop:disable Lint/HandleExceptions
rescue NameError
return
end
end

Expand Down

0 comments on commit 3cb4de9

Please sign in to comment.