-
Notifications
You must be signed in to change notification settings - Fork 10
/
speckle_connector.rb
39 lines (29 loc) · 1.12 KB
/
speckle_connector.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# frozen_string_literal: true
require 'sketchup'
require 'extensions'
# Speckle connector module to enable multiplayer mode ON!
module SpeckleConnector
# Version - patched by CI
CONNECTOR_VERSION = '0.0.0'
file = __FILE__.dup
# Account for Ruby encoding bug under Windows.
file.force_encoding('UTF-8') if file.respond_to?(:force_encoding)
# Support folder should be named the same as the root .rb file.
folder_name = File.basename(file, '.*')
# Path to the root .rb file (this file).
PATH_ROOT = File.dirname(file).freeze
# Path to the support folder.
PATH = File.join(PATH_ROOT, folder_name).freeze
# Run from localhost or from build files
DEV_MODE = false
puts("Loading Speckle Connector v#{CONNECTOR_VERSION} from #{DEV_MODE ? 'dev' : 'build'}")
unless file_loaded?(__FILE__)
ex = SketchupExtension.new('Speckle SketchUp', File.join(PATH, 'bootstrap'))
ex.description = 'Speckle Connector for SketchUp'
ex.version = CONNECTOR_VERSION
ex.copyright = 'AEC Systems Ltd.'
ex.creator = 'Speckle Systems'
Sketchup.register_extension(ex, true)
file_loaded(__FILE__)
end
end