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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@

# Ignore master key for decrypting credentials and more.
/config/master.key

*.swp
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ gem "bootsnap", require: false
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
# gem "image_processing", "~> 1.2"


gem "gems"

gem "vcr", "~> 6.2"

group :development, :test do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
Expand All @@ -72,6 +71,7 @@ group :test do
gem "capybara"
gem "selenium-webdriver"
gem "database_cleaner-active_record"
gem "webmock", "~> 3.23"
end

# TODO: add a linter or rubocop or something like that
gem "octokit", "~> 9.1"
27 changes: 27 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ GEM
xpath (~> 3.2)
concurrent-ruby (1.3.3)
connection_pool (2.4.1)
crack (1.0.0)
bigdecimal
rexml
crass (1.0.6)
database_cleaner-active_record (2.1.0)
activerecord (>= 5.a)
Expand All @@ -105,9 +108,15 @@ GEM
reline (>= 0.3.8)
drb (2.2.1)
erubi (1.13.0)
faraday (2.10.0)
faraday-net_http (>= 2.0, < 3.2)
logger
faraday-net_http (3.1.0)
net-http
gems (1.2.0)
globalid (1.2.1)
activesupport (>= 6.1)
hashdiff (1.1.0)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
importmap-rails (2.0.1)
Expand All @@ -121,6 +130,7 @@ GEM
jbuilder (2.12.0)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
logger (1.6.0)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
Expand All @@ -135,6 +145,8 @@ GEM
minitest (5.23.1)
msgpack (1.7.2)
mutex_m (0.2.0)
net-http (0.4.1)
uri
net-imap (0.4.13)
date
net-protocol
Expand All @@ -147,6 +159,9 @@ GEM
nio4r (2.7.3)
nokogiri (1.16.6-x86_64-linux)
racc (~> 1.4)
octokit (9.1.0)
faraday (>= 1, < 3)
sawyer (~> 0.9)
psych (5.1.2)
stringio
public_suffix (5.1.1)
Expand Down Expand Up @@ -199,6 +214,9 @@ GEM
rexml (3.3.0)
strscan
rubyzip (2.3.2)
sawyer (0.9.2)
addressable (>= 2.3.5)
faraday (>= 0.17.3, < 3)
selenium-webdriver (4.21.1)
base64 (~> 0.2)
rexml (~> 3.2, >= 3.2.5)
Expand Down Expand Up @@ -229,11 +247,17 @@ GEM
railties (>= 6.0.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uri (0.13.0)
vcr (6.2.0)
web-console (4.2.1)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webmock (3.23.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webrick (1.8.1)
websocket (1.2.10)
websocket-driver (0.7.6)
Expand All @@ -254,6 +278,7 @@ DEPENDENCIES
gems
importmap-rails
jbuilder
octokit (~> 9.1)
puma (>= 5.0)
rails (~> 7.1.3, >= 7.1.3.4)
selenium-webdriver
Expand All @@ -263,7 +288,9 @@ DEPENDENCIES
stimulus-rails
turbo-rails
tzinfo-data
vcr (~> 6.2)
web-console
webmock (~> 3.23)

RUBY VERSION
ruby 3.2.4p170
Expand Down
10 changes: 2 additions & 8 deletions app/models/ruby_gem.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
class RubyGem < ApplicationRecord
def self.fetch_from_ruby_gems_dot_org(gem_name)
# gem_info = Gems.info(gem_name).symbolize_keys
# puts gem_info
# new(gem_info).save
# create(name: "maid")
i = new
i.name = "maid" # FIXME: Y U NO WORK
i.save
i
gem_info = Gems.info(gem_name).symbolize_keys
create(gem_info)
end
end
1 change: 1 addition & 0 deletions b-coauthor.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Co-authored-by: Benjamin Oakes <hello@benjaminoakes.com>
207 changes: 207 additions & 0 deletions fixtures/vcr_cassettes/fetch_from_ruby_gems_dot_org.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions foo_hack.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# gem = RubyGem.find_by_name("maid")
#
# # This is gonna be a lot messier than just this, but for now that's ok
# gem.github_url
# # homepage?
#
# # GitHubCacheFooModel.new
# github_repo_object = query_github_from_project_url(project_url)
#
# github_repoo_object.archived?
#
# if gem.archived? && gem.usage_score > some_cutoff
# add_gem_to_our_fostering_portfolio
# end

# github_repo_object = query_github_from_project_url(project_url)

require "octokit"

def query_github_from_project_url(project_url)
puts "querying " + project_url
client = Octokit::Client.new(:access_token => 'personal_access_token')

p client
p client.user
end

query_github_from_project_url("maid")
4 changes: 4 additions & 0 deletions test/lib/query_gems_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
require "test_helper"

class QueryGemsTest < ActiveSupport::TestCase

def test_foo
fail "check out the foo_hack.rb file next"
end
# TODO: close instance before we wrap for the day
=begin

Expand Down
Loading