Class: Rosette::Core::Commands::CommitCommand
- Inherits:
-
GitCommand
- Object
- Command
- GitCommand
- Rosette::Core::Commands::CommitCommand
- Includes:
- WithRef, WithRepoName
- Defined in:
- lib/rosette/core/commands/git/commit_command.rb
Overview
Inspects the given commit and extracts translatable phrases using the configured extractors. By design, CommitCommand (and the rest of Rosette) will not process merge commits. Generally, a snapshot of the repository will be necessary to find the commits where individual files were last changed (see the RepoSnapshotCommand or SnapshotFactory class to take snapshots).
Instance Attribute Summary
Attributes included from WithRef
Attributes included from WithRepoName
Attributes inherited from Command
Instance Method Summary collapse
-
#execute ⇒ void
Executes the command.
Methods included from WithRef
#commit_id, #set_commit_id, #set_ref
Methods included from WithRepoName
Methods inherited from GitCommand
Methods inherited from Command
#initialize, #messages, #valid?, validate, validators
Constructor Details
This class inherits a constructor from Rosette::Core::Commands::Command
Instance Method Details
#execute ⇒ void
This method returns an undefined value.
Executes the command. Causes phrases to be extracted from the given git ref or commit id and written to the configured data store, triggering hooks in the process.
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/rosette/core/commands/git/commit_command.rb', line 35 def execute commit_processor.process_each_phrase(repo_name, commit_id) do |phrase| begin datastore.store_phrase(repo_name, phrase) rescue ActiveRecord::RecordNotUnique => e configuration.error_reporter.report_warning(e) end end trigger_hooks(:after) end |