This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Accessors | |
def attr_accessor_with_history(*args) | |
args.each do |attribute_name| | |
define_method(attribute_name) { instance_variable_get("@#{attribute_name}") } | |
define_method("#{attribute_name}=") do |value| | |
instance_variable_set("@#{attribute_name}", value) | |
history = instance_variable_get("@#{attribute_name}_history") || [nil] | |
history << value | |
instance_variable_set("@#{attribute_name}_history", history) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:16.04 | |
# Using rvm inside docker is bad practice (docker anti-pattern) https://stackoverflow.com/a/41925488/3292174 | |
RUN apt-get update && apt-get install -y openssl curl | |
# rvm | |
RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB | |
RUN \curl -L https://get.rvm.io | bash -s stable |