source
stringclasses
1 value
repo
stringlengths
5
63
repo_url
stringlengths
24
82
path
stringlengths
5
167
language
stringclasses
1 value
license
stringclasses
5 values
stars
int64
10
51.4k
ref
stringclasses
23 values
size_bytes
int64
200
258k
text
stringlengths
137
258k
github
rubaidh/rubaidhstrano
https://github.com/rubaidh/rubaidhstrano
recipes/multistage.rb
Ruby
mit
89
master
2,145
# This code has been chowned and modified from the capistrano-ext gem by Jamis # Buck and the following license applies: # # Copyright (c) 2006 Jamis Buck # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in...
github
rubaidh/rubaidhstrano
https://github.com/rubaidh/rubaidhstrano
recipes/tags.rb
Ruby
mit
89
master
682
set :git_remote, "origin" namespace :tags do desc <<-TEXT Tag the (git) repository with the release name and push that tag back upstream. This is double-entry book keeping. The actual deployment knows what revision was deployed (from the REVISION file) and the git repository also knows from the tag. ...
github
rubaidh/rubaidhstrano
https://github.com/rubaidh/rubaidhstrano
recipes/gems.rb
Ruby
mit
89
master
379
namespace :gems do desc <<-TEXT Build any binary gems that need compilation. This does require that your deployment environment have the right build tools installed. TEXT task :build, :except => { :no_release => true } do rubaidh_run_rake "gems:build" end end on :load do if fetch(:build_gems, fal...
github
rubaidh/rubaidhstrano
https://github.com/rubaidh/rubaidhstrano
recipes/utils.rb
Ruby
mit
89
master
924
# Run rake on the remote server(s), using the version of rake that has been # specified (defaulting to whatever is in the path) and the correct RAILS_ENV # (defaulting to production if not specified). Pass in one or more tasks to # run. This always runs tasks against the latest release, so it's only valid # to use af...
github
rubaidh/rubaidhstrano
https://github.com/rubaidh/rubaidhstrano
recipes/databases.rb
Ruby
mit
89
master
1,293
namespace :db do desc <<-DESC Back up the database from the deployment environment. This task dumps the MySQL database in the current deployment environment out to an SQL dump file which is bzip compressed. It will overwrite any existing backup from there. DESC task :backup, :roles => :db, :only =...
github
rubaidh/rubaidhstrano
https://github.com/rubaidh/rubaidhstrano
recipes/defaults.rb
Ruby
mit
89
master
1,249
# Some defaults, based upon how we tend to work. # Repository defaults set :scm, :git set :git_enable_submodules, true set(:repository) { "git@github.com:rubaidh/#{application}.git" } set :deploy_via, :remote_cache # Deployment configuration set :daemon_strategy, :passenger set(:user) { application.gsub('_', '') } se...
github
rubaidh/rubaidhstrano
https://github.com/rubaidh/rubaidhstrano
recipes/assets.rb
Ruby
mit
89
master
2,096
set :asset_directories, [] set(:shared_assets_path) { File.join(shared_path, 'assets') } namespace :assets do desc "Compress javascripts and stylesheets" task :compress, :except => { :no_release => true } do rubaidh_run_rake "assets:compress" end namespace :directories do desc "[internal] Create all t...
github
rubaidh/rubaidhstrano
https://github.com/rubaidh/rubaidhstrano
recipes/replicate.rb
Ruby
mit
89
master
993
desc <<-TEXT Clone the deployment environment to your current environment. This will back up the current database and any assets from the production environment, copy them locally and load them. WARNING: This will totally and utterly destroy the current data contents of your local environment. Don't do this unless you'...
github
rubaidh/rubaidhstrano
https://github.com/rubaidh/rubaidhstrano
recipes/cache.rb
Ruby
mit
89
master
616
namespace :deploy do namespace :cache do namespace :code do desc <<-TEXT Remove the cached copy of the code. This can sometimes be helpful when, for example, you've changed the upstream location of a git submodule. Git doesn't seem to want to update its working copy with that...
github
rubaidh/rubaidhstrano
https://github.com/rubaidh/rubaidhstrano
recipes/daemon_strategies/passenger.rb
Ruby
mit
89
master
901
namespace :deploy do desc <<-DESC Start the application servers. Since the app servers are managed through Phusion Passenger, this is a no-op. DESC task :start, :roles => :app do; end desc <<-DESC Stop the application servers. Since the app servers are managed through Phusion Passenger, this is...
github
rubaidh/rubaidhstrano
https://github.com/rubaidh/rubaidhstrano
tasks/databases.rake
Ruby
mit
89
master
1,647
namespace :db do namespace :backup do desc "Dumps the database for the current environment into db/env-data.sql.bz2." task :dump => :environment do abc = ActiveRecord::Base.configurations[RAILS_ENV] case abc['adapter'] when 'mysql' cmd = ['mysqldump'] cmd << "--host='#{abc['h...
github
rubaidh/rubaidhstrano
https://github.com/rubaidh/rubaidhstrano
tasks/assets.rake
Ruby
mit
89
master
1,831
namespace :assets do desc <<-TEXT Compress static assets so they can be be served more quickly. This task will take all javascript and CSS stylesheets, and minify them to reduce their size, using the YUI Compressor. WARNING: It will overwrite the existing copies of the files. Please don't check the m...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
gitnesse.gemspec
Ruby
mit
89
master
1,122
# -*- encoding: utf-8 -*- require File.expand_path '../lib/gitnesse/version', __FILE__ Gem::Specification.new do |spec| spec.name = "gitnesse" spec.version = Gitnesse::VERSION spec.authors = ["www.hybridgroup.com"] spec.email = ["info@hybridgroup.com"] spec.description = %q{Git...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
lib/gitnesse.rb
Ruby
mit
89
master
373
require 'gitnesse/version' require 'gitnesse/config' require 'gitnesse/config_loader' require 'gitnesse/dependency_checker' require 'gitnesse/feature' require 'gitnesse/feature_extractor' require 'gitnesse/feature_transform' require 'gitnesse/dir_manager' require 'gitnesse/wiki' require 'gitnesse/hooks' require 'gitne...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
lib/gitnesse/dependency_checker.rb
Ruby
mit
89
master
2,184
module Gitnesse class DependencyChecker attr_reader :errors def initialize @errors = [] end def check check_git check_cucumber check_repository_url check_identifier check_features_dir_exists display_errors if @errors.any? end def add_error(message)...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
lib/gitnesse/feature_transform.rb
Ruby
mit
89
master
606
module Gitnesse class FeatureTransform # Converts a Cucumber feature into a Markdown string compatible with # Github's Wiki system # # feature - Cucumber feature to convert to Markdown # # Returns a string def self.convert(feature) unless feature.scan(/^\s*?Feature\:(.+?)\n/).flatte...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
lib/gitnesse/dir_manager.rb
Ruby
mit
89
master
1,026
require 'fileutils' require 'etc' module Gitnesse class DirManager class << self # Public: Checks/Creates ~/.gitnesse/{{project_name}} dir. # The project name is derived from the folder gitnesse is run in. # # Returns the path to the created project dir def make_project_dir ...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
lib/gitnesse/cli.rb
Ruby
mit
89
master
954
require 'gitnesse' require 'optparse' require 'optparse/version' require 'gitnesse/cli/task' module Gitnesse class Cli attr_accessor :out, :parser def initialize(out = STDOUT) @out = out setup_parser end def parse(args = ARGV) # gitnesse run will pass all arguments onto cucumber...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
lib/gitnesse/wiki.rb
Ruby
mit
89
master
3,596
Dir[File.dirname(__FILE__) + "/wiki/*.rb"].each { |f| require(f) } require 'git' module Gitnesse class Wiki attr_reader :repo, :pages, :dir # Public: Clones/updates a wiki in the provided dir # # url - cloneable URL for wiki repository # dir - directory to clone git wiki into # opts - hash ...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
lib/gitnesse/config.rb
Ruby
mit
89
master
1,995
require 'singleton' module Gitnesse class Config include Singleton ConfigStruct = Struct.new :repository_url, :features_dir, :branch, :annotate_results, :identifier # Config Options: # # repository_url - URl to remote git-based wiki. # features_dir - dire...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
lib/gitnesse/hooks.rb
Ruby
mit
89
master
1,695
module Gitnesse class Hooks @config = Gitnesse::Config.instance DIR = File.expand_path "./#{@config.features_dir}/support" PATH = File.join DIR, "gitnesse.rb" # Public: Copies Gitnesse Cucumber hooks to Cucumber's support dir. # # Returns nothing def self.create! FileUtils.mkdir_p ...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
lib/gitnesse/config_loader.rb
Ruby
mit
89
master
918
module Gitnesse class ConfigLoader def self.find_and_load files = Dir.glob(File.join("**", "gitnesse.rb")) files = reject_irrelevant_files files files_with_config = files.select do |file_name| file_content = File.read(file_name) file_content.match("Gitnesse::Config.config do") ...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
lib/gitnesse/railtie.rb
Ruby
mit
89
master
233
require 'gitnesse' require 'gitnesse/cli/task' require 'rails' module Gitnesse class Railtie < Rails::Railtie railtie_name :gitnesse rake_tasks do load File.dirname(__FILE__) + '/rake/tasks.rake' end end end
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
lib/gitnesse/feature_extractor.rb
Ruby
mit
89
master
839
module Gitnesse class FeatureExtractor # Extracts Cucumber features from a Markdown-formatted string # # string - Markdown-formatted string to find Cucumber features in # # Returns an array of matches def self.extract!(string) matches = string.scan(/\u0060{3}gherkin\s*(.+?)\u0060{3}/im)...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
lib/gitnesse/feature.rb
Ruby
mit
89
master
1,671
module Gitnesse class Feature attr_accessor :filename def initialize(filename) if filename =~ /^\.\/features\/(.+)/ @filename = filename.scan(/^\.?\/?features\/(.+)/).flatten.first else @filename = filename end @config = Gitnesse::Config.instance end # Public...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
lib/gitnesse/wiki/page.rb
Ruby
mit
89
master
3,432
module Gitnesse class Wiki class Page attr_reader :wiki_path, :path, :filename, :relative_path # Public: Creates a new Wiki Page object. Contains references to the page # and an easy way to access/update relevant page data. # # path - full path to the file # # Returns a ...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
lib/gitnesse/cli/task.rb
Ruby
mit
89
master
1,313
Dir["#{File.dirname(__FILE__)}/helpers/*.rb"].each { |f| require f } module Gitnesse class Cli class Task include Gitnesse::Cli::ConfigHelpers include Gitnesse::Cli::FeatureHelpers include Gitnesse::Cli::WikiHelpers attr_accessor :out class << self attr_accessor :name ...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
lib/gitnesse/cli/task/push.rb
Ruby
mit
89
master
2,255
Gitnesse::Cli.task :push do desc "Pushes local features to remote git-based wiki" help do <<-EOS USAGE: gitnesse push #{desc} Pushes the local features files to the remote git-based wiki, creating/updating wiki pages as necessary. Examples: gitnesse push # will push local features to remote wiki EOS ...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
lib/gitnesse/cli/task/help.rb
Ruby
mit
89
master
794
Gitnesse::Cli.task :help, nil do def perform(name = nil) return overview unless name task = tasks_by_name[name] abort "No help for task '#{name}'" unless task && task.help puts task.help end private def overview puts <<-EOS USAGE: gitnesse <task> [<args>] The gitnesse tasks are: EOS ...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
lib/gitnesse/cli/task/pull.rb
Ruby
mit
89
master
498
Gitnesse::Cli.task :pull do desc "Pulls features from remote git-based wiki" help do <<-EOS USAGE: gitnesse pull #{desc} Pulls the remote wiki, finds the feature files it contains, and updates the relevant local features, creating new ones if necessary. Examples: gitnesse pull # will pull features from r...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
lib/gitnesse/cli/task/run.rb
Ruby
mit
89
master
2,320
Gitnesse::Cli.task :run do desc "Pulls changes from remote git-based wiki, and runs Cucumber." help do <<-EOS USAGE: gitnesse run #{desc} Pulls changed features from remote git-based wiki, runs Cucumber, and pushes annotated results to the remote git-based wiki if the "annotate_results" setting is enabled. ...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
lib/gitnesse/cli/task/cleanup.rb
Ruby
mit
89
master
1,141
require 'etc' Gitnesse::Cli.task :cleanup do desc "Cleans up project folders in ~/.gitnesse" help do <<-EOS USAGE: gitnesse cleanup #{desc} Cleans up the folders for local copies of wikis Gitnesse leaves in ~/.gitnesse. Examples: gitnesse cleanup # will remove all subfolders from ~/.gitnesse EOS e...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
lib/gitnesse/cli/task/info.rb
Ruby
mit
89
master
622
Gitnesse::Cli.task :info do desc "Prints current Gitnesse configuration" def perform Gitnesse::ConfigLoader.find_and_load config = Gitnesse::Config.instance.to_h size = config.keys.map(&:length).max puts "Current Gitnesse Configuration:" config.each do |key, value| puts " #{key.to_s.rj...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
lib/gitnesse/cli/helpers/config_helpers.rb
Ruby
mit
89
master
321
module Gitnesse class Cli module ConfigHelpers # Loads and checks Gitnesse configuration/dependencies # # Returns an instance of Gitnesse::Config def load_and_check_config Gitnesse::ConfigLoader.find_and_load Gitnesse::DependencyChecker.new.check end end end end
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
lib/gitnesse/cli/helpers/feature_helpers.rb
Ruby
mit
89
master
701
module Gitnesse class Cli module FeatureHelpers # Public: Creates or updates local cucumber features # # Returns nothing. def create_or_update_local_features puts " Creating and updating local features." @feature_pages.each do |page| if File.exists?(page.path) ...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
lib/gitnesse/cli/helpers/wiki_helpers.rb
Ruby
mit
89
master
1,506
module Gitnesse class Cli module WikiHelpers # Public: Clones or updates local copy of remote git-based wiki. Also prints # message indicating which operation is taking place # # Returns instance of Gitnesse::Wiki referring to new/updated local wiki def clone_wiki opts = {} ...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
lib/gitnesse/rake/tasks.rake
Ruby
mit
89
master
224
namespace :gitnesse do task :environment do end Gitnesse::Cli.tasks.values.each do |task| desc(task.desc) if task.desc task task.name.to_sym => :environment do task.new(STDOUT).perform end end end
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
spec/support_helper.rb
Ruby
mit
89
master
1,719
SUPPORT_FILES_DIR = File.join(File.dirname(__FILE__), "/support") require 'fileutils' require 'tempfile' require 'tmpdir' module CliSpecs def gitnesse(args) out = StringIO.new Gitnesse::Cli.new(out).parse(args.split(/\s+/)) out.rewind out.read rescue SystemExit out.rewind out.read end e...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
spec/lib/wiki_spec.rb
Ruby
mit
89
master
1,042
require 'spec_helper' module Gitnesse describe Wiki do describe "#remove_features" do before do Wiki.any_instance.stub(:clone_or_update).and_return(true) @repo = double('repo', status: []) expect(Git).to receive(:init).with("~/.gitnesse/gitnesse").and_return(@repo) @wiki =...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
spec/lib/hooks_spec.rb
Ruby
mit
89
master
1,129
require 'spec_helper' module Gitnesse describe Hooks do let(:hook) { File.expand_path("#{File.dirname(__FILE__)}/../../lib/gitnesse/hooks/gitnesse.rb") } let(:path) { Hooks::PATH } let(:dir) { Hooks::DIR } it "sets DIR to the 'support' cucumber dir" do expect(dir).to match "features/support" ...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
spec/lib/feature_spec.rb
Ruby
mit
89
master
1,610
require 'spec_helper' module Gitnesse describe Feature do let(:feature) { Feature.new "thing.feature" } let(:nested_feature) { Feature.new "nested_features/thing.feature" } it "accepts a filename as an argument" do expect(feature.filename).to eq "thing.feature" end it "can generate a wiki...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
spec/lib/feature_extractor_spec.rb
Ruby
mit
89
master
934
require 'spec_helper' module Gitnesse describe FeatureExtractor do let(:example_page) { Support.example_wiki_page } let(:expected_features) { Support.example_features } describe ".extract!" do it "extracts Cucumber features from Markdown wiki pages as an array" do extracted_page = FeatureE...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
spec/lib/cli_spec.rb
Ruby
mit
89
master
348
require 'spec_helper' require 'gitnesse/cli' module Gitnesse describe Cli, type: :cli do describe "-v, --version" do it "outputs the gem name and version" do expect(gitnesse("--version")).to eq "gitnesse #{Gitnesse::VERSION}\n" expect(gitnesse("-v")).to eq "gitnesse #{Gitnesse::VERSION}\n" ...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
spec/lib/dependency_checker_spec.rb
Ruby
mit
89
master
5,114
require 'spec_helper' module Gitnesse describe DependencyChecker do let(:checker) { DependencyChecker.new } let(:config) { Config.instance } describe "#check" do it "calls other dependency checks" do checks = %w(check_git check_cucumber check_repository_url check_ident...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
spec/lib/config_loader_spec.rb
Ruby
mit
89
master
1,464
require 'spec_helper' module Gitnesse describe ConfigLoader do let(:config) { Config.instance } describe "#find_and_load" do context "when no config file exists" do before do expect(Dir).to receive(:glob).and_return [] message = "Can't find a gitnesse.rb file with Gitnesse ...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
spec/lib/config_spec.rb
Ruby
mit
89
master
1,502
require 'spec_helper' module Gitnesse describe Config do let(:config) { Config.instance } let(:default_config_hash) do { annotate_results: false, branch: 'master', identifier: nil, features_dir: 'features', repository_url: nil } end it "is a single...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
spec/lib/feature_transform_spec.rb
Ruby
mit
89
master
678
require 'spec_helper' module Gitnesse describe FeatureTransform do describe ".convert" do context "when a feature is passed" do it "converts a Cucumber feature to a Markdown wiki page" do wiki_page = FeatureTransform.convert(Support.addition_feature) expect(wiki_page).to eq Supp...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
spec/lib/dir_manager_spec.rb
Ruby
mit
89
master
1,215
require 'spec_helper' module Gitnesse describe DirManager do let(:path) { "#{Dir.home}/.gitnesse/gitnesse" } describe ".make_project_dir" do before do expect(FileUtils).to receive(:mkdir_p).with(path).and_return(true) end it "creates a dir based on the current project name" do ...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
spec/lib/wiki/page_spec.rb
Ruby
mit
89
master
2,285
require 'spec_helper' require 'time' module Gitnesse describe Wiki::Page do let(:page) { Wiki::Page.new("~/.gitnesse/gitnesse/features > new_features > new_feature.feature.md") } it "converts the filename to a local path" do expect(page.relative_path).to eq "./features/new_features" end it "e...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
spec/lib/cli/task/pull_spec.rb
Ruby
mit
89
master
497
require 'spec_helper' require 'gitnesse/cli' module Gitnesse describe Cli, type: :cli do let(:help) do <<-EOS USAGE: gitnesse pull Pulls features from remote git-based wiki Pulls the remote wiki, finds the feature files it contains, and updates the relevant local features, creating new ones if necessary....
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
spec/lib/cli/task/push_spec.rb
Ruby
mit
89
master
478
require 'spec_helper' require 'gitnesse/cli' module Gitnesse describe Cli, type: :cli do let(:help) do <<-EOS USAGE: gitnesse push Pushes local features to remote git-based wiki Pushes the local features files to the remote git-based wiki, creating/updating wiki pages as necessary. Examples: gitnesse ...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
spec/lib/cli/task/info_spec.rb
Ruby
mit
89
master
498
require 'spec_helper' require 'gitnesse/cli' module Gitnesse describe Cli, type: :cli do let(:result) do <<-EOS Current Gitnesse Configuration: repository_url - [not set] features_dir - features branch - master annotate_results - [not set] identifier - [not set] EOS ...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
spec/lib/cli/task/cleanup_spec.rb
Ruby
mit
89
master
460
require 'spec_helper' require 'gitnesse/cli' module Gitnesse describe Cli, type: :cli do let(:help) do <<-EOS USAGE: gitnesse cleanup Cleans up project folders in ~/.gitnesse Cleans up the folders for local copies of wikis Gitnesse leaves in ~/.gitnesse. Examples: gitnesse cleanup # will remove all s...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
spec/lib/cli/task/help_spec.rb
Ruby
mit
89
master
1,012
require 'spec_helper' require 'gitnesse/cli' module Gitnesse describe Cli, type: :cli do let(:overview) do <<-EOS USAGE: gitnesse <task> [<args>] The gitnesse tasks are: cleanup Cleans up project folders in ~/.gitnesse info Prints current Gitnesse configuration pull Pulls features from r...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
features/step_definitions/gitnesse_steps.rb
Ruby
mit
89
master
1,458
def change_repo_url config_file = File.join(@repo_dir, "gitnesse.rb") config = File.read(config_file) config.gsub!(/c\.repository_url.*$/, "c.repository_url = '#{@wiki_dir}'") File.open(config_file, 'w') { |file| file.puts config } end Given(/^there is a wiki with Cucumber features defined$/) do @wiki_dir = ...
github
hybridgroup/gitnesse
https://github.com/hybridgroup/gitnesse
features/support/env.rb
Ruby
mit
89
master
2,212
require 'gitnesse' require 'rspec' require 'cucumber/rspec/doubles' wiki_url = "https://github.com/hybridgroup/gitnesse-demo.wiki.git" repo_url = "https://github.com/hybridgroup/gitnesse-example-sinatra.git" RSpec::Mocks::setup(self) puts "Setting up Gitnesse for Cucumber testing:" @root = File.join(Dir.home, ".gi...
github
cherring/connection_ninja
https://github.com/cherring/connection_ninja
connection_ninja.gemspec
Ruby
mit
89
master
1,837
# Generated by jeweler # DO NOT EDIT THIS FILE DIRECTLY # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = %q{connection_ninja} s.version = "0.4.0" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :r...
github
cherring/connection_ninja
https://github.com/cherring/connection_ninja
Rakefile
Ruby
mit
89
master
928
require 'rubygems' require 'rake' begin require 'jeweler' Jeweler::Tasks.new do |gem| gem.name = "connection_ninja" gem.summary = %Q{Handle multiple Database conenctions with ActiveRecord Models} gem.description = %Q{Handle multiple Database conenctions with ActiveRecord Models} gem.email = "chris....
github
cherring/connection_ninja
https://github.com/cherring/connection_ninja
spec/connection_ninja_spec.rb
Ruby
mit
89
master
1,441
require 'spec/spec_helper' describe ActiveRecord::Base, "methods" do before do ActiveRecord::Base.send(:extend, ConnectionNinja::Orms::ActiveRecord) end it "should have configurtions" do ActiveRecord::Base.configurations.should_not == {} end it "should have connection ninja methods" do ActiveRe...
github
cherring/connection_ninja
https://github.com/cherring/connection_ninja
spec/spec_helper.rb
Ruby
mit
89
master
441
$LOAD_PATH.unshift(File.dirname(__FILE__)) $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'rspec' require 'rails' require 'active_record' require 'connection_ninja/orms/active_record' require 'spec/fixtures/models' FileUtils.mkdir_p "#{Dir.pwd}/tmp" ActiveRecord::Base.logger = Log...
github
cherring/connection_ninja
https://github.com/cherring/connection_ninja
lib/connection_ninja/railtie.rb
Ruby
mit
89
master
335
require 'connection_ninja' module ConnectionNinja class Railtie < Rails::Railtie initializer "connection_ninja.active_record" do |app| if defined? ::ActiveRecord require 'connection_ninja/orms/active_record' ActiveRecord::Base.send(:extend, ConnectionNinja::Orms::ActiveRecord) end ...
github
cherring/connection_ninja
https://github.com/cherring/connection_ninja
lib/connection_ninja/orms/active_record.rb
Ruby
mit
89
master
557
require 'active_record' require 'connection_ninja' module ConnectionNinja module Orms module ActiveRecord def use_connection_ninja(config_group) establish_connection ninja_config(config_group) end protected def ninja_config(config_group) begin configurations[c...
github
docusealco/rllama
https://github.com/docusealco/rllama
rllama.gemspec
Ruby
mit
89
master
1,963
# frozen_string_literal: true require_relative 'lib/rllama/version' Gem::Specification.new do |spec| spec.name = 'rllama' spec.version = Rllama::VERSION spec.authors = ['Pete Matsyburka'] spec.email = ['pete@docuseal.com'] spec.summary = 'Ruby bindings for llama.cpp to run local LLMs with Ruby.' spec.desc...
github
docusealco/rllama
https://github.com/docusealco/rllama
Gemfile
Ruby
mit
89
master
272
# frozen_string_literal: true source 'https://rubygems.org' gem 'irb' group :development, :test do gem 'rake' gem 'rspec' gem 'rubocop', require: false gem 'rubocop-performance', require: false gem 'rubocop-rspec', require: false gem 'rubyzip' end gemspec
github
docusealco/rllama
https://github.com/docusealco/rllama
Rakefile
Ruby
mit
89
master
15,123
# frozen_string_literal: true require 'bundler/gem_helper' require 'fileutils' require 'net/http' require 'uri' require 'zip' LLAMA_CPP_VERSION = ENV.fetch('LLAMA_CPP_VERSION', 'b8642') PLATFORMS = { 'x86_64-linux' => { gem_platform: 'x86_64-linux-gnu', asset_name: 'llama-%<version>s-bin-ubuntu-x64.tar.gz'...
github
docusealco/rllama
https://github.com/docusealco/rllama
lib/rllama.rb
Ruby
mit
89
master
684
# frozen_string_literal: true module Rllama autoload :Model, 'rllama/model' autoload :Loader, 'rllama/loader' autoload :Context, 'rllama/context' autoload :Cpp, 'rllama/cpp' autoload :Cli, 'rllama/cli' autoload :VERSION, 'rllama/version' Result = Struct.new(:text, :stats, keyword_init: true) Error = C...
github
docusealco/rllama
https://github.com/docusealco/rllama
lib/rllama/cli.rb
Ruby
mit
89
master
5,500
# frozen_string_literal: true require 'readline' module Rllama class Cli POPULAR_MODELS = [ { path: 'lmstudio-community/gemma-4-E4B-it-GGUF/gemma-4-E4B-it-Q4_K_M.gguf', size: 5_335_285_280 }, { path: 'lmstudio-community/gemma-4-26B-A4B-it-GGUF/gemma-4-26B-A4B-it-Q4_K_M.gguf', size: 16_796_010_624 },...
github
docusealco/rllama
https://github.com/docusealco/rllama
lib/rllama/loader.rb
Ruby
mit
89
master
6,281
# frozen_string_literal: true require 'uri' require 'net/http' require 'fileutils' module Rllama module Loader HUGGINGFACE_BASE_URL = 'https://huggingface.co' DEFAULT_DIR = File.join(Dir.home, '.rllama') UNITS = %w[B KB MB GB TB].freeze module_function def resolve(path_or_name, dir: nil) ...
github
docusealco/rllama
https://github.com/docusealco/rllama
lib/rllama/context.rb
Ruby
mit
89
master
8,520
# frozen_string_literal: true require 'etc' module Rllama class Context attr_reader :messages, :n_ctx, :n_batch, :n_past def initialize(model, embeddings: false, n_ctx: nil, n_batch: nil, n_threads: Etc.nprocessors) @model = model @n_ctx = n_ctx @n_batch = n_batch @embeddings = embe...
github
docusealco/rllama
https://github.com/docusealco/rllama
lib/rllama/model.rb
Ruby
mit
89
master
5,024
# frozen_string_literal: true module Rllama class Model DEFAULT_CONTEXT_LENGTH = 2**13 FALLBACK_TEMPLATES = { 'gemma4' => { bos: '<bos>', role_map: { 'assistant' => 'model' }, turn_start: ->(role) { "<|turn>#{role}\n" }, turn_end: "<turn|>\n", generation_prompt:...
github
docusealco/rllama
https://github.com/docusealco/rllama
lib/rllama/cpp.rb
Ruby
mit
89
master
30,147
# frozen_string_literal: true require 'ffi' module Rllama module Cpp extend FFI::Library LIB_NAME = 'llama' PLATFORM = case FFI::Platform::OS when 'darwin' FFI::Platform::ARCH == 'aarch64' ? 'arm64-darwin' : 'x86_64-darwin' when 'windows', 'mingw32' 'x64-mingw32' ...
github
kamipo/activerecord-mysql-awesome
https://github.com/kamipo/activerecord-mysql-awesome
Rakefile
Ruby
mit
89
master
1,751
require "bundler/gem_tasks" require 'rake/testtask' require File.expand_path(File.dirname(__FILE__)) + "/test/config" require File.expand_path(File.dirname(__FILE__)) + "/test/support/config" desc 'Run mysql2 tests by default' task :default => :test desc 'Run mysql2 tests' task :test => :test_mysql2 desc 'Build MyS...
github
kamipo/activerecord-mysql-awesome
https://github.com/kamipo/activerecord-mysql-awesome
activerecord-mysql-awesome.gemspec
Ruby
mit
89
master
1,217
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'activerecord/mysql/awesome/version' Gem::Specification.new do |spec| spec.name = "activerecord-mysql-awesome" spec.version = ActiveRecord::Mysql::Awesome::VERSION spec.author...
github
kamipo/activerecord-mysql-awesome
https://github.com/kamipo/activerecord-mysql-awesome
Gemfile
Ruby
mit
89
master
205
source 'https://rubygems.org' gem "activerecord", "~> #{ENV['AR_VERSION']}" if ENV['AR_VERSION'] gem "mysql2", "~> 0.3.18" # Specify your gem's dependencies in activerecord-mysql-awesome.gemspec gemspec
github
kamipo/activerecord-mysql-awesome
https://github.com/kamipo/activerecord-mysql-awesome
test/config.rb
Ruby
mit
89
master
225
TEST_ROOT = File.expand_path(File.dirname(__FILE__)) ASSETS_ROOT = TEST_ROOT + "/assets" FIXTURES_ROOT = TEST_ROOT + "/fixtures" MIGRATIONS_ROOT = TEST_ROOT + "/migrations" SCHEMA_ROOT = TEST_ROOT + "/schema"
github
kamipo/activerecord-mysql-awesome
https://github.com/kamipo/activerecord-mysql-awesome
test/support/connection.rb
Ruby
mit
89
master
478
require 'active_support/logger' module ARTest def self.connection_name ENV['ARCONN'] || config['default_connection'] end def self.connection_config config['connections'][connection_name] end def self.connect puts "Using #{connection_name}" ActiveRecord::Base.logger = ActiveSupport::Logger.n...
github
kamipo/activerecord-mysql-awesome
https://github.com/kamipo/activerecord-mysql-awesome
test/support/config.rb
Ruby
mit
89
master
997
require 'yaml' require 'erb' require 'fileutils' require 'pathname' module ARTest class << self def config @config ||= read_config end private def config_file Pathname.new(ENV['ARCONFIG'] || TEST_ROOT + '/config.yml') end def read_config unless config_file.exist? ...
github
kamipo/activerecord-mysql-awesome
https://github.com/kamipo/activerecord-mysql-awesome
test/support/connection_helper.rb
Ruby
mit
89
master
230
module ConnectionHelper def run_without_connection original_connection = ActiveRecord::Base.remove_connection yield original_connection ensure ActiveRecord::Base.establish_connection(original_connection) end end
github
kamipo/activerecord-mysql-awesome
https://github.com/kamipo/activerecord-mysql-awesome
test/support/schema_dumping_helper.rb
Ruby
mit
89
master
810
module SchemaDumpingHelper def dump_table_schema(table, connection = ActiveRecord::Base.connection) old_ignore_tables = ActiveRecord::SchemaDumper.ignore_tables ActiveRecord::SchemaDumper.ignore_tables = connection.tables - [table] stream = StringIO.new ActiveRecord::SchemaDumper.dump(ActiveRecord::Ba...
github
kamipo/activerecord-mysql-awesome
https://github.com/kamipo/activerecord-mysql-awesome
test/cases/strict_mode_test.rb
Ruby
mit
89
master
1,134
require 'cases/helper' require 'support/connection_helper' class StrictModeTest < ActiveRecord::TestCase include ConnectionHelper def setup super @connection = ActiveRecord::Base.connection end def test_mysql_strict_mode_enabled result = @connection.exec_query "SELECT @@SESSION.sql_mode" asse...
github
kamipo/activerecord-mysql-awesome
https://github.com/kamipo/activerecord-mysql-awesome
test/cases/helper.rb
Ruby
mit
89
master
1,406
require 'bundler' Bundler.setup require 'activerecord-mysql-awesome' require 'config' require 'active_support/testing/autorun' require 'stringio' require 'active_record' require 'cases/test_case' require 'active_support/dependencies' require 'active_support/logger' require 'active_support/core_ext/string/strip' req...
github
kamipo/activerecord-mysql-awesome
https://github.com/kamipo/activerecord-mysql-awesome
test/cases/date_time_precision_test.rb
Ruby
mit
89
master
3,917
require 'cases/helper' require 'support/schema_dumping_helper' if ActiveRecord::Base.connection.supports_datetime_with_precision? class DateTimePrecisionTest < ActiveRecord::TestCase include SchemaDumpingHelper class Foo < ActiveRecord::Base; end setup do @connection = ActiveRecord::Base.connection end ...
github
kamipo/activerecord-mysql-awesome
https://github.com/kamipo/activerecord-mysql-awesome
test/cases/charset_collation_test.rb
Ruby
mit
89
master
1,875
require 'cases/helper' require 'support/schema_dumping_helper' class CharsetCollationTest < ActiveRecord::TestCase include SchemaDumpingHelper class CharsetCollation < ActiveRecord::Base end setup do @connection = ActiveRecord::Base.connection @connection.create_table("charset_collations", force: tru...
github
kamipo/activerecord-mysql-awesome
https://github.com/kamipo/activerecord-mysql-awesome
test/cases/table_options_test.rb
Ruby
mit
89
master
510
require 'cases/helper' require 'support/schema_dumping_helper' class TableOptionsTest < ActiveRecord::TestCase include SchemaDumpingHelper teardown do ActiveRecord::Base.connection.drop_table "table_options" end def test_dump_table_options ActiveRecord::Base.connection.create_table(:table_options, fo...
github
kamipo/activerecord-mysql-awesome
https://github.com/kamipo/activerecord-mysql-awesome
test/cases/unsigned_type_test.rb
Ruby
mit
89
master
1,917
require 'cases/helper' require 'support/schema_dumping_helper' class UnsignedTypeTest < ActiveRecord::TestCase include SchemaDumpingHelper class UnsignedType < ActiveRecord::Base end setup do @connection = ActiveRecord::Base.connection @connection.create_table("unsigned_types", force: true) do |t| ...
github
kamipo/activerecord-mysql-awesome
https://github.com/kamipo/activerecord-mysql-awesome
test/cases/bigint_pk_test.rb
Ruby
mit
89
master
869
require 'cases/helper' require 'support/schema_dumping_helper' class PrimaryKeyBigIntTest < ActiveRecord::TestCase include SchemaDumpingHelper class Widget < ActiveRecord::Base end setup do @connection = ActiveRecord::Base.connection @connection.create_table(:widgets, id: :bigint, force: true) end ...
github
kamipo/activerecord-mysql-awesome
https://github.com/kamipo/activerecord-mysql-awesome
test/cases/time_precision_test.rb
Ruby
mit
89
master
3,215
require 'cases/helper' require 'support/schema_dumping_helper' if ActiveRecord::Base.connection.supports_datetime_with_precision? class TimePrecisionTest < ActiveRecord::TestCase include SchemaDumpingHelper class Foo < ActiveRecord::Base; end setup do @connection = ActiveRecord::Base.connection end te...
github
kamipo/activerecord-mysql-awesome
https://github.com/kamipo/activerecord-mysql-awesome
test/cases/primary_keys_test.rb
Ruby
mit
89
master
1,796
require 'cases/helper' require 'support/schema_dumping_helper' class PrimaryKeyAnyTypeTest < ActiveRecord::TestCase include SchemaDumpingHelper class Barcode < ActiveRecord::Base end setup do @connection = ActiveRecord::Base.connection @connection.create_table(:barcodes, primary_key: "code", id: :str...
github
kamipo/activerecord-mysql-awesome
https://github.com/kamipo/activerecord-mysql-awesome
test/cases/test_case.rb
Ruby
mit
89
master
4,247
require 'active_support/test_case' module ActiveRecord # = Active Record Test Case # # Defines some test assertions to test against SQL queries. class TestCase < ActiveSupport::TestCase #:nodoc: def teardown SQLCounter.clear_log end def assert_date_from_db(expected, actual, message = nil) ...
github
kamipo/activerecord-mysql-awesome
https://github.com/kamipo/activerecord-mysql-awesome
lib/activerecord/mysql/awesome.rb
Ruby
mit
89
master
264
require 'active_support' begin require 'rails' rescue LoadError # nothing to do! yay! end if defined? Rails require 'activerecord/mysql/awesome/railtie' else ActiveSupport.on_load :active_record do require 'activerecord/mysql/awesome/base' end end
github
kamipo/activerecord-mysql-awesome
https://github.com/kamipo/activerecord-mysql-awesome
lib/activerecord/mysql/awesome/base.rb
Ruby
mit
89
master
459
if ActiveRecord::VERSION::MAJOR == 4 require 'activerecord-mysql-awesome/active_record/schema_dumper' require 'activerecord-mysql-awesome/active_record/connection_adapters/abstract/schema_dumper' require 'activerecord-mysql-awesome/active_record/connection_adapters/abstract_mysql_adapter' require 'activerecord-...
github
kamipo/activerecord-mysql-awesome
https://github.com/kamipo/activerecord-mysql-awesome
lib/activerecord/mysql/awesome/railtie.rb
Ruby
mit
89
master
301
module ActiveRecord module Mysql module Awesome class Railtie < Rails::Railtie initializer 'activerecord-mysql-awesome' do ActiveSupport.on_load :active_record do require 'activerecord/mysql/awesome/base' end end end end end end
github
kamipo/activerecord-mysql-awesome
https://github.com/kamipo/activerecord-mysql-awesome
lib/activerecord-mysql-awesome/active_record/schema_dumper.rb
Ruby
mit
89
master
1,038
require 'active_record/schema_dumper' module ActiveRecord module Mysql module Awesome module SchemaDumper private def table(table, stream) @types = @types.merge(@connection.options_for_column_spec(table)) pk = @connection.primary_key(table) pkcol = @connection...
github
kamipo/activerecord-mysql-awesome
https://github.com/kamipo/activerecord-mysql-awesome
lib/activerecord-mysql-awesome/active_record/connection_adapters/abstract_mysql_adapter.rb
Ruby
mit
89
master
11,063
require 'active_record/connection_adapters/abstract_mysql_adapter' module ActiveRecord module Mysql module Awesome class ChangeColumnDefinition < Struct.new(:column, :name) end module ColumnMethods def primary_key(name, type = :primary_key, **options) options[:auto_increment]...
github
kamipo/activerecord-mysql-awesome
https://github.com/kamipo/activerecord-mysql-awesome
lib/activerecord-mysql-awesome/active_record/connection_adapters/mysql2_adapter.rb
Ruby
mit
89
master
632
require 'active_record/connection_adapters/mysql2_adapter' module ActiveRecord module ConnectionAdapters class Mysql2Adapter < AbstractMysqlAdapter class Version include Comparable def initialize(version_string) @version = version_string.split('.').map(&:to_i) end ...
github
kamipo/activerecord-mysql-awesome
https://github.com/kamipo/activerecord-mysql-awesome
lib/activerecord-mysql-awesome/active_record/connection_adapters/abstract/schema_dumper.rb
Ruby
mit
89
master
582
require 'active_record/connection_adapters/abstract/schema_dumper' module ActiveRecord module ConnectionAdapters # :nodoc: module ColumnDumper def options_for_column_spec(table_name) { table_name: table_name } end def column_spec_for_primary_key(column, options) return if colum...
github
zombocom/rate_throttle_client
https://github.com/zombocom/rate_throttle_client
rate_throttle_client.gemspec
Ruby
mit
89
main
1,619
require_relative 'lib/rate_throttle_client/version' Gem::Specification.new do |spec| spec.name = "rate_throttle_client" spec.version = RateThrottleClient::VERSION spec.authors = ["schneems"] spec.email = ["richard.schneeman+foo@gmail.com"] spec.summary = %q{Don't error, in...
github
zombocom/rate_throttle_client
https://github.com/zombocom/rate_throttle_client
Rakefile
Ruby
mit
89
main
2,190
require "bundler/gem_tasks" require "rake/testtask" Rake::TestTask.new(:test) do |t| t.libs << "test" t.libs << "lib" t.test_files = FileList["test/**/*_test.rb"] end task :default => :test $LOAD_PATH.unshift File.expand_path("../lib", __dir__) require "rate_throttle_client" require 'rate_throttle_client/demo...
github
zombocom/rate_throttle_client
https://github.com/zombocom/rate_throttle_client
lib/rate_throttle_client.rb
Ruby
mit
89
main
614
require "rate_throttle_client/version" require "rate_throttle_client/info" require 'thread' module RateThrottleClient class Error < StandardError; end class << self attr_accessor :multiplier, :min_sleep, :max_limit, :log_block end self.log_block = ->(info) { warn "RateThrottleClient: sleep_for=#{info.slee...
github
zombocom/rate_throttle_client
https://github.com/zombocom/rate_throttle_client
lib/rate_throttle_client/chart.rb
Ruby
mit
89
main
1,586
module RateThrottleClient class Chart def initialize(log_dir:, name:, time_scale:) @log_dir = log_dir @time_scale = time_scale @name = name @label_hash = nil @log_files = nil end def log_files @log_files ||= @log_dir.entries.map do |entry| @log_dir.join(entry) ...