Skip to content

Commit 165146b

Browse files
committed
some clean-up
1 parent 95b22f4 commit 165146b

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

lib/jruby_art/installer.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
VERSION = '3.1.1' # processing version
55

66
class Installer
7-
attr_reader :os, :jruby, :sketch, :gem_root
8-
def initialize(os: :linux, jruby: true, root:)
7+
attr_reader :os, :sketch, :gem_root, :home
8+
def initialize(os: :linux, root:)
99
@os = os
10-
@jruby = jruby
1110
@gem_root = root
12-
@sketch = "#{ENV['HOME']}/sketchbook" if os == :linux
13-
@sketch = "#{ENV['HOME']}/My Documents/Processing" if os == :windows
14-
@sketch = "#{ENV['HOME']}/Documents/Processing" if os == :mac
11+
@home = ENV['HOME']
12+
@sketch = "#{home}/sketchbook" if os == :linux
13+
@sketch = "#{home}/My Documents/Processing" if os == :windows
14+
@sketch = "#{home}/Documents/Processing" if os == :mac
1515
end
1616

1717
def install
@@ -28,15 +28,15 @@ def install_examples
2828
# Optimistically set processing root
2929
def set_processing_root
3030
require 'psych'
31-
folder = File.expand_path("#{ENV['HOME']}/.jruby_art")
31+
folder = File.expand_path("#{home}/.jruby_art")
3232
Dir.mkdir(folder) unless File.exist? folder
3333
path = File.join(folder, 'config.yml')
34-
proot = "#{ENV['HOME']}/processing-#{VERSION}"
34+
proot = "#{home}/processing-#{VERSION}"
3535
proot = "/Java/Processing-#{VERSION}" if os == :windows
3636
proot = "/Applications/Processing.app/Contents/Java" if os == :mac
3737
data = {
3838
'PROCESSING_ROOT' => proot,
39-
'JRUBY' => jruby.to_s,
39+
'JRUBY' => true.to_s,
4040
'sketchbook_path' => sketch,
4141
'MAX_WATCH' => '20'
4242
}
@@ -49,7 +49,7 @@ def root_exist?
4949
end
5050

5151
def config
52-
k9config = File.expand_path("#{ENV['HOME']}/.jruby_art/config.yml")
52+
k9config = File.expand_path("#{home}/.jruby_art/config.yml")
5353
return nil unless File.exist? k9config
5454
YAML.load_file(k9config)
5555
end

lib/jruby_art/runner.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def watch(sketch, args)
121121
end
122122

123123
def setup(choice)
124-
installer = Installer.new(root: K9_ROOT, os: host_os, jruby: true)
124+
installer = Installer.new(root: K9_ROOT, os: host_os)
125125
case choice
126126
when /check/
127127
installer.check

0 commit comments

Comments
 (0)