Sha256: b27b44b8b895be95bbff81c1da2dc85655c01de27013b0b1683227c27c761f40

Contents?: true

Size: 571 Bytes

Versions: 4

Compression:

Stored size: 571 Bytes

Contents

#!/usr/bin/env ruby
# encoding: UTF-8

require 'bundler/setup'

require 'pathname'
require 'dump/env'

readme = Pathname('README.markdown')
lines = readme.readlines.map(&:rstrip)
readme.open('w') do |f|
  lines.each do |line|
    line.sub!(/^`(.+?)`.*—.*$/) do
      key, names = Dump::Env::DICTIONARY.find{ |_key, values| values.include?(Regexp.last_match[1])  }
      if key
        names = names.map{ |name| "`#{name}`" }.join(', ')
        explanation = Dump::Env::EXPLANATIONS[key]
        "#{names} — #{explanation}"
      end
    end
    f.puts line
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dump-1.1.0 script/update_readme
dump-1.0.8 script/update_readme
dump-1.0.7 script/update_readme
dump-1.0.6 script/update_readme