Sha256: 0ea319918c514fcdf6c6d2258e16ac307ab73a9aec8d9f7fae3ca1c8570a0c38

Contents?: true

Size: 564 Bytes

Versions: 2

Compression:

Stored size: 564 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/core_ext'

module Avm
  module Scms
    module AutoCommit
      class FileResourceName
        module Ruby
          RUBY_CLASS_NAME_PATTERNS = [%r{lib/((?!.*/lib/).+)\.rb\z},
                                      %r{app/[^/]+/(.+)\.rb\z}].freeze

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

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
avm-0.59.0 lib/avm/scms/auto_commit/file_resource_name/ruby.rb
eac_tools-0.50.0 sub/avm/lib/avm/scms/auto_commit/file_resource_name/ruby.rb