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
spajus/gosu-tiled
https://github.com/spajus/gosu-tiled
spec/gosu_tiled/map_spec.rb
Ruby
mit
19
master
1,348
require 'spec_helper' RSpec.describe Gosu::Tiled::Map do let(:files_dir) { File.join(File.dirname(File.dirname(__FILE__)), 'files') } let(:target_class) { Gosu::Tiled::Map } let(:map_json) { JSON.load(File.open(File.join(files_dir, 'tiled_map.json'))) } let(:game_window) { TestGameWindow.instance } subject...
github
spajus/gosu-tiled
https://github.com/spajus/gosu-tiled
spec/gosu_tiled/tilesets_spec.rb
Ruby
mit
19
master
2,367
require 'spec_helper' RSpec.describe Gosu::Tiled::Tilesets do let(:files_dir) { File.join(File.dirname(File.dirname(__FILE__)), 'files') } let(:target_class) { Gosu::Tiled::Tilesets } let(:map_json) { JSON.load(File.open(File.join(files_dir, 'tiled_map.json'))) } let(:game_window) { TestGameWindow.instance } ...
github
spajus/gosu-tiled
https://github.com/spajus/gosu-tiled
spec/gosu_tiled/layers_spec.rb
Ruby
mit
19
master
991
require 'spec_helper' RSpec.describe Gosu::Tiled::Layers do let(:files_dir) { File.join(File.dirname(File.dirname(__FILE__)), 'files') } let(:target_class) { Gosu::Tiled::Layers } let(:map_json) { JSON.load(File.open(File.join(files_dir, 'tiled_map.json'))) } let(:game_window) { TestGameWindow.instance } le...
github
spajus/gosu-tiled
https://github.com/spajus/gosu-tiled
examples/panorama.rb
Ruby
mit
19
master
1,104
ROOT_DIR = File.dirname(File.dirname(__FILE__)) # Add ../lib to load path $:.unshift File.join(ROOT_DIR, 'lib') require 'gosu' require 'gosu_tiled' class GameWindow < Gosu::Window WIDTH = 800 HEIGHT = 600 def initialize super(WIDTH, HEIGHT, false) json_path = File.join(ROOT_DIR, 'spec', 'files', 'tiled...
github
jmettraux/volute
https://github.com/jmettraux/volute
Rakefile
Ruby
mit
19
master
1,506
$:.unshift('.') # ruby 1.9.2 require 'lib/volute.rb' require 'rubygems' require 'rake' # # SPEC task :rspec do sh 'time rspec -cfs spec/' end task :default => :rspec # # CLEAN require 'rake/clean' CLEAN.include('pkg', 'tmp', 'html', 'rdoc') # # GEM require 'jeweler' Jeweler::Tasks.new do |gem| gem.ver...
github
jmettraux/volute
https://github.com/jmettraux/volute
volute.gemspec
Ruby
mit
19
master
2,689
# 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{volute} s.version = "0.1.1" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_ru...
github
jmettraux/volute
https://github.com/jmettraux/volute
examples/diagnosis.rb
Ruby
mit
19
master
1,642
# license is MIT # this example is strongly inspired by the diagnosis example # for Ruleby ( http://github.com/codeaspects/ruleby ) # but please remember that Ruleby is a Rete implementation and is thus # vastly superior to what is implemented here $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require '...
github
jmettraux/volute
https://github.com/jmettraux/volute
examples/state_machine_2.rb
Ruby
mit
19
master
1,010
# license is MIT # # a state-machine-ish example, inspired by the example at # http://github.com/qoobaa/transitions $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'volute' # # our classes module Bookshop class Book include Volute attr_accessor :stock attr_accessor :discontinued ...
github
jmettraux/volute
https://github.com/jmettraux/volute
examples/light.rb
Ruby
mit
19
master
452
# license is MIT $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'volute' # gem install volute class Light include Volute attr_accessor :colour attr_accessor :changed_at end volute Light do volute :colour do object.changed_at = Time.now end end l = Light.new p l # => #<Light:0x100...
github
jmettraux/volute
https://github.com/jmettraux/volute
examples/state_machine.rb
Ruby
mit
19
master
977
# license is MIT # # a state-machine-ish example, inspired by the example at # http://github.com/qoobaa/transitions $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'volute' # # our classes module Bookshop class Book include Volute attr_accessor :stock attr_accessor :discontinued ...
github
jmettraux/volute
https://github.com/jmettraux/volute
examples/equation.rb
Ruby
mit
19
master
795
# license is MIT $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'volute' # # our class class Equation include Volute attr_accessor :km, :h, :kph def initialize @km = 1.0 @h = 1.0 @kph = 1.0 end def inspect "#{@km} km, #{@h} h, #{@kph} kph" end end # # a volute pe...
github
jmettraux/volute
https://github.com/jmettraux/volute
examples/traffic.rb
Ruby
mit
19
master
1,703
# license is MIT $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'volute' # # our classes class Light include Volute attr_accessor :colour attr_accessor :changed_at def initialize(colour) self.colour = colour end def green? self.colour == :green end def red! self.c...
github
jmettraux/volute
https://github.com/jmettraux/volute
spec/filter_not_spec.rb
Ruby
mit
19
master
884
require File.join(File.dirname(__FILE__), 'spec_helper.rb') describe 'a volute with a :not as first arg' do before(:each) do @item = Item.new @invoice = Invoice.new end describe 'and classes as further args' do before(:each) do Volute.clear! volute :not, Item do object.comm...
github
jmettraux/volute
https://github.com/jmettraux/volute
spec/filter_state_spec.rb
Ruby
mit
19
master
3,607
require File.join(File.dirname(__FILE__), 'spec_helper.rb') describe "a 'state' volute" do describe do before(:each) do @item = Item.new Volute.clear! volute Item do volute :weight => '1kg', :delivered => true do object.comment = '1kg and delivered' end v...
github
jmettraux/volute
https://github.com/jmettraux/volute
spec/include_volute_spec.rb
Ruby
mit
19
master
711
require File.join(File.dirname(__FILE__), 'spec_helper.rb') describe Volute do before(:each) do @invoice = Invoice.new @package = Package.new end describe 'when included' do it 'should grant getters' do @invoice.paid.should == nil end it 'should grants setters' do @invoice...
github
jmettraux/volute
https://github.com/jmettraux/volute
spec/apply_spec.rb
Ruby
mit
19
master
755
require File.join(File.dirname(__FILE__), 'spec_helper.rb') class Engine attr_accessor :state def turn_key! @key_turned = true Volute.apply(self, :key_turned) end def press_red_button! Volute.apply(self) end end describe 'Volute.apply' do before(:each) do Volute.clear! volute En...
github
jmettraux/volute
https://github.com/jmettraux/volute
spec/volutes_spec.rb
Ruby
mit
19
master
1,547
require File.join(File.dirname(__FILE__), 'spec_helper.rb') describe 'volutes' do before(:each) do Volute.clear! volute Invoice do end volute Package do end volute Financing::Loan do end volute Financing::Grant do end volute Financing do end volute :delivered do ...
github
jmettraux/volute
https://github.com/jmettraux/volute
spec/filter_transitions_spec.rb
Ruby
mit
19
master
4,236
require File.join(File.dirname(__FILE__), 'spec_helper.rb') describe 'transition volutes' do describe 'from that value to this value' do before(:each) do Volute.clear! @package = Package.new @package.vset(:location, 'NRT') volute :location do volute :any => 'SFO' do ...
github
jmettraux/volute
https://github.com/jmettraux/volute
spec/over_spec.rb
Ruby
mit
19
master
620
require File.join(File.dirname(__FILE__), 'spec_helper.rb') describe 'a volute with an over' do before(:each) do Volute.clear! @package = Package.new volute Package do volute do over if object.delivered end volute :location do (object.comment ||= []) << value ...
github
jmettraux/volute
https://github.com/jmettraux/volute
spec/filter_spec.rb
Ruby
mit
19
master
3,771
require File.join(File.dirname(__FILE__), 'spec_helper.rb') describe 'a volute for a class' do before(:each) do Volute.clear! @invoice = Invoice.new @item = Item.new volute Invoice do object.comment = [ attribute, previous_value, value ] end end it 'should affect its class' do ...
github
jmettraux/volute
https://github.com/jmettraux/volute
spec/volute_spec.rb
Ruby
mit
19
master
1,084
require File.join(File.dirname(__FILE__), 'spec_helper.rb') describe 'a volute' do before(:each) do Volute.clear! @invoice = Invoice.new volute do object.comment = [ attribute, previous_value, value ] end end it 'should not be applied when #instance_variable_set is used' do @invo...
github
jmettraux/volute
https://github.com/jmettraux/volute
spec/spec_helper.rb
Ruby
mit
19
master
808
$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'volute' class Invoice include Volute attr_accessor :paid attr_accessor :customer_name attr_accessor :customer_id o_attr_accessor :comment end class Item include Volute attr_accessor :weight attr_accessor :delivered o_attr_accesso...
github
jmettraux/volute
https://github.com/jmettraux/volute
lib/volute.rb
Ruby
mit
19
master
6,914
#-- # Copyright (c) 2010-2010, John Mettraux, jmettraux@gmail.com # # 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 the Software without restriction, including without limitation the rights # to use, copy...
github
guitsaru/rbvimeo
https://github.com/guitsaru/rbvimeo
Rakefile
Ruby
mit
19
master
2,205
require 'rubygems' require 'rake' begin require 'jeweler' Jeweler::Tasks.new do |gem| gem.name = "rbvimeo" gem.summary = %Q{A ruby wrapper for the vimeo api.} gem.email = "guitsaru@gmail.com" gem.homepage = "http://github.com/guitsaru/rbvimeo" gem.authors = ["Matt Pruitt"] gem.rubyforge_pro...
github
guitsaru/rbvimeo
https://github.com/guitsaru/rbvimeo
rbvimeo.gemspec
Ruby
mit
19
master
1,585
# Generated by jeweler # DO NOT EDIT THIS FILE DIRECTLY # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec' # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = %q{rbvimeo} s.version = "0.4.0" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubyge...
github
guitsaru/rbvimeo
https://github.com/guitsaru/rbvimeo
test/rbvimeo_test.rb
Ruby
mit
19
master
1,594
require 'test_helper' class RbvimeoTest < Test::Unit::TestCase context "Vimeo" do setup do @api_key = '56a9c1c65e700ca10a678a2bcd8e77af' @api_secret = '59c629610' @vimeo = RBVIMEO::Vimeo.new(@api_key, @api_secret) @params = {"method" => "vimeo.videos.getInfo", "video_id" => "339189", "api...
github
guitsaru/rbvimeo
https://github.com/guitsaru/rbvimeo
test/test_helper.rb
Ruby
mit
19
master
233
require 'rubygems' require 'test/unit' require 'shoulda' require 'mocha' $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH.unshift(File.dirname(__FILE__)) require 'rbvimeo' class Test::Unit::TestCase end
github
guitsaru/rbvimeo
https://github.com/guitsaru/rbvimeo
test/video_test.rb
Ruby
mit
19
master
3,540
require 'test_helper' class VideoTest < Test::Unit::TestCase context "initialization" do setup do @api_key = '56a9c1c65e700ca10a678a2bcd8e77af' @api_secret = '59c629610' @vimeo = RBVIMEO::Vimeo.new(@api_key, @api_secret) @params = {"method" => "vimeo.videos.getInfo", "video_id" => "339189...
github
guitsaru/rbvimeo
https://github.com/guitsaru/rbvimeo
lib/rbvimeo.rb
Ruby
mit
19
master
202
require 'rubygems' require 'digest/md5' require 'open-uri' require 'hpricot' require 'rbvimeo/vimeo' require 'rbvimeo/video' require 'rbvimeo/thumbnail' require 'rbvimeo/user' require 'rbvimeo/comment'
github
guitsaru/rbvimeo
https://github.com/guitsaru/rbvimeo
lib/rbvimeo/comment.rb
Ruby
mit
19
master
328
module RBVIMEO class Comment attr_accessor :id, :author, :authorname, :datecreate, :permalink, :text, :portraits def initialize @portraits = [] end def date return @datecreate end def url return @permalink end def id return @id.to_i end ...
github
guitsaru/rbvimeo
https://github.com/guitsaru/rbvimeo
lib/rbvimeo/user.rb
Ruby
mit
19
master
423
# <owner display_name="Vimeo Staff" id="152184" is_plus="1" is_staff="1" profileurl="http://vimeo.com/staff" realname="Vimeo Staff" username="staff" videosurl="http://vimeo.com/staff/videos"> module RBVIMEO class User attr_accessor :id, :username, :display_name, :is_plus, :is_staff, :profileurl, :realname, :user...
github
guitsaru/rbvimeo
https://github.com/guitsaru/rbvimeo
lib/rbvimeo/vimeo.rb
Ruby
mit
19
master
1,672
module RBVIMEO class Vimeo attr_accessor :api_key, :api_secret @@API_REST_URL = "http://www.vimeo.com/api/rest/v2/" @@API_AUTH_URL = "http://www.vimeo.com/services/auth/" @@API_UPLOAD_URL = "http://www.vimeo.com/services/upload/" # api_key and api_secret should both be generated on www.vimeo...
github
guitsaru/rbvimeo
https://github.com/guitsaru/rbvimeo
lib/rbvimeo/video.rb
Ruby
mit
19
master
4,065
module RBVIMEO class Video attr_reader :id, :title, :description, :upload_date, :number_of_likes, :number_of_plays attr_reader :number_of_comments, :width, :height, :owner, :tags, :url attr_reader :thumbs, :duration # Fetches data about a video from the Vimeo site # id is the id of the the Vimeo...
github
pavlo/russian_metaphone
https://github.com/pavlo/russian_metaphone
russian_metaphone.gemspec
Ruby
mit
19
master
1,016
# -*- encoding: utf-8 -*- lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'russian_metaphone/version' Gem::Specification.new do |gem| gem.name = "russian_metaphone" gem.version = RussianMetaphone::VERSION gem.authors = ["Pavlo V. Lys...
github
pavlo/russian_metaphone
https://github.com/pavlo/russian_metaphone
spec/normalization_filter_spec.rb
Ruby
mit
19
master
892
# encoding: UTF-8 require 'spec_helper' describe "Normalization Filter" do it "should join multiple words into one" do RussianMetaphone::Filter::Normalization.filter("привет от старых штиблет").should == 'приветотстарыхштиблет' end it "should not allow anything but cyrillic chars" do RussianMetaphone::...
github
pavlo/russian_metaphone
https://github.com/pavlo/russian_metaphone
spec/breath_consonants_filter_spec.rb
Ruby
mit
19
master
1,110
# encoding: UTF-8 require 'spec_helper' describe "Breath Consonants Filter" do it "should replace voiced with voiceless counterpart if voiced goes right before a voiceless" do RussianMetaphone::Filter::BreathConsonants.filter('мавка').should == 'мафка' RussianMetaphone::Filter::BreathConsonants.filter('об...
github
pavlo/russian_metaphone
https://github.com/pavlo/russian_metaphone
spec/replacement_filter_spec.rb
Ruby
mit
19
master
1,687
# encoding: UTF-8 require 'spec_helper' # # Исходные символы | Конечный символ # | # О, Ы, А, Я | А # Ю, У | У # Е, Ё, Э, И | И # # ЙО, ИО, ЙЕ, ИЕ заменяются на И # ТС, ДС заменяются на Ц describe "Replacements Filter" do it "should not take i...
github
pavlo/russian_metaphone
https://github.com/pavlo/russian_metaphone
spec/duplicates_removal_filter_spec.rb
Ruby
mit
19
master
526
# encoding: UTF-8 require 'spec_helper' describe "Duplicates Removal Filter" do it "should remove all duplicates" do RussianMetaphone::Filter::DuplicatesRemoval.filter('Метревелли').should == 'Метревели' RussianMetaphone::Filter::DuplicatesRemoval.filter('Длиннющий').should == 'Длинющий' end it "sh...
github
pavlo/russian_metaphone
https://github.com/pavlo/russian_metaphone
spec/lastname_ending_filter_spec.rb
Ruby
mit
19
master
1,456
# encoding: UTF-8 require 'spec_helper' describe "Lastname Ending Filter" do it "should collapse like this:" do assert_filter('Дубровский', 'Дубр%1') assert_filter('Раевский', 'Ра%2') assert_filter('Покровская', 'Покр%3') assert_filter('Раневская', 'Ран%4') assert_filter('Палиева', 'Пал%5') ...
github
pavlo/russian_metaphone
https://github.com/pavlo/russian_metaphone
lib/russian_metaphone.rb
Ruby
mit
19
master
708
# encoding: UTF-8 require "unicode" require "russian_metaphone/version" require "russian_metaphone/filter" module RussianMetaphone # fits well if you search for similar sounded last names / names DEFAULT_FILTERS = [ RussianMetaphone::Filter::Normalization, RussianMetaphone::Filter::DuplicatesRemoval, ...
github
pavlo/russian_metaphone
https://github.com/pavlo/russian_metaphone
lib/russian_metaphone/filter.rb
Ruby
mit
19
master
272
# encoding: UTF-8 require 'russian_metaphone/filter/normalization' require 'russian_metaphone/filter/replacement' require 'russian_metaphone/filter/breath_consonants' require 'russian_metaphone/filter/duplicates_removal' require 'russian_metaphone/filter/lastname_ending'
github
pavlo/russian_metaphone
https://github.com/pavlo/russian_metaphone
lib/russian_metaphone/filter/normalization.rb
Ruby
mit
19
master
320
# encoding: UTF-8 module RussianMetaphone module Filter module Normalization STRIP_REGEXP = /[ъь]/ def filter(string, options = {}) string = Unicode.downcase(string.gsub(/\P{Cyrillic}+/, '')) string.gsub(STRIP_REGEXP, '') end module_function :filter end end end
github
pavlo/russian_metaphone
https://github.com/pavlo/russian_metaphone
lib/russian_metaphone/filter/breath_consonants.rb
Ruby
mit
19
master
2,113
# encoding: UTF-8 module RussianMetaphone module Filter # Оглушение согласных в слабой позиции module BreathConsonants REZONANTS = %w(л м н р) # Сонорные согласные (те звонкие, у которых нет глухой пары?) VOICED_VS_VOICELESS = { 'б' => 'п', 'в' => 'ф', 'г' => 'к', 'д' => 'т', 'ж' => 'ж', 'з' => ...
github
pavlo/russian_metaphone
https://github.com/pavlo/russian_metaphone
lib/russian_metaphone/filter/duplicates_removal.rb
Ruby
mit
19
master
481
# encoding: UTF-8 module RussianMetaphone module Filter # Исключение повторяющихся символов module DuplicatesRemoval def filter(string, options = {}) previous_char = nil string.each_char.each_with_index do |current_char, ind| string.slice!(ind-1) if previous_char == current_c...
github
pavlo/russian_metaphone
https://github.com/pavlo/russian_metaphone
lib/russian_metaphone/filter/replacement.rb
Ruby
mit
19
master
854
# encoding: UTF-8 # ТС, ДС | Ц # І, Ї | И # Є | Е # ЙО, ИО, ЙЕ, ИЕ | И # О, Ы, А, Я | А # Ю, У | У # Е, Ё, Э, И | И module RussianMetaphone module Filter module Replacement REPLACEMENTS =...
github
pavlo/russian_metaphone
https://github.com/pavlo/russian_metaphone
lib/russian_metaphone/filter/lastname_ending.rb
Ruby
mit
19
master
952
# encoding: UTF-8 module RussianMetaphone module Filter module LastnameEnding REPLACEMENTS = { /овский$/ => '%1', /евский$/ => '%2', /овская$/ => '%3', /евская$/ => '%4', /иева$|еева$|ова$|ева$/ => '%5', ...
github
dgolja/golja-influxdb
https://github.com/dgolja/golja-influxdb
Rakefile
Ruby
apache-2.0
19
master
675
require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-lint/tasks/puppet-lint' PuppetLint.configuration.send('relative') PuppetLint.configuration.send("disable_80chars") PuppetLint.configuration.send('disable_class_parameter_defaults') PuppetLint.configuration.send('disable_class_inherits_from_params_class') Pupp...
github
dgolja/golja-influxdb
https://github.com/dgolja/golja-influxdb
Gemfile
Ruby
apache-2.0
19
master
1,780
source ENV['GEM_SOURCE'] || 'https://rubygems.org' def location_for(place, fake_version = nil) if place =~ /^(git[:@][^#]*)#(.*)/ [fake_version, { :git => $1, :branch => $2, :require => false }].compact elsif place =~ /^file:\/\/(.*)/ ['>= 0', { :path => File.expand_path($1), :require => false }] else ...
github
dgolja/golja-influxdb
https://github.com/dgolja/golja-influxdb
lib/facter/influxdb_version.rb
Ruby
apache-2.0
19
master
320
# Facter.add(:influxdb_version) do setcode do if Facter::Util::Resolution.which('influx') # InfluxDB shell version: 1.1.1 version_stdout = Facter::Util::Resolution.exec('influx --version') match = version_stdout.match(%r{[0-9]+\.[0-9]+\.[0-9]+}) match ? match[0] : nil end end end
github
dgolja/golja-influxdb
https://github.com/dgolja/golja-influxdb
spec/spec_helper_acceptance.rb
Ruby
apache-2.0
19
master
1,638
require 'beaker-rspec' require 'beaker_spec_helper' require 'beaker-rspec/spec_helper' require 'beaker-rspec/helpers/serverspec' require 'beaker/puppet_install_helper' include BeakerSpecHelper # https://github.com/puppetlabs/beaker-puppet_install_helper run_puppet_install_helper UNSUPPORTED_PLATFORMS = %w(Suse windo...
github
dgolja/golja-influxdb
https://github.com/dgolja/golja-influxdb
spec/spec_helper.rb
Ruby
apache-2.0
19
master
200
require 'puppetlabs_spec_helper/module_spec_helper' require 'rspec-puppet-facts' include RspecPuppetFacts # Include code coverage report for all our specs at_exit { RSpec::Puppet::Coverage.report! }
github
dgolja/golja-influxdb
https://github.com/dgolja/golja-influxdb
spec/unit/facter/util/fact_influxdb_version_spec.rb
Ruby
apache-2.0
19
master
1,050
require 'spec_helper' describe Facter::Util::Fact do before { Facter.clear } on_supported_os.each do |os, facts| context "on #{os}" do let(:facts) { facts } describe 'when influxdb present' do it 'expect Facter[:influxdb_version].value == "1.2.0"' do influxdb_output = '1.2.0' ...
github
dgolja/golja-influxdb
https://github.com/dgolja/golja-influxdb
spec/acceptance/class_spec.rb
Ruby
apache-2.0
19
master
940
require 'spec_helper_acceptance' describe 'influxdb class', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do context 'default parameters' do pp = <<-EOS class { 'influxdb': manage_repos => true, } EOS it 'works with no errors' do # Run it twice and test for idempotency ...
github
dgolja/golja-influxdb
https://github.com/dgolja/golja-influxdb
spec/classes/service_spec.rb
Ruby
apache-2.0
19
master
841
require 'spec_helper' describe 'influxdb::service' do on_supported_os.each do |os, facts| context "on #{os}" do let(:facts) { facts } describe 'with default params' do let(:pre_condition) do <<-EOS include influxdb EOS end it do is_expected.to ...
github
dgolja/golja-influxdb
https://github.com/dgolja/golja-influxdb
spec/classes/config_spec.rb
Ruby
apache-2.0
19
master
9,410
require 'spec_helper' def esc_regex(v) Regexp.new(Regexp.escape(v)) end describe 'influxdb::config' do on_supported_os.each do |os, facts| context "on #{os}" do let(:facts) { facts } describe 'with default params' do let(:pre_condition) do <<-EOS include influxdb EOS ...
github
dgolja/golja-influxdb
https://github.com/dgolja/golja-influxdb
spec/classes/install_spec.rb
Ruby
apache-2.0
19
master
1,502
require 'spec_helper' describe 'influxdb::install' do on_supported_os.each do |os, facts| context "on #{os}" do let(:facts) { facts } describe 'with default params' do let(:pre_condition) do <<-EOS include influxdb EOS end it { is_expected.not_to contain_...
github
dgolja/golja-influxdb
https://github.com/dgolja/golja-influxdb
spec/classes/repo_spec.rb
Ruby
apache-2.0
19
master
1,187
require 'spec_helper' describe 'influxdb::repo' do on_supported_os.each do |os, facts| context "on #{os}" do let(:facts) { facts } describe 'with default params' do case facts[:osfamily] when 'Archlinux' next when 'Debian' let(:contained_class) { 'influxdb...
github
dgolja/golja-influxdb
https://github.com/dgolja/golja-influxdb
spec/classes/init_spec.rb
Ruby
apache-2.0
19
master
700
require 'spec_helper' describe 'influxdb' do on_supported_os.each do |os, facts| context "on #{os}" do let(:facts) { facts } describe 'with default params' do it { is_expected.to contain_anchor('influxdb::start') } it { is_expected.to contain_class('influxdb::params') } it { ...
github
dgolja/golja-influxdb
https://github.com/dgolja/golja-influxdb
spec/classes/repo/apt_spec.rb
Ruby
apache-2.0
19
master
1,455
require 'spec_helper' describe 'influxdb::repo::apt' do on_supported_os.each do |os, facts| # A little ugly, but we only want to run our tests for Debian based machines. next unless facts[:operatingsystem] == 'Debian' context "on #{os}" do let(:facts) { facts } describe 'with default params...
github
dgolja/golja-influxdb
https://github.com/dgolja/golja-influxdb
spec/classes/repo/yum_spec.rb
Ruby
apache-2.0
19
master
1,232
require 'spec_helper' describe 'influxdb::repo::yum' do on_supported_os.each do |os, facts| # A little ugly, but we only want to run our tests for RHEL based machines. next unless facts[:osfamily] == 'RedHat' context "on #{os}" do let(:facts) { facts } describe 'with default params' do ...
github
antiwork/omniauth-gumroad
https://github.com/antiwork/omniauth-gumroad
omniauth-gumroad.gemspec
Ruby
mit
19
master
1,099
# -*- encoding: utf-8 -*- require File.expand_path('../lib/omniauth-gumroad/version', __FILE__) Gem::Specification.new do |gem| gem.name = "omniauth-gumroad" gem.version = OmniAuth::Gumroad::VERSION gem.authors = ["Maxwell Elliott"] gem.email = ["maxwell@gumroad.com"] gem.homepage = "...
github
antiwork/omniauth-gumroad
https://github.com/antiwork/omniauth-gumroad
lib/omniauth/strategies/gumroad.rb
Ruby
mit
19
master
1,301
require "omniauth/strategies/oauth2" module OmniAuth module Strategies class Gumroad < OmniAuth::Strategies::OAuth2 option :name, "gumroad" option :client_options, { authorize_url: "https://gumroad.com/oauth/authorize", token_url: "https://gumroad.com/oauth/token", site: "ht...
github
antiwork/omniauth-gumroad
https://github.com/antiwork/omniauth-gumroad
spec/spec_helper.rb
Ruby
mit
19
master
317
$:.unshift File.expand_path('..', __FILE__) require 'rspec' require 'rack/test' require 'webmock/rspec' require 'omniauth' require 'omniauth-gumroad' RSpec.configure do |config| config.include WebMock::API config.include Rack::Test::Methods config.extend OmniAuth::Test::StrategyMacros, :type => :strategy end
github
antiwork/omniauth-gumroad
https://github.com/antiwork/omniauth-gumroad
spec/omniauth/strategies/gumroad_spec.rb
Ruby
mit
19
master
936
require 'spec_helper' describe OmniAuth::Strategies::Gumroad do let(:client) do OmniAuth::Strategies::Gumroad.new('GUMROAD_APP_KEY', 'GUMROAD_SECRET_KEY') end context "client options" do it "should have the correct site" do client.options.client_options.site.should eq "https://gumroad.com" end it "shou...
github
bkeepers/spiderman
https://github.com/bkeepers/spiderman
spiderman.gemspec
Ruby
mit
19
master
1,346
require_relative 'lib/spiderman/version' Gem::Specification.new do |spec| spec.name = "spiderman" spec.version = Spiderman::VERSION spec.authors = ["Brandon Keepers"] spec.email = ["brandon@opensoul.org"] spec.summary = %q{your friendly neighborhood web crawler} spec.des...
github
bkeepers/spiderman
https://github.com/bkeepers/spiderman
lib/spiderman.rb
Ruby
mit
19
master
2,926
require "logger" require "http" require "http/mime_type/html" require "http/acts_as_nokogiri_document" require "active_support/core_ext/class" require "active_support/core_ext/module" require "active_support/concern" require "spiderman/version" require "spiderman/runner" require 'spiderman/railtie' if defined?(Rails) ...
github
bkeepers/spiderman
https://github.com/bkeepers/spiderman
lib/http/acts_as_nokogiri_document.rb
Ruby
mit
19
master
345
module HTTP # Module to mix into `HTTP::Response` to make it act like a Nokogiri doc module ActAsNokogiriDocument def document return @document if defined?(@document) @document = parse(content_type.mime_type) end def method_missing(method, *args, &block) document.send(method, *args, &...
github
bkeepers/spiderman
https://github.com/bkeepers/spiderman
lib/http/mime_type/html.rb
Ruby
mit
19
master
383
module HTTP module MimeType # This allows you to call `response.parse` and get back a Nokogiri object # if the content type is HTML. class HTML < Adapter def encode(obj) obj.to_s if obj end def decode(str) Nokogiri::HTML(str) end end register_adapter "text...
github
bkeepers/spiderman
https://github.com/bkeepers/spiderman
lib/spiderman/runner.rb
Ruby
mit
19
master
939
module Spiderman class Runner class_attribute :logger, instance_accessor: true, default: Logger.new(STDOUT, level: :info) attr_reader :urls, :headers, :handlers def initialize @urls = [] @handlers = {} @headers = {} end def start_at(*urls) @urls.append(*urls) end ...
github
bkeepers/spiderman
https://github.com/bkeepers/spiderman
lib/spiderman/railtie.rb
Ruby
mit
19
master
206
module Spiderman class Railtie < Rails::Railtie initializer "spiderman" do Spiderman::Runner.logger = Rails.logger end rake_tasks do load "spiderman/tasks.rake" end end end
github
bkeepers/spiderman
https://github.com/bkeepers/spiderman
lib/spiderman/tasks.rake
Ruby
mit
19
master
948
namespace :spiderman do # Load the environment and eager load all classes task :environment => :environment do if defined?(Rails) ActiveSupport.run_load_hooks(:before_eager_load, Rails.configuration) Rails.configuration.eager_load_namespaces.each(&:eager_load!) end if defined?(Zeitwerk) ...
github
bkeepers/spiderman
https://github.com/bkeepers/spiderman
spec/spiderman_spec.rb
Ruby
mit
19
master
2,940
RSpec.describe Spiderman do subject { Class.new { include Spiderman } } before do Spiderman::Runner.logger = Logger.new(STDOUT, level: :unknown) end it "has a version number" do expect(Spiderman::VERSION).not_to be nil end it "adds a crawler configuration to the class" do expect(subject.crawl...
github
bkeepers/spiderman
https://github.com/bkeepers/spiderman
spec/spec_helper.rb
Ruby
mit
19
master
389
require "bundler/setup" require 'webmock/rspec' require "spiderman" RSpec.configure do |config| # Enable flags like --only-failures and --next-failure config.example_status_persistence_file_path = ".rspec_status" # Disable RSpec exposing methods globally on `Module` and `main` config.disable_monkey_patching! ...
github
jhawthorn/delta_debug
https://github.com/jhawthorn/delta_debug
delta_debug.gemspec
Ruby
mit
19
main
1,246
# frozen_string_literal: true require_relative "lib/delta_debug/version" Gem::Specification.new do |spec| spec.name = "delta_debug" spec.version = DeltaDebug::VERSION spec.authors = ["John Hawthorn"] spec.email = ["john@hawthorn.email"] spec.summary = "reduces failing test input" spec.description = "Impl...
github
jhawthorn/delta_debug
https://github.com/jhawthorn/delta_debug
lib/delta_debug.rb
Ruby
mit
19
main
1,914
# frozen_string_literal: true require "delta_debug/version" # https://www.st.cs.uni-saarland.de/papers/tse2002/tse2002.pdf class DeltaDebug def initialize(harness, verbose: $DEBUG) @harness = harness @verbose = verbose end attr_reader :verbose def run_test(input) print "testing #{input.inspect} ...
github
jhawthorn/delta_debug
https://github.com/jhawthorn/delta_debug
examples/html_select.rb
Ruby
mit
19
main
258
require "delta_debug" input = '<SELECT NAME="priority" MULTIPLE SIZE=7>' harness = -> (html) do if html =~ /<SELECT\b.*>/ puts "found failure: #{html.dump}" true else false end end result = DeltaDebug.new(harness).ddmin(input) p(result:)
github
jhawthorn/delta_debug
https://github.com/jhawthorn/delta_debug
test/test_delta_debug.rb
Ruby
mit
19
main
3,020
# frozen_string_literal: true require "test_helper" class TestDeltaDebug < Minitest::Test def test_that_it_has_a_version_number refute_nil ::DeltaDebug::VERSION end def test_array_example input = (1..8).to_a harness = ->(v) { ([1,7,8] - v).empty? } result = DeltaDebug.new(harness).ddmin(input)...
github
dorahacksglobal/Hackathon-Playbook
https://github.com/dorahacksglobal/Hackathon-Playbook
Gemfile
Ruby
mit
19
main
1,135
source "https://rubygems.org" # Hello! This is where you manage which Jekyll version is used to run. # When you want to use a different version, change it below, save the # file and run `bundle install`. Run Jekyll with `bundle exec`, like so: # # bundle exec jekyll serve # # This will help ensure the proper Jekyll...
github
DILA-edu/cbeta-metadata
https://github.com/DILA-edu/cbeta-metadata
creators/bin/json2csv.rb
Ruby
mit
19
master
543
require 'json' require 'csv' IN = '../creators-by-canon' OUT = '../out' def convert(f) puts f src = File.join(IN, f) s = File.read(src) data = JSON.parse(s) basename = File.basename(f, '.json') dest = File.join(OUT, basename+'.csv') CSV.open(dest, "wb") do |csv| csv << %w(work_id title byline cre...
github
DILA-edu/cbeta-metadata
https://github.com/DILA-edu/cbeta-metadata
creators/bin/get-creators-from-authority.rb
Ruby
mit
19
master
1,386
require 'rest-client' require 'json' require 'nokogiri' # https://github.com/DILA-edu/Authority-Databases AUTHORITY = '/Users/ray/git-repos/Authority-Databases' OUT = '../creators-by-canon/T.json' def check_person_exist(works) puts "check person id exist in authority database" puts "待檢查筆數: #{works.size}" fn = ...
github
DILA-edu/cbeta-metadata
https://github.com/DILA-edu/cbeta-metadata
creators/bin/get-creators-from-xml.rb
Ruby
mit
19
master
1,460
require 'cbeta' require 'json' IN = '/Users/ray/git-repos/cbeta-xml-p5a' def handle_canon(canon) fn = File.join('../creators-by-canon', "#{canon}.json") if File.exist?(fn) $works = JSON.parse(File.read(fn)) else $works = {} end folder = File.join(IN, canon) $dirty = false Dir.entries(folder).so...
github
DILA-edu/cbeta-metadata
https://github.com/DILA-edu/cbeta-metadata
creators/bin/check.rb
Ruby
mit
19
master
854
# 列出缺少「作譯者資訊」或「作譯者ID」的典籍 require 'csv' require 'json' WORKS = '../../work-id' CREATORS = '../creators-by-canon' OUT = '../out' def chk_canon(canon) work_id_file = File.join(WORKS, "#{canon}.csv") creators_file = File.join(CREATORS, "#{canon}.json") s = File.read(creators_file) creators = JSON.parse(s) ...
github
DILA-edu/cbeta-metadata
https://github.com/DILA-edu/cbeta-metadata
creators/bin/list-all.rb
Ruby
mit
19
master
3,961
require 'csv' require 'json' require 'pp' require 'set' require 'unihan2' TITLES = '../../titles/titles-by-canon' IN = '../creators-by-canon' OUT = '../all-creators.txt' OUT_CSV = '../all-title-byline.csv' OUT_JSON = '../all-creators.json' OUT_STROKE = '../creators-by-strokes-with-works.json' OUT_STROKE2 = '../creator...
github
DILA-edu/cbeta-metadata
https://github.com/DILA-edu/cbeta-metadata
creators/bin/stat.rb
Ruby
mit
19
master
1,328
require 'json' require 'set' IN = '../creators-by-canon' OUT = '../out/stat.md' def handle_file(fn) s = File.read(fn) creators = JSON.parse(s) creators.each do |k, v| if v.key? 'creators_with_id' s = v['creators_with_id'] if s.include? ',' puts fn puts "creators_with_id 欄位不應有逗點: ...
github
DILA-edu/cbeta-metadata
https://github.com/DILA-edu/cbeta-metadata
variants/completely-synonymous.rb
Ruby
mit
19
master
594
require 'json' require 'set' def chk_k2s(chars) chars.each do |c| return $k2s[c] if $k2s.key?(c) end nil end variants = JSON.parse(File.read('variants.json')) $k2s = {} all = [] variants.each do |h| next unless h['type'] == '完全同義' chars = h['chars'].split(',') vars = chk_k2s(chars) if vars.nil? ...
github
DILA-edu/cbeta-metadata
https://github.com/DILA-edu/cbeta-metadata
chars/bin/list-chars.rb
Ruby
mit
19
master
801
require 'nokogiri' require 'csv' require 'set' require 'unihan2' IN = '/Users/ray/git-repos/cbeta-xml-p5a' OUT = '../cbeta-all-uni-chars.csv' def handle_folder(folder) Dir.entries(folder).sort.each do |f| next if f.start_with? '.' path = File.join(folder, f) if Dir.exist?(path) handle_folder(path)...
github
DILA-edu/cbeta-metadata
https://github.com/DILA-edu/cbeta-metadata
chars/bin/count.rb
Ruby
mit
19
master
2,011
# 統計 CBETA 各經字數 # 校勘不列入統計 require 'cbeta' XML = '/Users/ray/git-repos/cbeta-xml-p5a' PUNCS = /[ ,\.\(\)\[\]'" 。‧.,、;?!:︰()「」『』《》<>〈〉〔〕[]【】〖〗〃…—─~│┬▆*+-=]/ def handle_canon(canon) canon_folder = File.join(XML, canon) Dir.entries(canon_folder).each do |vol| next if vol.start_with? '.' vol_folder = File.joi...
github
DILA-edu/cbeta-metadata
https://github.com/DILA-edu/cbeta-metadata
textref/convert.rb
Ruby
mit
19
master
1,054
require 'csv' require 'json' require 'yaml' # DILA Authority: # https://github.com/DILA-edu/Authority-Databases/tree/master/authority_catalog/json IN = '/Users/ray/git-repos/Authority-Databases/authority_catalog/json' def handle_file(f) canon = File.basename(f, '.json') edition = $canons[canon]['zh'] work_in...
github
DILA-edu/cbeta-metadata
https://github.com/DILA-edu/cbeta-metadata
work-info/bin/update-from-authority.rb
Ruby
mit
19
master
1,743
require 'rest-client' require 'json' require 'nokogiri' # https://github.com/DILA-edu/Authority-Databases AUTHORITY = '/Users/ray/git-repos/Authority-Databases' OUT = '../T.json' def check_person_exist(works) puts "check person id exist in authority database" puts "待檢查筆數: #{works.size}" fn = File.join(AUTHORIT...
github
cockroachdb/homebrew-tap
https://github.com/cockroachdb/homebrew-tap
Formula/cockroach@24.1.rb
Ruby
apache-2.0
19
master
6,648
# Auto-generated file, DO NOT EDIT # Source: release/cockroach-tmpl.rb class CockroachAT241 < Formula desc "Distributed SQL database" homepage "https://www.cockroachlabs.com" version "24.1.28" on_macos do on_intel do url "https://binaries.cockroachdb.com/cockroach-v24.1.28.darwin-10.9-amd64.tgz" ...
github
cockroachdb/homebrew-tap
https://github.com/cockroachdb/homebrew-tap
Formula/cockroach@25.4.rb
Ruby
apache-2.0
19
master
6,644
# Auto-generated file, DO NOT EDIT # Source: release/cockroach-tmpl.rb class CockroachAT254 < Formula desc "Distributed SQL database" homepage "https://www.cockroachlabs.com" version "25.4.9" on_macos do on_intel do url "https://binaries.cockroachdb.com/cockroach-v25.4.9.darwin-10.9-amd64.tgz" ...
github
cockroachdb/homebrew-tap
https://github.com/cockroachdb/homebrew-tap
Formula/ccloud.rb
Ruby
apache-2.0
19
master
953
# Auto-generated file, DO NOT EDIT # Source: release/ccloud-tmpl.rb class Ccloud < Formula desc "CockroachDB Cloud CLI" homepage "https://www.cockroachlabs.com" version "0.8.23" on_macos do on_intel do url "https://binaries.cockroachdb.com/ccloud/ccloud_darwin-amd64_0.8.23.tar.gz" sha256 "28db...
github
cockroachdb/homebrew-tap
https://github.com/cockroachdb/homebrew-tap
Formula/cockroach-sql.rb
Ruby
apache-2.0
19
master
1,151
# Auto-generated file, DO NOT EDIT # Source: release/cockroach-sql-tmpl.rb class CockroachSql < Formula desc "Distributed SQL database shell" homepage "https://www.cockroachlabs.com" version "26.1.3" on_macos do on_intel do url "https://binaries.cockroachdb.com/cockroach-sql-v26.1.3.darwin-10.9-amd6...
github
cockroachdb/homebrew-tap
https://github.com/cockroachdb/homebrew-tap
Formula/cockroach@24.3.rb
Ruby
apache-2.0
19
master
6,648
# Auto-generated file, DO NOT EDIT # Source: release/cockroach-tmpl.rb class CockroachAT243 < Formula desc "Distributed SQL database" homepage "https://www.cockroachlabs.com" version "24.3.31" on_macos do on_intel do url "https://binaries.cockroachdb.com/cockroach-v24.3.31.darwin-10.9-amd64.tgz" ...
github
cockroachdb/homebrew-tap
https://github.com/cockroachdb/homebrew-tap
Formula/cockroach@25.2.rb
Ruby
apache-2.0
19
master
6,648
# Auto-generated file, DO NOT EDIT # Source: release/cockroach-tmpl.rb class CockroachAT252 < Formula desc "Distributed SQL database" homepage "https://www.cockroachlabs.com" version "25.2.17" on_macos do on_intel do url "https://binaries.cockroachdb.com/cockroach-v25.2.17.darwin-10.9-amd64.tgz" ...
github
cockroachdb/homebrew-tap
https://github.com/cockroachdb/homebrew-tap
Formula/cockroach@25.3.rb
Ruby
apache-2.0
19
master
6,644
# Auto-generated file, DO NOT EDIT # Source: release/cockroach-tmpl.rb class CockroachAT253 < Formula desc "Distributed SQL database" homepage "https://www.cockroachlabs.com" version "25.3.7" on_macos do on_intel do url "https://binaries.cockroachdb.com/cockroach-v25.3.7.darwin-10.9-amd64.tgz" ...
github
cockroachdb/homebrew-tap
https://github.com/cockroachdb/homebrew-tap
Formula/cockroach@25.1.rb
Ruby
apache-2.0
19
master
6,648
# Auto-generated file, DO NOT EDIT # Source: release/cockroach-tmpl.rb class CockroachAT251 < Formula desc "Distributed SQL database" homepage "https://www.cockroachlabs.com" version "25.1.10" on_macos do on_intel do url "https://binaries.cockroachdb.com/cockroach-v25.1.10.darwin-10.9-amd64.tgz" ...
github
cockroachdb/homebrew-tap
https://github.com/cockroachdb/homebrew-tap
Formula/cockroach.rb
Ruby
apache-2.0
19
master
6,639
# Auto-generated file, DO NOT EDIT # Source: release/cockroach-tmpl.rb class Cockroach < Formula desc "Distributed SQL database" homepage "https://www.cockroachlabs.com" version "26.1.3" on_macos do on_intel do url "https://binaries.cockroachdb.com/cockroach-v26.1.3.darwin-10.9-amd64.tgz" sha25...
github
cockroachdb/homebrew-tap
https://github.com/cockroachdb/homebrew-tap
Formula/cockroach@26.1.rb
Ruby
apache-2.0
19
master
6,644
# Auto-generated file, DO NOT EDIT # Source: release/cockroach-tmpl.rb class CockroachAT261 < Formula desc "Distributed SQL database" homepage "https://www.cockroachlabs.com" version "26.1.3" on_macos do on_intel do url "https://binaries.cockroachdb.com/cockroach-v26.1.3.darwin-10.9-amd64.tgz" ...
github
cockroachdb/homebrew-tap
https://github.com/cockroachdb/homebrew-tap
release/ccloud-tmpl.rb
Ruby
apache-2.0
19
master
692
# Auto-generated file, DO NOT EDIT # Source: release/ccloud-tmpl.rb class Ccloud < Formula desc "CockroachDB Cloud CLI" homepage "https://www.cockroachlabs.com" version "{{ .Version }}" on_macos do on_intel do url "{{ .DarwinAMD64URL }}" sha256 "{{ .DarwinAMD64SHA256 }}" end on_arm do ...