Sha256: 175da2aeb16f250317a7c106a52e7945391de5b5c18e363c42212d5d7ee3e073

Contents?: true

Size: 540 Bytes

Versions: 43

Compression:

Stored size: 540 Bytes

Contents

module ActiveGraph
  module Migrations
    class MigrationFile
      attr_reader :file_name, :symbol_name, :class_name, :version

      def initialize(file_name)
        @file_name = file_name
        extract_data!
      end

      def create(options = {})
        require @file_name
        class_name.constantize.new(@version, options)
      end

      private

      def extract_data!
        @version, @symbol_name = File.basename(@file_name, '.rb').split('_', 2)
        @class_name = @symbol_name.camelize
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
activegraph-12.0.0.beta.5 lib/active_graph/migrations/migration_file.rb
activegraph-12.0.0.beta.4 lib/active_graph/migrations/migration_file.rb
activegraph-11.5.0.beta.3 lib/active_graph/migrations/migration_file.rb
activegraph-12.0.0.beta.3 lib/active_graph/migrations/migration_file.rb
activegraph-12.0.0.beta.2 lib/active_graph/migrations/migration_file.rb
activegraph-11.5.0.beta.2 lib/active_graph/migrations/migration_file.rb
activegraph-12.0.0.beta.1 lib/active_graph/migrations/migration_file.rb
activegraph-11.5.0.beta.1 lib/active_graph/migrations/migration_file.rb
activegraph-11.5.0.alpha.1 lib/active_graph/migrations/migration_file.rb
activegraph-11.4.0 lib/active_graph/migrations/migration_file.rb
activegraph-11.3.1 lib/active_graph/migrations/migration_file.rb
activegraph-11.3.0 lib/active_graph/migrations/migration_file.rb
activegraph-11.2.0 lib/active_graph/migrations/migration_file.rb
activegraph-11.1.0 lib/active_graph/migrations/migration_file.rb
activegraph-11.1.0.beta.1 lib/active_graph/migrations/migration_file.rb
activegraph-11.1.0.alpha.4 lib/active_graph/migrations/migration_file.rb
activegraph-11.1.0.alpha.3 lib/active_graph/migrations/migration_file.rb
activegraph-11.1.0.alpha.2 lib/active_graph/migrations/migration_file.rb
activegraph-11.1.0.alpha.1 lib/active_graph/migrations/migration_file.rb
activegraph-10.2.0.beta.1 lib/active_graph/migrations/migration_file.rb