Class: Docman::GitRepoProvider
- Defined in:
- lib/docman/commands/git_repo_provider_cmd.rb
Instance Attribute Summary collapse
-
#version(remote = false) ⇒ Object
readonly
Returns the value of attribute version.
Attributes inherited from Command
Instance Method Summary collapse
- #changed? ⇒ Boolean
- #changed_from_last_version? ⇒ Boolean
- #execute ⇒ Object
- #get_content ⇒ Object
- #validate_command ⇒ Object
Methods inherited from Command
#add_action, #add_actions, #config, create, #describe, #initialize, #perform, #prefix, register_command, #replace_placeholder, #run_actions, #run_with_hooks
Methods included from Logging
#log, logger, #logger, #prefix, #properties_info, #with_logging
Constructor Details
This class inherits a constructor from Docman::Command
Instance Attribute Details
#version(remote = false) ⇒ Object (readonly)
Returns the value of attribute version.
4 5 6 |
# File 'lib/docman/commands/git_repo_provider_cmd.rb', line 4 def version @version end |
Instance Method Details
#changed? ⇒ Boolean
19 20 21 22 23 24 25 |
# File 'lib/docman/commands/git_repo_provider_cmd.rb', line 19 def changed? stored_version = @context.stored_version['result'] @last_version = GitUtil.last_revision(self['target_path']) # TODO: diff with remote instead of get v = version(true) stored_version != v end |
#changed_from_last_version? ⇒ Boolean
31 32 33 |
# File 'lib/docman/commands/git_repo_provider_cmd.rb', line 31 def changed_from_last_version? @last_version != @version end |
#execute ⇒ Object
13 14 15 16 17 |
# File 'lib/docman/commands/git_repo_provider_cmd.rb', line 13 def execute @execute_result = get_content # No commit hash for 'root' as it will be changed later @version = @context['type'] == 'root' ? @context['build_path'] : @execute_result end |