Skip to content

Commit

Permalink
inertia - fix rspec, get new tapioca dsl + gems
Browse files Browse the repository at this point in the history
  • Loading branch information
dcordz committed Aug 26, 2024
1 parent 7dbaaab commit a9d535c
Show file tree
Hide file tree
Showing 165 changed files with 70,761 additions and 62,965 deletions.
138 changes: 69 additions & 69 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (7.1.3.4)
actionpack (= 7.1.3.4)
activesupport (= 7.1.3.4)
actioncable (7.1.4)
actionpack (= 7.1.4)
activesupport (= 7.1.4)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.1.3.4)
actionpack (= 7.1.3.4)
activejob (= 7.1.3.4)
activerecord (= 7.1.3.4)
activestorage (= 7.1.3.4)
activesupport (= 7.1.3.4)
actionmailbox (7.1.4)
actionpack (= 7.1.4)
activejob (= 7.1.4)
activerecord (= 7.1.4)
activestorage (= 7.1.4)
activesupport (= 7.1.4)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.1.3.4)
actionpack (= 7.1.3.4)
actionview (= 7.1.3.4)
activejob (= 7.1.3.4)
activesupport (= 7.1.3.4)
actionmailer (7.1.4)
actionpack (= 7.1.4)
actionview (= 7.1.4)
activejob (= 7.1.4)
activesupport (= 7.1.4)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.2)
actionpack (7.1.3.4)
actionview (= 7.1.3.4)
activesupport (= 7.1.3.4)
actionpack (7.1.4)
actionview (= 7.1.4)
activesupport (= 7.1.4)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
actiontext (7.1.3.4)
actionpack (= 7.1.3.4)
activerecord (= 7.1.3.4)
activestorage (= 7.1.3.4)
activesupport (= 7.1.3.4)
actiontext (7.1.4)
actionpack (= 7.1.4)
activerecord (= 7.1.4)
activestorage (= 7.1.4)
activesupport (= 7.1.4)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.1.3.4)
activesupport (= 7.1.3.4)
actionview (7.1.4)
activesupport (= 7.1.4)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.1.3.4)
activesupport (= 7.1.3.4)
activejob (7.1.4)
activesupport (= 7.1.4)
globalid (>= 0.3.6)
activemodel (7.1.3.4)
activesupport (= 7.1.3.4)
activerecord (7.1.3.4)
activemodel (= 7.1.3.4)
activesupport (= 7.1.3.4)
activemodel (7.1.4)
activesupport (= 7.1.4)
activerecord (7.1.4)
activemodel (= 7.1.4)
activesupport (= 7.1.4)
timeout (>= 0.4.0)
activestorage (7.1.3.4)
actionpack (= 7.1.3.4)
activejob (= 7.1.3.4)
activerecord (= 7.1.3.4)
activesupport (= 7.1.3.4)
activestorage (7.1.4)
actionpack (= 7.1.4)
activejob (= 7.1.4)
activerecord (= 7.1.4)
activesupport (= 7.1.4)
marcel (~> 1.0)
activesupport (7.1.3.4)
activesupport (7.1.4)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
Expand Down Expand Up @@ -134,10 +134,10 @@ GEM
railties (>= 5.0.0)
faker (3.4.2)
i18n (>= 1.8.11, < 2)
faraday (2.10.1)
faraday-net_http (>= 2.0, < 3.2)
faraday (2.11.0)
faraday-net_http (>= 2.0, < 3.4)
logger
faraday-net_http (3.1.1)
faraday-net_http (3.3.0)
net-http
geocoder (1.8.3)
base64 (>= 0.1.0)
Expand All @@ -154,7 +154,7 @@ GEM
retriable (>= 2.0, < 4.a)
google-apis-iamcredentials_v1 (0.21.0)
google-apis-core (>= 0.15.0, < 2.a)
google-apis-storage_v1 (0.43.0)
google-apis-storage_v1 (0.44.0)
google-apis-core (>= 0.15.0, < 2.a)
google-cloud-core (1.7.1)
google-cloud-env (>= 1.0, < 3.a)
Expand Down Expand Up @@ -262,20 +262,20 @@ GEM
rackup (2.1.0)
rack (>= 3)
webrick (~> 1.8)
rails (7.1.3.4)
actioncable (= 7.1.3.4)
actionmailbox (= 7.1.3.4)
actionmailer (= 7.1.3.4)
actionpack (= 7.1.3.4)
actiontext (= 7.1.3.4)
actionview (= 7.1.3.4)
activejob (= 7.1.3.4)
activemodel (= 7.1.3.4)
activerecord (= 7.1.3.4)
activestorage (= 7.1.3.4)
activesupport (= 7.1.3.4)
rails (7.1.4)
actioncable (= 7.1.4)
actionmailbox (= 7.1.4)
actionmailer (= 7.1.4)
actionpack (= 7.1.4)
actiontext (= 7.1.4)
actionview (= 7.1.4)
activejob (= 7.1.4)
activemodel (= 7.1.4)
activerecord (= 7.1.4)
activestorage (= 7.1.4)
activesupport (= 7.1.4)
bundler (>= 1.15.0)
railties (= 7.1.3.4)
railties (= 7.1.4)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
Expand All @@ -287,9 +287,9 @@ GEM
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.1.3.4)
actionpack (= 7.1.3.4)
activesupport (= 7.1.3.4)
railties (7.1.4)
actionpack (= 7.1.4)
activesupport (= 7.1.4)
irb
rackup (>= 1.0.0)
rake (>= 12.2)
Expand Down Expand Up @@ -354,10 +354,10 @@ GEM
rubocop-performance (1.21.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rails (2.25.1)
rubocop-rails (2.26.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop (>= 1.52.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rspec (3.0.4)
rubocop (~> 1.61)
Expand All @@ -384,15 +384,15 @@ GEM
faraday (>= 0.17.5, < 3.a)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
sorbet (0.5.11535)
sorbet-static (= 0.5.11535)
sorbet-runtime (0.5.11535)
sorbet-static (0.5.11535-aarch64-linux)
sorbet-static (0.5.11535-universal-darwin)
sorbet-static (0.5.11535-x86_64-linux)
sorbet-static-and-runtime (0.5.11535)
sorbet (= 0.5.11535)
sorbet-runtime (= 0.5.11535)
sorbet (0.5.11545)
sorbet-static (= 0.5.11545)
sorbet-runtime (0.5.11545)
sorbet-static (0.5.11545-aarch64-linux)
sorbet-static (0.5.11545-universal-darwin)
sorbet-static (0.5.11545-x86_64-linux)
sorbet-static-and-runtime (0.5.11545)
sorbet (= 0.5.11545)
sorbet-runtime (= 0.5.11545)
spoom (1.4.2)
erubi (>= 1.10.0)
prism (>= 0.28.0)
Expand Down Expand Up @@ -437,7 +437,7 @@ GEM
openssl (> 2.0)
openssl-signature_algorithm (~> 1.0)
trailblazer-option (0.1.2)
twilio-ruby (7.2.3)
twilio-ruby (7.2.4)
faraday (>= 0.9, < 3.0)
jwt (>= 1.5, < 3.0)
nokogiri (>= 1.6, < 2.0)
Expand Down
2 changes: 1 addition & 1 deletion app/models/user_inviter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class << self

sig { params(user: User).void }
def from(user:)
UserInviter.create!(user:)
create!(user:)
end
end

Expand Down
18 changes: 10 additions & 8 deletions lib/census.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'faraday'
require "faraday"

module Census
CONGRESS = 118
Expand All @@ -10,11 +10,9 @@ def initialize(address)
end

def congressional_district
data&.fetch("features", []).first&.dig("attributes", "CD#{CONGRESS}")
data&.fetch("features", [])&.first&.dig("attributes", "CD#{CONGRESS}")
end



# {
# displayFieldName: string;
# fieldAliases: { STATE: "STATE"; CD118: "CD118" };
Expand Down Expand Up @@ -44,19 +42,23 @@ def congressional_district
# ];
# }
def request
@request ||= Faraday.get(query_url, headers: { "Accept": 'application/json' })
@request ||= Faraday.get(query_url, headers: {Accept: "application/json"})
end

def data
@_data ||= request&.body ? JSON.parse(request.body) : nil
@_data ||= if request.is_a?(Hash)
request
else
request&.body ? JSON.parse(request.body) : nil
end
end

private

def query_url
CENSUS_QUERY_URL
.sub('<latitude>', @address.latitude.to_s)
.sub('<longitude>', @address.longitude.to_s)
.sub("<latitude>", @address.latitude.to_s)
.sub("<longitude>", @address.longitude.to_s)
end
end
end
Loading

0 comments on commit a9d535c

Please sign in to comment.