source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/models/application_record.rb | Ruby | mit | 92 | main | 466 | class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
def blob_url(attachment, variant: nil, placeholder: nil, ext: nil)
if attachment.attached?
key = variant ? attachment.variant(variant)&.processed&.key : attachment.blob&.key
"#{App.content_base_url}/blob/#{key}#{".#{ext}" if ex... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/models/track.rb | Ruby | mit | 92 | main | 3,640 | class Track < ApplicationRecord
include TrackApiV1
include HasAudioStatus
belongs_to :show, touch: true
has_many :songs_tracks, dependent: :destroy
has_many :songs, through: :songs_tracks
has_many :likes, as: :likable, dependent: :destroy
has_many :track_tags, dependent: :destroy
has_many :tags, throug... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/models/concerns/has_cover_art.rb | Ruby | mit | 92 | main | 3,983 | require "mini_magick"
module HasCoverArt
extend ActiveSupport::Concern
included do # rubocop:disable Metrics/BlockLength
def cover_art_urls
placeholder_prefix = (respond_to?(:audio_status) && audio_status == "missing") ?
"missing-audio-cover-art" : "cover-art"
return %i[... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/models/concerns/has_audio_status.rb | Ruby | mit | 92 | main | 893 | module HasAudioStatus
extend ActiveSupport::Concern
AUDIO_STATUSES = %w[complete partial missing].freeze
included do
validates :audio_status, inclusion: { in: AUDIO_STATUSES }
scope :with_audio, -> { where(audio_status: %w[complete partial]) }
scope :without_audio, -> { where(audio_status: "missing... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/models/concerns/track_api_v1.rb | Ruby | mit | 92 | main | 1,690 | module TrackApiV1
extend ActiveSupport::Concern
included do # rubocop:disable Metrics/BlockLength
def as_json # rubocop:disable Metrics/MethodLength
{
id:,
title:,
position:,
duration:,
jam_starts_at_second:,
set:,
set_name:,
likes_count:,
... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/models/concerns/sorcery_authenticable.rb | Ruby | mit | 92 | main | 1,091 | module SorceryAuthenticable
extend ActiveSupport::Concern
included do
authenticates_with_sorcery!
has_many :authentications, dependent: :destroy
validates \
:username,
presence: true,
uniqueness: true,
format: {
with: /\A[A-Za-z0-9_]{3,15}\z/,
message: "may con... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/models/concerns/show_api_v1.rb | Ruby | mit | 92 | main | 1,690 | module ShowApiV1
extend ActiveSupport::Concern
included do # rubocop:disable Metrics/BlockLength
def as_json # rubocop:disable Metrics/MethodLength
{
id:,
date: date.iso8601,
duration:,
incomplete:,
sbd:,
remastered:,
tour_id:,
venue_id:,
... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/mcp/widget_compiler.rb | Ruby | mit | 92 | main | 3,905 | class WidgetCompiler
SOURCE_DIR = Rails.root.join("app", "mcp", "widgets")
OUTPUT_DIR = Rails.root.join("public", "mcp-widgets")
PARTIALS_DIR = SOURCE_DIR.join("partials")
class << self
def compile_all(force: false)
ensure_output_dir
widget_sources.each { |source| compile_widget(Pathname.new(so... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/mcp/mcp_helpers.rb | Ruby | mit | 92 | main | 981 | module McpHelpers
module_function
def base_url
App.base_url
end
def cache_key_for_resource(resource_name, identifier)
"mcp/#{resource_name}/#{identifier}"
end
def cache_key_for_collection(resource_name, params)
"mcp/#{resource_name}?#{params.compact.to_query}"
end
def cache_key_for_custo... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/mcp/tool_builder.rb | Ruby | mit | 92 | main | 1,459 | module ToolBuilder
def self.build_tools(client:)
base_tools.map { |base_class| build_tool(base_class, client:) }
end
def self.build_tool(base_class, client:)
tool_name_str = base_class.name_value
desc = Descriptions.for(tool_name_str, client)
tool_meta = base_class.try(:"#{client}_meta")
base... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/mcp/descriptions.rb | Ruby | mit | 92 | main | 8,153 | module Descriptions
# IMPORTANT: When linking to tracks, always use the web 'url' field (e.g., https://phish.in/1997-11-22/tweezer),
# NOT the 'mp3_url' blob field. The web URL provides a better user experience with context, artwork, and navigation.
BASE = {
list_tags: "List all tags with show and track coun... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/mcp/server.rb | Ruby | mit | 92 | main | 5,074 | class Server
WIDGETS_DIR = Rails.root.join("public", "mcp-widgets")
WIDGET_ASSET_HOST_PLACEHOLDER = "{{WIDGET_ASSET_HOST}}"
APP_NAME_PLACEHOLDER = "{{MCP_APP_NAME}}"
LOGO_FULL_PLACEHOLDER = "{{MCP_LOGO_FULL}}"
LOGO_SQUARE_PLACEHOLDER = "{{MCP_LOGO_SQUARE}}"
CLIENT_BRANDING = {
openai: {
logo_full... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/mcp/tools/search.rb | Ruby | mit | 92 | main | 4,293 | module Tools
class Search < MCP::Tool
MAX_QUERY_LENGTH = 200
tool_name "search"
description Descriptions::BASE[:search]
annotations(read_only_hint: true, destructive_hint: false, open_world_hint: false)
input_schema(
properties: {
query: { type: "string", description: "Search que... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/mcp/tools/list_years.rb | Ruby | mit | 92 | main | 2,804 | module Tools
class ListYears < MCP::Tool
tool_name "list_years"
description Descriptions::BASE[:list_years]
annotations(read_only_hint: true, destructive_hint: false, open_world_hint: false)
input_schema(
properties: {}
)
class << self
def call
result = fetch_years_data... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/mcp/tools/get_show.rb | Ruby | mit | 92 | main | 6,485 | module Tools
class GetShow < MCP::Tool
tool_name "get_show"
description Descriptions::BASE[:get_show]
annotations(read_only_hint: true, destructive_hint: false, open_world_hint: false)
input_schema(
properties: {
date: { type: "string", description: "Show date (YYYY-MM-DD). Omit for r... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/mcp/tools/get_tour.rb | Ruby | mit | 92 | main | 1,392 | module Tools
class GetTour < MCP::Tool
tool_name "get_tour"
description Descriptions::BASE[:get_tour]
annotations(read_only_hint: true, destructive_hint: false, open_world_hint: false)
input_schema(
properties: {
slug: { type: "string", description: "Tour slug (e.g., 'fall-tour-1997',... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/mcp/tools/get_tag.rb | Ruby | mit | 92 | main | 4,869 | module Tools
class GetTag < MCP::Tool
tool_name "get_tag"
description Descriptions::BASE[:get_tag]
annotations(read_only_hint: true, destructive_hint: false, open_world_hint: false)
input_schema(
properties: {
slug: { type: "string", description: "Tag slug (e.g., 'jamcharts', 'costume... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/mcp/tools/list_tours.rb | Ruby | mit | 92 | main | 1,292 | module Tools
class ListTours < MCP::Tool
tool_name "list_tours"
description Descriptions::BASE[:list_tours]
annotations(read_only_hint: true, destructive_hint: false, open_world_hint: false)
input_schema(
properties: {
year: { type: "integer", description: "Filter tours by year (e.g.,... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/mcp/tools/list_tags.rb | Ruby | mit | 92 | main | 920 | module Tools
class ListTags < MCP::Tool
tool_name "list_tags"
description Descriptions::BASE[:list_tags]
annotations(read_only_hint: true, destructive_hint: false, open_world_hint: false)
input_schema(properties: {})
class << self
def call
result = fetch_tags
MCP::Tool::R... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/mcp/tools/get_song.rb | Ruby | mit | 92 | main | 4,066 | module Tools
class GetSong < MCP::Tool
EXCLUDED_SETS = %w[S P].freeze
tool_name "get_song"
description Descriptions::BASE[:get_song]
annotations(read_only_hint: true, destructive_hint: false, open_world_hint: false)
input_schema(
properties: {
slug: { type: "string", description:... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/mcp/tools/list_venues.rb | Ruby | mit | 92 | main | 2,763 | module Tools
class ListVenues < MCP::Tool
tool_name "list_venues"
description Descriptions::BASE[:list_venues]
annotations(read_only_hint: true, destructive_hint: false, open_world_hint: false)
input_schema(
properties: {
city: { type: "string", description: "Filter by city name" },
... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/mcp/tools/stats.rb | Ruby | mit | 92 | main | 2,665 | module Tools
class Stats < MCP::Tool
tool_name "stats"
description Descriptions::BASE[:stats]
annotations(read_only_hint: true, destructive_hint: false, open_world_hint: false)
input_schema(
properties: {
stat_type: {
type: "string",
enum: %w[gaps transitions set_p... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/mcp/tools/get_audio_track.rb | Ruby | mit | 92 | main | 8,173 | module Tools
class GetAudioTrack < MCP::Tool
tool_name "get_audio_track"
description Descriptions::BASE[:get_audio_track]
annotations(read_only_hint: true, destructive_hint: false, open_world_hint: false)
input_schema(
properties: {
slug: { type: "string", description: "Track slug: 'Y... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/mcp/tools/get_venue.rb | Ruby | mit | 92 | main | 1,897 | module Tools
class GetVenue < MCP::Tool
tool_name "get_venue"
description Descriptions::BASE[:get_venue]
annotations(read_only_hint: true, destructive_hint: false, open_world_hint: false)
input_schema(
properties: {
slug: { type: "string", description: "Venue slug (e.g., 'madison-squa... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/mcp/tools/list_shows.rb | Ruby | mit | 92 | main | 4,979 | module Tools
class ListShows < MCP::Tool
tool_name "list_shows"
description Descriptions::BASE[:list_shows]
annotations(read_only_hint: true, destructive_hint: false, open_world_hint: false)
input_schema(
properties: {
year: { type: "integer", description: "Filter by year (e.g., 1997)... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/mcp/tools/get_playlist.rb | Ruby | mit | 92 | main | 5,010 | module Tools
class GetPlaylist < MCP::Tool
tool_name "get_playlist"
description Descriptions::BASE[:get_playlist]
annotations(read_only_hint: true, destructive_hint: false, open_world_hint: false)
input_schema(
properties: {
slug: { type: "string", description: "Playlist slug (omit fo... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/mcp/tools/list_playlists.rb | Ruby | mit | 92 | main | 2,930 | module Tools
class ListPlaylists < MCP::Tool
tool_name "list_playlists"
description Descriptions::BASE[:list_playlists]
annotations(read_only_hint: true, destructive_hint: false, open_world_hint: false)
input_schema(
properties: {
sort_by: {
type: "string",
enum: %... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/mcp/tools/list_songs.rb | Ruby | mit | 92 | main | 2,611 | module Tools
class ListSongs < MCP::Tool
tool_name "list_songs"
description Descriptions::BASE[:list_songs]
annotations(read_only_hint: true, destructive_hint: false, open_world_hint: false)
input_schema(
properties: {
song_type: {
type: "string",
enum: %w[all orig... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/jobs/album_zip_cleanup_job.rb | Ruby | mit | 92 | main | 1,009 | class AlbumZipCleanupJob
include Sidekiq::Worker
BUFFER = 5.gigabytes
def perform
total_size = get_total_size
return if total_size <= target_size
# Continue deleting the oldest attachments until we are under the target limit
while total_size > target_size
oldest_blob =
ActiveStora... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/jobs/venue_map_snapshot_job.rb | Ruby | mit | 92 | main | 2,267 | require "typhoeus"
require "mini_magick"
class VenueMapSnapshotJob
include Sidekiq::Job
ZOOM = 4
STYLE = "mapbox/streets-v12"
PIN_COLOR = "03BBF2"
REQUEST_SIZE = 256
EXTRA_HEIGHT = 40
OUTPUT_SIZE = 512
def perform(venue_id)
@venue = Venue.find_by(id: venue_id)
return unless @venue
genera... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/jobs/regenerate_track_waveform_job.rb | Ruby | mit | 92 | main | 314 | require "typhoeus"
class RegenerateTrackWaveformJob
include Sidekiq::Job
attr_reader :track_id
def perform(track_id)
@track_id = track_id
return unless track
track.generate_waveform_image(purge_cache: true)
end
private
def track
@track ||= Track.find_by(id: @track_id)
end
end |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/jobs/album_zip_job.rb | Ruby | mit | 92 | main | 1,718 | require "zip"
class AlbumZipJob
include Sidekiq::Job
attr_reader :show_id
def perform(show_id)
@show_id = show_id
AlbumZipCleanupJob.new.perform
create_and_attach_album_zip
show.update!(album_zip_requested_at: nil)
end
private
def create_and_attach_album_zip
Tempfile.open([ "album... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/mailers/user_mailer.rb | Ruby | mit | 92 | main | 215 | class UserMailer < ApplicationMailer
def reset_password(user)
@user = user
@url = "#{App.base_url}/reset-password/#{user.reset_password_token}"
mail to: user.email, subject: "Reset Password"
end
end |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/likes.rb | Ruby | mit | 92 | main | 2,211 | class ApiV2::Likes < ApiV2::Base
resource :likes do
desc "Like or unlike a show, track, or playlist" do
detail "Creates a like for a show, track, or playlist. Restricted to authenticated users."
success [ { code: 201 } ]
failure [
[ 401, "Unauthorized", ApiV2::Entities::ApiResponse ],
... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/playlists.rb | Ruby | mit | 92 | main | 8,054 | class ApiV2::Playlists < ApiV2::Base
SORT_COLS = %w[name likes_count tracks_count duration updated_at]
helpers do
params :playlist_params do
requires :name,
type: String,
desc: "Name of the playlist"
requires :slug,
type: String,
desc: "Sl... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/api.rb | Ruby | mit | 92 | main | 3,034 | class ApiV2::Api < ApiV2::Base
mount ApiV2::Announcements
mount ApiV2::Auth
mount ApiV2::Likes
mount ApiV2::Playlists
mount ApiV2::Reports
mount ApiV2::Search
mount ApiV2::Shows
mount ApiV2::Songs
mount ApiV2::Tags
mount ApiV2::Tours
mount ApiV2::Tracks
mount ApiV2::Venues
mount ApiV2::Years
... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/reports.rb | Ruby | mit | 92 | main | 1,176 | class ApiV2::Reports < ApiV2::Base
resource :reports do
desc "Fetch a list of missing and incomplete content" do
detail \
"Returns a list of dates on which Phish is known to have played " \
"but for which there is partial or nonexistent audio in circulation"
success [
{ code: 2... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/years.rb | Ruby | mit | 92 | main | 4,312 | class ApiV2::Years < ApiV2::Base
COVER_ART = {
"1983-1987" => "1985-10-30",
"1988" => "1988-12-10",
"1989" => "1989-10-13",
"1990" => "1990-05-23",
"1991" => "1991-05-16",
"1992" => "1992-03-12",
"1993" => "1993-07-16",
"1994" => "1994-11-25",
"1995" => "1995-06-30",
"1996" => ... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/auth.rb | Ruby | mit | 92 | main | 5,561 | require "jwt"
class ApiV2::Auth < ApiV2::Base
resource :auth do
desc "Create a new user" do
detail \
"Create a new user with the provided username, email, " \
"password, and password confirmation"
success [
{
code: 201,
model: ApiV2::Entities::LoginResponse... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/shows.rb | Ruby | mit | 92 | main | 9,337 | class ApiV2::Shows < ApiV2::Base # rubocop:disable Metrics/ClassLength
SORT_COLS = %w[ date likes_count duration updated_at ]
helpers do
params :sort do
optional :sort,
type: String,
desc: "Sort by attribute and direction (e.g., 'date:desc')",
default: "date:d... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/tracks.rb | Ruby | mit | 92 | main | 6,707 | class ApiV2::Tracks < ApiV2::Base
SORT_COLS = %w[ id title likes_count duration date updated_at ]
resource :tracks do
desc "Fetch a list of tracks" do
detail "Fetch a filtered, sorted, paginated list of tracks"
success ApiV2::Entities::Track
failure [
[ 400, "Bad Request", ApiV2::Enti... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/songs.rb | Ruby | mit | 92 | main | 2,354 | class ApiV2::Songs < ApiV2::Base
SORT_COLS = %w[ title tracks_count updated_at ]
resource :songs do
desc "Fetch a list of songs" do
detail "Fetch a filtered, sorted, paginated list of songs"
success ApiV2::Entities::Song
failure [
[ 400, "Bad Request", ApiV2::Entities::ApiResponse ],
... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/venues.rb | Ruby | mit | 92 | main | 2,451 | class ApiV2::Venues < ApiV2::Base
SORT_COLS = %w[ name shows_count updated_at ]
resource :venues do
desc "Fetch a list of venues" do
detail "Fetch a filtered, sorted, paginated list of venues"
success ApiV2::Entities::Venue
end
params do
use :pagination, :proximity, :audio_status
... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/tags.rb | Ruby | mit | 92 | main | 416 | class ApiV2::Tags < ApiV2::Base
resource :tags do
desc "Fetch a list of tags" do
detail "Fetch a list of all tags, sorted alphabetically by name"
success ApiV2::Entities::Tag
end
get do
present tags, with: ApiV2::Entities::Tag
end
end
helpers do
def tags
Rails.cache.f... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/base.rb | Ruby | mit | 92 | main | 643 | class ApiV2::Base < Grape::API
format :json
# Helpers
# helpers ApiV2::Helpers::AuthHelper
helpers ApiV2::Helpers::SharedHelpers
helpers ApiV2::Helpers::SharedParams
# Endpoints
# before { authenticate_api_key! unless swagger_endpoint? }
# Error handling
rescue_from ActiveRecord::RecordNotFound do ... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/search.rb | Ruby | mit | 92 | main | 1,514 | class ApiV2::Search < ApiV2::Base
resource :search do
desc "Search the database" do
detail \
"Perform a text based search across " \
"shows, tracks, songs, venues, and tags."
success ApiV2::Entities::SearchResults
failure [ [ 400, "Bad Request", ApiV2::Entities::ApiResponse ] ]
... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/tours.rb | Ruby | mit | 92 | main | 1,651 | class ApiV2::Tours < ApiV2::Base
SORT_COLS = %w[ name starts_on ends_on shows_count updated_at ]
resource :tours do
desc "Fetch a list of tours" do
detail "Fetch a sorted, paginated list of tours"
success ApiV2::Entities::Tour
end
params do
use :pagination
optional :sort,
... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/announcements.rb | Ruby | mit | 92 | main | 490 | class ApiV2::Announcements < ApiV2::Base
resource :announcements do
desc "Fetch recent announcements" do
detail "Fetch the newest 100 announcements"
success ApiV2::Entities::Announcement
end
get do
present announcements, with: ApiV2::Entities::Announcement
end
end
helpers do
... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/helpers/shared_params.rb | Ruby | mit | 92 | main | 993 | module ApiV2::Helpers::SharedParams
extend Grape::API::Helpers
params :audio_status do
optional :audio_status,
type: String,
desc: "Filter by audio status: 'any' (default), 'complete', 'partial', 'missing', 'complete_or_partial'",
default: "any",
values: %w[a... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/helpers/shared_helpers.rb | Ruby | mit | 92 | main | 4,838 | module ApiV2::Helpers::SharedHelpers
extend Grape::API::Helpers
# Use case-insensitive ASCII-based sorting on text columns
def apply_sort(relation, secondary_col = nil, secondary_dir = :asc)
attribute, direction = params[:sort].split(":")
table_name = relation.table_name
primary_column = relation.co... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/helpers/auth_helper.rb | Ruby | mit | 92 | main | 480 | module ApiV2::Helpers::AuthHelper
def authenticate_api_key!
error!("Unauthorized: No API key provided", 401) if key_from_header.blank?
error!("Unauthorized: Invalid API key", 401) unless api_key
end
def swagger_endpoint?
request.path.include?("/swagger_doc")
end
private
def key_from_header
... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/entities/announcement.rb | Ruby | mit | 92 | main | 584 | class ApiV2::Entities::Announcement < ApiV2::Entities::Base
expose \
:title,
documentation: {
type: "String",
desc: "Title of the announcement"
}
expose \
:description,
documentation: {
type: "String",
desc: "Description of the announcement"
}
expose \
:url,
... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/entities/tour.rb | Ruby | mit | 92 | main | 1,280 | class ApiV2::Entities::Tour < ApiV2::Entities::Base
include ApiV2::Concerns::CountFieldsWithAudio
expose \
:slug,
documentation: {
type: "String",
desc: "Unique slug identifier for the tour"
}
expose \
:name,
documentation: {
type: "String",
desc: "Name of the tour"
... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/entities/missing_content_report.rb | Ruby | mit | 92 | main | 559 | class ApiV2::Entities::MissingContentReport < ApiV2::Entities::Base
expose \
:missing_shows,
documentation: {
type: "Array[Object]",
desc: \
"A list of shows for which there is no circulated recording. " \
"Each object contains the date, venue_name, and location."
}
expose \... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/entities/search_results.rb | Ruby | mit | 92 | main | 2,751 | class ApiV2::Entities::SearchResults < ApiV2::Entities::Base
expose(
:exact_show,
using: ApiV2::Entities::Show,
documentation: {
type: "Object",
desc: \
"The show that exactly matches the specified date (if any). " \
"Returns a show object including venue and date information. ... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/entities/playlist.rb | Ruby | mit | 92 | main | 2,163 | class ApiV2::Entities::Playlist < ApiV2::Entities::Base
expose \
:id,
documentation: {
type: "Integer",
desc: "ID of the playlist"
}
expose \
:slug,
documentation: {
type: "String",
desc: "The unique slug for the playlist"
}
expose \
:name,
documentation: ... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/entities/login_response.rb | Ruby | mit | 92 | main | 367 | class ApiV2::Entities::LoginResponse < ApiV2::Entities::Base
expose \
:jwt,
documentation: {
type: "String",
desc: "JWT"
}
expose \
:username,
documentation: {
type: "String",
desc: "User's username"
}
expose \
:email,
documentation: {
type: "String"... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/entities/show.rb | Ruby | mit | 92 | main | 4,419 | class ApiV2::Entities::Show < ApiV2::Entities::Base
expose \
:id,
documentation: {
type: "Integer",
desc: "ID of the show"
}
expose \
:date,
format_with: :iso8601,
documentation: {
type: "String",
format: "date",
desc: "Date of the show"
}
expose \
:... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/entities/venue.rb | Ruby | mit | 92 | main | 1,722 | class ApiV2::Entities::Venue < ApiV2::Entities::Base
include ApiV2::Concerns::CountFieldsWithAudio
expose \
:slug,
documentation: {
type: "String",
desc: "Unique slug identifier for the venue"
}
expose \
:name,
documentation: {
type: "String",
desc: "Name of the venue... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/entities/playlist_track.rb | Ruby | mit | 92 | main | 1,064 | class ApiV2::Entities::PlaylistTrack < ApiV2::Entities::Base
expose(
:track,
unless: ->(_, opts) { opts[:exclude_tracks] },
documentation: {
type: "Object",
desc: "The associated track details"
}
) do
ApiV2::Entities::Track.represent \
_1.track,
_2.merge(exclude_show: tru... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/entities/year.rb | Ruby | mit | 92 | main | 925 | class ApiV2::Entities::Year < ApiV2::Entities::Base
include ApiV2::Concerns::CountFieldsWithAudio
expose \
:period,
documentation: {
type: "String",
desc: 'The year or period being represented (e.g. "1997", "1983-1987")'
}
expose_count_fields_with_audio :shows_count, "shows that were per... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/entities/track_tag.rb | Ruby | mit | 92 | main | 1,195 | class ApiV2::Entities::TrackTag < ApiV2::Entities::Base
expose(
:name,
documentation: {
type: "String",
desc: "The name of the tag"
}
) { it.tag.name }
expose(
:description,
documentation: {
type: "String",
desc: "A description of the tag"
}
) { it.tag.descripti... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/entities/show_tag.rb | Ruby | mit | 92 | main | 739 | class ApiV2::Entities::ShowTag < ApiV2::Entities::Base
expose(
:name,
documentation: {
type: "String",
desc: "The name of the tag"
}
) { it.tag.name }
expose(
:description,
documentation: {
type: "String",
desc: "A description of the tag"
}
) { it.tag.description... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/entities/song.rb | Ruby | mit | 92 | main | 3,264 | class ApiV2::Entities::Song < ApiV2::Entities::Base
include ApiV2::Concerns::CountFieldsWithAudio
expose \
:slug,
documentation: {
type: "String",
desc: "Unique slug identifier for the song"
}
expose \
:title,
documentation: {
type: "String",
desc: "Title of the song"... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/entities/tag.rb | Ruby | mit | 92 | main | 896 | class ApiV2::Entities::Tag < ApiV2::Entities::Base
expose \
:slug,
documentation: {
type: "String",
desc: "Unique slug identifier for the tag"
}
expose \
:name,
documentation: {
type: "String",
desc: "Name of the tag"
}
expose \
:description,
documentation... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/entities/user.rb | Ruby | mit | 92 | main | 611 | class ApiV2::Entities::User < ApiV2::Entities::Base
expose \
:username,
documentation: {
type: "String",
desc: "Username of the user"
}
expose \
:email,
documentation: {
type: "String",
desc: "Email address of the user"
}
expose \
:created_at,
format_with:... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/entities/track.rb | Ruby | mit | 92 | main | 3,989 | class ApiV2::Entities::Track < ApiV2::Entities::Base
expose \
:id,
documentation: {
type: "Integer",
desc: "ID of the track"
}
expose \
:slug,
documentation: {
type: "String",
desc: "Unique slug identifier for the track"
}
expose \
:title,
documentation: {... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | app/api/api_v2/concerns/count_fields_with_audio.rb | Ruby | mit | 92 | main | 595 | module ApiV2::Concerns::CountFieldsWithAudio
extend ActiveSupport::Concern
class_methods do
def expose_count_fields_with_audio(base_field, description_base)
expose base_field,
documentation: {
type: "Integer",
desc: "Number of #{description_base}"
}... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | lib/tasks/widgets.rake | Ruby | mit | 92 | main | 1,037 | namespace :widgets do
desc "Compile all widget templates from app/mcp/widgets/ to public/mcp-widgets/"
task compile: :environment do
puts "Compiling widgets..."
WidgetCompiler.compile_all(force: ENV["FORCE"].present?)
puts "Done! Compiled #{WidgetCompiler.widget_sources.count} widget(s)"
end
desc "... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | lib/tasks/phishnet_sync.rake | Ruby | mit | 92 | main | 41,836 | # rubocop:disable Rake/MethodDefinitionInTask
namespace :phishnet do
# Venue duplication mappings - maps dupe venue name to keeper venue ID
VENUE_DUPES = {
"Post-Gazette Pavilion" => 635,
"ALLTEL Pavilion" => 733,
"The Agora Theatre" => 17,
"Beta Theta Pi Frat House Party, Denison University" => 79,... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | lib/tasks/duplicate_sets.rake | Ruby | mit | 92 | main | 2,970 | namespace :sets do
desc "Find duplicate sets (identical order and same songs regardless of order)"
task duplicates: :environment do
puts "Analyzing sets for duplicates...\n\n"
set_data = Track
.where(set: %w[1 2 3])
.joins(:songs_tracks)
.joins(:show)
.group("tracks.show_id", "track... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | lib/tasks/lore.rake | Ruby | mit | 92 | main | 514 | namespace :lore do
desc "Analyze setlist notes and apply Lore tag where warranted"
task sync: :environment do
opts = {
date: ENV["DATE"],
dates: ENV["DATES"],
start_date: ENV["START_DATE"],
end_date: ENV["END_DATE"],
all: ENV["ALL"] == "true",
dry_run: ENV["DRY_RUN"] == "true... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | lib/tasks/mcp.rake | Ruby | mit | 92 | main | 1,940 | namespace :mcp do
desc "Display MCP tool descriptions per client with read/write indicators and widget info"
task tools: :environment do
cyan = "\e[36m"
dim = "\e[2m"
green = "\e[32m"
yellow = "\e[33m"
reset = "\e[0m"
box_width = 76
text_width = box_width - 4
wrap_text = ->(text, w... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | lib/tasks/tracks.rake | Ruby | mit | 92 | main | 1,326 | namespace :tracks do
desc "Populate song performance gaps"
task populate_gaps: :environment do
rel = Show.published.order(date: :asc)
pbar = ProgressBar.create(
total: rel.count,
format: "%a %B %c/%C %p%% %E"
)
rel.each do |show|
GapService.call(show)
pbar.increment
end
... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | lib/tasks/tagin.rake | Ruby | mit | 92 | main | 2,118 | require "google/apis/sheets_v4"
require "googleauth"
require "googleauth/stores/file_token_store"
require "csv"
namespace :tagin do
desc "Sync data from remote spreadsheet"
task sync: :environment do
TAGIN_TAGS.each do |tag_name|
puts "========================"
puts " Syncing Tag: #{tag_name}"
... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | lib/tasks/backup.rake | Ruby | mit | 92 | main | 1,173 | # lib/tasks/backup.rake
namespace :backup do
desc "Backup all configured model attachments to S3"
task all: :environment do
existing_keys = Backup::ListingService.call
Rails.application.config.attachment_backup[:attachments].each do |config|
model = config[:model]
attachment = config[:attachmen... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | lib/tasks/shows.rake | Ruby | mit | 92 | main | 1,520 | namespace :shows do
desc "Generate cover art"
task art: :environment do
date = ENV.fetch("DATE", nil)
start_date = ENV.fetch("START_DATE", nil)
rel = Show.where(cover_art_parent_show_id: nil).includes(:tracks).order(date: :asc)
if ENV.fetch("REDO", nil).present?
dates = File.readlines(Rails.... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | lib/tasks/gaps.rake | Ruby | mit | 92 | main | 18,911 | namespace :gaps do
desc "Reset and rebuild all performance gap data from scratch"
task rebuild: :environment do
puts "🔄 Starting complete rebuild of all performance gap data..."
puts "This will reset all gap/slug data and rebuild from scratch."
print "Continue? (y/N): "
exit unless STDIN.gets.chomp... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | lib/tasks/venues.rake | Ruby | mit | 92 | main | 1,062 | namespace :venues do
desc "Generate map snapshots for all venues with coordinates"
task generate_maps: :environment do
relation = Venue.where.not(latitude: nil, longitude: nil)
pbar = ProgressBar.create(
total: relation.count,
format: "%a %B %c/%C %p%% %E"
)
relation.find_each do |venue... |
github | jcraigk/phishin | https://github.com/jcraigk/phishin | lib/tasks/pnet.rake | Ruby | mit | 92 | main | 2,619 | namespace :pnet do
desc "Sync jamcharts data"
task jamcharts: :environment do
puts "Fetching Jamcharts data from Phish.net API..."
JamchartsImporter.call(ENV["PNET_API_KEY"])
end
desc "Sync Unfinished tag from setlist notes"
task unfinished: :environment do
require "ostruct"
puts "Fetching da... |
github | minamijoyo/commit-m | https://github.com/minamijoyo/commit-m | Gemfile | Ruby | mit | 92 | master | 2,297 | source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.0'
# Use sqlite3 as the database for Active Record
#gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use Co... |
github | minamijoyo/commit-m | https://github.com/minamijoyo/commit-m | Guardfile | Ruby | mit | 92 | master | 2,591 | # A sample Guardfile
# More info at https://github.com/guard/guard#readme
## Uncomment and set this to only include directories you want to watch
# directories %w(app lib config test spec features)
## Uncomment to clear the screen before every task
# clearing :on
## Guard internally checks for changes in the Guardfi... |
github | minamijoyo/commit-m | https://github.com/minamijoyo/commit-m | Vagrantfile | Ruby | mit | 92 | master | 589 | # -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "opscode-centos-6.5"
config.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5_chef-provisionerless.box"
config.vm.network :"fo... |
github | minamijoyo/commit-m | https://github.com/minamijoyo/commit-m | spec/rails_helper.rb | Ruby | mit | 92 | master | 3,806 | require 'rubygems'
require 'spork'
#uncomment the following line to use spork with the debugger
#require 'spork/ext/ruby-debug'
Spork.prefork do
# Loading more in this block will cause your tests to run faster. However,
# if you change any configuration or code from libraries loaded here, you'll
# need to restar... |
github | minamijoyo/commit-m | https://github.com/minamijoyo/commit-m | spec/models/commit_spec.rb | Ruby | mit | 92 | master | 396 | require 'rails_helper'
RSpec.describe Commit, type: :model do
before { @commit = Commit.new(
repo_full_name: 'minamijoyo/commit-m',
sha: 'ad029c9d6d79ad6e1b2ca4ff33e998c23c471675',
message: 'Initial commit') }
subject { @commit }
it { should respond_to(:repo_full_name) }
it { should respond_to(:s... |
github | minamijoyo/commit-m | https://github.com/minamijoyo/commit-m | spec/requests/commits_spec.rb | Ruby | mit | 92 | master | 1,616 | require 'rails_helper'
RSpec.describe "Commits", type: :request do
subject { page }
describe "Root Page" do
before { visit root_path }
describe "Site name" do
it { should have_content('commit-m') }
it { should have_title('commit-m') }
end
describe "Twitter link" do
it { should ... |
github | minamijoyo/commit-m | https://github.com/minamijoyo/commit-m | app/models/commit.rb | Ruby | mit | 92 | master | 493 | class Commit < ActiveRecord::Base
include Commit::Searchable
def self.search_message(keyword)
if keyword.present?
query = {
"query": {
"match": {
"message": keyword
}
},
"highlight": {
"pre_tags": ['<mark>'],
"post_tags": ['</mark... |
github | minamijoyo/commit-m | https://github.com/minamijoyo/commit-m | app/models/concerns/commit/searchable.rb | Ruby | mit | 92 | master | 1,119 | require 'active_support/concern'
module Commit::Searchable
extend ActiveSupport::Concern
included do
include Elasticsearch::Model
index_name "commitm"
settings index: {
number_of_shards: 1,
number_of_replicas: 0,
analysis: {
analyzer: {
commit_analyzer: {
... |
github | minamijoyo/commit-m | https://github.com/minamijoyo/commit-m | app/controllers/commits_controller.rb | Ruby | mit | 92 | master | 235 | class CommitsController < ApplicationController
def index
@commits = []
@keyword = ""
end
def search
@keyword = params[:keyword]
@commits = Commit.search_message(@keyword).paginate(page: params[:page])
end
end |
github | minamijoyo/commit-m | https://github.com/minamijoyo/commit-m | db/schema.rb | Ruby | mit | 92 | master | 1,110 | # encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative sou... |
github | minamijoyo/commit-m | https://github.com/minamijoyo/commit-m | db/seeds.rb | Ruby | mit | 92 | master | 799 | # This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel... |
github | minamijoyo/commit-m | https://github.com/minamijoyo/commit-m | db/migrate/20150201100358_create_commits.rb | Ruby | mit | 92 | master | 215 | class CreateCommits < ActiveRecord::Migration
def change
create_table :commits do |t|
t.string :repo_full_name
t.string :sha
t.text :message
t.timestamps null: false
end
end
end |
github | minamijoyo/commit-m | https://github.com/minamijoyo/commit-m | config/application.rb | Ruby | mit | 92 | master | 1,202 | require File.expand_path('../boot', __FILE__)
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module CommitM
class Application < Rails::Application
# Settings in config/environments/* take prece... |
github | minamijoyo/commit-m | https://github.com/minamijoyo/commit-m | config/routes.rb | Ruby | mit | 92 | master | 1,668 | Rails.application.routes.draw do
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".
# You can have the root of your site routed with "root"
root 'commits#index'
match 'commits/search', to: 'commits#search', via: ['post', 'g... |
github | minamijoyo/commit-m | https://github.com/minamijoyo/commit-m | config/initializers/mysqlpls.rb | Ruby | mit | 92 | master | 242 | require 'active_record/connection_adapters/abstract_mysql_adapter'
module ActiveRecord
module ConnectionAdapters
class AbstractMysqlAdapter
NATIVE_DATABASE_TYPES[:string] = { :name => "varchar", :limit => 191 }
end
end
end |
github | raykrueger/ruby-smpp | https://github.com/raykrueger/ruby-smpp | Rakefile | Ruby | mit | 92 | master | 225 | # encoding: UTF-8
require "bundler/gem_tasks"
require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
test.libs << 'lib' << 'test'
test.pattern = 'test/**/*_test.rb'
test.verbose = true
end
task :default => :test |
github | raykrueger/ruby-smpp | https://github.com/raykrueger/ruby-smpp | ruby-smpp.gemspec | Ruby | mit | 92 | master | 1,178 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'smpp/version'
Gem::Specification.new do |spec|
spec.name = "ruby-smpp"
spec.version = Smpp::VERSION
spec.authors = ["Ray Krueger", "August Z. Flatby"]
spec.email ... |
github | raykrueger/ruby-smpp | https://github.com/raykrueger/ruby-smpp | lib/smpp.rb | Ruby | mit | 92 | master | 753 | # encoding: UTF-8
# SMPP v3.4 subset implementation.
# SMPP is a short message peer-to-peer protocol typically used to communicate
# with SMS Centers (SMSCs) over TCP/IP.
#
# August Z. Flatby
# august@apparat.no
require 'logger'
$:.unshift(File.dirname(__FILE__))
require 'smpp/base.rb'
require 'smpp/transceiver.rb'
r... |
github | raykrueger/ruby-smpp | https://github.com/raykrueger/ruby-smpp | lib/smpp/receiver.rb | Ruby | mit | 92 | master | 830 | # encoding: UTF-8
# The SMPP Receiver maintains a unidirectional connection to an SMSC.
# Provide a config hash with connection options to get started.
# See the sample_gateway.rb for examples of config values.
# The receiver accepts a delegate object that may implement
# the following (all optional) methods:
#
# mo... |
github | raykrueger/ruby-smpp | https://github.com/raykrueger/ruby-smpp | lib/smpp/server.rb | Ruby | mit | 92 | master | 7,747 | # encoding: UTF-8
# --------
# This is experimental stuff submitted by taryn@taryneast.org
# --------
# the opposite of a client-based receiver, the server transmitter will send
# out MOs to the client when set up
class Smpp::Server < Smpp::Base
attr_accessor :bind_status
# Expects a config hash,
# a proc to ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.