Class: Releasy::Builders::WindowsBuilder Abstract

Inherits:
Builder
  • Object
show all
Includes:
Mixins::CanExcludeEncoding
Defined in:
lib/releasy/builders/windows_builder.rb

Overview

This class is abstract.

General functionality for Windows builders.

Direct Known Subclasses

OcraBuilder, WindowsWrapped

Constant Summary collapse

EXECUTABLE_TYPES =
[:auto, :windows, :console]

Constants included from Mixins::Log

Mixins::Log::DEFAULT_LOG_LEVEL, Mixins::Log::LOG_LEVELS

Instance Attribute Summary collapse

Attributes inherited from Builder

#project, #suffix

Instance Method Summary collapse

Methods included from Mixins::CanExcludeEncoding

#exclude_encoding

Methods inherited from Builder

#initialize, #type, #valid_for_platform?

Methods included from Mixins::Log

log_level, log_level=

Methods included from Mixins::HasPackagers

#add_package

Constructor Details

This class inherits a constructor from Releasy::Builders::Builder

Instance Attribute Details

#executable_type:auto, ...

Returns Type of ruby to run executable with. :console means run with ‘ruby.exe’, :windows means run with ‘rubyw.exe’, :auto means determine type from executable extension (.rb => :console or .rbw => :windows).

Returns:

  • (:auto, :windows, :console)

    Type of ruby to run executable with. :console means run with ‘ruby.exe’, :windows means run with ‘rubyw.exe’, :auto means determine type from executable extension (.rb => :console or .rbw => :windows).



15
16
17
# File 'lib/releasy/builders/windows_builder.rb', line 15

def executable_type
  @executable_type
end

#iconString

Optional filename of icon to show on executable/installer (.ico).

Returns:

  • (String)

    the current value of icon



9
10
11
# File 'lib/releasy/builders/windows_builder.rb', line 9

def icon
  @icon
end

Instance Method Details

#effective_executable_type:windows, :console

Executable type, resolving :auto if possible.

Returns:

  • (:windows, :console)


19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/releasy/builders/windows_builder.rb', line 19

def effective_executable_type
  if executable_type == :auto
    case File.extname(project.executable)
      when '.rbw'
        :windows
      when '.rb'
        :console
      else
        raise ConfigError, "Unless the executable file extension is .rbw or .rb, then #executable_type must be explicitly :windows or :console"
    end
  else
    executable_type
  end
end