Module: Avm::Git::AutoCommitPath::Ruby

Defined in:
lib/avm/git/auto_commit_path/ruby.rb

Constant Summary collapse

RUBY_CLASS_NAME_PATTERNS =
[%r{lib/((?!.*/lib/).+)\.rb\z}, %r{app/[^/]+/(.+)\.rb\z}].freeze

Instance Method Summary collapse

Instance Method Details

#ruby_class_nameObject



11
12
13
14
15
16
# File 'lib/avm/git/auto_commit_path/ruby.rb', line 11

def ruby_class_name
  RUBY_CLASS_NAME_PATTERNS.each do |pattern|
    pattern.if_match(relative_path.to_path, false) { |m| return m[1].camelize }
  end
  nil
end