Sha256: 5157a48ff461cd4ebd3e7a9d8ae37d20eddee50819880dd0e73fea08de46ce20

Contents?: true

Size: 793 Bytes

Versions: 8

Compression:

Stored size: 793 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 needed, commit not needed"
      end
      # @not_execute = true unless GitUtil.repo_changed? @context['root']['full_build_path']
    end

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
docman-0.0.13 lib/docman/commands/git_commit_cmd.rb
docman-0.0.12 lib/docman/commands/git_commit_cmd.rb
docman-0.0.11 lib/docman/commands/git_commit_cmd.rb
docman-0.0.10 lib/docman/commands/git_commit_cmd.rb
docman-0.0.9 lib/docman/commands/git_commit_cmd.rb
docman-0.0.8 lib/docman/commands/git_commit_cmd.rb
docman-0.0.7 lib/docman/commands/git_commit_cmd.rb
docman-0.0.6 lib/docman/commands/git_commit_cmd.rb