Class: Avm::Scms::AutoCommit::FileResourceName

Inherits:
Object
  • Object
show all
Defined in:
lib/avm/scms/auto_commit/file_resource_name.rb

Instance Method Summary collapse

Instance Method Details

#class_nameObject



13
14
15
# File 'lib/avm/scms/auto_commit/file_resource_name.rb', line 13

def class_name
  file_format.file_resource_name(relative_path)
end

#commit_messageObject



17
18
19
20
21
22
# File 'lib/avm/scms/auto_commit/file_resource_name.rb', line 17

def commit_message
  r = class_name
  r += ': *' if modified?
  r += ': remove' unless path.file?
  "#{r}."
end

#modified?Boolean



25
26
27
# File 'lib/avm/scms/auto_commit/file_resource_name.rb', line 25

def modified?
  dirty_file.if_present(false, &:modify?)
end

#relative_pathPathname



30
31
32
# File 'lib/avm/scms/auto_commit/file_resource_name.rb', line 30

def relative_path
  path.expand_path.relative_path_from(scm.path.expand_path)
end