method
validate_dependencies

v2_2_9 -
Show latest stable
-
0 notes -
Class: Specification
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125
- 1_9_3_392
- 2_1_10 (0)
- 2_2_9 (0)
- 2_4_6 (0)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
Related methods
- Class methods (48)
-
add_spec
-
add_specs
-
all
-
_all
-
all=
-
all_names
-
array_attributes
-
attribute_names
-
_clear_load_cache
-
default_stubs
(>= v2_4_6)
-
dirs
-
dirs=
-
each
-
each_gemspec
-
each_spec
-
each_stub
-
find_active_stub_by_path (>= v2_4_6)
-
find_all_by_full_name (>= v2_5_5)
-
find_all_by_name
-
find_by_name
-
find_by_path
-
find_inactive_by_path
-
find_in_unresolved
-
find_in_unresolved_tree
-
from_yaml
-
gemspec_stubs_in
(>= v2_4_6)
-
installed_stubs
(>= v2_4_6)
-
_latest_specs (>= v2_4_6)
-
latest_specs
-
load
-
_load
-
load_defaults
-
map_stubs
(>= v2_4_6)
-
new
-
non_nil_attributes
-
normalize_yaml_input
-
outdated
-
outdated_and_latest_version
-
remove_spec
-
required_attribute?
-
required_attributes
-
reset
-
_resort!
-
sort_by!
(>= v2_4_6)
-
stubs
-
stubs_for (>= v2_4_6)
-
uniq_by
(>= v2_4_6)
-
unresolved_deps
- Instance methods (150)
-
<=>
-
==
-
abbreviate (>= v2_4_6)
-
activate
-
activate_dependencies
-
add_bindir
-
add_dependency
-
add_dependency_with_type
-
add_development_dependency
-
add_runtime_dependency
-
add_self_to_load_path
-
author
-
author=
-
authors
-
authors=
-
base_dir (>= v1_9_3_125)
-
bin_dir
-
bin_file
-
build_args
-
build_extensions
-
build_info_dir
-
build_info_file
-
bundled_gem_in_old_ruby?
-
cache_dir
-
cache_file
-
cache_gem (<= v1_9_3_392)
-
check_version_conflict
-
conficts_when_loaded_with? (>= v2_4_6)
-
conflicts
-
contains_requirable_file? (<= v1_9_3_392)
-
date
-
date=
-
default_executable
-
default_value
-
dependencies
-
dependencies_to_gemfile
(>= v2_6_3)
-
dependent_gems
-
dependent_specs
-
description=
-
development_dependencies
-
doc_dir
-
_dump
-
encode_with
-
eql?
-
executable
-
executable=
-
executables
-
executables=
-
extension_dir (>= v2_6_3)
-
extensions
-
extensions=
-
extra_rdoc_files
-
extra_rdoc_files=
-
file_name
-
files
-
files=
-
find_all_satisfiers
-
find_full_gem_path
-
for_cache
-
full_gem_path (>= v1_9_3_125)
-
full_name
-
gem_build_complete_path
-
gem_dir
-
gems_dir (>= v1_9_3_125)
-
git_version (>= v2_6_3)
-
groups (>= v2_6_3)
-
has_conflicts? (>= v2_4_6)
-
hash
-
has_rdoc
-
has_rdoc=
-
has_rdoc?
-
has_unit_tests?
-
initialize_copy
-
init_with
-
inspect
-
installation_path (<= v1_9_3_392)
-
installed_by_version
-
installed_by_version=
-
internal_init (>= v2_4_6)
-
invalidate_memoized_attributes
-
keep_only_files_and_directo... (>= v2_6_3)
-
lib_dirs_glob
-
lib_files
-
license
-
license=
-
licenses
-
licenses=
-
loaded_from (>= v2_6_3)
-
loaded_from=
-
load_paths (>= v2_6_3)
-
mark_version
-
matches_for_glob
-
method_missing
-
missing_extensions?
-
name_tuple
-
nondevelopment_dependencies (>= v2_6_3)
-
normalize
-
original_name
-
original_platform
-
platform
-
platform=
-
pretty_print
-
raise_if_conflicts
-
raw_require_paths (>= v2_4_6)
-
rdoc_options
-
rdoc_options=
-
required_rubygems_version=
-
required_ruby_version=
-
requirements
-
requirements=
-
require_path
-
require_path=
-
require_paths=
-
reset_nil_attributes_to_def...
-
respond_to_missing?
-
rg_loaded_from (>= v2_6_3)
-
ri_dir
-
ruby_code
-
runtime_dependencies
-
same_attributes?
-
sanitize (>= v2_4_6)
-
sanitize_string (>= v2_4_6)
-
satisfies_requirement?
-
sort_obj
-
source
-
spec_dir
-
spec_file
-
spec_name
-
stubbed?
-
summary=
-
test_file
-
test_file=
-
test_files
-
test_files=
-
test_suite_file (<= v1_9_3_392)
-
test_suite_file= (<= v1_9_3_392)
-
to_gemfile (>= v2_6_3)
-
to_ruby
-
to_ruby_for_cache
-
to_s
-
to_spec
-
to_yaml
-
traverse
-
validate
-
validate_dependencies
-
validate_metadata (>= v2_5_5)
-
validate_permissions
-
version=
-
warning
-
yaml_initialize
= private
= protected
validate_dependencies()
public
Checks that dependencies use requirements as we recommend. Warnings are issued when dependencies are open-ended or overly strict for semantic versioning.
Show source
# File lib/rubygems/specification.rb, line 2652 def validate_dependencies # :nodoc: seen = {} dependencies.each do |dep| if prev = seen[dep.name] then raise Gem::InvalidSpecificationException, duplicate dependency on #{dep}, (#{prev.requirement}) use: add_runtime_dependency '#{dep.name}', '#{dep.requirement}', '#{prev.requirement}' end seen[dep.name] = dep prerelease_dep = dep.requirements_list.any? do |req| Gem::Requirement.new(req).prerelease? end warning "prerelease dependency on #{dep} is not recommended" if prerelease_dep overly_strict = dep.requirement.requirements.length == 1 && dep.requirement.requirements.any? do |op, version| op == '~>' and not version.prerelease? and version.segments.length > 2 and version.segments.first != 0 end if overly_strict then _, dep_version = dep.requirement.requirements.first base = dep_version.segments.first 2 warning pessimistic dependency on #{dep} may be overly strict if #{dep.name} is semantically versioned, use: add_#{dep.type}_dependency '#{dep.name}', '~> #{base.join '.'}', '>= #{dep_version}' end open_ended = dep.requirement.requirements.all? do |op, version| not version.prerelease? and (op == '>' or op == '>=') end if open_ended then op, dep_version = dep.requirement.requirements.first base = dep_version.segments.first 2 bugfix = if op == '>' then ", '> #{dep_version}'" elsif op == '>=' and base != dep_version.segments then ", '>= #{dep_version}'" end warning open-ended dependency on #{dep} is not recommended if #{dep.name} is semantically versioned, use: add_#{dep.type}_dependency '#{dep.name}', '~> #{base.join '.'}'#{bugfix} end end end