Class: Tebako::ScenarioManager

Inherits:
ScenarioManagerBase show all
Defined in:
lib/tebako/scenario_manager.rb

Overview

Manages packaging scenario based on input files (gemfile, gemspec, etc)

Direct Known Subclasses

ScenarioManagerWithBundler

Instance Attribute Summary collapse

Attributes inherited from ScenarioManagerBase

#exe_suffix, #fs_mount_point

Instance Method Summary collapse

Methods inherited from ScenarioManagerBase

#b_env, #linux?, #linux_gnu?, #linux_musl?, #m_files, #macos?, #msys?, #musl?, #ncores

Constructor Details

#initialize(fs_root, fs_entrance) ⇒ ScenarioManager

Returns a new instance of ScenarioManager.



119
120
121
122
123
124
125
# File 'lib/tebako/scenario_manager.rb', line 119

def initialize(fs_root, fs_entrance)
  super()
  @with_gemfile = @with_lockfile = @needs_bundler = false
  @bundler_version = BUNDLER_VERSION
  initialize_root(fs_root)
  initialize_entry_point(fs_entrance || "stub.rb")
end

Instance Attribute Details

#fs_entranceObject (readonly)

Returns the value of attribute fs_entrance.



127
128
129
# File 'lib/tebako/scenario_manager.rb', line 127

def fs_entrance
  @fs_entrance
end

#fs_entry_pointObject (readonly)

Returns the value of attribute fs_entry_point.



127
128
129
# File 'lib/tebako/scenario_manager.rb', line 127

def fs_entry_point
  @fs_entry_point
end

#gemfile_pathObject (readonly)

Returns the value of attribute gemfile_path.



127
128
129
# File 'lib/tebako/scenario_manager.rb', line 127

def gemfile_path
  @gemfile_path
end

#needs_bundlerObject (readonly)

Returns the value of attribute needs_bundler.



127
128
129
# File 'lib/tebako/scenario_manager.rb', line 127

def needs_bundler
  @needs_bundler
end

#with_gemfileObject (readonly)

Returns the value of attribute with_gemfile.



127
128
129
# File 'lib/tebako/scenario_manager.rb', line 127

def with_gemfile
  @with_gemfile
end

Instance Method Details

#bundler_referenceObject



129
130
131
# File 'lib/tebako/scenario_manager.rb', line 129

def bundler_reference
  @needs_bundler ? "_#{@bundler_version}_" : nil
end

#configure_scenarioObject



133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/tebako/scenario_manager.rb', line 133

def configure_scenario
  lookup_files

  case @gs_length
  when 0
    configure_scenario_no_gemspec
  when 1
    @scenario = @with_gemfile ? :gemspec_and_gemfile : :gemspec
  else
    raise Tebako::Error, "Multiple Ruby gemspecs found in #{@fs_root}"
  end
end