Skip to content

Commit 356bd4e

Browse files
committed
refactoring
1 parent cc17d3c commit 356bd4e

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

lib/jruby_art/app.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
# frozen_string_literal: false
23
require 'java'
34
require_relative '../rpextras'
@@ -55,10 +56,10 @@ def self.inherited(subclass)
5556

5657
class << self
5758
# Handy getters and setters on the class go here:
58-
attr_accessor :sketch_class, :library_loader
59+
attr_reader :sketch_class, :library_loader
5960

6061
def load_libraries(*args)
61-
library_loader ||= LibraryLoader.new
62+
@library_loader ||= LibraryLoader.new
6263
library_loader.load_library(*args)
6364
end
6465
alias load_library load_libraries
@@ -122,8 +123,8 @@ def sketch_title(title)
122123
surface.set_title(title)
123124
end
124125

125-
def sketch_path(spath = nil)
126-
return super() if spath.nil?
126+
def sketch_path(spath = '')
127+
return super() if spath.empty?
127128
super(spath)
128129
end
129130

lib/jruby_art/installer.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ def set_processing_root
3131
end
3232

3333
def root_exist?
34-
return false if config.nil?
34+
return false if config.empty?
3535
File.exist? config['PROCESSING_ROOT']
3636
end
3737

3838
def config
3939
k9config = File.expand_path("#{home}/.jruby_art/config.yml")
40-
return nil unless File.exist? k9config
40+
return '' unless File.exist? k9config
4141
YAML.load_file(k9config)
4242
end
4343

0 commit comments

Comments
 (0)