Class: Rdm::CLI::DiffPackage
- Inherits:
-
Object
- Object
- Rdm::CLI::DiffPackage
- Defined in:
- lib/rdm/cli/diff_package.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#revision ⇒ Object
readonly
Returns the value of attribute revision.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(path:, revision:) ⇒ DiffPackage
constructor
A new instance of DiffPackage.
- #run ⇒ Object
Constructor Details
#initialize(path:, revision:) ⇒ DiffPackage
Returns a new instance of DiffPackage.
9 10 11 12 |
# File 'lib/rdm/cli/diff_package.rb', line 9 def initialize(path:, revision:) @path = path @revision = revision end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
8 9 10 |
# File 'lib/rdm/cli/diff_package.rb', line 8 def path @path end |
#revision ⇒ Object (readonly)
Returns the value of attribute revision.
8 9 10 |
# File 'lib/rdm/cli/diff_package.rb', line 8 def revision @revision end |
Class Method Details
.run(opts = {}) ⇒ Object
3 4 5 |
# File 'lib/rdm/cli/diff_package.rb', line 3 def run(opts = {}) Rdm::CLI::DiffPackage.new(opts).run end |
Instance Method Details
#run ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/rdm/cli/diff_package.rb', line 14 def run puts Rdm::Handlers::DiffPackageHandler.handle(path: path, revision: revision) rescue Rdm::Errors::GitRepositoryNotInitialized puts "Git repository is not initialized. Use `git init .`" rescue Rdm::Errors::GitCommandError => e puts e. end |