Sha256: 7e63159b139525d6abdd3d4445ccf6efa95e07d8974c3d4a23e41cad5e77e54d

Contents?: true

Size: 725 Bytes

Versions: 93

Compression:

Stored size: 725 Bytes

Contents

module Docman
  class GitCommitCmd < Docman::Command

    register_command :git_commit

    def validate_command
      raise "Please provide 'context'" if @context.nil?
      raise "Context should be of type 'Info'" unless @context.is_a? Docman::Info
    end

    before_execute do
      unless GitUtil.repo_changed? @context['root']['full_build_path']
        raise NoChangesError, "Repo not changed, commit not needed" unless @context.need_rebuild?
      end
    end

    def execute
      message = "name: #{@context['name']} updated, state: #{@context.state_name}"
      with_logging(message) do
        GitUtil.commit(@context['root']['full_build_path'], @context['full_build_path'], message)
      end
    end
  end
end

Version data entries

93 entries across 93 versions & 1 rubygems

Version Path
docman-0.0.107 lib/docman/commands/git_commit_cmd.rb
docman-0.0.106 lib/docman/commands/git_commit_cmd.rb
docman-0.0.105 lib/docman/commands/git_commit_cmd.rb
docman-0.0.104 lib/docman/commands/git_commit_cmd.rb
docman-0.0.103 lib/docman/commands/git_commit_cmd.rb
docman-0.0.102 lib/docman/commands/git_commit_cmd.rb
docman-0.0.101 lib/docman/commands/git_commit_cmd.rb
docman-0.0.100 lib/docman/commands/git_commit_cmd.rb
docman-0.0.99 lib/docman/commands/git_commit_cmd.rb
docman-0.0.98 lib/docman/commands/git_commit_cmd.rb
docman-0.0.97 lib/docman/commands/git_commit_cmd.rb
docman-0.0.96 lib/docman/commands/git_commit_cmd.rb
docman-0.0.95 lib/docman/commands/git_commit_cmd.rb
docman-0.0.94 lib/docman/commands/git_commit_cmd.rb
docman-0.0.93 lib/docman/commands/git_commit_cmd.rb
docman-0.0.92 lib/docman/commands/git_commit_cmd.rb
docman-0.0.91 lib/docman/commands/git_commit_cmd.rb
docman-0.0.90 lib/docman/commands/git_commit_cmd.rb
docman-0.0.89 lib/docman/commands/git_commit_cmd.rb
docman-0.0.88 lib/docman/commands/git_commit_cmd.rb