Sha256: 623a683211cf00484538da8fed012437ce1dd5e5ed576c178a58e0109f220efc
Contents?: true
Size: 612 Bytes
Versions: 4
Compression:
Stored size: 612 Bytes
Contents
class Dynomite::Migration class FileInfo attr_reader :path def initialize(path) @path = path end def pretty_path @path.sub(/^\.\//,'') # remove leading ./ end def migration_class filename = File.basename(@path, '.rb') filename = filename.sub(/\d+[-_]/, '') # strip leading timestsamp filename.camelize.constantize end def version filename = File.basename(@path, '.rb') md = filename.match(/(\d+)[-_]/) md[1].to_i end def self.all_files Dir.glob("#{Dynomite.root}/dynamodb/migrate/*").to_a.sort end end end
Version data entries
4 entries across 4 versions & 1 rubygems