Module: AllImages::Config

Extended by:
Config
Included in:
Config
Defined in:
lib/all_images/config.rb

Constant Summary collapse

EXAMPLE =
<<~end
  dockerfile: |-
    RUN apk add --no-cache build-base git
    RUN gem update --system
    RUN gem install gem_hadar bundler

  script: &script |-
    echo -e "\\e[1m"
    ruby -v
    bundle
    echo -e "\\e[0m"
    rake test

  images:
    ruby:3.2-alpine: *script
    ruby:3.1-alpine: *script
    ruby:3.0-alpine: *script
    ruby:2.7-alpine: *script
    ruby:2.6-alpine: *script
end

Instance Method Summary collapse

Instance Method Details

#exampleObject



35
36
37
# File 'lib/all_images/config.rb', line 35

def example
  EXAMPLE
end

#init(filename) ⇒ Object



29
30
31
32
33
# File 'lib/all_images/config.rb', line 29

def init(filename)
  File.open(filename, 'w') do |output|
    output.print EXAMPLE
  end
end

#load(filename) ⇒ Object



4
5
6
# File 'lib/all_images/config.rb', line 4

def load(filename)
  YAML.unsafe_load_file(filename)
end