compact_index 0.9.4 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.gitignore +0 -1
- data/.rubocop-bundler.yml +40 -8
- data/.rubocop.yml +10 -1
- data/.rubocop_todo.yml +28 -371
- data/.travis.yml +15 -7
- data/CHANGELOG.md +30 -0
- data/Gemfile +11 -3
- data/Gemfile.lock +55 -0
- data/README.md +4 -4
- data/Rakefile +13 -3
- data/bin/console +1 -0
- data/compact_index.gemspec +10 -8
- data/db/migrations/01_rubygems_org_schema_dump.rb +49 -45
- data/db/migrations/02_prune.rb +20 -18
- data/db/migrations/03_add_ruby_and_rubygems_requirements.rb +4 -2
- data/db/migrations/04_add_deps_md5_to_rubygems.rb +2 -0
- data/db/migrations/05_create_checksums.rb +3 -1
- data/db/migrations/06_add_created_at_to_versions.rb +2 -0
- data/db/migrations/07_add_checksum_to_versions.rb +2 -0
- data/lib/compact_index.rb +6 -36
- data/lib/compact_index/dependency.rb +3 -1
- data/lib/compact_index/ext/date.rb +3 -1
- data/lib/compact_index/gem.rb +7 -1
- data/lib/compact_index/gem_version.rb +43 -2
- data/lib/compact_index/version.rb +3 -1
- data/lib/compact_index/versions_file.rb +43 -91
- metadata +9 -9
data/.travis.yml
CHANGED
@@ -1,9 +1,17 @@
|
|
1
1
|
language: ruby
|
2
|
-
rvm:
|
3
|
-
- "2.3.0"
|
4
|
-
- "2.2.4"
|
5
|
-
- "2.1.5"
|
6
|
-
- "1.9.3"
|
7
|
-
- "1.8.7"
|
8
|
-
script: bundle exec rspec
|
9
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
|
+
|
13
|
+
rvm:
|
14
|
+
- "2.7.1"
|
15
|
+
- "2.6.6"
|
16
|
+
- "2.5.8"
|
17
|
+
- "2.4.10"
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,33 @@
|
|
1
|
+
## 0.13.0 (May 25, 2020)
|
2
|
+
|
3
|
+
Bugfix:
|
4
|
+
|
5
|
+
- Revert trimming of space from requirements. Removing space would have meant info response of all gems were going to change.
|
6
|
+
- Fix token used for splitting list of requirements
|
7
|
+
|
8
|
+
## 0.12.0 (May 3, 2020)
|
9
|
+
|
10
|
+
Bugfix:
|
11
|
+
|
12
|
+
- Update info line to join multiple ruby or rubygems requirements by ampersand (rubygems/compact_index#26)
|
13
|
+
|
14
|
+
## 0.11.0 (January 22, 2016)
|
15
|
+
|
16
|
+
Features:
|
17
|
+
|
18
|
+
- Refactoring big part of the code
|
19
|
+
- Change behavior of VersionsFile#create to avoid adding multiple versions per line
|
20
|
+
|
21
|
+
## 0.10.0 (January 22, 2016)
|
22
|
+
|
23
|
+
Features:
|
24
|
+
|
25
|
+
- Frozen string literal support
|
26
|
+
|
27
|
+
Bugfixes:
|
28
|
+
|
29
|
+
- Use the last info checksum, rather than the first
|
30
|
+
|
1
31
|
## 0.9.4 (January 5, 2016)
|
2
32
|
|
3
33
|
Features:
|
data/Gemfile
CHANGED
@@ -1,7 +1,15 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
2
4
|
|
3
5
|
# Specify your gem's dependencies in compact_index.gemspec
|
4
6
|
gemspec
|
5
7
|
|
6
|
-
|
7
|
-
gem "redcarpet", "~>2.3"
|
8
|
+
group :documentation do
|
9
|
+
gem "redcarpet", "~> 2.3"
|
10
|
+
gem "yard", "~> 0.9"
|
11
|
+
end
|
12
|
+
|
13
|
+
group :development do
|
14
|
+
gem "rubocop", "~> 0.49.0", :install_if => lambda { RUBY_VERSION >= "2.0" }
|
15
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
compact_index (0.13.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 (2.3.0)
|
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 (~> 2.3)
|
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
|
-
[](https://travis-ci.org/rubygems/compact_index)
|
2
2
|
|
3
3
|
# CompactIndex
|
4
4
|
|
@@ -20,7 +20,7 @@ And then execute:
|
|
20
20
|
|
21
21
|
### `/names`
|
22
22
|
|
23
|
-
To render the body for this call, all you have to do is generate a list of gems available in
|
23
|
+
To render the body for this call, all you have to do is generate a list of gems available in alphabetical order and use call `CompactIndex.names`.
|
24
24
|
|
25
25
|
```ruby
|
26
26
|
gem 'compact_index'
|
@@ -37,7 +37,7 @@ gem 'compact_index'
|
|
37
37
|
versions_file = CompactIndex::VersionsFile.new("/path/to/versions/file")
|
38
38
|
|
39
39
|
# Get last updated date. This is used to discover what gems aren't in the file yet
|
40
|
-
from_date =
|
40
|
+
from_date = versions_file.updated_at
|
41
41
|
|
42
42
|
# Query the extra gems using the from date. Format should be as follows
|
43
43
|
extra_gems = [
|
@@ -52,7 +52,7 @@ extra_gems = [
|
|
52
52
|
]
|
53
53
|
|
54
54
|
# Render the body for the versions response
|
55
|
-
CompactIndex.versions(
|
55
|
+
CompactIndex.versions(versions_file, extra_gems)
|
56
56
|
```
|
57
57
|
|
58
58
|
### `/info/gem_name`
|
data/Rakefile
CHANGED
@@ -1,14 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "bundler/gem_tasks"
|
2
4
|
|
3
5
|
begin
|
4
|
-
require
|
6
|
+
require "rspec/core/rake_task"
|
5
7
|
|
6
8
|
desc "Run specs"
|
7
9
|
RSpec::Core::RakeTask.new(:spec) do |t|
|
8
|
-
t.rspec_opts = %w
|
10
|
+
t.rspec_opts = %w[--color]
|
11
|
+
end
|
12
|
+
|
13
|
+
begin
|
14
|
+
require "rubocop/rake_task"
|
15
|
+
RuboCop::RakeTask.new
|
16
|
+
rescue LoadError
|
17
|
+
task :rubocop
|
9
18
|
end
|
10
19
|
|
11
|
-
task :default => :spec
|
20
|
+
task :default => [:rubocop, :spec]
|
12
21
|
rescue LoadError => e
|
13
22
|
# rspec won't exist on production
|
23
|
+
nil
|
14
24
|
end
|
data/bin/console
CHANGED
data/compact_index.gemspec
CHANGED
@@ -1,23 +1,25 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
5
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
6
|
+
require "compact_index/version"
|
5
7
|
|
6
8
|
Gem::Specification.new do |spec|
|
7
9
|
spec.name = "compact_index"
|
8
10
|
spec.version = CompactIndex::VERSION
|
9
|
-
spec.authors = ["
|
10
|
-
spec.email = ["
|
11
|
+
spec.authors = ["Felipe Tanus"]
|
12
|
+
spec.email = ["fotanus@gmail.com"]
|
11
13
|
|
12
14
|
spec.summary = "Backend for compact index"
|
13
|
-
spec.homepage = "https://github.com/
|
15
|
+
spec.homepage = "https://github.com/rubygems/compact_index"
|
14
16
|
spec.license = "MIT"
|
15
17
|
|
16
|
-
spec.files = `git ls-files -z`.split("\x0").reject {
|
18
|
+
spec.files = `git ls-files -z`.split("\x0").reject {|f| f.match(%r{^(test|spec|features)/}) }
|
17
19
|
spec.bindir = "exe"
|
18
|
-
spec.executables = spec.files.grep(%r{^exe/}) {
|
20
|
+
spec.executables = spec.files.grep(%r{^exe/}) {|f| File.basename(f) }
|
19
21
|
spec.require_paths = ["lib"]
|
20
22
|
|
21
|
-
spec.add_development_dependency "rake", "~>
|
23
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
22
24
|
spec.add_development_dependency "rspec", "~> 3"
|
23
25
|
end
|
@@ -1,73 +1,77 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
Sequel.migration do
|
2
4
|
change do
|
3
|
-
create_table(:dependencies, :ignore_index_errors=>true) do
|
5
|
+
create_table(:dependencies, :ignore_index_errors => true) do
|
4
6
|
primary_key :id
|
5
|
-
String :requirements, :size=>255
|
7
|
+
String :requirements, :size => 255
|
6
8
|
DateTime :created_at
|
7
9
|
DateTime :updated_at
|
8
10
|
Integer :rubygem_id
|
9
11
|
Integer :version_id
|
10
|
-
String :scope, :size=>255
|
11
|
-
String :unresolved_name, :size=>255
|
12
|
-
|
13
|
-
index [:rubygem_id], :name
|
14
|
-
index [:unresolved_name], :name
|
15
|
-
index [:version_id], :name
|
12
|
+
String :scope, :size => 255
|
13
|
+
String :unresolved_name, :size => 255
|
14
|
+
|
15
|
+
index [:rubygem_id], :name => :index_dependencies_on_rubygem_id
|
16
|
+
index [:unresolved_name], :name => :index_dependencies_on_unresolved_name
|
17
|
+
index [:version_id], :name => :index_dependencies_on_version_id
|
16
18
|
end
|
17
|
-
|
18
|
-
create_table(:linksets, :ignore_index_errors=>true) do
|
19
|
+
|
20
|
+
create_table(:linksets, :ignore_index_errors => true) do
|
19
21
|
primary_key :id
|
20
22
|
Integer :rubygem_id
|
21
|
-
String :home, :size=>255
|
22
|
-
String :wiki, :size=>255
|
23
|
-
String :docs, :size=>255
|
24
|
-
String :mail, :size=>255
|
25
|
-
String :code, :size=>255
|
26
|
-
String :bugs, :size=>255
|
23
|
+
String :home, :size => 255
|
24
|
+
String :wiki, :size => 255
|
25
|
+
String :docs, :size => 255
|
26
|
+
String :mail, :size => 255
|
27
|
+
String :code, :size => 255
|
28
|
+
String :bugs, :size => 255
|
27
29
|
DateTime :created_at
|
28
30
|
DateTime :updated_at
|
29
|
-
|
30
|
-
index [:rubygem_id], :name
|
31
|
+
|
32
|
+
index [:rubygem_id], :name => :index_linksets_on_rubygem_id
|
31
33
|
end
|
32
|
-
|
33
|
-
create_table(:rubygems, :ignore_index_errors=>true) do
|
34
|
+
|
35
|
+
create_table(:rubygems, :ignore_index_errors => true) do
|
34
36
|
primary_key :id
|
35
|
-
String :name, :size=>255
|
37
|
+
String :name, :size => 255
|
36
38
|
DateTime :created_at
|
37
39
|
DateTime :updated_at
|
38
|
-
Integer :downloads, :default=>0
|
39
|
-
String :slug, :size=>255
|
40
|
-
|
41
|
-
index [:name], :name
|
40
|
+
Integer :downloads, :default => 0
|
41
|
+
String :slug, :size => 255
|
42
|
+
|
43
|
+
index [:name], :name => :index_rubygems_on_name, :unique => true
|
42
44
|
end
|
43
|
-
|
44
|
-
create_table(:versions, :ignore_index_errors=>true) do
|
45
|
+
|
46
|
+
create_table(:versions, :ignore_index_errors => true) do
|
45
47
|
primary_key :id
|
46
|
-
String :authors, :text=>true
|
47
|
-
String :description, :text=>true
|
48
|
-
String :number, :size=>255
|
48
|
+
String :authors, :text => true
|
49
|
+
String :description, :text => true
|
50
|
+
String :number, :size => 255
|
49
51
|
Integer :rubygem_id
|
50
52
|
DateTime :built_at
|
51
53
|
DateTime :updated_at
|
52
|
-
String :rubyforge_project, :size=>255
|
53
|
-
String :summary, :text=>true
|
54
|
-
String :platform, :size=>255
|
54
|
+
String :rubyforge_project, :size => 255
|
55
|
+
String :summary, :text => true
|
56
|
+
String :platform, :size => 255
|
55
57
|
DateTime :created_at
|
56
|
-
TrueClass :indexed, :default=>true
|
58
|
+
TrueClass :indexed, :default => true
|
57
59
|
TrueClass :prerelease
|
58
60
|
Integer :position
|
59
61
|
TrueClass :latest
|
60
|
-
String :full_name, :size=>255
|
61
|
-
|
62
|
-
index [:built_at], :name
|
63
|
-
index [:created_at], :name
|
64
|
-
index [:full_name], :name
|
65
|
-
index [:indexed], :name
|
66
|
-
index [:number], :name
|
67
|
-
index [:position], :name
|
68
|
-
index [:prerelease], :name
|
69
|
-
index [:rubygem_id], :name
|
70
|
-
index [:rubygem_id, :number, :platform],
|
62
|
+
String :full_name, :size => 255
|
63
|
+
|
64
|
+
index [:built_at], :name => :index_versions_on_built_at
|
65
|
+
index [:created_at], :name => :index_versions_on_created_at
|
66
|
+
index [:full_name], :name => :index_versions_on_full_name
|
67
|
+
index [:indexed], :name => :index_versions_on_indexed
|
68
|
+
index [:number], :name => :index_versions_on_number
|
69
|
+
index [:position], :name => :index_versions_on_position
|
70
|
+
index [:prerelease], :name => :index_versions_on_prerelease
|
71
|
+
index [:rubygem_id], :name => :index_versions_on_rubygem_id
|
72
|
+
index [:rubygem_id, :number, :platform],
|
73
|
+
:name => :index_versions_on_rubygem_id_and_number_and_platform,
|
74
|
+
:unique => true
|
71
75
|
end
|
72
76
|
end
|
73
77
|
end
|
data/db/migrations/02_prune.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
Sequel.migration do
|
2
4
|
up do
|
3
5
|
drop_table :linksets
|
@@ -28,47 +30,47 @@ Sequel.migration do
|
|
28
30
|
end
|
29
31
|
|
30
32
|
down do
|
31
|
-
create_table(:linksets, :ignore_index_errors=>true) do
|
33
|
+
create_table(:linksets, :ignore_index_errors => true) do
|
32
34
|
primary_key :id
|
33
35
|
Integer :rubygem_id
|
34
|
-
String :home, :size=>255
|
35
|
-
String :wiki, :size=>255
|
36
|
-
String :docs, :size=>255
|
37
|
-
String :mail, :size=>255
|
38
|
-
String :code, :size=>255
|
39
|
-
String :bugs, :size=>255
|
36
|
+
String :home, :size => 255
|
37
|
+
String :wiki, :size => 255
|
38
|
+
String :docs, :size => 255
|
39
|
+
String :mail, :size => 255
|
40
|
+
String :code, :size => 255
|
41
|
+
String :bugs, :size => 255
|
40
42
|
DateTime :created_at
|
41
43
|
DateTime :updated_at
|
42
44
|
|
43
|
-
index [:rubygem_id], :name
|
45
|
+
index [:rubygem_id], :name => :index_linksets_on_rubygem_id
|
44
46
|
end
|
45
47
|
|
46
48
|
alter_table :dependencies do
|
47
49
|
add_column :created_at, DateTime
|
48
50
|
add_column :updated_at, DateTime
|
49
|
-
add_column :unresolved_name, String, :size=>255
|
50
|
-
add_index [:unresolved_name], :name
|
51
|
+
add_column :unresolved_name, String, :size => 255
|
52
|
+
add_index [:unresolved_name], :name => :index_dependencies_on_unresolved_name
|
51
53
|
end
|
52
54
|
|
53
55
|
alter_table :rubygems do
|
54
56
|
add_column :created_at, DateTime
|
55
57
|
add_column :updated_at, DateTime
|
56
|
-
add_column :downloads, Integer, :default=>0
|
57
|
-
add_column :slug, String, :size=>255
|
58
|
+
add_column :downloads, Integer, :default => 0
|
59
|
+
add_column :slug, String, :size => 255
|
58
60
|
end
|
59
61
|
|
60
62
|
alter_table :versions do
|
61
63
|
add_column :created_at, DateTime
|
62
64
|
add_column :updated_at, DateTime
|
63
|
-
add_column :authors, String, :text=>true
|
64
|
-
add_column :description, String, :text=>true
|
65
|
+
add_column :authors, String, :text => true
|
66
|
+
add_column :description, String, :text => true
|
65
67
|
add_column :built_at, DateTime
|
66
|
-
add_column :rubyforge_project, String, :size=>255
|
68
|
+
add_column :rubyforge_project, String, :size => 255
|
67
69
|
add_column :position, Integer
|
68
70
|
add_column :latest, TrueClass
|
69
|
-
add_index [:created_at], :name
|
70
|
-
add_index [:built_at], :name
|
71
|
-
add_index [:position], :name
|
71
|
+
add_index [:created_at], :name => :index_versions_on_created_at
|
72
|
+
add_index [:built_at], :name => :index_versions_on_built_at
|
73
|
+
add_index [:position], :name => :index_versions_on_position
|
72
74
|
end
|
73
75
|
end
|
74
76
|
end
|
@@ -1,8 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
Sequel.migration do
|
2
4
|
up do
|
3
5
|
alter_table :versions do
|
4
|
-
add_column :rubygems_version, String, :size=>255
|
5
|
-
add_column :required_ruby_version, String, :size=>255
|
6
|
+
add_column :rubygems_version, String, :size => 255
|
7
|
+
add_column :required_ruby_version, String, :size => 255
|
6
8
|
end
|
7
9
|
end
|
8
10
|
|