Sha256: d2bf55874e847143b18c969657577409bd048f6a74eefc8ab7464a65977703cc

Contents?: true

Size: 1.43 KB

Versions: 16

Compression:

Stored size: 1.43 KB

Contents

#-------------------------------------------------------------------------------
#
#    Author: Unknown
# Copyright: Copyright (c) 2017
#   License: None
#
#-------------------------------------------------------------------------------

require 'json'

require 'extensions.rb'
require 'sketchup.rb'

module Example
module HelloWorld

  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

  # Extension information.
  extension_json_file = File.join(PATH, 'extension.json')
  extension_json = File.read(extension_json_file)
  EXTENSION = ::JSON.parse(extension_json, symbolize_names: true).freeze

  unless file_loaded?(__FILE__)
    loader = File.join(PATH, 'main')
    @extension = SketchupExtension.new(EXTENSION[:name], loader)
    @extension.description = EXTENSION[:description]
    @extension.version     = EXTENSION[:version]
    @extension.copyright   = EXTENSION[:copyright]
    @extension.creator     = EXTENSION[:creator]
    Sketchup.register_extension(@extension, true)
  end

end # module HelloWorld
end # module Example

file_loaded(__FILE__)

Version data entries

16 entries across 8 versions & 1 rubygems

Version Path
skippy-0.5.2.a fixtures/project_with_lib/src/hello_world.rb
skippy-0.5.2.a fixtures/my_project/src/hello_world.rb
skippy-0.5.1.a fixtures/project_with_lib/src/hello_world.rb
skippy-0.5.1.a fixtures/my_project/src/hello_world.rb
skippy-0.5.0.a fixtures/my_project/src/hello_world.rb
skippy-0.5.0.a fixtures/project_with_lib/src/hello_world.rb
skippy-0.4.3.a fixtures/my_project/src/hello_world.rb
skippy-0.4.3.a fixtures/project_with_lib/src/hello_world.rb
skippy-0.4.2.a fixtures/my_project/src/hello_world.rb
skippy-0.4.2.a fixtures/project_with_lib/src/hello_world.rb
skippy-0.4.1.a fixtures/my_project/src/hello_world.rb
skippy-0.4.1.a fixtures/project_with_lib/src/hello_world.rb
skippy-0.4.0.a fixtures/project_with_lib/src/hello_world.rb
skippy-0.4.0.a fixtures/my_project/src/hello_world.rb
skippy-0.3.0.a fixtures/my_project/src/hello_world.rb
skippy-0.3.0.a fixtures/project_with_lib/src/hello_world.rb