compact_index 0.11.0 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 26a6b9d47c580c53737df7aef9c0e9619a622dfb
4
- data.tar.gz: f846a31bc5833ff97687da9c6bb2aec1d865f347
2
+ SHA256:
3
+ metadata.gz: 53388525df0047c065e1c9197e9021550c69e988629f624e53dc17b6128af505
4
+ data.tar.gz: 72e4f7887f5e43cf485f43f0e4d0d3c1789805707166afed428de0b9b63fde8a
5
5
  SHA512:
6
- metadata.gz: a2ea035146ce0bcb7eb8c1d227a216dddd6279228c97c180e1f6ef211e969a46bbec6a89e920cd771e3b2fad6ea89de368fa048fdcaeea48e0fb3180986171a8
7
- data.tar.gz: 86c03f712b8d4f37e84502245abd7d065299eb9f6ff5081ec4dfcdbbe434df859c491b625c2d94fd6ecd9898f00a33c02dd57bf6d9fa29c3cf21a1618e4c19f9
6
+ metadata.gz: 48d42cebf94bc355e676dedb986beb08c4d512d50295d00a3337ad95f3f3e9f24001311b46ebfc17a1e9043f1af1e9ad6feefd5a846d92086af9bde3d4686432
7
+ data.tar.gz: ffb5581d24c9089a0f06e7497369ed9b5064c7c826a99fcb0536f1d1026ccac83f6818a75774af5c4bb0e06dde7caa576bc4a3ed24f23856a693189f7fda39bb
data/.gitignore CHANGED
@@ -1,6 +1,5 @@
1
1
  /.bundle/
2
2
  /.yardoc
3
- /Gemfile.lock
4
3
  /_yardoc/
5
4
  /coverage/
6
5
  /doc/
data/.rubocop-bundler.yml CHANGED
@@ -2,6 +2,7 @@ inherit_from:
2
2
  - .rubocop_todo.yml
3
3
 
4
4
  AllCops:
5
+ TargetRubyVersion: 1.9
5
6
  Exclude:
6
7
  - tmp/**/*
7
8
  - lib/bundler/vendor/**/*
@@ -14,23 +15,39 @@ Lint/AssignmentInCondition:
14
15
  Enabled: false
15
16
 
16
17
  Lint/EndAlignment:
17
- AlignWith: variable
18
+ EnforcedStyleAlignWith: variable
19
+ AutoCorrect: true
18
20
 
19
21
  Lint/UnusedMethodArgument:
20
22
  Enabled: false
21
23
 
22
24
  # Style
23
25
 
24
- Style/AccessModifierIndentation:
26
+ Layout/AccessModifierIndentation:
25
27
  EnforcedStyle: outdent
26
28
 
27
- Style/AlignParameters:
29
+ Style/Alias:
30
+ EnforcedStyle: prefer_alias_method
31
+
32
+ Layout/AlignParameters:
28
33
  EnforcedStyle: with_fixed_indentation
29
34
 
30
- Style/MultilineOperationIndentation:
35
+ Style/FrozenStringLiteralComment:
36
+ EnforcedStyle: always
37
+
38
+ Style/MultilineBlockChain:
39
+ Enabled: false
40
+
41
+ Layout/MultilineOperationIndentation:
31
42
  EnforcedStyle: indented
32
43
 
33
- Style/SpaceInsideBlockBraces:
44
+ Style/PerlBackrefs:
45
+ Enabled: false
46
+
47
+ Style/SingleLineBlockParams:
48
+ Enabled: false
49
+
50
+ Layout/SpaceInsideBlockBraces:
34
51
  SpaceBeforeBlockParameters: false
35
52
 
36
53
  Style/TrivialAccessors:
@@ -46,6 +63,18 @@ Style/StringLiterals:
46
63
  Style/StringLiteralsInInterpolation:
47
64
  EnforcedStyle: double_quotes
48
65
 
66
+ # Having these make it easier to *not* forget to add one when adding a new
67
+ # value and you can simply copy the previous line.
68
+ Style/TrailingCommaInLiteral:
69
+ EnforcedStyleForMultiline: comma
70
+
71
+ Style/TrailingUnderscoreVariable:
72
+ Enabled: false
73
+
74
+ # `String.new` is preferred style with enabled frozen string literal
75
+ Style/EmptyLiteral:
76
+ Enabled: false
77
+
49
78
  # 1.8.7 support
50
79
 
51
80
  Style/HashSyntax:
@@ -54,7 +83,7 @@ Style/HashSyntax:
54
83
  Style/Lambda:
55
84
  Enabled: false
56
85
 
57
- Style/DotPosition:
86
+ Layout/DotPosition:
58
87
  EnforcedStyle: trailing
59
88
 
60
89
  Style/EachWithObject:
@@ -63,6 +92,12 @@ Style/EachWithObject:
63
92
  Style/SpecialGlobalVars:
64
93
  Enabled: false
65
94
 
95
+ Style/TrailingCommaInArguments:
96
+ Enabled: false
97
+
98
+ Performance/FlatMap:
99
+ Enabled: false
100
+
66
101
  # Metrics
67
102
 
68
103
  # We've chosen to use Rubocop only for style, and not for complexity or quality checks.
@@ -84,5 +119,10 @@ Metrics/AbcSize:
84
119
  Metrics/CyclomaticComplexity:
85
120
  Enabled: false
86
121
 
122
+ Metrics/ParameterLists:
123
+ Enabled: false
124
+
125
+ # It will be obvious which code is complex, Rubocop should only lint simple
126
+ # rules for us.
87
127
  Metrics/PerceivedComplexity:
88
128
  Enabled: false
data/.rubocop.yml CHANGED
@@ -1,4 +1,13 @@
1
1
  inherit_from: .rubocop-bundler.yml
2
2
 
3
+ AllCops:
4
+ Exclude:
5
+ - !ruby/regexp /(vendor|bundle|bin|db|tmp)\/.*/
6
+
7
+ Metrics/BlockLength:
8
+ Exclude:
9
+ - "db/migrations/*.rb"
10
+ - "spec/**/*.rb"
11
+
3
12
  Style/FrozenStringLiteralComment:
4
13
  EnforcedStyle: always
data/.travis.yml CHANGED
@@ -1,8 +1,17 @@
1
1
  language: ruby
2
- before_install: gem install bundler
2
+
3
+ cache:
4
+ bundler: true
5
+ directories:
6
+ - vendor/cache
7
+
8
+ bundler_args: --jobs=3 --retry=3
9
+
10
+ script:
11
+ - bundle exec rake
12
+
3
13
  rvm:
4
- - "2.3.0"
5
- - "2.2.4"
6
- - "2.1.5"
7
- - "1.9.3"
8
- - "1.8.7"
14
+ - "2.7.1"
15
+ - "2.6.6"
16
+ - "2.5.8"
17
+ - "2.4.10"
data/CHANGELOG.md CHANGED
@@ -1,4 +1,24 @@
1
- ## 0.10.0 (January 22, 2016)
1
+
2
+ ## 0.14.0 (May 25, 2020)
3
+
4
+ Enhancement:
5
+
6
+ - Add timestamp arg to version file create function
7
+
8
+ ## 0.13.0 (May 25, 2020)
9
+
10
+ Bugfix:
11
+
12
+ - Revert trimming of space from requirements. Removing space would have meant info response of all gems were going to change.
13
+ - Fix token used for splitting list of requirements
14
+
15
+ ## 0.12.0 (May 3, 2020)
16
+
17
+ Bugfix:
18
+
19
+ - Update info line to join multiple ruby or rubygems requirements by ampersand (rubygems/compact_index#26)
20
+
21
+ ## 0.11.0 (January 22, 2016)
2
22
 
3
23
  Features:
4
24
 
data/Gemfile CHANGED
@@ -1,14 +1,15 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  source "https://rubygems.org"
3
4
 
4
5
  # Specify your gem's dependencies in compact_index.gemspec
5
6
  gemspec
6
7
 
7
8
  group :documentation do
8
- gem "yard", "~> 0.8"
9
- gem "redcarpet", "~> 2.3"
9
+ gem "redcarpet", "~> 3.5"
10
+ gem "yard", "~> 0.9"
10
11
  end
11
12
 
12
13
  group :development do
13
- gem "rubocop", :install_if => lambda { RUBY_VERSION >= "1.9" }
14
+ gem "rubocop", "~> 0.49.0", :install_if => lambda { RUBY_VERSION >= "2.0" }
14
15
  end
data/Gemfile.lock ADDED
@@ -0,0 +1,55 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ compact_index (0.14.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ ast (2.4.0)
10
+ diff-lcs (1.3)
11
+ parallel (1.19.1)
12
+ parser (2.7.1.1)
13
+ ast (~> 2.4.0)
14
+ powerpack (0.1.2)
15
+ rainbow (2.2.2)
16
+ rake
17
+ rake (13.0.1)
18
+ redcarpet (3.5.1)
19
+ rspec (3.9.0)
20
+ rspec-core (~> 3.9.0)
21
+ rspec-expectations (~> 3.9.0)
22
+ rspec-mocks (~> 3.9.0)
23
+ rspec-core (3.9.1)
24
+ rspec-support (~> 3.9.1)
25
+ rspec-expectations (3.9.1)
26
+ diff-lcs (>= 1.2.0, < 2.0)
27
+ rspec-support (~> 3.9.0)
28
+ rspec-mocks (3.9.1)
29
+ diff-lcs (>= 1.2.0, < 2.0)
30
+ rspec-support (~> 3.9.0)
31
+ rspec-support (3.9.2)
32
+ rubocop (0.49.1)
33
+ parallel (~> 1.10)
34
+ parser (>= 2.3.3.1, < 3.0)
35
+ powerpack (~> 0.1)
36
+ rainbow (>= 1.99.1, < 3.0)
37
+ ruby-progressbar (~> 1.7)
38
+ unicode-display_width (~> 1.0, >= 1.0.1)
39
+ ruby-progressbar (1.10.1)
40
+ unicode-display_width (1.7.0)
41
+ yard (0.9.24)
42
+
43
+ PLATFORMS
44
+ ruby
45
+
46
+ DEPENDENCIES
47
+ compact_index!
48
+ rake (~> 13.0)
49
+ redcarpet (~> 3.5)
50
+ rspec (~> 3)
51
+ rubocop (~> 0.49.0)
52
+ yard (~> 0.9)
53
+
54
+ BUNDLED WITH
55
+ 2.1.4
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Build Status](https://travis-ci.org/bundler/compact_index.svg)](https://travis-ci.org/bundler/compact_index)
1
+ [![Build Status](https://travis-ci.org/rubygems/compact_index.svg)](https://travis-ci.org/rubygems/compact_index)
2
2
 
3
3
  # CompactIndex
4
4
 
data/Rakefile CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "bundler/gem_tasks"
3
4
 
4
5
  begin
@@ -6,7 +7,7 @@ begin
6
7
 
7
8
  desc "Run specs"
8
9
  RSpec::Core::RakeTask.new(:spec) do |t|
9
- t.rspec_opts = %w(--color)
10
+ t.rspec_opts = %w[--color]
10
11
  end
11
12
 
12
13
  begin
@@ -1,5 +1,6 @@
1
1
  # coding: utf-8
2
2
  # frozen_string_literal: true
3
+
3
4
  lib = File.expand_path("../lib", __FILE__)
4
5
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
6
  require "compact_index/version"
@@ -7,11 +8,11 @@ require "compact_index/version"
7
8
  Gem::Specification.new do |spec|
8
9
  spec.name = "compact_index"
9
10
  spec.version = CompactIndex::VERSION
10
- spec.authors = ["fotanus@gmail.com"]
11
- spec.email = ["Felipe Tanus"]
11
+ spec.authors = ["Felipe Tanus"]
12
+ spec.email = ["fotanus@gmail.com"]
12
13
 
13
14
  spec.summary = "Backend for compact index"
14
- spec.homepage = "https://github.com/bundler/compact_index"
15
+ spec.homepage = "https://github.com/rubygems/compact_index"
15
16
  spec.license = "MIT"
16
17
 
17
18
  spec.files = `git ls-files -z`.split("\x0").reject {|f| f.match(%r{^(test|spec|features)/}) }
@@ -19,6 +20,6 @@ Gem::Specification.new do |spec|
19
20
  spec.executables = spec.files.grep(%r{^exe/}) {|f| File.basename(f) }
20
21
  spec.require_paths = ["lib"]
21
22
 
22
- spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_development_dependency "rake", "~> 13.0"
23
24
  spec.add_development_dependency "rspec", "~> 3"
24
25
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Sequel.migration do
3
4
  change do
4
5
  create_table(:dependencies, :ignore_index_errors => true) do
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Sequel.migration do
3
4
  up do
4
5
  drop_table :linksets
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Sequel.migration do
3
4
  up do
4
5
  alter_table :versions do
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Sequel.migration do
3
4
  change do
4
5
  alter_table :rubygems do
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Sequel.migration do
3
4
  change do
4
5
  create_table :checksums do
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Sequel.migration do
3
4
  change do
4
5
  alter_table :versions do
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Sequel.migration do
3
4
  change do
4
5
  alter_table :versions do
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module CompactIndex
3
4
  Dependency = Struct.new(:gem, :version, :platform, :checksum) do
4
5
  def version_and_platform
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "date"
3
4
 
4
5
  # Ruby 1.8.7 makes Time#to_datetime private, but we need it
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module CompactIndex
3
4
  Gem = Struct.new(:name, :versions) do
4
5
  def <=>(other)
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module CompactIndex
4
+ # rubocop:disable Metrics/BlockLength
3
5
  GemVersion = Struct.new(:number, :platform, :checksum, :info_checksum,
4
6
  :dependencies, :ruby_version, :rubygems_version) do
5
7
  def number_and_platform
@@ -22,18 +24,30 @@ module CompactIndex
22
24
 
23
25
  def to_line
24
26
  line = number_and_platform.dup << " " << deps_line << "|checksum:#{checksum}"
25
- line << ",ruby:#{ruby_version}" if ruby_version && ruby_version != ">= 0"
26
- line << ",rubygems:#{rubygems_version}" if rubygems_version && rubygems_version != ">= 0"
27
+ line << ",ruby:#{ruby_version_line}" if ruby_version && ruby_version != ">= 0"
28
+ line << ",rubygems:#{rubygems_version_line}" if rubygems_version && rubygems_version != ">= 0"
27
29
  line
28
30
  end
29
31
 
30
32
  private
31
33
 
34
+ def ruby_version_line
35
+ join_multiple(ruby_version)
36
+ end
37
+
38
+ def rubygems_version_line
39
+ join_multiple(rubygems_version)
40
+ end
41
+
32
42
  def deps_line
33
43
  return "" if dependencies.nil?
34
44
  dependencies.map do |d|
35
- [d[:gem], d.version_and_platform.split(", ").sort.join("&")].join(":")
45
+ [d[:gem], join_multiple(d.version_and_platform)].join(":")
36
46
  end.join(",")
37
47
  end
48
+
49
+ def join_multiple(requirements)
50
+ requirements.split(", ").sort.join("&")
51
+ end
38
52
  end
39
53
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module CompactIndex
3
- VERSION = "0.11.0".freeze
4
+ VERSION = "0.14.0".freeze
4
5
  end
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "time"
3
4
  require "date"
4
5
  require "digest"
5
- require "compact_index"
6
6
 
7
7
  module CompactIndex
8
8
  class VersionsFile
@@ -24,11 +24,11 @@ module CompactIndex
24
24
  created_at_header(@path) || Time.at(0).to_datetime
25
25
  end
26
26
 
27
- def create(gems)
27
+ def create(gems, ts = Time.now.iso8601)
28
28
  gems.sort!
29
29
 
30
30
  File.open(@path, "w") do |io|
31
- io.write "created_at: #{Time.now.iso8601}\n---\n"
31
+ io.write "created_at: #{ts}\n---\n"
32
32
  io.write gem_lines(gems)
33
33
  end
34
34
  end
@@ -36,8 +36,6 @@ module CompactIndex
36
36
  private
37
37
 
38
38
  def gem_lines(gems)
39
- gems.each {|g| g.versions.sort! }
40
-
41
39
  gems.reduce("".dup) do |lines, gem|
42
40
  version_numbers = gem.versions.map(&:number_and_platform).join(",")
43
41
  lines << gem.name <<
data/lib/compact_index.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "compact_index/gem"
3
4
  require "compact_index/gem_version"
4
5
  require "compact_index/dependency"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: compact_index
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
- - fotanus@gmail.com
7
+ - Felipe Tanus
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-27 00:00:00.000000000 Z
11
+ date: 2021-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '10.0'
19
+ version: '13.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '10.0'
26
+ version: '13.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -40,7 +40,7 @@ dependencies:
40
40
  version: '3'
41
41
  description:
42
42
  email:
43
- - Felipe Tanus
43
+ - fotanus@gmail.com
44
44
  executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
@@ -55,6 +55,7 @@ files:
55
55
  - CHANGELOG.md
56
56
  - CODE_OF_CONDUCT.md
57
57
  - Gemfile
58
+ - Gemfile.lock
58
59
  - LICENSE.txt
59
60
  - README.md
60
61
  - Rakefile
@@ -75,7 +76,7 @@ files:
75
76
  - lib/compact_index/gem_version.rb
76
77
  - lib/compact_index/version.rb
77
78
  - lib/compact_index/versions_file.rb
78
- homepage: https://github.com/bundler/compact_index
79
+ homepage: https://github.com/rubygems/compact_index
79
80
  licenses:
80
81
  - MIT
81
82
  metadata: {}
@@ -94,8 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
95
  - !ruby/object:Gem::Version
95
96
  version: '0'
96
97
  requirements: []
97
- rubyforge_project:
98
- rubygems_version: 2.4.6
98
+ rubygems_version: 3.2.3
99
99
  signing_key:
100
100
  specification_version: 4
101
101
  summary: Backend for compact index