File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+ # module encapsulates a check that the PROCESSING_ROOT exists
3+ module Core
4+ def self . check? ( path )
5+ if File . directory? ( path )
6+ core_path = File . join ( path , 'core/library/core.jar' )
7+ return true if File . exist? ( core_path )
8+ warn format ( '%s jar does not exist' , core_path )
9+ else warn format ( '%s directory does not exist' , path )
10+ end
11+ end
12+ end
13+
14+ # Provided processing distributions have the same nested structure ie:-
15+ # "core/library/core.jar" we can find "core.jar" when PROCESSING_ROOT exists
Original file line number Diff line number Diff line change @@ -31,8 +31,7 @@ def set_processing_root
3131 end
3232
3333 def root_exist?
34- return false if config . empty?
35- File . exist? config [ 'PROCESSING_ROOT' ]
34+ Core . check? ( config [ 'PROCESSING_ROOT' ] )
3635 end
3736
3837 def config
@@ -55,12 +54,13 @@ def show_version
5554
5655# Configuration checker
5756class Check < Installer
57+ require_relative 'core'
5858 def install
5959 show_version
6060 return super unless config
6161 installed = File . exist? File . join ( gem_root , 'lib/ruby/jruby-complete.jar' )
62- proot = ' PROCESSING_ROOT = Not Set!!!' unless root_exist?
63- proot ||= " PROCESSING_ROOT = #{ config [ 'PROCESSING_ROOT' ] } "
62+ proot = ' PROCESSING_ROOT = Not Set Correctly !!!' unless root_exist?
63+ proot ||= " PROCESSING_ROOT = #{ config [ 'PROCESSING_ROOT' ] } "
6464 sketchbook = " sketchbook_path = #{ config [ 'sketchbook_path' ] } "
6565 template = " template = #{ config [ 'template' ] } "
6666 java_args = " java_args = #{ config [ 'java_args' ] } "
You can’t perform that action at this time.
0 commit comments