Skip to content

Commit

Permalink
Fixing error with loading the ruby bindings normally
Browse files Browse the repository at this point in the history
  • Loading branch information
axelstudios committed May 6, 2014
1 parent db4ed7d commit 74c3859
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions openstudiocore/ruby/openstudio.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#####################################################################

if Sketchup.version_number > 14000000
require 'pathname'
else
if defined? Sketchup && Sketchup.version_number <= 14000000
require File.expand_path(File.dirname(__FILE__)) + '/openstudio/sketchup_plugin/stdruby/pathname'
else
require 'pathname'
end

# follow symlinks so that we find the original path to the so's
Expand Down
6 changes: 3 additions & 3 deletions openstudiocore/ruby/openstudio_dev.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
######################################################################

if Sketchup.version_number > 14000000
require 'pathname'
else
if defined? Sketchup && Sketchup.version_number <= 14000000
require File.expand_path(File.dirname(__FILE__)) + '/openstudio/sketchup_plugin/stdruby/pathname'
else
require 'pathname'
end

# follow symlinks so that we find the original path to the so's
Expand Down

2 comments on commit 74c3859

@macumber
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks legit, what error was this causing @axelstudios ?

@axelstudios
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line got merged in during the last iteration:

The problem is that pathname isn't part of SketchUp 2013 and earlier, so the plug-in was failing to load. So I made a change to load the absolute path of the pathname.rb if it matched those SketchUp versions, which fixed it. But in doing so, I added the Sketchup constant to openstudio.rb, which obviously can't be found if you just load the bindings like normal (results measures failed in the app). So finally, I made this commit to check whether or not we're in SketchUp <=2013, and if so, load pathname.rb that we provide.

Please sign in to comment.