app/commands/sketchup.rb in skippy-0.4.1.a vs app/commands/sketchup.rb in skippy-0.4.2.a

- old
+ new

@@ -13,10 +13,11 @@ def debug(version) app = find_sketchup(version) unless app.can_debug raise Skippy::Error, "Debug library not installed for Sketchup #{version}" end + arguments = ['-rdebug', %("ide port=#{options.port}")] Skippy.os.launch_app(app.executable, *arguments) end desc 'launch VERSION', 'Start SketchUp' @@ -49,13 +50,17 @@ private # @param [Integer] version # @return [Skippy::SketchUpApp, nil] def find_sketchup(version) + # Allow shortcuts such as 18 to mean 2018. + full_version = version.to_i + full_version += 2000 if (13..99).cover?(full_version) app = Skippy.os.sketchup_apps.find { |sketchup| - sketchup.version == version.to_i + sketchup.version == full_version } raise Skippy::Error, "SketchUp #{version} not found." if app.nil? + app end end