class Replr::Stack::Ruby::REPLMaker

Creates a Ruby REPL using docker for a stack and libraries combo

Private Instance Methods

library_file_with(libraries) click to toggle source
# File lib/replr/stack/ruby/repl_maker.rb, line 30
def library_file_with(libraries)
  gemfile = "source 'https://rubygems.org/'\n"
  libraries.each do |library|
    if library.include?(':')
      library, version = library.split(':')
      gemfile << "gem '#{library}', '#{version}'\n"
    else
      gemfile << "gem '#{library}'\n"
    end
  end
  gemfile
end
set_bootstrap_file_name() click to toggle source

It's optional to set a bootstrap file

# File lib/replr/stack/ruby/repl_maker.rb, line 17
def set_bootstrap_file_name
  @bootstrap_file_name = 'replr-bootstrap.rb'
end
set_filter_lines_for_install() click to toggle source
# File lib/replr/stack/ruby/repl_maker.rb, line 25
def set_filter_lines_for_install
  @filter_matching_lines_for_install = [/gem/i]
  @filter_not_matching_lines_for_install = []
end
set_library_file_name() click to toggle source
# File lib/replr/stack/ruby/repl_maker.rb, line 12
def set_library_file_name
  @library_file_name = 'Gemfile'
end
set_template_dir() click to toggle source
# File lib/replr/stack/ruby/repl_maker.rb, line 21
def set_template_dir
  @template_dir = __dir__
end