Sha256: 13b09a02be2108ab434634c0aafb2bd2c2ef980f079590e3789e143850c17b08
Contents?: true
Size: 1.44 KB
Versions: 1
Compression:
Stored size: 1.44 KB
Contents
# encoding: UTF-8 module Rosette module Core module Commands # Takes a snapshot and returns a list of phrases. This is different from # {RepoSnapshotCommand} in that it doesn't return the snapshot hash itself, # but instead the phrases contained in the snapshot's commits. # # @example # cmd = SnapshotCommand.new(configuration) # .set_repo_name('my_repo') # .set_ref('master') # # cmd.execute # # => [<Phrase #ba012cd key: 'foobar'>, ...] # # @!attribute [Array] paths # @return [Array] the paths to consider when taking the snapshot. Any paths # that do not exist in this array will not appear in the snapshot. class SnapshotCommand < GitCommand attr_reader :paths include WithSnapshots include WithRepoName include WithRef # Set the paths that will be included in the snapshot. # # @param [Array] paths The paths to include in the snapshot. # @return [self] def set_paths(paths) @paths = paths self end # Take the snapshot. # # @return [Array<Rosette::Core::Phrase>] the list of phrases from the # snapshot. def execute snapshot = take_snapshot(get_repo(repo_name), commit_id, paths) datastore.phrases_by_commits(repo_name, snapshot).to_a end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rosette-core-1.0.1 | lib/rosette/core/commands/git/snapshot_command.rb |