class Semverve::ProjectMetadata
Infers project metadata from explicit configuration or project files.
Public Class Methods
Source
# File lib/semverve/project_metadata.rb, line 15 def initialize(configuration) @configuration = configuration end
Initializes project metadata inference.
@param [Semverve::Configuration] configuration
@return [Semverve::ProjectMetadata]
Public Instance Methods
Source
# File lib/semverve/project_metadata.rb, line 24 def gem_name return explicit_gem_name || configured_gem_name unless configuration.infer_package_name? explicit_gem_name || configured_version_file_gem_name || gemspec_name end
Gem name from explicit config, the version-file path, or the gemspec. App adapters can disable package-name inference.
@return [String, nil]
Source
# File lib/semverve/project_metadata.rb, line 34 def module_name explicit_module_name || configured_module_name || camelize(gem_name) end
Ruby module name from explicit config or the resolved gem name.
@return [String]
Source
# File lib/semverve/project_metadata.rb, line 42 def version_file configured_version_file || File.join("lib", gem_name, "version.rb") end
Version-file path from explicit config or the resolved gem name.
@return [String]