gem_collector 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/gem_collector/api/v1/repositories_controller.rb +23 -0
- data/app/models/gem_collector/octokit_provider.rb +3 -2
- data/config/routes.rb +6 -0
- data/lib/gem_collector/version.rb +1 -1
- metadata +19 -8
- data/app/assets/config/gem_collector_manifest.js +0 -2
- data/app/assets/javascripts/gem_collector/application.js +0 -13
- data/app/assets/stylesheets/gem_collector/application.css +0 -15
- data/app/mailers/gem_collector/application_mailer.rb +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b9cac89eff3246661bafa03c4f92d365caa3dabd66c9bd76eb827c80e9a4502
|
4
|
+
data.tar.gz: 6ee0d9c9f5f91b3176c94b3078043431372471e072ad78dbc759610e4fa43283
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23cd2684cefb9f0d81373af864a93b9f77d67ed24794565854bc6a36c8cbeecc501775a82f5ea4fa32aa5d6db8dd48c217a6cf6ced405030fdce6d9d0ac8f321
|
7
|
+
data.tar.gz: '0197fea7c9a3fda8f2bbdfebaf99b4b26e4518bc7212ac35b2b147253b1d00a291c81d6cb8eb2691349af68c50738dcaa7a660507a1475171901946e6ab01c9d'
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class GemCollector::Api::V1::RepositoriesController < ActionController::API
|
2
|
+
def index
|
3
|
+
render json: GemCollector::Repository.all.map(&:as_json)
|
4
|
+
end
|
5
|
+
|
6
|
+
def show
|
7
|
+
repository = GemCollector::Repository.find(params[:id])
|
8
|
+
render json: {
|
9
|
+
gemfiles: repository.gems_with_version_point.group_by(&:path).map { |path, gems|
|
10
|
+
{
|
11
|
+
path: path,
|
12
|
+
gems: gems.map { |gem|
|
13
|
+
{
|
14
|
+
name: gem.name,
|
15
|
+
version: gem.version,
|
16
|
+
version_point: gem.version_point,
|
17
|
+
}
|
18
|
+
},
|
19
|
+
}
|
20
|
+
},
|
21
|
+
}
|
22
|
+
end
|
23
|
+
end
|
@@ -1,10 +1,11 @@
|
|
1
1
|
module GemCollector::OctokitProvider
|
2
2
|
def self.get(site)
|
3
3
|
conf = Rails.application.config.octokit.fetch(site.to_sym)
|
4
|
-
|
4
|
+
options = {
|
5
5
|
api_endpoint: conf[:api_endpoint],
|
6
6
|
web_endpoint: conf[:web_endpoint],
|
7
7
|
access_token: conf[:access_token],
|
8
|
-
|
8
|
+
}.compact
|
9
|
+
Octokit::Client.new(options)
|
9
10
|
end
|
10
11
|
end
|
data/config/routes.rb
CHANGED
@@ -6,4 +6,10 @@ GemCollector::Engine.routes.draw do
|
|
6
6
|
get '/gems/:name' => 'repository_gems#show', as: :repository_gem
|
7
7
|
get '/gems/:name/new_issue' => 'gem_news#new', as: :new_gem_news
|
8
8
|
post '/gems/:name/new_issue' => 'gem_news#create', as: :create_gem_news
|
9
|
+
|
10
|
+
namespace :api do
|
11
|
+
namespace :v1 do
|
12
|
+
resources :repositories, only: %i[index show]
|
13
|
+
end
|
14
|
+
end
|
9
15
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gem_collector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kohei Suzuki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord-import
|
@@ -95,7 +95,7 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 6.0.1
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: autodoc
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
@@ -109,7 +109,21 @@ dependencies:
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: factory_bot_rails
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rspec-rails
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
114
128
|
requirements:
|
115
129
|
- - ">="
|
@@ -132,9 +146,7 @@ files:
|
|
132
146
|
- MIT-LICENSE
|
133
147
|
- README.md
|
134
148
|
- Rakefile
|
135
|
-
- app/
|
136
|
-
- app/assets/javascripts/gem_collector/application.js
|
137
|
-
- app/assets/stylesheets/gem_collector/application.css
|
149
|
+
- app/controllers/gem_collector/api/v1/repositories_controller.rb
|
138
150
|
- app/controllers/gem_collector/application_controller.rb
|
139
151
|
- app/controllers/gem_collector/gem_news_controller.rb
|
140
152
|
- app/controllers/gem_collector/repositories_controller.rb
|
@@ -142,7 +154,6 @@ files:
|
|
142
154
|
- app/helpers/gem_collector/application_helper.rb
|
143
155
|
- app/jobs/gem_collector/application_job.rb
|
144
156
|
- app/jobs/gem_collector/update_gemfile_job.rb
|
145
|
-
- app/mailers/gem_collector/application_mailer.rb
|
146
157
|
- app/models/gem_collector/application_record.rb
|
147
158
|
- app/models/gem_collector/octokit_provider.rb
|
148
159
|
- app/models/gem_collector/repository.rb
|
@@ -1,13 +0,0 @@
|
|
1
|
-
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
-
// listed below.
|
3
|
-
//
|
4
|
-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
-
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
-
//
|
7
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
9
|
-
//
|
10
|
-
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
-
// about supported directives.
|
12
|
-
//
|
13
|
-
//= require_tree .
|
@@ -1,15 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
-
* listed below.
|
4
|
-
*
|
5
|
-
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
-
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
-
*
|
8
|
-
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
-
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
-
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
-
* It is generally better to create a new file per style scope.
|
12
|
-
*
|
13
|
-
*= require_tree .
|
14
|
-
*= require_self
|
15
|
-
*/
|