Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ Style/ClassAndModuleChildren:
- lib/gemcutter/middleware/hostess.rb
- lib/gemcutter/middleware/redirector.rb

Rails/Present:
Exclude:
- lib/compact_index/*.rb

Rails/ThreeStateBooleanColumn:
Enabled: false

Expand Down
8 changes: 6 additions & 2 deletions lib/compact_index/gem_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module CompactIndex
module GemVersionMethods
def version_token
return "#{number}-#{content_address}" if content_address.present?
return "#{number}-#{content_address}" if content_address?

if platform.nil? || platform == "ruby"
number
Expand All @@ -27,12 +27,16 @@ def to_line
line = "#{version_token} #{deps_line}|checksum:#{checksum}"
line << ",ruby:#{ruby_version_line}" if ruby_version && ruby_version != ">= 0"
line << ",rubygems:#{rubygems_version_line}" if rubygems_version && rubygems_version != ">= 0"
line << ",platform:= #{platform}" if content_address.present?
line << ",platform:= #{platform}" if content_address?
line
end

private

def content_address?
!content_address.nil? && !content_address.empty?
end
Comment thread
jenshenny marked this conversation as resolved.

def ruby_version_line
join_multiple(ruby_version)
end
Expand Down