-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
79 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,3 +37,6 @@ | |
|
||
/app/assets/builds/* | ||
!/app/assets/builds/.keep | ||
|
||
# Ignore Cursor AI rules | ||
.cursorrules |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
require "net/http" | ||
require "json" | ||
|
||
class PagesController < ApplicationController | ||
def index | ||
@stargazers_count = Rails.cache.fetch("stargazers_count", expires_in: 24.hours) do | ||
fetch_stargazers_count | ||
end | ||
end | ||
|
||
private | ||
|
||
def fetch_stargazers_count | ||
url = URI("https://ungh.cc/repos/maybe-finance/maybe") | ||
response = Net::HTTP.get(url) | ||
json = JSON.parse(response) | ||
json["repo"]["stars"] | ||
rescue StandardError => e | ||
Rails.logger.error "Failed to fetch stargazers count: #{e.message}" | ||
nil | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module PagesHelper | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<div class="text-center"> | ||
<div class="max-w-xl pt-8 mx-auto text-3xl"> | ||
Maybe <%= image_tag('icon-maybe-color.svg', alt: 'Maybe Logo', class: 'inline') %> is a <em class="relative"><span class="border-b-2 border-dotted border-neutral-400">fully</span><sup>*</sup> <span class="absolute w-64 text-xs text-left left-16 -top-7 -rotate-3 text-neutral-400"><sup>*</sup>your finances are secure</span></em> open-source | ||
<div class="inline-flex border rounded-md shadow-[0_1px_8px_0_rgba(0,0,0,0.04)] border-neutral-200"> | ||
<%= link_to 'https://github.com/maybe-finance/maybe', class: "px-2 py-1.5 border-r shadow-[inset_0_-2px_5px_0_rgba(0,0,0,0.07)] bg-neutral-100 rounded-l-md border-neutral-200 flex items-center justify-center" do %> | ||
<%= image_tag('icon-github.svg', alt: 'GitHub icon', class: 'h-5 w-5') %> | ||
<% end %> | ||
<span class="px-2 py-1.5 text-sm font-medium bg-white shadow-[inset_0_-2px_5px_0_rgba(0,0,0,0.07)] rounded-r-md"><%= number_to_human(@stargazers_count, format: "%n%u", units: { thousand: "k" }) %></span> | ||
</div> | ||
OS for your personal finances <%= image_tag('icon-chart.svg', alt: 'Chart', class: 'inline') %> built by a small team <%= image_tag('icon-team.png', alt: 'Maybe Team', class: 'inline h-9') %> alongside an incredible community <%= image_tag('icon-discord.svg', alt: 'Discord', class: 'inline') %> | ||
</div> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require "test_helper" | ||
|
||
class PagesControllerTest < ActionDispatch::IntegrationTest | ||
test "should get index" do | ||
get pages_index_url | ||
assert_response :success | ||
end | ||
end |