$30 off During Our Annual Pro Sale. View Details »

Writing config files in Ruby

Writing config files in Ruby

Grzegorz Witek

March 25, 2018
Tweet

More Decks by Grzegorz Witek

Other Decks in Technology

Transcript

  1. >
    <
    FOOTNOTE TEXT NOBODY READS
    WRITING CONFIG FILES IN RUBY
    @ARNVALD, RUBYCONFTW 2018
    1

    View Slide

  2. CONFIG FILES? next 2

    View Slide

  3. BORING!!! next 3

    View Slide

  4. just use
    JSON / YAML / XML
    or store it in the db
    next 4

    View Slide

  5. configuration
    is
    static
    next 5

    View Slide

  6. what if it has to be
    dynamic? next 6

    View Slide

  7. is it still
    configuration? next 7

    View Slide

  8. gem 'simple_configuration' next 8

    View Slide

  9. github:
    arnvald/simple_configuration
    next 9

    View Slide

  10. Challenge time! next 10

    View Slide

  11. >
    <
    STILL NOTHING TO SEE HERE 11
    MISSING_VALUE = '__missing_value__'
    def config(
    config_name,
    default_value = MISSING_VALUE,
    &default_value_blk
    )

    View Slide

  12. >
    <
    STILL NOTHING TO SEE HERE 12
    engineering.kaligo.com

    View Slide