Class: Rdm::CLI::DiffPackage

Inherits:
Object
  • Object
show all
Defined in:
lib/rdm/cli/diff_package.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#pathObject (readonly)

Returns the value of attribute path.



8
9
10
# File 'lib/rdm/cli/diff_package.rb', line 8

def path
  @path
end

#revisionObject (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

#runObject



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.message
end