Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use require_relative instead of require for same-gem requires #35

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions lib/compact_index.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# frozen_string_literal: true

require "compact_index/gem"
require "compact_index/gem_version"
require "compact_index/dependency"
require_relative "compact_index/gem"
require_relative "compact_index/gem_version"
require_relative "compact_index/dependency"

require "compact_index/version"
require "compact_index/versions_file"
require_relative "compact_index/version"
require_relative "compact_index/versions_file"

module CompactIndex
# Formats a list of gem names, to be used on the /names endpoint.
Expand All @@ -18,7 +18,7 @@ module CompactIndex
# other-gem
# ```
def self.names(gem_names)
String.new("---\n") << gem_names.join("\n") << "\n"
gem_names.join("\n").prepend("---\n") << "\n"
end

# Returns the versions file content argumented with some extra gems
Expand Down Expand Up @@ -70,7 +70,7 @@ def self.versions(versions_file, gems = nil, args = {})
# 1.0.2 requirement:<2.0&>1.0,requirement2:=1.1|checksum:abc2,ruby:>1.0,rubygems:>2.0
# ```
def self.info(versions)
versions.inject("---\n".dup) do |output, version|
versions.inject(+"---\n") do |output, version|
output << version.to_line << "\n"
end
end
Expand Down