Sha256: 8c3781561f3daaa48c6904d2e3c3fe22dc142a956bdbe710d2a60db86f803a1d

Contents?: true

Size: 844 Bytes

Versions: 5

Compression:

Stored size: 844 Bytes

Contents

module MigrationBundler
  module Actions
    # Run a command in git.
    #
    #   git :init
    #   git add: "this.file that.rb"
    #   git add: "onefile.rb", rm: "badfile.cxx"
    def git(commands={})
      if commands.is_a?(Symbol)
        run "git #{commands}"
      else
        commands.each do |cmd, options|
          run "git #{cmd} #{options}"
        end
      end
    end

    def git_add(*paths)
      inside(destination_root) do
        git add: paths.flatten.join(' ')
      end
    end

    def truncate_database
      say_status :truncate, database.to_s, :yellow
      database.drop
    end

    def bundle
      inside(destination_root) { run "bundle" }
    end

    def unique_tag_for_version(version)
      return version if options['pretend']
      MigrationBundler::Util.unique_tag_for_version(version)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
migration_bundler-1.4.0 lib/migration_bundler/actions.rb
migration_bundler-1.3.3 lib/migration_bundler/actions.rb
migration_bundler-1.3.2 lib/migration_bundler/actions.rb
migration_bundler-1.3.1 lib/migration_bundler/actions.rb
migration_bundler-1.3.0 lib/migration_bundler/actions.rb