repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
code-ops-show/writefully-old | https://github.com/code-ops-show/writefully-old/blob/be98e3b37d7c1dc4db637bc3571d21febdd7dda7/lib/writefully/content.rb | lib/writefully/content.rb | module Writefully
class Content
attr_reader :index, :path
attr_accessor :body
def initialize(index)
@index = index
@path = File.join(Writefully.options[:content], index[:site], index[:resource], index[:slug])
end
def body
Dir.chdir(path) { File.open(Dir['README.*'].first).read ... | ruby | MIT | be98e3b37d7c1dc4db637bc3571d21febdd7dda7 | 2026-01-04T17:37:21.208640Z | false |
code-ops-show/writefully-old | https://github.com/code-ops-show/writefully-old/blob/be98e3b37d7c1dc4db637bc3571d21febdd7dda7/lib/writefully/postable.rb | lib/writefully/postable.rb | require 'active_support/concern'
module Writefully
module Postable
extend ActiveSupport::Concern
class NoContentField < StandardError ; end
included do
after_initialize :check_content_field_existence
attr_accessor :publish
scope :with_taxonomies, -> (*types) { select(Taxon::EagerLoad... | ruby | MIT | be98e3b37d7c1dc4db637bc3571d21febdd7dda7 | 2026-01-04T17:37:21.208640Z | false |
code-ops-show/writefully-old | https://github.com/code-ops-show/writefully-old/blob/be98e3b37d7c1dc4db637bc3571d21febdd7dda7/lib/writefully/version.rb | lib/writefully/version.rb | module Writefully
VERSION = "0.8.2"
end
| ruby | MIT | be98e3b37d7c1dc4db637bc3571d21febdd7dda7 | 2026-01-04T17:37:21.208640Z | false |
code-ops-show/writefully-old | https://github.com/code-ops-show/writefully-old/blob/be98e3b37d7c1dc4db637bc3571d21febdd7dda7/lib/writefully/tools.rb | lib/writefully/tools.rb | module Writefully
module Tools
end
end
require 'writefully/tools/stationery'
require 'writefully/tools/eraser'
require 'writefully/tools/pencil'
require 'writefully/tools/pigeon'
require 'writefully/tools/hammer'
require 'writefully/tools/dispatcher'
require 'writefully/tools/retryer'
require 'writefully/tools/in... | ruby | MIT | be98e3b37d7c1dc4db637bc3571d21febdd7dda7 | 2026-01-04T17:37:21.208640Z | false |
code-ops-show/writefully-old | https://github.com/code-ops-show/writefully-old/blob/be98e3b37d7c1dc4db637bc3571d21febdd7dda7/lib/writefully/indices.rb | lib/writefully/indices.rb | module Writefully
module Indices
def self.build_from(modified)
modified.map do |file_name|
index_hash_from(index_name_from(remove_content_path(file_name)))
end
end
def self.remove_content_path(file_name)
file_name.split('/') - Writefully.options[:content].split('/')
e... | ruby | MIT | be98e3b37d7c1dc4db637bc3571d21febdd7dda7 | 2026-01-04T17:37:21.208640Z | false |
code-ops-show/writefully-old | https://github.com/code-ops-show/writefully-old/blob/be98e3b37d7c1dc4db637bc3571d21febdd7dda7/lib/writefully/loader.rb | lib/writefully/loader.rb | require 'writefully/storage'
require 'erb'
module Writefully
SCOPES = %w(repo public_repo user write:repo_hook)
class << self
QUEUE = {
top: -> (c, job) { c.lpush "jobs", job },
bottom: -> (c, job) { c.rpush "jobs", job }
}
def options=(config)
@_options = config
end
d... | ruby | MIT | be98e3b37d7c1dc4db637bc3571d21febdd7dda7 | 2026-01-04T17:37:21.208640Z | false |
code-ops-show/writefully-old | https://github.com/code-ops-show/writefully-old/blob/be98e3b37d7c1dc4db637bc3571d21febdd7dda7/lib/writefully/news_agency.rb | lib/writefully/news_agency.rb | module Writefully
class NewsAgency < Celluloid::SupervisionGroup
pool Tools::Pigeon, as: :pigeons, size: ((Writefully.options[:concurrency] * 4) rescue 2)
pool Workers::Journalist, as: :journalists, size: (Writefully.options[:concurrency] rescue 2)
supervise Workers::Handyma... | ruby | MIT | be98e3b37d7c1dc4db637bc3571d21febdd7dda7 | 2026-01-04T17:37:21.208640Z | false |
code-ops-show/writefully-old | https://github.com/code-ops-show/writefully-old/blob/be98e3b37d7c1dc4db637bc3571d21febdd7dda7/lib/writefully/taxon.rb | lib/writefully/taxon.rb | module Writefully
class Taxon
attr_reader :incoming, :existing, :type
def initialize(incoming, existing, type)
@incoming = incoming
@existing = existing
@type = type
end
def non_existing
get_difference.map { |token| Tag.new(build_attributes(token)) }
end
def sele... | ruby | MIT | be98e3b37d7c1dc4db637bc3571d21febdd7dda7 | 2026-01-04T17:37:21.208640Z | false |
code-ops-show/writefully-old | https://github.com/code-ops-show/writefully-old/blob/be98e3b37d7c1dc4db637bc3571d21febdd7dda7/lib/writefully/process.rb | lib/writefully/process.rb | require 'fog'
require 'listen'
require 'logger'
require 'celluloid'
require 'github_api'
require 'active_record'
require 'friendly_id'
require 'activerecord-import'
require 'connection_pool'
require 'redis'
require 'redis-namespace'
require 'writefully/version'
require 'writefully/loader'
require 'writefully/tools'
req... | ruby | MIT | be98e3b37d7c1dc4db637bc3571d21febdd7dda7 | 2026-01-04T17:37:21.208640Z | false |
code-ops-show/writefully-old | https://github.com/code-ops-show/writefully-old/blob/be98e3b37d7c1dc4db637bc3571d21febdd7dda7/lib/writefully/cli.rb | lib/writefully/cli.rb | require 'thor'
require 'writefully/process'
module Writefully
class CLI < Thor
desc "start", "Start listening to the content directory"
method_options %w( daemonize -d ) => :boolean
def start(file)
config = Writefully.config_from(file)
if options.daemonize?
::Process.daemon(t... | ruby | MIT | be98e3b37d7c1dc4db637bc3571d21febdd7dda7 | 2026-01-04T17:37:21.208640Z | false |
code-ops-show/writefully-old | https://github.com/code-ops-show/writefully-old/blob/be98e3b37d7c1dc4db637bc3571d21febdd7dda7/lib/writefully/workers.rb | lib/writefully/workers.rb | module Writefully
module Workers
end
end
require 'writefully/workers/helpers'
require 'writefully/workers/base_worker'
require 'writefully/workers/journalist'
require 'writefully/workers/handyman'
| ruby | MIT | be98e3b37d7c1dc4db637bc3571d21febdd7dda7 | 2026-01-04T17:37:21.208640Z | false |
code-ops-show/writefully-old | https://github.com/code-ops-show/writefully-old/blob/be98e3b37d7c1dc4db637bc3571d21febdd7dda7/lib/writefully/engine.rb | lib/writefully/engine.rb | require 'jquery-rails'
require 'coffee_script'
require 'turbolinks'
require 'transponder'
require 'bootstrap-sass'
require 'friendly_id'
module Writefully
class Engine < ::Rails::Engine
isolate_namespace Writefully
initializer 'Writefully precompile hook', group: :all do |app|
app.config.assets.precom... | ruby | MIT | be98e3b37d7c1dc4db637bc3571d21febdd7dda7 | 2026-01-04T17:37:21.208640Z | false |
code-ops-show/writefully-old | https://github.com/code-ops-show/writefully-old/blob/be98e3b37d7c1dc4db637bc3571d21febdd7dda7/lib/writefully/asset.rb | lib/writefully/asset.rb | module Writefully
class Asset
attr_reader :path, :endpoint
def initialize(index)
base_path = [Writefully.options[:content], index[:site], index[:resource], index[:slug]]
@path = File.join(base_path, 'assets')
@endpoint = File.join(index[:site], index[:resource], index[:slug], 'assets')
... | ruby | MIT | be98e3b37d7c1dc4db637bc3571d21febdd7dda7 | 2026-01-04T17:37:21.208640Z | false |
code-ops-show/writefully-old | https://github.com/code-ops-show/writefully-old/blob/be98e3b37d7c1dc4db637bc3571d21febdd7dda7/lib/writefully/workers/journalist.rb | lib/writefully/workers/journalist.rb | module Writefully
module Workers
class Journalist < BaseWorker
def publish
Writefully.logger.info "Publishing #{message[:resource]} #{message[:slug]}"
pencil = Tools::Pencil.new_link(message)
pencil.perform
end
def remove
eraser = Tools::Eraser.new_link(message)
... | ruby | MIT | be98e3b37d7c1dc4db637bc3571d21febdd7dda7 | 2026-01-04T17:37:21.208640Z | false |
code-ops-show/writefully-old | https://github.com/code-ops-show/writefully-old/blob/be98e3b37d7c1dc4db637bc3571d21febdd7dda7/lib/writefully/workers/base_worker.rb | lib/writefully/workers/base_worker.rb | module Writefully
module Workers
class BaseWorker
include Celluloid
trap_exit :actor_died
attr_accessor :message
def perform(message)
@message = message
self.__send__ message[:task]
end
def close_db_connection!
::ActiveRecord::Base.clear_active_conne... | ruby | MIT | be98e3b37d7c1dc4db637bc3571d21febdd7dda7 | 2026-01-04T17:37:21.208640Z | false |
code-ops-show/writefully-old | https://github.com/code-ops-show/writefully-old/blob/be98e3b37d7c1dc4db637bc3571d21febdd7dda7/lib/writefully/workers/handyman.rb | lib/writefully/workers/handyman.rb | module Writefully
module Workers
class Handyman < BaseWorker
include Helpers::Handyman::Builder
attr_reader :site
def build
@site = Site.where(id: message[:site_id]).first
@hammer = Tools::Hammer.new_link(message.merge({ domain: site.domain }))
# create the repo... | ruby | MIT | be98e3b37d7c1dc4db637bc3571d21febdd7dda7 | 2026-01-04T17:37:21.208640Z | false |
code-ops-show/writefully-old | https://github.com/code-ops-show/writefully-old/blob/be98e3b37d7c1dc4db637bc3571d21febdd7dda7/lib/writefully/workers/helpers.rb | lib/writefully/workers/helpers.rb | require 'active_support/concern'
module Writefully::Workers
module Helpers
end
end
require 'writefully/workers/helpers/handyman/builder' | ruby | MIT | be98e3b37d7c1dc4db637bc3571d21febdd7dda7 | 2026-01-04T17:37:21.208640Z | false |
code-ops-show/writefully-old | https://github.com/code-ops-show/writefully-old/blob/be98e3b37d7c1dc4db637bc3571d21febdd7dda7/lib/writefully/workers/helpers/handyman/builder.rb | lib/writefully/workers/helpers/handyman/builder.rb | module Writefully::Workers::Helpers::Handyman
module Builder
extend ActiveSupport::Concern
def complete_site_setup repo, hook
site_repository = { name: repo.name, id: repo.id, hook_id: hook.id }
site.update_attributes(repository: site_repository, processing: false, healthy: true)
end
def... | ruby | MIT | be98e3b37d7c1dc4db637bc3571d21febdd7dda7 | 2026-01-04T17:37:21.208640Z | false |
code-ops-show/writefully-old | https://github.com/code-ops-show/writefully-old/blob/be98e3b37d7c1dc4db637bc3571d21febdd7dda7/lib/writefully/tools/stationery.rb | lib/writefully/tools/stationery.rb | module Writefully
module Tools
class Stationery
include Celluloid
attr_reader :content, :asset, :index, :site_id
class ContentModelNotFound < StandardError; end
class SomeAssetsNotUploaded < StandardError; end
class SomeAssetsNotRemoved < StandardError; end
def initia... | ruby | MIT | be98e3b37d7c1dc4db637bc3571d21febdd7dda7 | 2026-01-04T17:37:21.208640Z | false |
code-ops-show/writefully-old | https://github.com/code-ops-show/writefully-old/blob/be98e3b37d7c1dc4db637bc3571d21febdd7dda7/lib/writefully/tools/synchronizer.rb | lib/writefully/tools/synchronizer.rb | module Writefully
module Tools
class Synchronizer
include Celluloid
SYNC_SCRIPT = File.dirname(__FILE__) + "/../../../scripts/sync.sh"
attr_reader :message
def initialize message
@message = message
end
def sync
Writefully.logger.info "Synchronizing #{message... | ruby | MIT | be98e3b37d7c1dc4db637bc3571d21febdd7dda7 | 2026-01-04T17:37:21.208640Z | false |
code-ops-show/writefully-old | https://github.com/code-ops-show/writefully-old/blob/be98e3b37d7c1dc4db637bc3571d21febdd7dda7/lib/writefully/tools/pigeon.rb | lib/writefully/tools/pigeon.rb | module Writefully
module Tools
class Pigeon
include Celluloid
def upload endpoint, path, name
file = File.open(File.join(path, name))
Writefully::Storage.store_file(File.join(endpoint, name), file)
rescue StandardError => e
nil
end
def remove key
Wri... | ruby | MIT | be98e3b37d7c1dc4db637bc3571d21febdd7dda7 | 2026-01-04T17:37:21.208640Z | false |
code-ops-show/writefully-old | https://github.com/code-ops-show/writefully-old/blob/be98e3b37d7c1dc4db637bc3571d21febdd7dda7/lib/writefully/tools/initializer.rb | lib/writefully/tools/initializer.rb | module Writefully
module Tools
class Initializer
include Celluloid
INITIALIZE_SCRIPT = File.dirname(__FILE__) + "/../../../scripts/initialize.sh"
attr_reader :message, :api
def initialize message
@message = message
@api = Github.new oauth_token: message[:auth_token]
... | ruby | MIT | be98e3b37d7c1dc4db637bc3571d21febdd7dda7 | 2026-01-04T17:37:21.208640Z | false |
code-ops-show/writefully-old | https://github.com/code-ops-show/writefully-old/blob/be98e3b37d7c1dc4db637bc3571d21febdd7dda7/lib/writefully/tools/retryer.rb | lib/writefully/tools/retryer.rb | module Writefully
module Tools
class Retryer
include Celluloid
attr_accessor :job
def retry(job)
@job = job
if job[:message][:tries] <= 5
after(delay) { queue_retry }
else
mark_as_failed
end
end
def queue_retry
Writefu... | ruby | MIT | be98e3b37d7c1dc4db637bc3571d21febdd7dda7 | 2026-01-04T17:37:21.208640Z | false |
code-ops-show/writefully-old | https://github.com/code-ops-show/writefully-old/blob/be98e3b37d7c1dc4db637bc3571d21febdd7dda7/lib/writefully/tools/pencil.rb | lib/writefully/tools/pencil.rb | module Writefully
module Tools
class Pencil < Stationery
def use
assets_uploaded = upload_assets.map(&:value).compact
written_to_db = future.write if can_update_db?(assets_uploaded)
terminate if written_to_db.value
end
def computed_attributes
content.meta.merg... | ruby | MIT | be98e3b37d7c1dc4db637bc3571d21febdd7dda7 | 2026-01-04T17:37:21.208640Z | false |
code-ops-show/writefully-old | https://github.com/code-ops-show/writefully-old/blob/be98e3b37d7c1dc4db637bc3571d21febdd7dda7/lib/writefully/tools/dispatcher.rb | lib/writefully/tools/dispatcher.rb | module Writefully
module Tools
class Dispatcher
include Celluloid
attr_reader :job
def initialize
every 1.second do
async.heartbeat
end
end
def get_job_data
Writefully.redis.with { |c| c.lpop 'jobs' }
end
def heartbeat
data =... | ruby | MIT | be98e3b37d7c1dc4db637bc3571d21febdd7dda7 | 2026-01-04T17:37:21.208640Z | false |
code-ops-show/writefully-old | https://github.com/code-ops-show/writefully-old/blob/be98e3b37d7c1dc4db637bc3571d21febdd7dda7/lib/writefully/tools/hammer.rb | lib/writefully/tools/hammer.rb | module Writefully
module Tools
class Hammer
include Celluloid
attr_reader :api, :message
def initialize message
@message = message
@api = Github.new oauth_token: message[:auth_token]
end
def hook_config
{ name: 'web',
events: ["push", "member"],
... | ruby | MIT | be98e3b37d7c1dc4db637bc3571d21febdd7dda7 | 2026-01-04T17:37:21.208640Z | false |
code-ops-show/writefully-old | https://github.com/code-ops-show/writefully-old/blob/be98e3b37d7c1dc4db637bc3571d21febdd7dda7/lib/writefully/tools/eraser.rb | lib/writefully/tools/eraser.rb | module Writefully
module Tools
class Eraser < Stationery
def use
trash
remove_assets
destroyed = future.destroy
terminate if destroyed.value
end
def trash
compute_type.by_site(site_id)
.where(slug: content.slug)
... | ruby | MIT | be98e3b37d7c1dc4db637bc3571d21febdd7dda7 | 2026-01-04T17:37:21.208640Z | false |
code-ops-show/writefully-old | https://github.com/code-ops-show/writefully-old/blob/be98e3b37d7c1dc4db637bc3571d21febdd7dda7/config/routes.rb | config/routes.rb | Writefully::Engine.routes.draw do
resources :sites do
get 'tab/:tab', to: 'sites#show', as: :tab, on: :member
resources :posts, only: [:index, :show]
end
resource :profile, only: [:edit]
resource :authorship, only: [:update]
resource :hook, only: [:create]
get '/signin', to: 'sessions#... | ruby | MIT | be98e3b37d7c1dc4db637bc3571d21febdd7dda7 | 2026-01-04T17:37:21.208640Z | false |
kontena/mortar | https://github.com/kontena/mortar/blob/3f85f19340d73b84330487c0f90008caaf289c81/spec/fire_spec.rb | spec/fire_spec.rb | RSpec.describe Mortar::FireCommand do
describe '#variables_struct' do
let(:subject) do
subject = described_class.new('')
subject.load_config # Load the empty config
subject
end
it 'has each' do
subject.parse(["test-shot", "/foobar", "--var", "foo=bar", "--var", "b... | ruby | Apache-2.0 | 3f85f19340d73b84330487c0f90008caaf289c81 | 2026-01-04T17:37:23.208474Z | false |
kontena/mortar | https://github.com/kontena/mortar/blob/3f85f19340d73b84330487c0f90008caaf289c81/spec/mortar_spec.rb | spec/mortar_spec.rb | RSpec.describe Mortar do
it "has a version number" do
expect(Mortar::VERSION).not_to be nil
end
end
| ruby | Apache-2.0 | 3f85f19340d73b84330487c0f90008caaf289c81 | 2026-01-04T17:37:23.208474Z | false |
kontena/mortar | https://github.com/kontena/mortar/blob/3f85f19340d73b84330487c0f90008caaf289c81/spec/config_spec.rb | spec/config_spec.rb | RSpec.describe Mortar::Config do
describe '#self.load' do
it 'raises on empty config' do
expect {
described_class.load(fixture_path('config/config_empty.yaml'))
}.to raise_error(Mortar::Config::ConfigError, 'Failed to load config, check config file syntax')
end
it 'loads vars from fil... | ruby | Apache-2.0 | 3f85f19340d73b84330487c0f90008caaf289c81 | 2026-01-04T17:37:23.208474Z | false |
kontena/mortar | https://github.com/kontena/mortar/blob/3f85f19340d73b84330487c0f90008caaf289c81/spec/spec_helper.rb | spec/spec_helper.rb | require "bundler/setup"
require "mortar"
require_relative 'helpers/fixture_helpers'
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"
# Disable RSpec exposing methods globally on `Module` and `main`
config.disable_... | ruby | Apache-2.0 | 3f85f19340d73b84330487c0f90008caaf289c81 | 2026-01-04T17:37:23.208474Z | false |
kontena/mortar | https://github.com/kontena/mortar/blob/3f85f19340d73b84330487c0f90008caaf289c81/spec/helpers/fixture_helpers.rb | spec/helpers/fixture_helpers.rb | module FixtureHelpers
FIXTURES_PATH = File.join(File.dirname(__FILE__), '../fixtures')
# @return [String] file path
def fixture_path(*path)
File.join(FIXTURES_PATH, *path)
end
# @return [String] file contents
def fixture(*path)
File.read(fixture_path(*path))
end
end
| ruby | Apache-2.0 | 3f85f19340d73b84330487c0f90008caaf289c81 | 2026-01-04T17:37:23.208474Z | false |
kontena/mortar | https://github.com/kontena/mortar/blob/3f85f19340d73b84330487c0f90008caaf289c81/lib/mortar.rb | lib/mortar.rb | # frozen_string_literal: true
require "clamp"
require "deep_merge"
require "mortar/version"
require "mortar/root_command"
require "mortar/config"
autoload :K8s, "k8s-client"
autoload :YAML, "yaml"
autoload :ERB, "erb"
autoload :Rouge, "rouge"
autoload :RecursiveOpenStruct, "recursive-open-struct"
autoload :Pastel, "p... | ruby | Apache-2.0 | 3f85f19340d73b84330487c0f90008caaf289c81 | 2026-01-04T17:37:23.208474Z | false |
kontena/mortar | https://github.com/kontena/mortar/blob/3f85f19340d73b84330487c0f90008caaf289c81/lib/extensions/recursive_open_struct/each.rb | lib/extensions/recursive_open_struct/each.rb | # frozen_string_literal: true
module Extensions
module RecursiveOpenStruct
module Each
def each
to_h.each { |k, v| yield k.to_s, v }
end
end
end
end
# Monkey-patch the above module into RecursiveOpenStruct
RecursiveOpenStruct.include Extensions::RecursiveOpenStruct::Each
| ruby | Apache-2.0 | 3f85f19340d73b84330487c0f90008caaf289c81 | 2026-01-04T17:37:23.208474Z | false |
kontena/mortar | https://github.com/kontena/mortar/blob/3f85f19340d73b84330487c0f90008caaf289c81/lib/mortar/command.rb | lib/mortar/command.rb | # frozen_string_literal: true
require "clamp"
module Mortar
class Command < Clamp::Command
LABEL = 'mortar.kontena.io/shot'
CHECKSUM_ANNOTATION = 'mortar.kontena.io/shot-checksum'
option ["-d", "--debug"], :flag, "debug"
end
end
| ruby | Apache-2.0 | 3f85f19340d73b84330487c0f90008caaf289c81 | 2026-01-04T17:37:23.208474Z | false |
kontena/mortar | https://github.com/kontena/mortar/blob/3f85f19340d73b84330487c0f90008caaf289c81/lib/mortar/list_command.rb | lib/mortar/list_command.rb | # frozen_string_literal: true
require_relative "command"
require_relative "mixins/client_helper"
require_relative "mixins/tty_helper"
module Mortar
class ListCommand < Mortar::Command
include Mortar::ClientHelper
include Mortar::TTYHelper
option ['-q', '--quiet'], :flag, "only output shot names"
d... | ruby | Apache-2.0 | 3f85f19340d73b84330487c0f90008caaf289c81 | 2026-01-04T17:37:23.208474Z | false |
kontena/mortar | https://github.com/kontena/mortar/blob/3f85f19340d73b84330487c0f90008caaf289c81/lib/mortar/version.rb | lib/mortar/version.rb | # frozen_string_literal: true
module Mortar
VERSION = "0.4.7"
end
| ruby | Apache-2.0 | 3f85f19340d73b84330487c0f90008caaf289c81 | 2026-01-04T17:37:23.208474Z | false |
kontena/mortar | https://github.com/kontena/mortar/blob/3f85f19340d73b84330487c0f90008caaf289c81/lib/mortar/yank_command.rb | lib/mortar/yank_command.rb | # frozen_string_literal: true
require_relative "command"
require_relative "mixins/client_helper"
require_relative "mixins/tty_helper"
module Mortar
class YankCommand < Mortar::Command
include Mortar::ClientHelper
include Mortar::TTYHelper
parameter "NAME", "deployment name"
option ["--force"], :fl... | ruby | Apache-2.0 | 3f85f19340d73b84330487c0f90008caaf289c81 | 2026-01-04T17:37:23.208474Z | false |
kontena/mortar | https://github.com/kontena/mortar/blob/3f85f19340d73b84330487c0f90008caaf289c81/lib/mortar/yaml_file.rb | lib/mortar/yaml_file.rb | # frozen_string_literal: true
module Mortar
# Reads YAML files and optionally performs ERB evaluation
class YamlFile
class Namespace
def initialize(variables)
variables.each do |key, value|
singleton_class.send(:define_method, key) { value }
end
end
def with_binding... | ruby | Apache-2.0 | 3f85f19340d73b84330487c0f90008caaf289c81 | 2026-01-04T17:37:23.208474Z | false |
kontena/mortar | https://github.com/kontena/mortar/blob/3f85f19340d73b84330487c0f90008caaf289c81/lib/mortar/fire_command.rb | lib/mortar/fire_command.rb | # frozen_string_literal: true
require "base64"
require_relative "command"
require_relative "yaml_file"
require_relative "mixins/resource_helper"
require_relative "mixins/client_helper"
require_relative "mixins/tty_helper"
module Mortar
class FireCommand < Mortar::Command
include Mortar::ResourceHelper
inclu... | ruby | Apache-2.0 | 3f85f19340d73b84330487c0f90008caaf289c81 | 2026-01-04T17:37:23.208474Z | false |
kontena/mortar | https://github.com/kontena/mortar/blob/3f85f19340d73b84330487c0f90008caaf289c81/lib/mortar/describe_command.rb | lib/mortar/describe_command.rb | # frozen_string_literal: true
require_relative "command"
require_relative "mixins/client_helper"
require_relative "mixins/tty_helper"
module Mortar
class DescribeCommand < Mortar::Command
include Mortar::ClientHelper
include Mortar::TTYHelper
include Mortar::ResourceHelper
parameter "NAME", "deploy... | ruby | Apache-2.0 | 3f85f19340d73b84330487c0f90008caaf289c81 | 2026-01-04T17:37:23.208474Z | false |
kontena/mortar | https://github.com/kontena/mortar/blob/3f85f19340d73b84330487c0f90008caaf289c81/lib/mortar/install_completions_command.rb | lib/mortar/install_completions_command.rb | # frozen_string_literal: true
module Mortar
class InstallCompletionsCommand < Mortar::Command
include Mortar::TTYHelper
DEFAULT_PATHS = [
'/etc/bash_completion.d/mortar.bash',
'/usr/local/etc/bash_completion.d/mortar.bash',
'/usr/share/zsh/site-functions/_mortar',
'/usr/local/share/z... | ruby | Apache-2.0 | 3f85f19340d73b84330487c0f90008caaf289c81 | 2026-01-04T17:37:23.208474Z | false |
kontena/mortar | https://github.com/kontena/mortar/blob/3f85f19340d73b84330487c0f90008caaf289c81/lib/mortar/config.rb | lib/mortar/config.rb | # frozen_string_literal: true
module Mortar
class Config
class ConfigError < StandardError; end
def self.load(path)
cfg = YAML.safe_load(File.read(path))
raise ConfigError, "Failed to load config, check config file syntax" unless cfg.is_a? Hash
raise ConfigError, "Failed to load config, o... | ruby | Apache-2.0 | 3f85f19340d73b84330487c0f90008caaf289c81 | 2026-01-04T17:37:23.208474Z | false |
kontena/mortar | https://github.com/kontena/mortar/blob/3f85f19340d73b84330487c0f90008caaf289c81/lib/mortar/root_command.rb | lib/mortar/root_command.rb | # frozen_string_literal: true
require "clamp"
require_relative "fire_command"
require_relative "yank_command"
require_relative "describe_command"
require_relative "list_command"
require_relative "install_completions_command"
Clamp.allow_options_after_parameters = true
module Mortar
class RootCommand < Clamp::Comma... | ruby | Apache-2.0 | 3f85f19340d73b84330487c0f90008caaf289c81 | 2026-01-04T17:37:23.208474Z | false |
kontena/mortar | https://github.com/kontena/mortar/blob/3f85f19340d73b84330487c0f90008caaf289c81/lib/mortar/mixins/tty_helper.rb | lib/mortar/mixins/tty_helper.rb | # frozen_string_literal: true
module Mortar
module TTYHelper
# @return [Pastel]
def pastel
@pastel ||= Pastel.new
end
end
end
| ruby | Apache-2.0 | 3f85f19340d73b84330487c0f90008caaf289c81 | 2026-01-04T17:37:23.208474Z | false |
kontena/mortar | https://github.com/kontena/mortar/blob/3f85f19340d73b84330487c0f90008caaf289c81/lib/mortar/mixins/resource_helper.rb | lib/mortar/mixins/resource_helper.rb | # frozen_string_literal: true
module Mortar
module ResourceHelper
# @param filename [String] file path
# @return [Array<K8s::Resource>]
def from_files(path)
Dir.glob("#{path}/*.{yml,yaml,yml.erb,yaml.erb}").sort.map { |file|
from_file(file)
}.flatten
end
# @param filename [St... | ruby | Apache-2.0 | 3f85f19340d73b84330487c0f90008caaf289c81 | 2026-01-04T17:37:23.208474Z | false |
kontena/mortar | https://github.com/kontena/mortar/blob/3f85f19340d73b84330487c0f90008caaf289c81/lib/mortar/mixins/client_helper.rb | lib/mortar/mixins/client_helper.rb | # frozen_string_literal: true
module Mortar
module ClientHelper
# @return [K8s::Client]
def client
@client ||= create_client
end
def create_client
if ENV['KUBE_TOKEN'] && ENV['KUBE_CA'] && ENV['KUBE_SERVER']
K8s::Client.new(K8s::Transport.config(build_kubeconfig_from_env))
... | ruby | Apache-2.0 | 3f85f19340d73b84330487c0f90008caaf289c81 | 2026-01-04T17:37:23.208474Z | false |
pjhyett/auto_migrations | https://github.com/pjhyett/auto_migrations/blob/59977d1faa4c4dbce948eca1ab733843111b567e/init.rb | init.rb | require 'auto_migrations'
ActiveRecord::Migration.send :include, AutoMigrations
| ruby | MIT | 59977d1faa4c4dbce948eca1ab733843111b567e | 2026-01-04T17:37:24.454794Z | false |
pjhyett/auto_migrations | https://github.com/pjhyett/auto_migrations/blob/59977d1faa4c4dbce948eca1ab733843111b567e/test/auto_migrations_test.rb | test/auto_migrations_test.rb | require 'test/unit'
class AutoMigrationsTest < Test::Unit::TestCase
# Replace this with your real tests.
def test_this_plugin
flunk
end
end
| ruby | MIT | 59977d1faa4c4dbce948eca1ab733843111b567e | 2026-01-04T17:37:24.454794Z | false |
pjhyett/auto_migrations | https://github.com/pjhyett/auto_migrations/blob/59977d1faa4c4dbce948eca1ab733843111b567e/lib/auto_migrations.rb | lib/auto_migrations.rb | module AutoMigrations
def self.run
# Turn off schema_info code for auto-migration
class << ActiveRecord::Schema
alias :old_define :define
attr_accessor :version
def define(info={}, &block) @version = Time.now.utc.strftime("%Y%m%d%H%M%S"); instance_eval(&block) end
end
load(File... | ruby | MIT | 59977d1faa4c4dbce948eca1ab733843111b567e | 2026-01-04T17:37:24.454794Z | false |
Azdaroth/active_model_attributes | https://github.com/Azdaroth/active_model_attributes/blob/e5f7756cb48d81e85bbe8964c227e585dd86d260/spec/active_model_attributes_spec.rb | spec/active_model_attributes_spec.rb | require "spec_helper"
require "active_model"
describe ActiveModelAttributes do
class ModelForAttributesTest
include ActiveModel::Model
include ActiveModelAttributes
attribute :integer_field, :integer
attribute :string_field, :string
attribute :decimal_field, :decimal
attribute :string_with_d... | ruby | MIT | e5f7756cb48d81e85bbe8964c227e585dd86d260 | 2026-01-04T17:37:26.154016Z | false |
Azdaroth/active_model_attributes | https://github.com/Azdaroth/active_model_attributes/blob/e5f7756cb48d81e85bbe8964c227e585dd86d260/spec/spec_helper.rb | spec/spec_helper.rb | $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
require 'coveralls'
Coveralls.wear!
require "active_model_attributes"
require "pry"
| ruby | MIT | e5f7756cb48d81e85bbe8964c227e585dd86d260 | 2026-01-04T17:37:26.154016Z | false |
Azdaroth/active_model_attributes | https://github.com/Azdaroth/active_model_attributes/blob/e5f7756cb48d81e85bbe8964c227e585dd86d260/lib/active_model_attributes.rb | lib/active_model_attributes.rb | require "active_model_attributes/version"
require "active_support/concern"
require "active_model/type"
module ActiveModelAttributes
extend ActiveSupport::Concern
delegate :type_for_attribute, :has_attribute?, to: :class
included do
class_attribute :attributes_registry, :attribute_types, instance_accessor: ... | ruby | MIT | e5f7756cb48d81e85bbe8964c227e585dd86d260 | 2026-01-04T17:37:26.154016Z | false |
Azdaroth/active_model_attributes | https://github.com/Azdaroth/active_model_attributes/blob/e5f7756cb48d81e85bbe8964c227e585dd86d260/lib/active_model_attributes/version.rb | lib/active_model_attributes/version.rb | module ActiveModelAttributes
VERSION = "1.6.0"
end
| ruby | MIT | e5f7756cb48d81e85bbe8964c227e585dd86d260 | 2026-01-04T17:37:26.154016Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/app/helpers/users_helper.rb | app/helpers/users_helper.rb | module UsersHelper
end
| ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/app/helpers/authorize_helper.rb | app/helpers/authorize_helper.rb | module AuthorizeHelper
end
| ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/app/helpers/application_helper.rb | app/helpers/application_helper.rb | module ApplicationHelper
def manifest_attr
return '' unless Rails.env.production?
%{manifest="#{manifest_path}"}.html_safe
end
end
| ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/app/helpers/app_helper.rb | app/helpers/app_helper.rb | module AppHelper
end
| ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/app/controllers/users_controller.rb | app/controllers/users_controller.rb | class UsersController < ApplicationController
before_filter :find_user
def update
@user.update_attributes!(params[:user])
head :ok
end
protected
def find_user
@user = current_user
end
end | ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/app/controllers/authorize_controller.rb | app/controllers/authorize_controller.rb | class AuthorizeController < ApplicationController
def create
self.current_user = User.authorize_google!(
request.env["omniauth.auth"]
)
redirect_to "/"
end
def failure
raise "OAuth failure - #{params[:message]}"
end
def destroy
reset_session
cookies.delete(:user_id)
r... | ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/app/controllers/app_controller.rb | app/controllers/app_controller.rb | class AppController < ApplicationController
before_filter :require_user
rescue_from Nestful::UnauthorizedAccess do |exception|
head :unauthorized
end
def index
@user = current_user
end
def calendar
@events = current_user.google.calendar
render :json => @events
end
def email... | ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/app/controllers/application_controller.rb | app/controllers/application_controller.rb | class ApplicationController < ActionController::Base
protect_from_forgery
protected
def current_user=(user)
session[:user_id] = user && user.id
end
def current_user
return @current_user if defined?(@current_user)
@current_user = session[:user_id].present? && User.find(ses... | ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/app/models/user.rb | app/models/user.rb | class User < ActiveRecord::Base
attr_accessible :note
class << self
def authorize_google!(auth)
return unless auth && auth.uid
user = self.find_by_uid(auth.uid) || self.new
user.uid = auth.uid
user.first_name = auth.info.first_name
user.last_name = auth.info.las... | ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/db/seeds.rb | db/seeds.rb | # 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... | ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/db/schema.rb | db/schema.rb | # 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... | ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/db/migrate/20120128032530_create_users.rb | db/migrate/20120128032530_create_users.rb | class CreateUsers < ActiveRecord::Migration
def change
create_table :users do |t|
t.string :first_name
t.string :last_name
t.string :email
t.string :uid
t.string :google_token
t.string :avatar_url
t.text :note
t.timestamps
end
end
end
| ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/test/test_helper.rb | test/test_helper.rb | ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
class ActiveSupport::TestCase
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
#
# Note: You'll currently still have to declare fixtures explicitly in integrati... | ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/test/performance/browsing_test.rb | test/performance/browsing_test.rb | require 'test_helper'
require 'rails/performance_test_help'
class BrowsingTest < ActionDispatch::PerformanceTest
# Refer to the documentation for all available options
# self.profile_options = { :runs => 5, :metrics => [:wall_time, :memory]
# :output => 'tmp/performance', :formats => [:f... | ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/test/unit/user_test.rb | test/unit/user_test.rb | require 'test_helper'
class UserTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
| ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/test/unit/note_test.rb | test/unit/note_test.rb | require 'test_helper'
class NoteTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
| ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/test/unit/helpers/app_helper_test.rb | test/unit/helpers/app_helper_test.rb | require 'test_helper'
class AppHelperTest < ActionView::TestCase
end
| ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/test/unit/helpers/authorize_helper_test.rb | test/unit/helpers/authorize_helper_test.rb | require 'test_helper'
class AuthorizeHelperTest < ActionView::TestCase
end
| ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/test/unit/helpers/users_helper_test.rb | test/unit/helpers/users_helper_test.rb | require 'test_helper'
class UsersHelperTest < ActionView::TestCase
end
| ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/test/functional/authorize_controller_test.rb | test/functional/authorize_controller_test.rb | require 'test_helper'
class AuthorizeControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
end
| ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/test/functional/app_controller_test.rb | test/functional/app_controller_test.rb | require 'test_helper'
class AppControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
end
| ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/test/functional/users_controller_test.rb | test/functional/users_controller_test.rb | require 'test_helper'
class UsersControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
end
| ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/lib/google.rb | lib/google.rb | require 'nestful'
module Google
class Email
def initialize(result)
@subject = result['title']
@summary = result['summary']
@link = result['link']['href']
@sent_at = Time.parse(result['issued'])
end
def serializable_hash(options = nil)
{
subject: @subject,
... | ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/config/application.rb | config/application.rb | require File.expand_path('../boot', __FILE__)
require 'rails/all'
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require(*Rails.groups(:assets => %w(development test)))
# If you want your assets lazily compiled in production, use this line
# Bundler.requi... | ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/config/environment.rb | config/environment.rb | # Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
HeadsUp::Application.initialize!
| ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/config/routes.rb | config/routes.rb | HeadsUp::Application.routes.draw do
match '/auth/google' => redirect('/auth/google_oauth2')
match '/auth/google_oauth2/callback' => 'authorize#create'
match '/auth/failure' => 'authorize#failure'
match '/logout' => 'authorize#destroy', :as => :logout
match '/authorize' => redirect('/auth/google'), :as => :... | ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/config/boot.rb | config/boot.rb | require 'rubygems'
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
| ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/config/initializers/session_store.rb | config/initializers/session_store.rb | # Be sure to restart your server when you modify this file.
HeadsUp::Application.config.session_store :cookie_store, key: '_dashboard_session'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rails... | ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/config/initializers/wrap_parameters.rb | config/initializers/wrap_parameters.rb | # Be sure to restart your server when you modify this file.
#
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
wrap_parameters ... | ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/config/initializers/omniauth.rb | config/initializers/omniauth.rb | Rails.application.config.middleware.use OmniAuth::Builder do
provider :google_oauth2, ENV["GOOGLE_KEY"], ENV["GOOGLE_SECRET"], approval_prompt: '', scope: "userinfo.email,userinfo.profile,https://www.googleapis.com/auth/calendar.readonly,https://mail.google.com/mail/feed/atom/"
on_failure do |env, msg|
[200, {}... | ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/config/initializers/inflections.rb | config/initializers/inflections.rb | # Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
# (all these examples are active by default):
# ActiveSupport::Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', ... | ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/config/initializers/backtrace_silencers.rb | config/initializers/backtrace_silencers.rb | # Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
# You can also remove all the silencers if you're trying to debug a probl... | ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/config/initializers/mime_types.rb | config/initializers/mime_types.rb | # Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone
| ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/config/initializers/secret_token.rb | config/initializers/secret_token.rb | # Be sure to restart your server when you modify this file.
# Your secret key for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attac... | ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/config/environments/test.rb | config/environments/test.rb | HeadsUp::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test su... | ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/config/environments/development.rb | config/environments/development.rb | HeadsUp::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web se... | ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
maccman/headsup | https://github.com/maccman/headsup/blob/2199db96c3ef8b1bb09f82cf06e36cd7e9539226/config/environments/production.rb | config/environments/production.rb | HeadsUp::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.action... | ruby | MIT | 2199db96c3ef8b1bb09f82cf06e36cd7e9539226 | 2026-01-04T17:37:25.561061Z | false |
piotrmurach/tty-pie | https://github.com/piotrmurach/tty-pie/blob/98b8b1d1779cce8242fb35646aaf06df24291a73/spec/spec_helper.rb | spec/spec_helper.rb | # frozen_string_literal: true
if ENV["COVERAGE"] == "true"
require "simplecov"
require "coveralls"
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter
])
SimpleCov.start do
command_name "spec"
add_filter "spec... | ruby | MIT | 98b8b1d1779cce8242fb35646aaf06df24291a73 | 2026-01-04T17:37:26.546188Z | false |
piotrmurach/tty-pie | https://github.com/piotrmurach/tty-pie/blob/98b8b1d1779cce8242fb35646aaf06df24291a73/spec/perf/render_spec.rb | spec/perf/render_spec.rb | # frozen_string_literal: true
require "rspec-benchmark"
require "yaml"
RSpec.describe TTY::Pie do
include RSpec::Benchmark::Matchers
let(:data) {
[
{name: "BTC", value: 5977},
{name: "BCH", value: 3045},
{name: "LTC", value: 2030}
]
}
it "performs pie chart rendering slower than YA... | ruby | MIT | 98b8b1d1779cce8242fb35646aaf06df24291a73 | 2026-01-04T17:37:26.546188Z | false |
piotrmurach/tty-pie | https://github.com/piotrmurach/tty-pie/blob/98b8b1d1779cce8242fb35646aaf06df24291a73/spec/unit/update_spec.rb | spec/unit/update_spec.rb | # frozen_string_literal: true
RSpec.describe TTY::Pie, "#update" do
it "updates current data" do
data = [{name: "BTC", value: 5977, fill: "*"}]
pie = TTY::Pie.new(data: data, radius: 2)
output = pie.render
expect(output).to eq([
" ***\n",
" *******\n",
"********* * BTC 100.0... | ruby | MIT | 98b8b1d1779cce8242fb35646aaf06df24291a73 | 2026-01-04T17:37:26.546188Z | false |
piotrmurach/tty-pie | https://github.com/piotrmurach/tty-pie/blob/98b8b1d1779cce8242fb35646aaf06df24291a73/spec/unit/reset_spec.rb | spec/unit/reset_spec.rb | # frozen_string_literal: true
RSpec.describe TTY::Pie, "#reset" do
it "resets current data" do
data = [{name: "BTC", value: 5977, fill: "*"}]
pie = TTY::Pie.new(data: data, radius: 2)
output = pie.render
expect(output).to eq([
" ***\n",
" *******\n",
"********* * BTC 100.00%... | ruby | MIT | 98b8b1d1779cce8242fb35646aaf06df24291a73 | 2026-01-04T17:37:26.546188Z | false |
piotrmurach/tty-pie | https://github.com/piotrmurach/tty-pie/blob/98b8b1d1779cce8242fb35646aaf06df24291a73/spec/unit/fill_spec.rb | spec/unit/fill_spec.rb | # frozen_string_literal: true
RSpec.describe TTY::Pie, ":fill option" do
let(:data) {
[
{name: "BTC", value: 5977, color: :bright_yellow, fill: "*"},
{name: "BCH", value: 3045, color: :bright_green, fill: "+"},
{name: "LTC", value: 2030, color: :bright_magenta, fill: "x"}
]
}
it "rende... | ruby | MIT | 98b8b1d1779cce8242fb35646aaf06df24291a73 | 2026-01-04T17:37:26.546188Z | false |
piotrmurach/tty-pie | https://github.com/piotrmurach/tty-pie/blob/98b8b1d1779cce8242fb35646aaf06df24291a73/spec/unit/render_spec.rb | spec/unit/render_spec.rb | # frozen_string_literal: true
RSpec.describe TTY::Pie, "#render" do
let(:data) {
[
{name: "BTC", value: 5977},
{name: "BCH", value: 3045},
{name: "LTC", value: 2030}
]
}
it "renders chart with no data" do
pie = TTY::Pie.new(data: [], radius: 2)
expect(pie.render).to eq("")
e... | ruby | MIT | 98b8b1d1779cce8242fb35646aaf06df24291a73 | 2026-01-04T17:37:26.546188Z | false |
piotrmurach/tty-pie | https://github.com/piotrmurach/tty-pie/blob/98b8b1d1779cce8242fb35646aaf06df24291a73/spec/unit/color_spec.rb | spec/unit/color_spec.rb | # frozen_string_literal: true
RSpec.describe TTY::Pie, ":color option" do
it "renders a pie chart without colors" do
data = [
{name: "BTC", value: 5977, fill: "*"},
{name: "BCH", value: 3045, fill: "+"},
{name: "LTC", value: 2030, fill: "x"}
]
pie = TTY::Pie.new(data: data, radius: 2)
... | ruby | MIT | 98b8b1d1779cce8242fb35646aaf06df24291a73 | 2026-01-04T17:37:26.546188Z | false |
piotrmurach/tty-pie | https://github.com/piotrmurach/tty-pie/blob/98b8b1d1779cce8242fb35646aaf06df24291a73/spec/unit/legend_spec.rb | spec/unit/legend_spec.rb | # frozen_string_literal: true
RSpec.describe TTY::Pie, ":legend option" do
it "renders legend at default location with 1 line separator" do
data = [
{name: "BTC", value: 5977, fill: "*"},
{name: "BCH", value: 3045, fill: "+"},
{name: "LTC", value: 2030, fill: "x"}
]
pie = TTY::Pie.new(... | ruby | MIT | 98b8b1d1779cce8242fb35646aaf06df24291a73 | 2026-01-04T17:37:26.546188Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.