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 | nodai2hITC/eturem | https://github.com/nodai2hITC/eturem | test/eturem_test.rb | Ruby | mit | 19 | main | 2,859 | require "test_helper"
require "eturem/ja/main"
class EturemJaTest < Minitest::Test
def load_and_full_message(filename)
exception = Eturem.load(filename)
return nil unless exception.is_a?(Exception)
Eturem.extend_exception(exception)
exception.eturem_full_message(highlight: false).strip + "\n"
end
... |
github | nodai2hITC/eturem | https://github.com/nodai2hITC/eturem | lib/eturem.rb | Ruby | mit | 19 | main | 3,007 | enable = true
debug = false
lang = "en"
output_backtrace = true
output_original = true
output_script = true
override_warning = true
use_coderay = false
before_line_num = 2
after_line_num = 2
repl = nil
config_file = File.exist?("./.eturem") ? "./.eturem" : File.join(Dir.home, ".eturem")
if F... |
github | nodai2hITC/eturem | https://github.com/nodai2hITC/eturem | lib/eturem/warning.rb | Ruby | mit | 19 | main | 427 | module Warning
def self.warn(*message)
new_message = message.map do |mes|
if mes.force_encoding("utf-8").match(/^(.+?):(\d+):\s*warning:\s*/)
path, lineno, warning = $1, $2.to_i, $'.strip
path = Eturem.program_name if path == File.expand_path(Eturem.program_name)
str = Eturem::Base.w... |
github | nodai2hITC/eturem | https://github.com/nodai2hITC/eturem | lib/eturem/base.rb | Ruby | mit | 19 | main | 9,449 | require "eturem/version"
module Eturem
@program_name = $PROGRAM_NAME.encode("utf-8")
def self.rescue
yield
rescue Exception => exception
raise exception if exception.is_a? SystemExit
exception
end
# load script and return exception if exception raised
# @param [String] filename script file
... |
github | nodai2hITC/eturem | https://github.com/nodai2hITC/eturem | lib/eturem/ja/load_error.rb | Ruby | mit | 19 | main | 335 | # coding: utf-8
module Eturem
module LoadErrorExt
include ExceptionExt
def eturem_message()
@eturem_message_ja =
%<ファイル/ライブラリ "#{self.path.encode("utf-8")}" が見つかりません。> +
%<ファイル/ライブラリ名を確認してください。>
super
end
end
end |
github | nodai2hITC/eturem | https://github.com/nodai2hITC/eturem | lib/eturem/ja/error_enoent.rb | Ruby | mit | 19 | main | 582 | # coding: utf-8
module Eturem
module Errno_ENOENTExt
include ExceptionExt
def eturem_message()
@eturem_message_ja = "ファイルアクセスに失敗しました。"
if @eturem_message.match(/-\s*(?<filename>.+)\s*$/)
filename = Regexp.last_match(:filename).encode("utf-8")
@eturem_message_ja += %<ファイル "#{filen... |
github | nodai2hITC/eturem | https://github.com/nodai2hITC/eturem | lib/eturem/ja/dxruby_error.rb | Ruby | mit | 19 | main | 326 | module Eturem
module DXRubyErrorExt
include ExceptionExt
def eturem_message()
case @eturem_message
when /^Load error - (.+)/
@eturem_message_ja = %<ファイル "#{$1}" の読み込みに失敗しました。ファイル名を確認してください。>
end
super
end
end
end |
github | nodai2hITC/eturem | https://github.com/nodai2hITC/eturem | lib/eturem/ja/syntax_error.rb | Ruby | mit | 19 | main | 3,658 | module Eturem
module SyntaxErrorExt
include ExceptionExt
def eturem_message()
if @eturem_message.match(/unexpected (?<unexpected>(?:','|[^,])+)/)
eturem_unexpected(eturem_transform_keyword(Regexp.last_match(:unexpected)))
elsif @eturem_message.match(/Invalid (?<invalid>(?:break|next|retry... |
github | nodai2hITC/eturem | https://github.com/nodai2hITC/eturem | lib/eturem/ja/name_error.rb | Ruby | mit | 19 | main | 1,878 | module Eturem
module NameErrorExt
include ExceptionExt
def eturem_message()
if self.name.to_s.encode("utf-8").include?(" ")
eturem_multibyte_space
elsif self.name.to_s.encode("utf-8").match(/[”’`(){}#]/)
eturem_multibyte_char
elsif self.receiver == nil
eturem_receive... |
github | nodai2hITC/eturem | https://github.com/nodai2hITC/eturem | lib/eturem/ja/type_error.rb | Ruby | mit | 19 | main | 431 | module Eturem
module TypeErrorExt
include ExceptionExt
def eturem_message()
@eturem_message_ja = "「#{@eturem_label}」への引数の型(種類)が正しくありません。"
if @eturem_message.match(/no implicit conversion of (\S+) into (\S+)/)
@eturem_message_ja += "\n本来 #{$2} 型などが来るべきところに #{$1} 型が来ています。"
end
s... |
github | nodai2hITC/eturem | https://github.com/nodai2hITC/eturem | lib/eturem/ja/no_memory_error.rb | Ruby | mit | 19 | main | 279 | # coding: utf-8
module Eturem
module NoMemoryErrorExt
include ExceptionExt
def eturem_message()
@eturem_message_ja = "メモリを確保できませんでした。あまりにも大量のデータを作成していませんか?"
super
end
end
end |
github | nodai2hITC/eturem | https://github.com/nodai2hITC/eturem | lib/eturem/ja/zero_division_error.rb | Ruby | mit | 19 | main | 206 | module Eturem
module ZeroDivisionErrorExt
include ExceptionExt
def eturem_message()
@eturem_message_ja = "割る数が 0 での割り算はできません。"
super
end
end
end |
github | nodai2hITC/eturem | https://github.com/nodai2hITC/eturem | lib/eturem/ja/system_stack_error.rb | Ruby | mit | 19 | main | 277 | module Eturem
module SystemStackErrorExt
include ExceptionExt
def eturem_message()
@eturem_message_ja = "システムスタックがあふれました。意図しない無限ループが生じている可能性があります。"
super
end
end
end |
github | nodai2hITC/eturem | https://github.com/nodai2hITC/eturem | lib/eturem/ja/interrupt.rb | Ruby | mit | 19 | main | 221 | # coding: utf-8
module Eturem
module InterruptExt
include ExceptionExt
def eturem_message()
@eturem_message_ja = "プログラムが途中で強制終了されました。"
super
end
end
end |
github | nodai2hITC/eturem | https://github.com/nodai2hITC/eturem | lib/eturem/ja/warning.rb | Ruby | mit | 19 | main | 2,156 | # coding: utf-8
module Eturem
module Base
def self.warning_message(path, lineno, warning)
str = "\e[1;33m【警告】\e[0m" +
(path == "(eval)" ? "eval 中の" : %<ファイル"#{path}" #{lineno}行目:>) +
(@@eturem_output_original ? "#{warning}\n" : "\n")
script_lines = Eturem::Base.read_script(path)
... |
github | nodai2hITC/eturem | https://github.com/nodai2hITC/eturem | lib/eturem/ja/argument_error.rb | Ruby | mit | 19 | main | 1,863 | # coding: utf-8
module Eturem
module ArgumentErrorExt
include ExceptionExt
def eturem_message()
given = nil
if @eturem_message.include?("wrong number of arguments")
if @eturem_message.match(/\(given (?<given>\d+), expected (?<expected>[^)]+)\)/)
given = Regexp.last_match(:gi... |
github | nodai2hITC/eturem | https://github.com/nodai2hITC/eturem | lib/eturem/ja/main.rb | Ruby | mit | 19 | main | 11,184 | # coding: utf-8
require "eturem/base"
Dir[File.expand_path("..", __FILE__) + "/*.rb"].each do |path|
require path unless path == File.expand_path(__FILE__)
end
module Eturem
def self._extend_exception(exception)
ext = case exception
when NoMemoryError then NoMemoryErrorExt
when LoadError t... |
github | nodai2hITC/eturem | https://github.com/nodai2hITC/eturem | lib/eturem/en/warning.rb | Ruby | mit | 19 | main | 292 | # coding: utf-8
module Eturem
module Base
def self.warning_message(path, lineno, warning)
script_lines = Eturem::Base.read_script(path)
script = Eturem::Base.script(script_lines, [lineno], lineno)
"#{path}:#{lineno}: warning: #{warning}\n" + script
end
end
end |
github | nodai2hITC/eturem | https://github.com/nodai2hITC/eturem | lib/eturem/en/main.rb | Ruby | mit | 19 | main | 10,723 | # coding: utf-8
require "eturem/base"
Dir[File.expand_path("..", __FILE__) + "/*.rb"].each do |path|
require path unless path == File.expand_path(__FILE__)
end
module Eturem
def self._extend_exception(exception)
ext = case exception
# when NoMemoryError then NoMemoryErrorExt
# when LoadError... |
github | julianfssen/coingecko_ruby | https://github.com/julianfssen/coingecko_ruby | coingecko_ruby.gemspec | Ruby | mit | 19 | master | 1,545 | require_relative 'lib/coingecko_ruby/version'
Gem::Specification.new do |spec|
spec.name = "coingecko_ruby"
spec.version = CoingeckoRuby::VERSION
spec.authors = ["Julian Foo Siang Sen"]
spec.email = ["juliandevmy@gmail.com"]
spec.summary = %q{An easy-to-use client/wrapper ... |
github | julianfssen/coingecko_ruby | https://github.com/julianfssen/coingecko_ruby | Rakefile | Ruby | mit | 19 | master | 227 | require "bundler/gem_tasks"
require "rake/testtask"
Rake::TestTask.new(:test) do |t|
t.options = "--no-plugins"
t.libs << "test"
t.libs << "lib"
t.test_files = FileList["test/**/*_test.rb"]
end
task :default => :test |
github | julianfssen/coingecko_ruby | https://github.com/julianfssen/coingecko_ruby | lib/coingecko_ruby/client.rb | Ruby | mit | 19 | master | 1,145 | require 'coingecko_ruby/connection'
require 'coingecko_ruby/client/status'
require 'coingecko_ruby/client/prices'
require 'coingecko_ruby/client/coins'
require 'coingecko_ruby/client/categories'
require 'coingecko_ruby/client/exchanges'
require 'coingecko_ruby/client/indexes'
require 'coingecko_ruby/client/finance'
req... |
github | julianfssen/coingecko_ruby | https://github.com/julianfssen/coingecko_ruby | lib/coingecko_ruby/connection.rb | Ruby | mit | 19 | master | 804 | require 'faraday'
require 'faraday_middleware'
require 'coingecko_ruby/error'
module CoingeckoRuby
module Connection
BASE_URL = 'https://api.coingecko.com/api/v3/'.freeze
def get(endpoint, **opts)
request :get, endpoint, **opts
end
def request(method, endpoint, **opts)
connection = crea... |
github | julianfssen/coingecko_ruby | https://github.com/julianfssen/coingecko_ruby | lib/coingecko_ruby/error.rb | Ruby | mit | 19 | master | 459 | require 'faraday'
module CoingeckoRuby
class FaradayError < Faraday::Error
def self.wrap_error(error)
class_to_wrap = error.class.name.split('::').last
wrapped_error_class = Class.new(error.class)
if CoingeckoRuby.const_defined?(class_to_wrap)
CoingeckoRuby.const_get(class_to_wrap)
... |
github | julianfssen/coingecko_ruby | https://github.com/julianfssen/coingecko_ruby | lib/coingecko_ruby/client/exchanges.rb | Ruby | mit | 19 | master | 8,017 | module CoingeckoRuby
class Client
module Exchanges
# Fetches complete data for every exchange currently supported by the CoinGecko API.
#
# @option options [Integer] :per_page (100) sets the number of results to return per page.
# @option options [Integer] :page sets the page for results.
... |
github | julianfssen/coingecko_ruby | https://github.com/julianfssen/coingecko_ruby | lib/coingecko_ruby/client/events.rb | Ruby | mit | 19 | master | 2,734 | module CoingeckoRuby
class Client
module Events
# Fetches the list of events listed in CoinGecko.
# @todo CoinGecko API is not returning any list of events. Investigate why this is happening.
#
# @option options [String] :country_code country code to fetch list of events from.
# @opt... |
github | julianfssen/coingecko_ruby | https://github.com/julianfssen/coingecko_ruby | lib/coingecko_ruby/client/coins.rb | Ruby | mit | 19 | master | 10,350 | module CoingeckoRuby
class Client
module Coins
# Fetches the id, name, and symbol of every coin supported by CoinGecko's API.
#
# @option options include_platform [Boolean] displays the coin's platform contract address (e.g. 0x... for ETH-based tokens)
#
# @return [Array<Hash>] retu... |
github | julianfssen/coingecko_ruby | https://github.com/julianfssen/coingecko_ruby | lib/coingecko_ruby/client/derivatives.rb | Ruby | mit | 19 | master | 5,855 | module CoingeckoRuby
class Client
module Derivatives
# Fetches the list of derivative products listed in CoinGecko.
#
# @option options [String] :include_tickers ('unexpired') determines whether to display all tickers or only show unexpired tickers. Valid values: all, unexpired
#
# @... |
github | julianfssen/coingecko_ruby | https://github.com/julianfssen/coingecko_ruby | lib/coingecko_ruby/client/indexes.rb | Ruby | mit | 19 | master | 3,096 | module CoingeckoRuby
class Client
module Indexes
# Fetches the list of market indexes listed in CoinGecko.
#
# @option options [Integer] :per_page (100) sets the number of results to return per page.
# @option options [Integer] :page sets the page for results.
#
# @return [Arra... |
github | julianfssen/coingecko_ruby | https://github.com/julianfssen/coingecko_ruby | lib/coingecko_ruby/client/status.rb | Ruby | mit | 19 | master | 300 | module CoingeckoRuby
class Client
module Status
# Fetches CoinGecko's API status.
#
# @return [Hash] returns CoinGecko's API status.
#
# @example Fetch CoinGecko's API status.
# client.status
def status
get 'ping'
end
end
end
end |
github | julianfssen/coingecko_ruby | https://github.com/julianfssen/coingecko_ruby | lib/coingecko_ruby/client/prices.rb | Ruby | mit | 19 | master | 14,043 | module CoingeckoRuby
class Client
module Prices
# Fetches the current price for a coin in the given coin or currency.
# @param ids [String, Array] the coin id or array of ids to fetch.
# @param currency [String, Array] the currency or array of currencies to display the coin's price. Defaults to ... |
github | julianfssen/coingecko_ruby | https://github.com/julianfssen/coingecko_ruby | lib/coingecko_ruby/client/finance.rb | Ruby | mit | 19 | master | 3,662 | module CoingeckoRuby
class Client
module Finance
# Fetches the list of finance platforms (e.g. Celsius Network, dYdX) listed in CoinGecko.
#
# @option options [Integer] :per_page (100) sets the number of results to return per page.
# @option options [Integer] :page sets the page for result... |
github | julianfssen/coingecko_ruby | https://github.com/julianfssen/coingecko_ruby | lib/coingecko_ruby/client/infos.rb | Ruby | mit | 19 | master | 6,618 | module CoingeckoRuby
class Client
module Infos
# Fetches global crypto data from CoinGecko.
#
# @return [Hash] global crypto data (e.g. market cap, total volume, active ICOs, etc.)
#
# @example Get global crypto data.
# client.global_crypto_data
# @example Sample respon... |
github | julianfssen/coingecko_ruby | https://github.com/julianfssen/coingecko_ruby | lib/coingecko_ruby/client/categories.rb | Ruby | mit | 19 | master | 2,722 | module CoingeckoRuby
class Client
module Categories
# Fetches the list of coin categories in CoinGecko.
#
# @return [Array<Hash>] each category's id and name
#
# @example Get all coin categories.
# client.categories
# @example Sample response object
# [{
#... |
github | julianfssen/coingecko_ruby | https://github.com/julianfssen/coingecko_ruby | test/test_helper.rb | Ruby | mit | 19 | master | 430 | $LOAD_PATH.unshift File.expand_path("../lib", __dir__)
require 'coingecko_ruby'
require 'minitest/autorun'
require 'webmock/minitest'
require 'vcr'
VCR.configure do |config|
config.cassette_library_dir = 'fixtures/vcr_cassettes'
config.hook_into :webmock
config.default_cassette_options = {
record: :new_epis... |
github | julianfssen/coingecko_ruby | https://github.com/julianfssen/coingecko_ruby | test/coingecko_ruby_test.rb | Ruby | mit | 19 | master | 282 | require "test_helper"
class CoingeckoRubyTest < Minitest::Test
def test_that_it_has_a_version_number
refute_nil ::CoingeckoRuby::VERSION
end
def test_that_it_returns_a_new_client_instance
assert_instance_of CoingeckoRuby::Client, CoingeckoRuby::Client.new
end
end |
github | julianfssen/coingecko_ruby | https://github.com/julianfssen/coingecko_ruby | test/coingecko_ruby/error_test.rb | Ruby | mit | 19 | master | 826 | require 'test_helper'
class TestError < Minitest::Test
ClientErrorStatuses = (400...451).freeze
ServerErrorStatuses = (500...511).freeze
def setup
@client = CoingeckoRuby::Client.new
end
def get_stubbed_endpoint(status)
body = "{\"#{status}\":\"Internal Server Error\"}"
stub_get('stubbed_endpoi... |
github | julianfssen/coingecko_ruby | https://github.com/julianfssen/coingecko_ruby | test/coingecko_ruby/client/exchanges_test.rb | Ruby | mit | 19 | master | 1,804 | require 'test_helper'
class TestExchanges < Minitest::Test
def setup
@client = CoingeckoRuby::Client.new
VCR.insert_cassette name
end
def test_that_it_gets_the_list_of_supported_exchanges
response = @client.exchanges
exchange_data = response[0]
assert_includes exchange_data, 'name'
asser... |
github | julianfssen/coingecko_ruby | https://github.com/julianfssen/coingecko_ruby | test/coingecko_ruby/client/finance_test.rb | Ruby | mit | 19 | master | 782 | require 'test_helper'
class TestFinance < Minitest::Test
def setup
@client = CoingeckoRuby::Client.new
VCR.insert_cassette name
end
def test_that_it_gets_finance_platforms
response = @client.finance_platforms
platform_data = response[0]
assert_includes platform_data, 'name'
assert_includ... |
github | julianfssen/coingecko_ruby | https://github.com/julianfssen/coingecko_ruby | test/coingecko_ruby/client/events_test.rb | Ruby | mit | 19 | master | 507 | require 'test_helper'
class TestEvents < Minitest::Test
def setup
@client = CoingeckoRuby::Client.new
VCR.insert_cassette name
end
def test_that_it_gets_event_countries
response = @client.event_countries
assert_includes response, 'data'
assert_includes response, 'count'
end
def test_tha... |
github | julianfssen/coingecko_ruby | https://github.com/julianfssen/coingecko_ruby | test/coingecko_ruby/client/indexes_test.rb | Ruby | mit | 19 | master | 879 | require 'test_helper'
class TestIndexes < Minitest::Test
def setup
@client = CoingeckoRuby::Client.new
VCR.insert_cassette name
end
def test_that_it_gets_indexes
response = @client.indexes
index_data = response[0]
assert_includes index_data, 'name'
assert_includes index_data, 'id'
as... |
github | julianfssen/coingecko_ruby | https://github.com/julianfssen/coingecko_ruby | test/coingecko_ruby/client/coins_test.rb | Ruby | mit | 19 | master | 2,427 | require 'test_helper'
class TestCoins < Minitest::Test
def setup
@client = CoingeckoRuby::Client.new
VCR.insert_cassette name
end
def test_that_it_gets_the_list_of_supported_coins
response = @client.coins_list
data = response[0]
assert_includes data, 'id'
assert_includes data, 'symbol'
... |
github | julianfssen/coingecko_ruby | https://github.com/julianfssen/coingecko_ruby | test/coingecko_ruby/client/derivatives_test.rb | Ruby | mit | 19 | master | 1,556 | require 'test_helper'
class TestDerivatives < Minitest::Test
def setup
@client = CoingeckoRuby::Client.new
VCR.insert_cassette name
end
def test_that_it_gets_derivatives
response = @client.derivatives
derivative_data = response[0]
assert_includes derivative_data, 'market'
assert_includes... |
github | julianfssen/coingecko_ruby | https://github.com/julianfssen/coingecko_ruby | test/coingecko_ruby/client/infos_test.rb | Ruby | mit | 19 | master | 747 | require 'test_helper'
class TestInfos < Minitest::Test
def setup
@client = CoingeckoRuby::Client.new
VCR.insert_cassette name
end
def test_that_it_gets_global_crypto_data
response = @client.global_crypto_data
assert_includes response, 'data'
end
def test_that_it_gets_global_defi_data
re... |
github | julianfssen/coingecko_ruby | https://github.com/julianfssen/coingecko_ruby | test/coingecko_ruby/client/prices_test.rb | Ruby | mit | 19 | master | 2,560 | require 'test_helper'
class TestPrices < Minitest::Test
def setup
@client = CoingeckoRuby::Client.new
VCR.insert_cassette name
end
def test_that_it_gets_price_for_one_coin
response = @client.price('bitcoin')
assert_includes response, 'bitcoin'
end
def test_that_it_gets_price_for_one_coin_in... |
github | julianfssen/coingecko_ruby | https://github.com/julianfssen/coingecko_ruby | test/coingecko_ruby/client/categories_test.rb | Ruby | mit | 19 | master | 853 | require 'test_helper'
class TestCategories < Minitest::Test
def setup
@client = CoingeckoRuby::Client.new
VCR.insert_cassette name
end
def test_that_it_gets_the_list_of_categories
response = @client.categories
data = response[0]
assert_includes data, 'category_id'
assert_includes data, '... |
github | bloudermilk/reddit_image_downloader | https://github.com/bloudermilk/reddit_image_downloader | reddit_image_downloader.gemspec | Ruby | mit | 19 | master | 1,327 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'reddit_image_downloader/version'
Gem::Specification.new do |spec|
spec.name = "reddit_image_downloader"
spec.version = RedditImageDownloader::VERSION
spec.authors = ["B... |
github | bloudermilk/reddit_image_downloader | https://github.com/bloudermilk/reddit_image_downloader | lib/reddit_image_downloader.rb | Ruby | mit | 19 | master | 340 | # Stdlib
require "optparse"
require "ostruct"
# Gems
require "snoo"
require "mechanize"
require "dimensions"
# Development Gems
if ENV["DEV"]
require "pry"
end
# Self
require "reddit_image_downloader/version"
require "reddit_image_downloader/option_parser"
require "reddit_image_downloader/processor"
module Reddit... |
github | bloudermilk/reddit_image_downloader | https://github.com/bloudermilk/reddit_image_downloader | lib/reddit_image_downloader/processor.rb | Ruby | mit | 19 | master | 1,422 | module RedditImageDownloader
class Processor < Struct.new(:options)
def self.process!(options)
new(options).process!
end
def process!
listings.each do |listing|
download = agent.get(listing["url"])
if download.is_a?(Mechanize::Image)
reader = Dimensions::Reader.new
... |
github | bloudermilk/reddit_image_downloader | https://github.com/bloudermilk/reddit_image_downloader | lib/reddit_image_downloader/option_parser.rb | Ruby | mit | 19 | master | 2,539 | module RedditImageDownloader
class OptionParser
PAGES = %W[top new controversial]
DEFAULT_OPTIONS = {
subreddits: [],
min_width: 0,
min_height: 0,
destination: Dir.pwd,
max_age: nil,
page: :top,
subcommand: :download,
}
BANNER = "Usage: reddit_image_download... |
github | theforeman/puppet-dhcp | https://github.com/theforeman/puppet-dhcp | Rakefile | Ruby | apache-2.0 | 19 | master | 1,926 | # This file is managed centrally by modulesync
# https://github.com/theforeman/foreman-installer-modulesync
# Attempt to load voxupuli-test (which pulls in puppetlabs_spec_helper),
# otherwise attempt to load it directly.
begin
require 'voxpupuli/test/rake'
rescue LoadError
begin
require 'puppetlabs_spec_hel... |
github | theforeman/puppet-dhcp | https://github.com/theforeman/puppet-dhcp | Gemfile | Ruby | apache-2.0 | 19 | master | 739 | # This file is managed centrally by modulesync
# https://github.com/theforeman/foreman-installer-modulesync
source 'https://rubygems.org'
gem 'puppet', ENV.fetch('PUPPET_GEM_VERSION', '>= 7'), groups: ['development', 'test']
gem 'rake'
gem 'kafo_module_lint', {"groups"=>["test"]}
gem 'puppet-lint-spaceship_operato... |
github | theforeman/puppet-dhcp | https://github.com/theforeman/puppet-dhcp | spec/spec_helper_acceptance.rb | Ruby | apache-2.0 | 19 | master | 621 | require 'voxpupuli/acceptance/spec_helper_acceptance'
ENV['BEAKER_setfile'] ||= 'centos8-64{hostname=centos8-64.example.com}'
configure_beaker(modules: :fixtures) do |host|
if fact_on(host, 'os.family') == 'RedHat'
unless fact_on(host, 'os.name') == 'Fedora'
# don't delete downloaded rpm for use with BEAK... |
github | theforeman/puppet-dhcp | https://github.com/theforeman/puppet-dhcp | spec/spec_helper.rb | Ruby | apache-2.0 | 19 | master | 1,167 | # This file is managed centrally by modulesync
# https://github.com/theforeman/foreman-installer-modulesync
require 'voxpupuli/test/spec_helper'
add_mocked_facts!
def get_content(subject, title)
is_expected.to contain_file(title)
content = subject.resource('file', title).send(:parameters)[:content]
content.s... |
github | theforeman/puppet-dhcp | https://github.com/theforeman/puppet-dhcp | spec/support/acceptance/examples.rb | Ruby | apache-2.0 | 19 | master | 489 | shared_examples 'a DHCP server' do
service_name = case fact('osfamily')
when 'Archlinux'
'dhcpd4'
when 'Debian'
'isc-dhcp-server'
else
'dhcpd'
end
describe service(service_name) do
it { i... |
github | theforeman/puppet-dhcp | https://github.com/theforeman/puppet-dhcp | spec/classes/failover_spec.rb | Ruby | apache-2.0 | 19 | master | 1,100 | require 'spec_helper'
describe 'dhcp::failover' do
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:pre_condition) {
"class { '::dhcp': interfaces => ['eth0']}"
}
let(:params) do {
:role => 'primary',
:address => '10.1.1.10',
:peer_add... |
github | theforeman/puppet-dhcp | https://github.com/theforeman/puppet-dhcp | spec/classes/init_spec.rb | Ruby | apache-2.0 | 19 | master | 14,089 | require 'spec_helper'
describe 'dhcp' do
let(:fragment_name) do
'dhcp.conf+01_main.dhcp'
end
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) { override_facts(facts, networking: {domain: 'example.com'}) }
let(:params) do
{
interfaces: ['eth0'],
... |
github | theforeman/puppet-dhcp | https://github.com/theforeman/puppet-dhcp | spec/defines/class_spec.rb | Ruby | apache-2.0 | 19 | master | 923 | require 'spec_helper'
describe 'dhcp::dhcp_class' do
on_supported_os.each do |os, facts|
context "on #{os}" do
let :title do 'vendor-class' end
let :params do {
:parameters => [
'match option vendor-class-identifier',
]
} end
let :facts do
facts
e... |
github | theforeman/puppet-dhcp | https://github.com/theforeman/puppet-dhcp | spec/defines/pool_spec.rb | Ruby | apache-2.0 | 19 | master | 5,691 | require 'spec_helper'
describe 'dhcp::pool' do
let(:fragment_name) do
'dhcp.conf+70_mypool.dhcp'
end
on_supported_os.each do |os, facts|
context "on #{os}" do
let :title do 'mypool' end
let :facts do
facts
end
let :pre_condition do
"class { '::dhcp': interfaces ... |
github | theforeman/puppet-dhcp | https://github.com/theforeman/puppet-dhcp | spec/defines/host_spec.rb | Ruby | apache-2.0 | 19 | master | 2,511 | require 'spec_helper'
describe 'dhcp::host' do
let :title do 'myhost' end
let :params do {
:ip => '10.0.0.100',
:mac => '01:02:03:04:05:06',
} end
let :pre_condition do
"class { '::dhcp': interfaces => ['eth0']}"
end
let(:fragment_name) do
'dhcp.hosts+10_myhost.hosts'
end
shared_ex... |
github | theforeman/puppet-dhcp | https://github.com/theforeman/puppet-dhcp | spec/acceptance/nameservers_spec.rb | Ruby | apache-2.0 | 19 | master | 2,145 | require 'spec_helper_acceptance'
describe 'with empty nameservers list' do
interface = 'eth0'
config_file = fact('os.family') == 'Archlinux' ? '/etc/dhcpd.conf' : '/etc/dhcp/dhcpd.conf'
it_behaves_like 'an idempotent resource' do
let(:manifest) do
<<-EOS
$interface = $facts['networking']['interf... |
github | theforeman/puppet-dhcp | https://github.com/theforeman/puppet-dhcp | spec/acceptance/basic_spec.rb | Ruby | apache-2.0 | 19 | master | 1,176 | require 'spec_helper_acceptance'
describe 'Simple installation' do
interface = 'eth0'
config_file = fact('os.family') == 'Archlinux' ? '/etc/dhcpd.conf' : '/etc/dhcp/dhcpd.conf'
it_behaves_like 'an idempotent resource' do
let(:manifest) do
<<-EOS
$interface = $facts['networking']['interfaces']['... |
github | theforeman/puppet-dhcp | https://github.com/theforeman/puppet-dhcp | spec/acceptance/include_spec.rb | Ruby | apache-2.0 | 19 | master | 631 | require 'spec_helper_acceptance'
describe 'Installation with include statement' do
interface = 'eth0'
it_behaves_like 'an idempotent resource' do
let(:manifest) do
<<-EOS
$interface = $facts['networking']['interfaces']['#{interface}']
file { '/etc/dhcp.include':
ensure => file,
... |
github | theforeman/puppet-dhcp | https://github.com/theforeman/puppet-dhcp | spec/acceptance/ddns_spec.rb | Ruby | apache-2.0 | 19 | master | 650 | require 'spec_helper_acceptance'
describe 'Simple installation' do
interface = 'eth0'
let(:pp) do
<<-EOS
$interface = $facts['networking']['interfaces']['#{interface}']
class { 'dhcp':
interfaces => ['#{interface}'],
ddns_updates => true,
}
dhcp::pool { "default subnet":
... |
github | theforeman/puppet-dhcp | https://github.com/theforeman/puppet-dhcp | spec/type_aliases/staticroute_spec.rb | Ruby | apache-2.0 | 19 | master | 575 | require 'spec_helper'
describe 'Dhcp::Staticroute' do
it do
is_expected.to allow_values(
{
'mask' => '255.255.255.0',
'gateway' => '192.0.2.1',
},
{
'mask' => '255.255.255.0',
'gateway' => '192.0.2.1',
'network' => '192.0.2.0',
},
)
end
des... |
github | theforeman/puppet-dhcp | https://github.com/theforeman/puppet-dhcp | spec/type_aliases/range_spec.rb | Ruby | apache-2.0 | 19 | master | 460 | require 'spec_helper'
describe 'Dhcp::Range' do
it do
is_expected.to allow_values(
'192.0.2.100',
'192.0.2.100 192.0.2.200',
'1.1.1.1 255.255.255.255',
'dynamic-bootp 192.0.2.100 192.0.2.200',
)
end
describe 'invalid value handling' do
[
nil,
"all",
"all all... |
github | theforeman/puppet-dhcp | https://github.com/theforeman/puppet-dhcp | spec/type_aliases/dhcppool_spec.rb | Ruby | apache-2.0 | 19 | master | 782 | require 'spec_helper'
describe 'Dhcp::DhcpPool' do
it do
is_expected.to allow_values(
{
'range' => '10.0.0.100 10.0.0.200',
},
{
'range' => true,
},
{
'range' => [
'10.0.0.100 10.0.0.200',
'10.1.0.100 10.1.0.200',
],
'failo... |
github | theforeman/puppet-dhcp | https://github.com/theforeman/puppet-dhcp | spec/type_aliases/macaddress_spec.rb | Ruby | apache-2.0 | 19 | master | 1,119 | require 'spec_helper'
describe 'Dhcp::Macaddress' do
it do
is_expected.to allow_values(
'a:a:a:a:a:a',
'00:00:00:00:00:00',
'11:11:11:11:11:11',
'22:22:22:22:22:22',
'33:33:33:33:33:33',
'44:44:44:44:44:44',
'55:55:55:55:55:55',
'66:66:66:66:66:66',
'77:77:77... |
github | SuperGoodSoft/csrf_protection | https://github.com/SuperGoodSoft/csrf_protection | Gemfile | Ruby | mit | 19 | main | 242 | # frozen_string_literal: true
source "https://rubygems.org"
# Specify your gem's dependencies in rack-sec_fetch_site.gemspec
gemspec
gem "irb"
gem "rake", "~> 13.0"
gem "rspec", "~> 3.0"
gem "standard", "~> 1.3"
gem "rack"
gem "debug" |
github | SuperGoodSoft/csrf_protection | https://github.com/SuperGoodSoft/csrf_protection | super_good-csrf_protection.gemspec | Ruby | mit | 19 | main | 1,434 | # frozen_string_literal: true
require_relative "lib/super_good/csrf_protection/version"
Gem::Specification.new do |spec|
spec.name = "super_good-csrf_protection"
spec.version = SuperGood::CSRFProtection::VERSION
spec.authors = ["Sofia Besenski", "Jared Norman", "Alistair Norman", "Senem Soy", "Noah Silvera"]
... |
github | SuperGoodSoft/csrf_protection | https://github.com/SuperGoodSoft/csrf_protection | lib/super_good/csrf_protection.rb | Ruby | mit | 19 | main | 1,288 | # frozen_string_literal: true
require_relative "csrf_protection/version"
module SuperGood
class CSRFProtection
class Error < StandardError; end
SAFE_METHODS = %w[GET HEAD OPTIONS].freeze
SAFE_SEC_FETCH_SITE_VALUES = %w[same-origin none].freeze
def initialize(app, raise_error: false)
@app = a... |
github | SuperGoodSoft/csrf_protection | https://github.com/SuperGoodSoft/csrf_protection | spec/spec_helper.rb | Ruby | mit | 19 | main | 420 | # frozen_string_literal: true
require "super_good/csrf_protection"
require "rack"
require "debug"
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`
c... |
github | SuperGoodSoft/csrf_protection | https://github.com/SuperGoodSoft/csrf_protection | spec/super_good/csrf_protection_spec.rb | Ruby | mit | 19 | main | 5,158 | # frozen_string_literal: true
RSpec.describe SuperGood::CSRFProtection do
subject {
described_class.new(app, raise_error: raise_error_option).call(env)
}
let(:app) { ->(_env) { [200, {"Content-Type" => "text/plain"}, ["OK"]] } }
let(:env) {
Rack::MockRequest.env_for("http://example.com:8080/", {
... |
github | shuber/abstract_class | https://github.com/shuber/abstract_class | abstract_class.gemspec | Ruby | mit | 19 | master | 809 | require File.expand_path('../lib/abstract_class/version', __FILE__)
Gem::Specification.new do |s|
s.author = 'Sean Huber'
s.description = 'An implementation of the "abstract class" design pattern in Ruby'
s.email = 'github@shuber.io'
s.extra_rdoc_files = %w(LICENSE)
s.files ... |
github | shuber/abstract_class | https://github.com/shuber/abstract_class | lib/abstract_class.rb | Ruby | mit | 19 | master | 887 | require 'abstract_class/version'
# Declares a class as abstract which prevents instantiation or allocation.
module AbstractClass
# The exception raised when an abstract class is instantiated or allocated.
Error = Class.new(RuntimeError)
def self.extended(mod)
mod.abstract_classes << mod
end
# Stores a ... |
github | shuber/abstract_class | https://github.com/shuber/abstract_class | spec/abstract_class_spec.rb | Ruby | mit | 19 | master | 1,245 | require File.expand_path('../../lib/abstract_class', __FILE__)
RSpec.describe AbstractClass do
let(:abstract) { Class.new.extend(described_class) }
let(:derived) { Class.new(abstract) }
let(:error) { described_class::Error }
describe '.abstract_classes' do
it 'should include the abstract class' do
... |
github | shuber/abstract_class | https://github.com/shuber/abstract_class | spec/spec_helper.rb | Ruby | mit | 19 | master | 342 | begin
if ENV['CODECLIMATE_REPO_TOKEN']
require 'codeclimate-test-reporter'
CodeClimate::TestReporter.start
else
require 'simplecov'
SimpleCov.start { add_filter('/vendor/bundle/') }
end
rescue LoadError
# Ignore when testing with Ruby 1.8.7
end
RSpec.configure do |config|
config.raise_errors_... |
github | sensu-plugins/sensu-plugins-process-checks | https://github.com/sensu-plugins/sensu-plugins-process-checks | Rakefile | Ruby | mit | 19 | master | 974 | require 'bundler/gem_tasks'
require 'github/markup'
require 'redcarpet'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'
require 'yard'
require 'yard/rake/yardoc_task'
require 'English'
YARD::Rake::YardocTask.new do |t|
OTHER_PATHS = %w[].freeze
t.files = ['lib/**/*.rb', 'bin/**/*.rb', OTHER_PATHS]
t.o... |
github | sensu-plugins/sensu-plugins-process-checks | https://github.com/sensu-plugins/sensu-plugins-process-checks | sensu-plugins-process-checks.gemspec | Ruby | mit | 19 | master | 2,628 | lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'date'
require_relative 'lib/sensu-plugins-process-checks'
Gem::Specification.new do |s| # rubocop: disable Metrics/BlockLength
s.authors = ['Sensu-Plugins and contributors']
s.date ... |
github | sensu-plugins/sensu-plugins-process-checks | https://github.com/sensu-plugins/sensu-plugins-process-checks | bin/check-process-restart.rb | Ruby | mit | 19 | master | 4,409 | #! /usr/bin/env ruby
#
# check-process-restart
#
# DESCRIPTION:
# This will check if a running process requires a restart if a
# dependent package/library has changed (i.e upgraded)
#
# OUTPUT:
# plain text
# Defaults: CRITICAL if 2 or more process require a restart
# WARNING if 1 process requires... |
github | sensu-plugins/sensu-plugins-process-checks | https://github.com/sensu-plugins/sensu-plugins-process-checks | bin/check-process.rb | Ruby | mit | 19 | master | 10,310 | #! /usr/bin/env ruby
#
# check-process
#
# DESCRIPTION:
# Finds processes matching various filters (name, state, etc). Will not
# match itself by default. The number of processes found will be tested
# against the Warning/critical thresholds. By default, fails with a
# CRITICAL if more than one process matches ... |
github | sensu-plugins/sensu-plugins-process-checks | https://github.com/sensu-plugins/sensu-plugins-process-checks | bin/metrics-processes-threads-count.rb | Ruby | mit | 19 | master | 5,083 | #! /usr/bin/env ruby
#
# metric-processes-threads-count.rb
#
# DESCRIPTION:
# Counts the number of processes running on the system (and optionally, the number of running threads) and outputs it in metric format.
# Can alternatively count the number of processes/threads matching a certain substring.
#
# OUTPUT:
# ... |
github | sensu-plugins/sensu-plugins-process-checks | https://github.com/sensu-plugins/sensu-plugins-process-checks | bin/check-threads-count.rb | Ruby | mit | 19 | master | 2,571 | #! /usr/bin/env ruby
#
# check-threads-count.rb
#
# DESCRIPTION:
# Counts the number of threads running on the system and alerts if that number is greater than the warning or critical values.
# The default warning and critical count thresholds come from the ~32000 thread limit in older Linux kernels.
#
# OUTPUT:
... |
github | sensu-plugins/sensu-plugins-process-checks | https://github.com/sensu-plugins/sensu-plugins-process-checks | bin/metrics-process-status.rb | Ruby | mit | 19 | master | 3,648 | #! /usr/bin/env ruby
#
# proc-status-metrics
#
# DESCRIPTION:
# For all processes owned by a user AND/OR matching a provided process
# name substring, return selected memory metrics from /proc/[PID]/status
#
# OUTPUT:
# metric data
#
# PLATFORMS:
# Linux
#
# DEPENDENCIES:
# gem: sensu-plugin
#
# USAGE:
#
#... |
github | sensu-plugins/sensu-plugins-process-checks | https://github.com/sensu-plugins/sensu-plugins-process-checks | bin/check-cmd.rb | Ruby | mit | 19 | master | 1,892 | #! /usr/bin/env ruby
#
# check-cmd
#
# DESCRIPTION:
# Generic check raising an error if exit code of command is not N.
#
# OUTPUT:
# plain text
#
# PLATFORMS:
# Linux
#
# DEPENDENCIES:
# gem: sensu-plugin
# gem: english
#
# USAGE:
#
# NOTES:
#
# LICENSE:
# Jean-Francois Theroux <failshell@gmail.com>
# Rel... |
github | sensu-plugins/sensu-plugins-process-checks | https://github.com/sensu-plugins/sensu-plugins-process-checks | bin/metrics-ipcs.rb | Ruby | mit | 19 | master | 1,519 | #! /usr/bin/env ruby
#
# metrics-ipcs
#
# DESCRIPTION:
# metrics-ipcs get metrics from ipcs
#
# OUTPUT:
# metric-data
#
# PLATFORMS:
# Linux
#
# DEPENDENCIES:
#
# USAGE:
#
#
# NOTES:
#
# LICENSE:
# Zubov Yuri <yury.zubau@gmail.com> sponsored by Actility, https://www.actility.com
# Released under the same terms... |
github | sensu-plugins/sensu-plugins-process-checks | https://github.com/sensu-plugins/sensu-plugins-process-checks | test/plugin_stub.rb | Ruby | mit | 19 | master | 483 | RSpec.configure do |c|
# XXX: Sensu plugins run in the context of an at_exit handler. This prevents
# XXX: code-under-test from being run at the end of the rspec suite.
c.before(:each) do
Sensu::Plugin::CLI.class_eval do
# PluginStub
class PluginStub
def run; end
def ok(*); end
... |
github | sensu-plugins/sensu-plugins-process-checks | https://github.com/sensu-plugins/sensu-plugins-process-checks | test/metrics-ipcs_spec.rb | Ruby | mit | 19 | master | 985 | require_relative './spec_helper'
require_relative '../bin/metrics-ipcs'
require_relative './fixtures/metrics-ips_fixture'
describe 'MetricsIPCS' do
before do
MetricsIPCS.class_variable_set(:@@autorun, false)
end
describe 'with positive answer' do
before do
@default_parameters = '--scheme=test'
... |
github | sensu-plugins/sensu-plugins-process-checks | https://github.com/sensu-plugins/sensu-plugins-process-checks | test/metrics-processes-threads-count_spec.rb | Ruby | mit | 19 | master | 3,990 | #!/usr/bin/env ruby
#
# metric-processes-threads-count_spec
#
# DESCRIPTION:
# Tests for metric-processes-threads-count_spec
#
# OUTPUT:
#
# PLATFORMS:
#
# DEPENDENCIES:
#
# USAGE:
# bundle install
# rake spec
#
# NOTES:
# This test suite mocks up a process table to be returned by Sys::ProcTable.ps()
#
# LICENS... |
github | sensu-plugins/sensu-plugins-process-checks | https://github.com/sensu-plugins/sensu-plugins-process-checks | test/check-threads-count_spec.rb | Ruby | mit | 19 | master | 2,636 | #!/usr/bin/env ruby
#
# check-threads-count_spec
#
# DESCRIPTION:
# Tests for check-threads-count.rb
#
# OUTPUT:
#
# PLATFORMS:
#
# DEPENDENCIES:
#
# USAGE:
# bundle install
# rake spec
#
# NOTES:
# This test suite mocks up a process table to be returned by Sys::ProcTable.ps()
#
# LICENSE:
# Copyright 2015 Co... |
github | ikaros/SmartRumote | https://github.com/ikaros/SmartRumote | Rakefile | Ruby | mit | 19 | master | 1,323 | # encoding: utf-8
require 'rubygems'
require 'bundler'
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end
require 'rake'
require 'jeweler'
Jeweler::Tasks.new do |gem|
# gem is... |
github | ikaros/SmartRumote | https://github.com/ikaros/SmartRumote | Gemfile | Ruby | mit | 19 | master | 393 | source "http://rubygems.org"
# Add dependencies required to use your gem here.
# Example:
# gem "activesupport", ">= 2.3.5"
# Add dependencies to develop your gem here.
# Include everything needed to run rake, tests, features, etc.
group :development do
gem "rspec", "~> 2.8.0"
gem "rdoc", "~> 3.12"
gem "bundle... |
github | ikaros/SmartRumote | https://github.com/ikaros/SmartRumote | spec/smart_tv_remote_spec.rb | Ruby | mit | 19 | master | 207 | require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
describe "SmartTvRemote" do
it "fails" do
fail "hey buddy, you should probably rename this file and start specing for real"
end
end |
github | ikaros/SmartRumote | https://github.com/ikaros/SmartRumote | spec/spec_helper.rb | Ruby | mit | 19 | master | 365 | $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'rspec'
require 'smart_tv_remote'
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| re... |
github | ikaros/SmartRumote | https://github.com/ikaros/SmartRumote | working_prototype/lib/samsung_tv_remote.rb | Ruby | mit | 19 | master | 5,693 | require "socket"
require "base64"
require File.dirname(__FILE__) + "/samsung_tv_remote/interactive_mode.rb"
class SamsungTvRemote
REMOTE_NAME = "Ruby Samsung Remote";
APPSTRING = "iphone..iapp.samsung"
KEY_CODES = [ :KEY_0, :KEY_1, :KEY_11, :KEY_12, :KEY_16_9, :KEY_2, :KEY_3,
:KEY_3SPEED, :KEY_4, :KEY_4_3... |
github | ikaros/SmartRumote | https://github.com/ikaros/SmartRumote | working_prototype/lib/samsung_tv_remote/interactive_mode.rb | Ruby | mit | 19 | master | 1,807 | class SamsungTvRemote
class InteractiveMode
DEFAULT_MAPPING = {
"q" => ->(r) { exit },
"m" => ->(r) { r.key_mute },
"\e[A" => ->(r) { r.key_up },
"\e[B" => ->(r) { r.key_down },
"\e[D" => ->(r) { r.key_left },
"\e[C" => ->(r) { r.key_right },
"\r" => ->(r) { r.key... |
github | ikaros/SmartRumote | https://github.com/ikaros/SmartRumote | working_prototype/lib/samsung_tv_remote/interactive_mode/mapping.rb | Ruby | mit | 19 | master | 1,578 | class Mapping
KEY_CODES = {
:up => :"\e[A",
:down => :"\e[B",
:left => :"\e[D",
:right => :"\e[C",
:backspace => :"\x7F",
:enter => :"\r"
}
def initialize(&block)
@mapping = {}
block && block.call(self)
end
def map(key_code, tv_key=nil, &block)
@... |
github | arbonap/gayify | https://github.com/arbonap/gayify | Gemfile | Ruby | mit | 19 | master | 222 | source 'https://rubygems.org'
# Specify your gem's dependencies in gayify.gemspec
# all prod gems need to be before `gemspec` and any development dependency we need to put it after `gemspec`
gemspec
# gemspec method call |
github | arbonap/gayify | https://github.com/arbonap/gayify | gayify.gemspec | Ruby | mit | 19 | master | 1,652 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'gayify/version'
Gem::Specification.new do |spec|
spec.name = "gayify"
spec.version = Gayify::VERSION
spec.authors = ["Patricia Arbona"]
spec.email = ["arbonap... |
github | arbonap/gayify | https://github.com/arbonap/gayify | lib/gayify/gay.rb | Ruby | mit | 19 | master | 937 | require 'active_support/inflector'
module Gayify
class Gay
def self.rainbow
"🌈"
end
def self.pluralize(word)
word.pluralize
end
end
end
class Exception
original_to_s = instance_method(:to_s)
define_method :to_s do
original_message = original_to_s.bind(self).call
" #{hap... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.