Skip to content

Instantly share code, notes, and snippets.

@pinglamb
Created February 26, 2015 10:21
Show Gist options
  • Save pinglamb/5e3da719fa5fb7694110 to your computer and use it in GitHub Desktop.
Save pinglamb/5e3da719fa5fb7694110 to your computer and use it in GitHub Desktop.
Changelog class for per user changes dialog
class Changelog
# Put your available versions in the array, in reverse release order, e.g. %w(1.1 1.0 0.9.9999999)
VERSIONS = %w().freeze
class << self
# e.g. Changelog.after('1.0')
def after(version)
changes = Changelog.new
if index = VERSIONS.index(version)
VERSIONS[0...index].collect {|v| changes[v] }.flatten
else
[]
end
end
end
def [](version)
@all[version]
end
def initialize
@all = {
# '1.0' => [
# 'Something hardcore you want others to know',
# ],
}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment