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 |
|---|---|---|---|---|---|---|---|---|
michael/ken-rb | https://github.com/michael/ken-rb/blob/b77ce234e5ff389da433c658d5988d146a2d8be8/test/unit/property_test.rb | test/unit/property_test.rb | require 'test_helper'
class PropertyTest < Test::Unit::TestCase
context "A Property instance" do
setup do
data = load_fixture('music_artist')
@type = Ken::Type.new(data)
@value_property = @type.properties[1]
@object_property = @type.properties[3]
end
should 'be a valid proper... | ruby | MIT | b77ce234e5ff389da433c658d5988d146a2d8be8 | 2026-01-04T17:45:38.274680Z | false |
michael/ken-rb | https://github.com/michael/ken-rb/blob/b77ce234e5ff389da433c658d5988d146a2d8be8/test/unit/view_test.rb | test/unit/view_test.rb | require 'test_helper'
class ViewTest < Test::Unit::TestCase
context "A View instance" do
setup do
Ken::Logger.new(STDOUT, :info)
data = load_fixture('the_police')
@the_police = Ken::Resource.new(data)
@view = @the_police.views.first
end
should "have a type" do
@view.type.... | ruby | MIT | b77ce234e5ff389da433c658d5988d146a2d8be8 | 2026-01-04T17:45:38.274680Z | false |
michael/ken-rb | https://github.com/michael/ken-rb/blob/b77ce234e5ff389da433c658d5988d146a2d8be8/examples/artist_links.rb | examples/artist_links.rb | require 'pathname'
require 'rubygems'
# displays all links related to music/artists
# low level api through Ken.session.mqlread is used here
EXAMPLES_ROOT = Pathname(__FILE__).dirname.expand_path
require EXAMPLES_ROOT.parent + 'lib/ken'
Ken::Session.new('http://www.freebase.com', 'ma', '*****')
puts "collecting art... | ruby | MIT | b77ce234e5ff389da433c658d5988d146a2d8be8 | 2026-01-04T17:45:38.274680Z | false |
michael/ken-rb | https://github.com/michael/ken-rb/blob/b77ce234e5ff389da433c658d5988d146a2d8be8/examples/artist.rb | examples/artist.rb | require 'pathname'
require 'rubygems'
EXAMPLES_ROOT = Pathname(__FILE__).dirname.expand_path
require EXAMPLES_ROOT.parent + 'lib/ken'
Ken::Logger.new(STDOUT, :info)
Ken::Session.new('http://www.freebase.com', 'ma', 'xxxxx')
resource = Ken.get('/en/the_police')
resource.views.each do |view|
puts view
puts "="*20... | ruby | MIT | b77ce234e5ff389da433c658d5988d146a2d8be8 | 2026-01-04T17:45:38.274680Z | false |
michael/ken-rb | https://github.com/michael/ken-rb/blob/b77ce234e5ff389da433c658d5988d146a2d8be8/lib/ken.rb | lib/ken.rb | require 'pathname'
require 'rubygems'
require 'net/http'
require 'json'
require 'extlib/assertions'
require 'addressable/uri'
dir = Pathname(__FILE__).dirname.expand_path + 'ken'
require dir + 'util'
require dir + 'session'
require dir + 'resource'
require dir + 'type'
require dir + 'view'
require dir + 'property'
re... | ruby | MIT | b77ce234e5ff389da433c658d5988d146a2d8be8 | 2026-01-04T17:45:38.274680Z | false |
michael/ken-rb | https://github.com/michael/ken-rb/blob/b77ce234e5ff389da433c658d5988d146a2d8be8/lib/ken/resource.rb | lib/ken/resource.rb | module Ken
class Resource
include Extlib::Assertions
extend Extlib::Assertions
attr_reader :data
# initializes a resource using a json result
def initialize(data)
assert_kind_of 'data', data, Hash
@schema_loaded, @attributes_loaded, @data = false, false, data
@data_fechted =... | ruby | MIT | b77ce234e5ff389da433c658d5988d146a2d8be8 | 2026-01-04T17:45:38.274680Z | false |
michael/ken-rb | https://github.com/michael/ken-rb/blob/b77ce234e5ff389da433c658d5988d146a2d8be8/lib/ken/collection.rb | lib/ken/collection.rb | module Ken
class Collection < Array
# add a linebreak after each entry
def to_s
self.inject("") { |m,i| "#{m}#{i.to_s}\n"}
end
end
end | ruby | MIT | b77ce234e5ff389da433c658d5988d146a2d8be8 | 2026-01-04T17:45:38.274680Z | false |
michael/ken-rb | https://github.com/michael/ken-rb/blob/b77ce234e5ff389da433c658d5988d146a2d8be8/lib/ken/session.rb | lib/ken/session.rb | module Ken
class << self
attr_accessor :session
end
# A class for returing errors from the freebase api.
# For more infomation see the freebase documentation:
class ReadError < ArgumentError
attr_accessor :code, :msg
def initialize(code,msg)
self.code = code
self.msg = msg
end
... | ruby | MIT | b77ce234e5ff389da433c658d5988d146a2d8be8 | 2026-01-04T17:45:38.274680Z | false |
michael/ken-rb | https://github.com/michael/ken-rb/blob/b77ce234e5ff389da433c658d5988d146a2d8be8/lib/ken/logger.rb | lib/ken/logger.rb | require "time"
# ==== Public Ken Logger API
#
# Logger taken from Merb/Datamapper :)
#
# To replace an existing logger with a new one:
# Ken.logger.set_log(log{String, IO},level{Symbol, String})
#
# Available logging levels are:
# :off, :fatal, :error, :warn, :info, :debug
#
# Logging via:
# Ken.logger.fatal(mes... | ruby | MIT | b77ce234e5ff389da433c658d5988d146a2d8be8 | 2026-01-04T17:45:38.274680Z | false |
michael/ken-rb | https://github.com/michael/ken-rb/blob/b77ce234e5ff389da433c658d5988d146a2d8be8/lib/ken/type.rb | lib/ken/type.rb | module Ken
class Type
include Extlib::Assertions
# initializes a resource using a json result
def initialize(data)
assert_kind_of 'data', data, Hash
@data = data
end
# access property info
# @api public
def properties
@properties ||= Ken::Collection.new(@da... | ruby | MIT | b77ce234e5ff389da433c658d5988d146a2d8be8 | 2026-01-04T17:45:38.274680Z | false |
michael/ken-rb | https://github.com/michael/ken-rb/blob/b77ce234e5ff389da433c658d5988d146a2d8be8/lib/ken/topic.rb | lib/ken/topic.rb | module Ken
class Topic
include Extlib::Assertions
extend Extlib::Assertions
attr_reader :data
# initializes a topic using a json result
def initialize(data)
assert_kind_of 'data', data, Hash
@data = data
@schema_loaded, @attributes_loaded = false, false
end
... | ruby | MIT | b77ce234e5ff389da433c658d5988d146a2d8be8 | 2026-01-04T17:45:38.274680Z | false |
michael/ken-rb | https://github.com/michael/ken-rb/blob/b77ce234e5ff389da433c658d5988d146a2d8be8/lib/ken/attribute.rb | lib/ken/attribute.rb | module Ken
class Attribute
include Extlib::Assertions
attr_reader :property
# initializes a resource by json result
def initialize(data, property)
assert_kind_of 'data', data, Array
assert_kind_of 'property', property, Ken::Property
@data, @property = data, property
end
... | ruby | MIT | b77ce234e5ff389da433c658d5988d146a2d8be8 | 2026-01-04T17:45:38.274680Z | false |
michael/ken-rb | https://github.com/michael/ken-rb/blob/b77ce234e5ff389da433c658d5988d146a2d8be8/lib/ken/view.rb | lib/ken/view.rb | # provides an interface to view a subject (resource or topic) as a specific type
# provides an interface for working with attributes, properties
module Ken
class View
include Extlib::Assertions
# initializes a subject (resource or topic) by json result
def initialize(subject, type)
assert_... | ruby | MIT | b77ce234e5ff389da433c658d5988d146a2d8be8 | 2026-01-04T17:45:38.274680Z | false |
michael/ken-rb | https://github.com/michael/ken-rb/blob/b77ce234e5ff389da433c658d5988d146a2d8be8/lib/ken/property.rb | lib/ken/property.rb | module Ken
class Property
include Extlib::Assertions
VALUE_TYPES = %w{
/type/id
/type/int
/type/float
/type/boolean
/type/text
/type/rawstring
/type/uri
/type/datetime
/type/key
}
# initializes a resource by json result
def initialize(dat... | ruby | MIT | b77ce234e5ff389da433c658d5988d146a2d8be8 | 2026-01-04T17:45:38.274680Z | false |
michael/ken-rb | https://github.com/michael/ken-rb/blob/b77ce234e5ff389da433c658d5988d146a2d8be8/lib/ken/util.rb | lib/ken/util.rb | module Ken
module Util
# magic hash conversion
def convert_hash(source)
source.inject({}) do |result, item|
if result[item["link"]]
result[item["link"]] << { "id" => item["id"], "name" => item["name"], "value" => item["value"] }
else
result[item["link"]] = []
... | ruby | MIT | b77ce234e5ff389da433c658d5988d146a2d8be8 | 2026-01-04T17:45:38.274680Z | false |
voxmedia/middleman-google_drive | https://github.com/voxmedia/middleman-google_drive/blob/363d0fd581eee5922f3894f53a6b5e940e673730/test/google_drive_test.rb | test/google_drive_test.rb | require 'minitest/autorun'
require 'fileutils'
require 'google_drive'
# Test the client lib!
class TestGoogleDrive < MiniTest::Test
def setup
@drive = ::GoogleDrive.new
@old_sheet_file_id = '0AiOYF21HkoowdEZ4Ukkyc09nb2czQUxUYldidTB4Q1E'
@new_sheet_file_id = '1vIICbbfHJ8lYSthiDWTNypZulrMResi9zPRjv4ePJJU'
... | ruby | BSD-3-Clause | 363d0fd581eee5922f3894f53a6b5e940e673730 | 2026-01-04T17:45:38.751473Z | false |
voxmedia/middleman-google_drive | https://github.com/voxmedia/middleman-google_drive/blob/363d0fd581eee5922f3894f53a6b5e940e673730/lib/middleman_extension.rb | lib/middleman_extension.rb | require 'middleman-google_drive'
| ruby | BSD-3-Clause | 363d0fd581eee5922f3894f53a6b5e940e673730 | 2026-01-04T17:45:38.751473Z | false |
voxmedia/middleman-google_drive | https://github.com/voxmedia/middleman-google_drive/blob/363d0fd581eee5922f3894f53a6b5e940e673730/lib/middleman-google_drive.rb | lib/middleman-google_drive.rb | require 'middleman-core'
Middleman::Extensions.register :google_drive do
require 'middleman-google_drive/extension'
Middleman::GoogleDrive::Extension
end
| ruby | BSD-3-Clause | 363d0fd581eee5922f3894f53a6b5e940e673730 | 2026-01-04T17:45:38.751473Z | false |
voxmedia/middleman-google_drive | https://github.com/voxmedia/middleman-google_drive/blob/363d0fd581eee5922f3894f53a6b5e940e673730/lib/google_drive.rb | lib/google_drive.rb | require 'middleman-google_drive/version'
require 'mime/types'
require 'google/api_client'
require 'google/api_client/client_secrets'
require 'google/api_client/auth/file_storage'
require 'google/api_client/auth/installed_app'
require 'rubyXL'
# Convience wrapper for Google Drive
#
# You can override the location of th... | ruby | BSD-3-Clause | 363d0fd581eee5922f3894f53a6b5e940e673730 | 2026-01-04T17:45:38.751473Z | false |
voxmedia/middleman-google_drive | https://github.com/voxmedia/middleman-google_drive/blob/363d0fd581eee5922f3894f53a6b5e940e673730/lib/middleman-google_drive/version.rb | lib/middleman-google_drive/version.rb | module Middleman
module GoogleDrive
VERSION = '0.3.13'
end
end
| ruby | BSD-3-Clause | 363d0fd581eee5922f3894f53a6b5e940e673730 | 2026-01-04T17:45:38.751473Z | false |
voxmedia/middleman-google_drive | https://github.com/voxmedia/middleman-google_drive/blob/363d0fd581eee5922f3894f53a6b5e940e673730/lib/middleman-google_drive/extension.rb | lib/middleman-google_drive/extension.rb | require 'middleman-core'
require 'google_drive'
require 'archieml'
module Middleman
module GoogleDrive
# Middle man extension that loads the google doc data
class Extension < Middleman::Extension
option :load_sheets, {}, 'Key for a google spreadsheet or a hash of google spreadsheets to load. Hash value... | ruby | BSD-3-Clause | 363d0fd581eee5922f3894f53a6b5e940e673730 | 2026-01-04T17:45:38.751473Z | false |
OlympiaAI/raix-rails | https://github.com/OlympiaAI/raix-rails/blob/c3f21ece8921bef080199073aea30bf504e74689/spec/spec_helper.rb | spec/spec_helper.rb | # frozen_string_literal: true
require "dotenv"
require "faraday"
require "faraday/retry"
require "open_router"
require "pry"
require "raix"
Dotenv.load
retry_options = {
max: 2,
interval: 0.05,
interval_randomness: 0.5,
backoff_factor: 2
}
OpenRouter.configure do |config|
config.faraday do |f|
f.reque... | ruby | MIT | c3f21ece8921bef080199073aea30bf504e74689 | 2026-01-04T17:45:38.241281Z | false |
OlympiaAI/raix-rails | https://github.com/OlympiaAI/raix-rails/blob/c3f21ece8921bef080199073aea30bf504e74689/spec/raix/rails_spec.rb | spec/raix/rails_spec.rb | # frozen_string_literal: true
RSpec.describe Raix::Rails do
it "has a version number" do
expect(Raix::Rails::VERSION).not_to be nil
end
end
| ruby | MIT | c3f21ece8921bef080199073aea30bf504e74689 | 2026-01-04T17:45:38.241281Z | false |
OlympiaAI/raix-rails | https://github.com/OlympiaAI/raix-rails/blob/c3f21ece8921bef080199073aea30bf504e74689/spec/raix/function_dispatch_spec.rb | spec/raix/function_dispatch_spec.rb | # frozen_string_literal: true
class WhatIsTheWeather
include Raix::ChatCompletion
include Raix::FunctionDispatch
function :check_weather, "Check the weather for a location", location: { type: "string" } do |arguments|
"The weather in #{arguments[:location]} is hot and sunny"
end
def initialize
self... | ruby | MIT | c3f21ece8921bef080199073aea30bf504e74689 | 2026-01-04T17:45:38.241281Z | false |
OlympiaAI/raix-rails | https://github.com/OlympiaAI/raix-rails/blob/c3f21ece8921bef080199073aea30bf504e74689/spec/raix/chat_completion_spec.rb | spec/raix/chat_completion_spec.rb | # frozen_string_literal: true
class MeaningOfLife
include Raix::ChatCompletion
def initialize
self.model = "meta-llama/llama-3-8b-instruct:free"
self.seed = 9999 # try to get reproduceable results
transcript << { user: "What is the meaning of life?" }
end
end
RSpec.describe MeaningOfLife do
subje... | ruby | MIT | c3f21ece8921bef080199073aea30bf504e74689 | 2026-01-04T17:45:38.241281Z | false |
OlympiaAI/raix-rails | https://github.com/OlympiaAI/raix-rails/blob/c3f21ece8921bef080199073aea30bf504e74689/lib/raix.rb | lib/raix.rb | # frozen_string_literal: true
require_relative "raix/rails/version"
require_relative "raix/chat_completion"
require_relative "raix/function_dispatch"
require_relative "raix/prompt_declarations"
# The Raix module provides configuration options for the Raix gem.
module Raix
# The Configuration class holds the configu... | ruby | MIT | c3f21ece8921bef080199073aea30bf504e74689 | 2026-01-04T17:45:38.241281Z | false |
OlympiaAI/raix-rails | https://github.com/OlympiaAI/raix-rails/blob/c3f21ece8921bef080199073aea30bf504e74689/lib/raix/prompt_declarations.rb | lib/raix/prompt_declarations.rb | # frozen_string_literal: true
require "ostruct"
module Raix
# The PromptDeclarations module provides a way to chain prompts and handle
# user responses in a serialized manner (in the order they were defined),
# with support for functions if the FunctionDispatch module is also included.
module PromptDeclaratio... | ruby | MIT | c3f21ece8921bef080199073aea30bf504e74689 | 2026-01-04T17:45:38.241281Z | false |
OlympiaAI/raix-rails | https://github.com/OlympiaAI/raix-rails/blob/c3f21ece8921bef080199073aea30bf504e74689/lib/raix/chat_completion.rb | lib/raix/chat_completion.rb | # frozen_string_literal: true
require "active_support/concern"
require "active_support/core_ext/object/blank"
require "open_router"
require "openai"
module Raix
# The `ChatCompletion`` module is a Rails concern that provides a way to interact
# with the OpenRouter Chat Completion API via its client. The module in... | ruby | MIT | c3f21ece8921bef080199073aea30bf504e74689 | 2026-01-04T17:45:38.241281Z | false |
OlympiaAI/raix-rails | https://github.com/OlympiaAI/raix-rails/blob/c3f21ece8921bef080199073aea30bf504e74689/lib/raix/function_dispatch.rb | lib/raix/function_dispatch.rb | # frozen_string_literal: true
require "securerandom"
module Raix
# Provides declarative function definition for ChatCompletion classes.
#
# Example:
#
# class MeaningOfLife
# include Raix::ChatCompletion
# include Raix::FunctionDispatch
#
# function :ask_deep_thought do
# wait 2... | ruby | MIT | c3f21ece8921bef080199073aea30bf504e74689 | 2026-01-04T17:45:38.241281Z | false |
OlympiaAI/raix-rails | https://github.com/OlympiaAI/raix-rails/blob/c3f21ece8921bef080199073aea30bf504e74689/lib/raix/rails/version.rb | lib/raix/rails/version.rb | # frozen_string_literal: true
module Raix
module Rails
VERSION = "0.3.1"
end
end
| ruby | MIT | c3f21ece8921bef080199073aea30bf504e74689 | 2026-01-04T17:45:38.241281Z | false |
joshsoftware/sso-devise-omniauth-client | https://github.com/joshsoftware/sso-devise-omniauth-client/blob/55d2c0ceb60adad839ad1fb821a12b1370437ea8/app/helpers/application_helper.rb | app/helpers/application_helper.rb | module ApplicationHelper
end
| ruby | MIT | 55d2c0ceb60adad839ad1fb821a12b1370437ea8 | 2026-01-04T17:45:40.365736Z | false |
joshsoftware/sso-devise-omniauth-client | https://github.com/joshsoftware/sso-devise-omniauth-client/blob/55d2c0ceb60adad839ad1fb821a12b1370437ea8/app/helpers/home_helper.rb | app/helpers/home_helper.rb | module HomeHelper
end
| ruby | MIT | 55d2c0ceb60adad839ad1fb821a12b1370437ea8 | 2026-01-04T17:45:40.365736Z | false |
joshsoftware/sso-devise-omniauth-client | https://github.com/joshsoftware/sso-devise-omniauth-client/blob/55d2c0ceb60adad839ad1fb821a12b1370437ea8/app/controllers/home_controller.rb | app/controllers/home_controller.rb | class HomeController < ApplicationController
before_filter :login_required#, :except => :index
def index
end
end
| ruby | MIT | 55d2c0ceb60adad839ad1fb821a12b1370437ea8 | 2026-01-04T17:45:40.365736Z | false |
joshsoftware/sso-devise-omniauth-client | https://github.com/joshsoftware/sso-devise-omniauth-client/blob/55d2c0ceb60adad839ad1fb821a12b1370437ea8/app/controllers/user_sessions_controller.rb | app/controllers/user_sessions_controller.rb | class UserSessionsController < ApplicationController
before_filter :login_required, :only => [ :destroy ]
respond_to :html
# omniauth callback method
def create
omniauth = env['omniauth.auth']
logger.debug "+++ #{omniauth}"
user = User.find_by_uid(omniauth['uid'])
if not user
# New user... | ruby | MIT | 55d2c0ceb60adad839ad1fb821a12b1370437ea8 | 2026-01-04T17:45:40.365736Z | false |
joshsoftware/sso-devise-omniauth-client | https://github.com/joshsoftware/sso-devise-omniauth-client/blob/55d2c0ceb60adad839ad1fb821a12b1370437ea8/app/controllers/application_controller.rb | app/controllers/application_controller.rb | class ApplicationController < ActionController::Base
protect_from_forgery
def login_required
if !current_user
respond_to do |format|
format.html {
redirect_to '/auth/joshid'
}
format.json {
render :json => { 'error' => 'Access Denied' }.to_json
}
... | ruby | MIT | 55d2c0ceb60adad839ad1fb821a12b1370437ea8 | 2026-01-04T17:45:40.365736Z | false |
joshsoftware/sso-devise-omniauth-client | https://github.com/joshsoftware/sso-devise-omniauth-client/blob/55d2c0ceb60adad839ad1fb821a12b1370437ea8/app/models/user.rb | app/models/user.rb | class User < ActiveRecord::Base
attr_accessible :uid, :first_name, :last_name
end
| ruby | MIT | 55d2c0ceb60adad839ad1fb821a12b1370437ea8 | 2026-01-04T17:45:40.365736Z | false |
joshsoftware/sso-devise-omniauth-client | https://github.com/joshsoftware/sso-devise-omniauth-client/blob/55d2c0ceb60adad839ad1fb821a12b1370437ea8/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 | 55d2c0ceb60adad839ad1fb821a12b1370437ea8 | 2026-01-04T17:45:40.365736Z | false |
joshsoftware/sso-devise-omniauth-client | https://github.com/joshsoftware/sso-devise-omniauth-client/blob/55d2c0ceb60adad839ad1fb821a12b1370437ea8/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 | 55d2c0ceb60adad839ad1fb821a12b1370437ea8 | 2026-01-04T17:45:40.365736Z | false |
joshsoftware/sso-devise-omniauth-client | https://github.com/joshsoftware/sso-devise-omniauth-client/blob/55d2c0ceb60adad839ad1fb821a12b1370437ea8/db/migrate/20101007212537_create_users.rb | db/migrate/20101007212537_create_users.rb | class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
t.string :uid
t.string :first_name
t.string :last_name
t.string :status
t.timestamps
end
end
def self.down
drop_table :users
end
end
| ruby | MIT | 55d2c0ceb60adad839ad1fb821a12b1370437ea8 | 2026-01-04T17:45:40.365736Z | false |
joshsoftware/sso-devise-omniauth-client | https://github.com/joshsoftware/sso-devise-omniauth-client/blob/55d2c0ceb60adad839ad1fb821a12b1370437ea8/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 | 55d2c0ceb60adad839ad1fb821a12b1370437ea8 | 2026-01-04T17:45:40.365736Z | false |
joshsoftware/sso-devise-omniauth-client | https://github.com/joshsoftware/sso-devise-omniauth-client/blob/55d2c0ceb60adad839ad1fb821a12b1370437ea8/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 | 55d2c0ceb60adad839ad1fb821a12b1370437ea8 | 2026-01-04T17:45:40.365736Z | false |
joshsoftware/sso-devise-omniauth-client | https://github.com/joshsoftware/sso-devise-omniauth-client/blob/55d2c0ceb60adad839ad1fb821a12b1370437ea8/lib/josh_id.rb | lib/josh_id.rb | require 'omniauth-oauth2'
module OmniAuth
module Strategies
class JoshId < OmniAuth::Strategies::OAuth2
CUSTOM_PROVIDER_URL = 'http://localhost:3000'
option :client_options, {
:site => CUSTOM_PROVIDER_URL,
:authorize_url => "#{CUSTOM_PROVIDER_URL}/auth/josh_id/authorize",
:a... | ruby | MIT | 55d2c0ceb60adad839ad1fb821a12b1370437ea8 | 2026-01-04T17:45:40.365736Z | false |
joshsoftware/sso-devise-omniauth-client | https://github.com/joshsoftware/sso-devise-omniauth-client/blob/55d2c0ceb60adad839ad1fb821a12b1370437ea8/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 | 55d2c0ceb60adad839ad1fb821a12b1370437ea8 | 2026-01-04T17:45:40.365736Z | false |
joshsoftware/sso-devise-omniauth-client | https://github.com/joshsoftware/sso-devise-omniauth-client/blob/55d2c0ceb60adad839ad1fb821a12b1370437ea8/config/environment.rb | config/environment.rb | # Load the rails application
require File.expand_path('../application', __FILE__)
require 'josh_id'
# Initialize the rails application
OauthClientDemo::Application.initialize!
| ruby | MIT | 55d2c0ceb60adad839ad1fb821a12b1370437ea8 | 2026-01-04T17:45:40.365736Z | false |
joshsoftware/sso-devise-omniauth-client | https://github.com/joshsoftware/sso-devise-omniauth-client/blob/55d2c0ceb60adad839ad1fb821a12b1370437ea8/config/routes.rb | config/routes.rb | OauthClientDemo::Application.routes.draw do
root :to => 'home#index'
# omniauth
match '/auth/:provider/callback', :to => 'user_sessions#create'
match '/auth/failure', :to => 'user_sessions#failure'
# Custom logout
match '/logout', :to => 'user_sessions#destroy'
end
| ruby | MIT | 55d2c0ceb60adad839ad1fb821a12b1370437ea8 | 2026-01-04T17:45:40.365736Z | false |
joshsoftware/sso-devise-omniauth-client | https://github.com/joshsoftware/sso-devise-omniauth-client/blob/55d2c0ceb60adad839ad1fb821a12b1370437ea8/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 | 55d2c0ceb60adad839ad1fb821a12b1370437ea8 | 2026-01-04T17:45:40.365736Z | false |
joshsoftware/sso-devise-omniauth-client | https://github.com/joshsoftware/sso-devise-omniauth-client/blob/55d2c0ceb60adad839ad1fb821a12b1370437ea8/config/initializers/session_store.rb | config/initializers/session_store.rb | # Be sure to restart your server when you modify this file.
OauthClientDemo::Application.config.session_store :cookie_store, key: '_oauth-client-demo_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 t... | ruby | MIT | 55d2c0ceb60adad839ad1fb821a12b1370437ea8 | 2026-01-04T17:45:40.365736Z | false |
joshsoftware/sso-devise-omniauth-client | https://github.com/joshsoftware/sso-devise-omniauth-client/blob/55d2c0ceb60adad839ad1fb821a12b1370437ea8/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 | 55d2c0ceb60adad839ad1fb821a12b1370437ea8 | 2026-01-04T17:45:40.365736Z | false |
joshsoftware/sso-devise-omniauth-client | https://github.com/joshsoftware/sso-devise-omniauth-client/blob/55d2c0ceb60adad839ad1fb821a12b1370437ea8/config/initializers/omniauth.rb | config/initializers/omniauth.rb | # Change this omniauth configuration to point to your registered provider
# Since this is a registered application, add the app id and secret here
APP_ID = 'YE0NYveQGoFsNLX220Dy5g'
APP_SECRET = 'aqpGBedDnHFyp5MmgT8KErr9D015ScmaY8r3vHg5C0'
CUSTOM_PROVIDER_URL = 'http://localhost:3000'
Rails.application.config.middlewa... | ruby | MIT | 55d2c0ceb60adad839ad1fb821a12b1370437ea8 | 2026-01-04T17:45:40.365736Z | false |
joshsoftware/sso-devise-omniauth-client | https://github.com/joshsoftware/sso-devise-omniauth-client/blob/55d2c0ceb60adad839ad1fb821a12b1370437ea8/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 | 55d2c0ceb60adad839ad1fb821a12b1370437ea8 | 2026-01-04T17:45:40.365736Z | false |
joshsoftware/sso-devise-omniauth-client | https://github.com/joshsoftware/sso-devise-omniauth-client/blob/55d2c0ceb60adad839ad1fb821a12b1370437ea8/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 | 55d2c0ceb60adad839ad1fb821a12b1370437ea8 | 2026-01-04T17:45:40.365736Z | false |
joshsoftware/sso-devise-omniauth-client | https://github.com/joshsoftware/sso-devise-omniauth-client/blob/55d2c0ceb60adad839ad1fb821a12b1370437ea8/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 | 55d2c0ceb60adad839ad1fb821a12b1370437ea8 | 2026-01-04T17:45:40.365736Z | false |
joshsoftware/sso-devise-omniauth-client | https://github.com/joshsoftware/sso-devise-omniauth-client/blob/55d2c0ceb60adad839ad1fb821a12b1370437ea8/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 | 55d2c0ceb60adad839ad1fb821a12b1370437ea8 | 2026-01-04T17:45:40.365736Z | false |
joshsoftware/sso-devise-omniauth-client | https://github.com/joshsoftware/sso-devise-omniauth-client/blob/55d2c0ceb60adad839ad1fb821a12b1370437ea8/config/environments/test.rb | config/environments/test.rb | OauthClientDemo::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... | ruby | MIT | 55d2c0ceb60adad839ad1fb821a12b1370437ea8 | 2026-01-04T17:45:40.365736Z | false |
joshsoftware/sso-devise-omniauth-client | https://github.com/joshsoftware/sso-devise-omniauth-client/blob/55d2c0ceb60adad839ad1fb821a12b1370437ea8/config/environments/development.rb | config/environments/development.rb | OauthClientDemo::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 th... | ruby | MIT | 55d2c0ceb60adad839ad1fb821a12b1370437ea8 | 2026-01-04T17:45:40.365736Z | false |
joshsoftware/sso-devise-omniauth-client | https://github.com/joshsoftware/sso-devise-omniauth-client/blob/55d2c0ceb60adad839ad1fb821a12b1370437ea8/config/environments/production.rb | config/environments/production.rb | OauthClientDemo::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
confi... | ruby | MIT | 55d2c0ceb60adad839ad1fb821a12b1370437ea8 | 2026-01-04T17:45:40.365736Z | false |
alehander92/hivemind | https://github.com/alehander92/hivemind/blob/8a0727078b566b5dbfffcc2e97465e4132092a47/spec/spec_helper.rb | spec/spec_helper.rb | # well, really, no time for a lot of tests now
# dirty fast prototyping
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'rspec'
require 'hivemind'
| ruby | MIT | 8a0727078b566b5dbfffcc2e97465e4132092a47 | 2026-01-04T17:45:40.296119Z | false |
alehander92/hivemind | https://github.com/alehander92/hivemind/blob/8a0727078b566b5dbfffcc2e97465e4132092a47/spec/hivemind/vm_spec.rb | spec/hivemind/vm_spec.rb | require 'spec_helper'
module Hivemind
describe VM do
it 'should work for a program with a single number' do
vm = VM.new UniversalAST::Number.new(44)
expect(vm.run(Runtime::HivemindEnv).data[:_value]).to eq 44
end
end
end
| ruby | MIT | 8a0727078b566b5dbfffcc2e97465e4132092a47 | 2026-01-04T17:45:40.296119Z | false |
alehander92/hivemind | https://github.com/alehander92/hivemind/blob/8a0727078b566b5dbfffcc2e97465e4132092a47/spec/hivemind/universal_ast_spec.rb | spec/hivemind/universal_ast_spec.rb | require 'spec_helper'
module Hivemind
module UniversalAST
describe Element do
it 'fields initializes a class with given labels' do
class A < Element
fields :a
end
expect(A.new(2).a).to eq(2)
end
end
describe ModuleStatement do
it 'is initi... | ruby | MIT | 8a0727078b566b5dbfffcc2e97465e4132092a47 | 2026-01-04T17:45:40.296119Z | false |
alehander92/hivemind | https://github.com/alehander92/hivemind/blob/8a0727078b566b5dbfffcc2e97465e4132092a47/spec/hivemind/parser_spec.rb | spec/hivemind/parser_spec.rb | ruby | MIT | 8a0727078b566b5dbfffcc2e97465e4132092a47 | 2026-01-04T17:45:40.296119Z | false | |
alehander92/hivemind | https://github.com/alehander92/hivemind/blob/8a0727078b566b5dbfffcc2e97465e4132092a47/lib/hivemind.rb | lib/hivemind.rb | require_relative 'hivemind/universal_ast'
require_relative 'hivemind/environment'
require_relative 'hivemind/vm'
require_relative 'hivemind/runtime'
require_relative 'hivemind/syntax'
require_relative 'hivemind/renderer'
| ruby | MIT | 8a0727078b566b5dbfffcc2e97465e4132092a47 | 2026-01-04T17:45:40.296119Z | false |
alehander92/hivemind | https://github.com/alehander92/hivemind/blob/8a0727078b566b5dbfffcc2e97465e4132092a47/lib/hivemind/combinators.rb | lib/hivemind/combinators.rb | require_relative 'universal_ast'
class Combinator
def &(other)
And.new(self, other)
end
def |(other)
Or.new(self, other)
end
end
class Lit < Combinator
attr_reader :value
def initialize(value)
@value = value
end
def parse(input, refs)
if input.start_with?(@value)
[true, @value... | ruby | MIT | 8a0727078b566b5dbfffcc2e97465e4132092a47 | 2026-01-04T17:45:40.296119Z | false |
alehander92/hivemind | https://github.com/alehander92/hivemind/blob/8a0727078b566b5dbfffcc2e97465e4132092a47/lib/hivemind/syntax.rb | lib/hivemind/syntax.rb | require_relative 'combinators'
module Hivemind
# BaseGrammar = Phoenix::Grammar.new
# BaseGrammar.rules = {
# segment: many(ref(:keyword_structure), as: :elements),
# keyword_structure: ref(:module) | ref(:class) | ref(:method),
# method: lit('module') & some(ws) & ref(:name, as: :module_name) &
# ... | ruby | MIT | 8a0727078b566b5dbfffcc2e97465e4132092a47 | 2026-01-04T17:45:40.296119Z | false |
alehander92/hivemind | https://github.com/alehander92/hivemind/blob/8a0727078b566b5dbfffcc2e97465e4132092a47/lib/hivemind/environment.rb | lib/hivemind/environment.rb | require_relative 'errors'
module Hivemind
class Environment
attr_reader :parent, :values, :top
attr_accessor :current_self
def initialize(parent, **values)
@parent, @values, @top = parent, values, (parent.nil? ? values : parent.top)
end
def [](key)
value = fetch key
return val... | ruby | MIT | 8a0727078b566b5dbfffcc2e97465e4132092a47 | 2026-01-04T17:45:40.296119Z | false |
alehander92/hivemind | https://github.com/alehander92/hivemind/blob/8a0727078b566b5dbfffcc2e97465e4132092a47/lib/hivemind/errors.rb | lib/hivemind/errors.rb | module Hivemind
class HivemindMissingNameError < StandardError
end
class HivemindAccessError < StandardError
end
end
| ruby | MIT | 8a0727078b566b5dbfffcc2e97465e4132092a47 | 2026-01-04T17:45:40.296119Z | false |
alehander92/hivemind | https://github.com/alehander92/hivemind/blob/8a0727078b566b5dbfffcc2e97465e4132092a47/lib/hivemind/vm.rb | lib/hivemind/vm.rb | require_relative 'runtime'
require_relative 'universal_ast'
module Hivemind
class VM
def initialize(ast)
@ast = ast
end
def run(env)
@ast.run env
end
end
class Runtime::HivemindObject
def call(function, args, env)
if function.is_a?(UniversalAST::MethodStatement)
ar... | ruby | MIT | 8a0727078b566b5dbfffcc2e97465e4132092a47 | 2026-01-04T17:45:40.296119Z | false |
alehander92/hivemind | https://github.com/alehander92/hivemind/blob/8a0727078b566b5dbfffcc2e97465e4132092a47/lib/hivemind/universal_ast.rb | lib/hivemind/universal_ast.rb | module Hivemind
module UniversalAST
class Element
def self.fields(*labels)
define_method(:initialize) do |*args|
args.zip(labels).each do |arg, label|
instance_variable_set "@#{label}", arg
end
end
attr_reader *labels
end
def offset(depth)... | ruby | MIT | 8a0727078b566b5dbfffcc2e97465e4132092a47 | 2026-01-04T17:45:40.296119Z | false |
alehander92/hivemind | https://github.com/alehander92/hivemind/blob/8a0727078b566b5dbfffcc2e97465e4132092a47/lib/hivemind/code_viewer.rb | lib/hivemind/code_viewer.rb | # 'universal_ast'
# module Hivemind
# class CodeViewer
# def initialize(tree)
# @tree = tree
# end
# def view_as(query)
# hierarchy = QueryAnalyzer.parse(query)
# rebuild_tree(hierarchy)
# end
# def rebuild_tree(hierarchy)
# if hierarchy[0].type == @code_view.hierarchy[... | ruby | MIT | 8a0727078b566b5dbfffcc2e97465e4132092a47 | 2026-01-04T17:45:40.296119Z | false |
alehander92/hivemind | https://github.com/alehander92/hivemind/blob/8a0727078b566b5dbfffcc2e97465e4132092a47/lib/hivemind/runtime.rb | lib/hivemind/runtime.rb | require_relative 'environment'
module Hivemind
module Runtime
class HivemindObject
attr_reader :data, :klass
def initialize(data, klass)
@data, @klass = data, klass
end
end
class HivemindClass
attr_reader :label, :methods, :parent
def initialize(label, parent = nil... | ruby | MIT | 8a0727078b566b5dbfffcc2e97465e4132092a47 | 2026-01-04T17:45:40.296119Z | false |
alehander92/hivemind | https://github.com/alehander92/hivemind/blob/8a0727078b566b5dbfffcc2e97465e4132092a47/lib/hivemind/renderer.rb | lib/hivemind/renderer.rb | require_relative 'syntax'
module Hivemind
BASE_RULES = {
image: -> element, depth = 0 do
element.statements.map { |s| render_element(s) }.join("\n")
end,
int: -> element, depth = 0 do
element.value.to_s
end,
float: -> element, depth = 0 do
element.value.to_s
end,
s... | ruby | MIT | 8a0727078b566b5dbfffcc2e97465e4132092a47 | 2026-01-04T17:45:40.296119Z | false |
maier/vagrant-alpine | https://github.com/maier/vagrant-alpine/blob/1cc9ec72c7438a5eba006369fba8fb8e53725f81/spec/guest_spec.rb | spec/guest_spec.rb | require 'vagrant-alpine/guest'
require 'vagrant-alpine/plugin'
require 'vagrant-alpine/cap/change_host_name'
require 'vagrant-alpine/cap/configure_networks'
require 'vagrant-alpine/cap/halt'
require 'vagrant-alpine/cap/rsync'
require 'vagrant-alpine/cap/nfs_client'
describe VagrantPlugins::GuestAlpine::Plugin do
i... | ruby | MIT | 1cc9ec72c7438a5eba006369fba8fb8e53725f81 | 2026-01-04T17:45:45.365621Z | false |
maier/vagrant-alpine | https://github.com/maier/vagrant-alpine/blob/1cc9ec72c7438a5eba006369fba8fb8e53725f81/spec/spec_helper.rb | spec/spec_helper.rb | require 'vagrant'
require 'support/dummy_communicator'
| ruby | MIT | 1cc9ec72c7438a5eba006369fba8fb8e53725f81 | 2026-01-04T17:45:45.365621Z | false |
maier/vagrant-alpine | https://github.com/maier/vagrant-alpine/blob/1cc9ec72c7438a5eba006369fba8fb8e53725f81/spec/support/dummy_communicator.rb | spec/support/dummy_communicator.rb | module VagrantTests
module DummyCommunicator
class Communicator < Vagrant.plugin("2", :communicator)
def ready?
true
end
attr_reader :known_commands
def initialize(machine)
@known_commands = Hash.new do |hash, key|
hash[key] = { expected: 0, received: 0, respons... | ruby | MIT | 1cc9ec72c7438a5eba006369fba8fb8e53725f81 | 2026-01-04T17:45:45.365621Z | false |
maier/vagrant-alpine | https://github.com/maier/vagrant-alpine/blob/1cc9ec72c7438a5eba006369fba8fb8e53725f81/spec/cap/halt_spec.rb | spec/cap/halt_spec.rb |
require 'spec_helper'
describe 'VagrantPlugins::GuestAlpine::Cap::Halt' do
let(:described_class) do
VagrantPlugins::GuestAlpine::Plugin.components.guest_capabilities[:alpine].get(:halt)
end
let(:machine) { double('machine') }
let(:communicator) { VagrantTests::DummyCommunicator::Communicator.n... | ruby | MIT | 1cc9ec72c7438a5eba006369fba8fb8e53725f81 | 2026-01-04T17:45:45.365621Z | false |
maier/vagrant-alpine | https://github.com/maier/vagrant-alpine/blob/1cc9ec72c7438a5eba006369fba8fb8e53725f81/spec/cap/configure_networks_spec.rb | spec/cap/configure_networks_spec.rb |
require 'spec_helper'
describe 'VagrantPlugins::GuestAlpine::Cap::ConfigureNetworks' do
let(:described_class) do
VagrantPlugins::GuestAlpine::Plugin.components.guest_capabilities[:alpine].get(:configure_networks)
end
let(:machine) { double('machine') }
let(:communicator) { VagrantTests::DummyC... | ruby | MIT | 1cc9ec72c7438a5eba006369fba8fb8e53725f81 | 2026-01-04T17:45:45.365621Z | false |
maier/vagrant-alpine | https://github.com/maier/vagrant-alpine/blob/1cc9ec72c7438a5eba006369fba8fb8e53725f81/spec/cap/change_host_name_spec.rb | spec/cap/change_host_name_spec.rb |
require 'spec_helper'
describe 'VagrantPlugins::GuestAlpine::Cap::ChangeHostname' do
let(:described_class) do
VagrantPlugins::GuestAlpine::Plugin.components.guest_capabilities[:alpine].get(:change_host_name)
end
let(:machine) { double('machine') }
let(:communicator) { VagrantTests::DummyCommun... | ruby | MIT | 1cc9ec72c7438a5eba006369fba8fb8e53725f81 | 2026-01-04T17:45:45.365621Z | false |
maier/vagrant-alpine | https://github.com/maier/vagrant-alpine/blob/1cc9ec72c7438a5eba006369fba8fb8e53725f81/spec/cap/nfs_client_spec.rb | spec/cap/nfs_client_spec.rb |
require 'spec_helper'
describe 'VagrantPlugins::GuestAlpine::Cap::NFSClient' do
let(:described_class) do
VagrantPlugins::GuestAlpine::Plugin.components.guest_capabilities[:alpine].get(:nfs_client_install)
end
let(:machine) { double('machine') }
let(:communicator) { VagrantTests::DummyCommunic... | ruby | MIT | 1cc9ec72c7438a5eba006369fba8fb8e53725f81 | 2026-01-04T17:45:45.365621Z | false |
maier/vagrant-alpine | https://github.com/maier/vagrant-alpine/blob/1cc9ec72c7438a5eba006369fba8fb8e53725f81/spec/cap/rsync_spec.rb | spec/cap/rsync_spec.rb |
require 'spec_helper'
describe 'VagrantPlugins::GuestAlpine::Cap::RSync' do
let(:machine) { double('machine') }
let(:communicator) { VagrantTests::DummyCommunicator::Communicator.new(machine) }
before do
allow(machine).to receive(:communicate).and_return(communicator)
end
after do
... | ruby | MIT | 1cc9ec72c7438a5eba006369fba8fb8e53725f81 | 2026-01-04T17:45:45.365621Z | false |
maier/vagrant-alpine | https://github.com/maier/vagrant-alpine/blob/1cc9ec72c7438a5eba006369fba8fb8e53725f81/lib/vagrant-alpine.rb | lib/vagrant-alpine.rb | # rubocop:disable Style/FileName
#
# squelch:
# lib/vagrant-alpine.rb:1:1: C: Use snake_case for source file names.
# require 'pathname'
#
require 'pathname'
require 'vagrant-alpine/plugin'
module VagrantPlugins
module GuestAlpine
# lib_path = Pathname.new(File.expand_path('../vagrant-alpine', __FILE__))
# a... | ruby | MIT | 1cc9ec72c7438a5eba006369fba8fb8e53725f81 | 2026-01-04T17:45:45.365621Z | false |
maier/vagrant-alpine | https://github.com/maier/vagrant-alpine/blob/1cc9ec72c7438a5eba006369fba8fb8e53725f81/lib/vagrant-alpine/version.rb | lib/vagrant-alpine/version.rb | module VagrantPlugins
# Alpine Linux guest gem + plugin version
module GuestAlpine
VERSION = '0.4.0'
end
end
| ruby | MIT | 1cc9ec72c7438a5eba006369fba8fb8e53725f81 | 2026-01-04T17:45:45.365621Z | false |
maier/vagrant-alpine | https://github.com/maier/vagrant-alpine/blob/1cc9ec72c7438a5eba006369fba8fb8e53725f81/lib/vagrant-alpine/plugin.rb | lib/vagrant-alpine/plugin.rb | begin
require 'vagrant'
rescue LoadError
raise 'The Vagrant Alpine Linux Guest plugin must be run within Vagrant.'
end
if Vagrant::VERSION < '1.7.0'
fail 'The vagrant-alpine plugin is only compatible with Vagrant 1.7+'
end
module VagrantPlugins
module GuestAlpine
class Plugin < Vagrant.plugin('2')
n... | ruby | MIT | 1cc9ec72c7438a5eba006369fba8fb8e53725f81 | 2026-01-04T17:45:45.365621Z | false |
maier/vagrant-alpine | https://github.com/maier/vagrant-alpine/blob/1cc9ec72c7438a5eba006369fba8fb8e53725f81/lib/vagrant-alpine/guest.rb | lib/vagrant-alpine/guest.rb | begin
require 'vagrant'
rescue LoadError
raise 'The Vagrant Alpine Linux Guest plugin must be run within Vagrant.'
end
if Vagrant::VERSION < '1.7.0'
fail 'The vagrant-alpine plugin is only compatible with Vagrant 1.7+'
end
module VagrantPlugins
module GuestAlpine
class Guest < Vagrant.plugin('2', :guest)
... | ruby | MIT | 1cc9ec72c7438a5eba006369fba8fb8e53725f81 | 2026-01-04T17:45:45.365621Z | false |
maier/vagrant-alpine | https://github.com/maier/vagrant-alpine/blob/1cc9ec72c7438a5eba006369fba8fb8e53725f81/lib/vagrant-alpine/cap/rsync.rb | lib/vagrant-alpine/cap/rsync.rb | module VagrantPlugins
module GuestAlpine
module Cap
class RSync
def self.rsync_installed(machine)
machine.communicate.test('test -f /usr/bin/rsync')
end
def self.rsync_install(machine)
machine.communicate.tap do |comm|
comm.sudo('apk add rsync')
... | ruby | MIT | 1cc9ec72c7438a5eba006369fba8fb8e53725f81 | 2026-01-04T17:45:45.365621Z | false |
maier/vagrant-alpine | https://github.com/maier/vagrant-alpine/blob/1cc9ec72c7438a5eba006369fba8fb8e53725f81/lib/vagrant-alpine/cap/halt.rb | lib/vagrant-alpine/cap/halt.rb | # rubocop:disable Style/RedundantBegin
# rubocop:disable Lint/HandleExceptions
#
# FIXME: address disabled warnings
#
module VagrantPlugins
module GuestAlpine
module Cap
class Halt
def self.halt(machine)
begin
machine.communicate.sudo('poweroff')
rescue Net::SSH::Disc... | ruby | MIT | 1cc9ec72c7438a5eba006369fba8fb8e53725f81 | 2026-01-04T17:45:45.365621Z | false |
maier/vagrant-alpine | https://github.com/maier/vagrant-alpine/blob/1cc9ec72c7438a5eba006369fba8fb8e53725f81/lib/vagrant-alpine/cap/configure_networks.rb | lib/vagrant-alpine/cap/configure_networks.rb | # rubocop:disable Metrics/MethodLength
# rubocop:disable Metrics/AbcSize
# rubocop:disable Style/BracesAroundHashParameters
#
# FIXME: address disabled warnings
#
require 'set'
require 'tempfile'
require 'pathname'
require 'vagrant/util/template_renderer'
module VagrantPlugins
module GuestAlpine
module Cap
... | ruby | MIT | 1cc9ec72c7438a5eba006369fba8fb8e53725f81 | 2026-01-04T17:45:45.365621Z | false |
maier/vagrant-alpine | https://github.com/maier/vagrant-alpine/blob/1cc9ec72c7438a5eba006369fba8fb8e53725f81/lib/vagrant-alpine/cap/change_host_name.rb | lib/vagrant-alpine/cap/change_host_name.rb | module VagrantPlugins
module GuestAlpine
module Cap
class ChangeHostName
def self.change_host_name(machine, name)
new(machine, name).change!
end
attr_reader :machine, :new_hostname
def initialize(machine, new_hostname)
@machine = machine
@new_h... | ruby | MIT | 1cc9ec72c7438a5eba006369fba8fb8e53725f81 | 2026-01-04T17:45:45.365621Z | false |
maier/vagrant-alpine | https://github.com/maier/vagrant-alpine/blob/1cc9ec72c7438a5eba006369fba8fb8e53725f81/lib/vagrant-alpine/cap/nfs_client.rb | lib/vagrant-alpine/cap/nfs_client.rb | module VagrantPlugins
module GuestAlpine
module Cap
class NFSClient
def self.nfs_client_install(machine)
comm = machine.communicate
comm.sudo <<-EOS.gsub(/^\s+\|\s?/, '')
| # work around defunct repository in configu... | ruby | MIT | 1cc9ec72c7438a5eba006369fba8fb8e53725f81 | 2026-01-04T17:45:45.365621Z | false |
maier/vagrant-alpine | https://github.com/maier/vagrant-alpine/blob/1cc9ec72c7438a5eba006369fba8fb8e53725f81/lib/vagrant-alpine/cap/smb.rb | lib/vagrant-alpine/cap/smb.rb | module VagrantPlugins
module GuestAlpine
module Cap
class SMB
def self.smb_install(machine)
machine.communicate.tap do |comm|
comm.sudo('apk add cifs-utils')
end
end
end
end
end
end | ruby | MIT | 1cc9ec72c7438a5eba006369fba8fb8e53725f81 | 2026-01-04T17:45:45.365621Z | false |
netlify/jekyll-srcset | https://github.com/netlify/jekyll-srcset/blob/ad7730dea2e3d4e03f8878e2b8fba8123cd06834/lib/jekyll-srcset.rb | lib/jekyll-srcset.rb | require "jekyll/srcset"
Liquid::Template.register_tag('image_tag', Jekyll::SrcsetTag)
| ruby | MIT | ad7730dea2e3d4e03f8878e2b8fba8123cd06834 | 2026-01-04T17:45:46.319190Z | false |
netlify/jekyll-srcset | https://github.com/netlify/jekyll-srcset/blob/ad7730dea2e3d4e03f8878e2b8fba8123cd06834/lib/jekyll/srcset.rb | lib/jekyll/srcset.rb | require "jekyll/srcset/version"
require "jekyll/srcset/tag"
require "jekyll"
module Jekyll
module Srcset
end
end
| ruby | MIT | ad7730dea2e3d4e03f8878e2b8fba8123cd06834 | 2026-01-04T17:45:46.319190Z | false |
netlify/jekyll-srcset | https://github.com/netlify/jekyll-srcset/blob/ad7730dea2e3d4e03f8878e2b8fba8123cd06834/lib/jekyll/srcset/tag.rb | lib/jekyll/srcset/tag.rb | require "RMagick"
require "digest/sha1"
module Jekyll
class SrcsetTag < Liquid::Tag
include Magick
attr_accessor :markup
def self.optipng?
@optinpng ||= system("which optipng")
end
def initialize(tag_name, markup, _)
@markup = markup
super
end
def render(context)
... | ruby | MIT | ad7730dea2e3d4e03f8878e2b8fba8123cd06834 | 2026-01-04T17:45:46.319190Z | false |
netlify/jekyll-srcset | https://github.com/netlify/jekyll-srcset/blob/ad7730dea2e3d4e03f8878e2b8fba8123cd06834/lib/jekyll/srcset/version.rb | lib/jekyll/srcset/version.rb | module Jekyll
module Srcset
VERSION = "0.1.3"
end
end
| ruby | MIT | ad7730dea2e3d4e03f8878e2b8fba8123cd06834 | 2026-01-04T17:45:46.319190Z | false |
gitviola/ynab-bank-importer | https://github.com/gitviola/ynab-bank-importer/blob/d69e289b8136861c4504f50d68843e9abab5bf1e/run.rb | run.rb | require 'yaml'
require 'ynab'
Dir[File.dirname(__FILE__) + '/lib/*.rb'].each { |f| require f }
Dir[File.join('.', 'lib/**/*.rb')].each { |f| require f }
# Gathering transactions
transactions =
Settings.all['accounts'].map do |a|
account = Account.new(a)
account.fetch_transactions
account.transactions
... | ruby | MIT | d69e289b8136861c4504f50d68843e9abab5bf1e | 2026-01-04T17:45:50.785060Z | false |
gitviola/ynab-bank-importer | https://github.com/gitviola/ynab-bank-importer/blob/d69e289b8136861c4504f50d68843e9abab5bf1e/spec/transaction_creator_spec.rb | spec/transaction_creator_spec.rb | RSpec.describe TransactionCreator do
VCR_OPTIONS = { match_requests_on: %i[method host path] }.freeze
describe '.call' do
subject(:call) do
described_class.call(
account_id: '123456789',
date: current_time,
payee_name: 'Payee',
payee_iban: 'IBAN',
category_name: ni... | ruby | MIT | d69e289b8136861c4504f50d68843e9abab5bf1e | 2026-01-04T17:45:50.785060Z | false |
gitviola/ynab-bank-importer | https://github.com/gitviola/ynab-bank-importer/blob/d69e289b8136861c4504f50d68843e9abab5bf1e/spec/spec_helper.rb | spec/spec_helper.rb | require 'vcr'
ENV['ENV'] = 'test'
Dir[File.dirname(__FILE__) + '/lib/*.rb'].each { |f| require f }
Dir[File.join('.', 'lib/**/*.rb')].each { |f| require f }
VCR.configure do |config|
config.cassette_library_dir = 'spec/fixtures/vcr_cassettes'
config.hook_into :webmock
config.configure_rspec_metadata!
config.... | ruby | MIT | d69e289b8136861c4504f50d68843e9abab5bf1e | 2026-01-04T17:45:50.785060Z | false |
gitviola/ynab-bank-importer | https://github.com/gitviola/ynab-bank-importer/blob/d69e289b8136861c4504f50d68843e9abab5bf1e/spec/dumper/n26_spec.rb | spec/dumper/n26_spec.rb | vcr_options = { cassette_name: 'dumper/n26',
record: :none,
match_requests_on: %i[method host path] }
RSpec.describe Dumper::N26, vcr: vcr_options do
subject(:object) { Dumper::N26.new(params) }
let(:skip_pending_transactions) { false }
let(:params) do
{
'ynab_id' => '1... | ruby | MIT | d69e289b8136861c4504f50d68843e9abab5bf1e | 2026-01-04T17:45:50.785060Z | false |
gitviola/ynab-bank-importer | https://github.com/gitviola/ynab-bank-importer/blob/d69e289b8136861c4504f50d68843e9abab5bf1e/lib/error_message.rb | lib/error_message.rb | # Used to print out friendly error messages that help the user
# understand what went wrong and how to solve it
class ErrorMessage
require 'colorize'
def initialize(e)
@e = e
end
def print
puts summary
puts heading('Returned error message:')
puts message
puts heading('What you can do about... | ruby | MIT | d69e289b8136861c4504f50d68843e9abab5bf1e | 2026-01-04T17:45:50.785060Z | false |
gitviola/ynab-bank-importer | https://github.com/gitviola/ynab-bank-importer/blob/d69e289b8136861c4504f50d68843e9abab5bf1e/lib/account.rb | lib/account.rb | # Represents a real bank account but maps it with a YNAB account
# Uses the correct dumper to fetch the transactions.
class Account
attr_accessor :dumper, :iban, :ynab_id, :transactions
def initialize(params = {})
@dumper = Dumper.get_dumper(params.fetch('dumper'))
@iban = normalize_iban(params.fetch... | ruby | MIT | d69e289b8136861c4504f50d68843e9abab5bf1e | 2026-01-04T17:45:50.785060Z | false |
gitviola/ynab-bank-importer | https://github.com/gitviola/ynab-bank-importer/blob/d69e289b8136861c4504f50d68843e9abab5bf1e/lib/settings.rb | lib/settings.rb | # Reads the settings from the yaml file
class Settings
def self.all
@settings ||= begin
if ENV['ENV'] == 'test'
YAML.load_file(File.join('.', 'spec/config.test.yml'))
else
YAML.load_file(File.join('.', 'config.yml'))
end
end
end
end
| ruby | MIT | d69e289b8136861c4504f50d68843e9abab5bf1e | 2026-01-04T17:45:50.785060Z | false |
gitviola/ynab-bank-importer | https://github.com/gitviola/ynab-bank-importer/blob/d69e289b8136861c4504f50d68843e9abab5bf1e/lib/dumper.rb | lib/dumper.rb | # Uses methods that need to be implemented by each dumper -
# this is to enforce consitency.
class Dumper
def self.get_dumper(name)
case name
when :bbva
Dumper::Bbva
when :n26
Dumper::N26
when :fints
Dumper::Fints
else
raise "Dumper \"#{name}\" not supported."
end
end... | ruby | MIT | d69e289b8136861c4504f50d68843e9abab5bf1e | 2026-01-04T17:45:50.785060Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.