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
cookpad/denv
https://github.com/cookpad/denv
lib/denv/rails.rb
Ruby
mit
19
master
654
# Watch all loaded env files with Spring begin require 'spring/watcher' if Spring.respond_to?(:watch) Denv.callback = -> (filename) do Spring.watch(filename) if Rails.application end end rescue LoadError # Spring is not available end module Denv class Railtie < ::Rails::Railtie DEFAULT_ENV...
github
cookpad/denv
https://github.com/cookpad/denv
spec/denv_spec.rb
Ruby
mit
19
master
4,151
require 'spec_helper' RSpec.describe Denv do describe 'reloading env vars' do before do stub_const('ENV', previous) allow(Denv).to receive(:open_file).and_yield(StringIO.new(content)) end context 'when no entries are duplicated' do let(:previous) { { 'x' => '1', 'y' => '2'} } let...
github
cookpad/denv
https://github.com/cookpad/denv
spec/spec_helper.rb
Ruby
mit
19
master
788
require 'pry' lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'denv' # For integration test require 'spring/boot' RSpec.configure do |config| config.expect_with :rspec do |expectations| expectations.include_chain_clauses_in_custom_matcher_descriptions ...
github
alexsergeyev/capistrano-eye
https://github.com/alexsergeyev/capistrano-eye
capistrano-eye.gemspec
Ruby
mit
19
master
757
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'capistrano/eye/version' Gem::Specification.new do |gem| gem.name = 'capistrano-eye' gem.version = Capistrano::Eye::VERSION gem.authors = ['Alex Sergeyev'] gem.email ...
github
openminds/active_merchant_ogone
https://github.com/openminds/active_merchant_ogone
active_merchant_ogone.gemspec
Ruby
mit
19
master
1,559
# 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 = "active_merchant_ogone" s.version = "1.0.0" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :req...
github
openminds/active_merchant_ogone
https://github.com/openminds/active_merchant_ogone
Rakefile
Ruby
mit
19
master
1,220
require 'rake' require 'rake/testtask' require 'rake/rdoctask' desc 'Default: run unit tests.' task :default => :test desc 'Test the active_merchant_ogone plugin.' Rake::TestTask.new(:test) do |t| t.libs << 'lib' t.libs << 'test' t.pattern = 'test/**/*_test.rb' t.verbose = true end desc 'Generate documentati...
github
openminds/active_merchant_ogone
https://github.com/openminds/active_merchant_ogone
lib/active_merchant_ogone.rb
Ruby
mit
19
master
2,759
# Ogone Integration developed by Openminds (www.openminds.be) # For problems contact us at ogone@openminds.be require 'active_merchant' require 'active_merchant_ogone/helper.rb' require 'active_merchant_ogone/notification.rb' module ActiveMerchant #:nodoc: module Billing #:nodoc: module Integrations #:nodoc: ...
github
openminds/active_merchant_ogone
https://github.com/openminds/active_merchant_ogone
lib/active_merchant_ogone/notification.rb
Ruby
mit
19
master
4,037
require 'net/http' module ActiveMerchant #:nodoc: module Billing #:nodoc: module Integrations #:nodoc: module Ogone class Notification < ActiveMerchant::Billing::Integrations::Notification # params on a successfull payment # orderID=order_342 # cur...
github
openminds/active_merchant_ogone
https://github.com/openminds/active_merchant_ogone
lib/active_merchant_ogone/helper.rb
Ruby
mit
19
master
3,237
module ActiveMerchant #:nodoc: module Billing #:nodoc: module Integrations #:nodoc: module Ogone class Helper < ActiveMerchant::Billing::Integrations::Helper attr_reader :outbound_signature def initialize(order, account, options = {}) super @outbound_sign...
github
openminds/active_merchant_ogone
https://github.com/openminds/active_merchant_ogone
test/active_merchant_ogone_test.rb
Ruby
mit
19
master
1,186
require 'test_helper' class ActiveMerchantOgoneTest < Test::Unit::TestCase include ActiveMerchant::Billing::Integrations def test_sha1_signature_out # input values and return value taken from BASIC documentation data = {'orderID' => '1234', 'currency' => 'EUR', 'amount' => 1500,...
github
openminds/active_merchant_ogone
https://github.com/openminds/active_merchant_ogone
test/test_helper.rb
Ruby
mit
19
master
4,782
#!/usr/bin/env ruby $:.unshift(File.dirname(__FILE__) + '/../lib') require 'rubygems' begin gem 'actionpack', '2.3.11' rescue LoadError raise StandardError, "The view tests need ActionPack installed as gem to run" end require 'active_merchant' require 'money' require 'test/unit' require 'mocha' require 'yaml' #...
github
openminds/active_merchant_ogone
https://github.com/openminds/active_merchant_ogone
test/active_merchant_ogone/helper_test.rb
Ruby
mit
19
master
3,150
require 'test_helper' class OgoneHelperTest < Test::Unit::TestCase include ActiveMerchant::Billing::Integrations def setup @helper = Ogone::Helper.new 'order-500','openminds', { :amount => 900, :currency => 'EUR', :credential2 => '6df8766fb6d8275e0c0d' } end def test_outbound_signat...
github
openminds/active_merchant_ogone
https://github.com/openminds/active_merchant_ogone
test/active_merchant_ogone/notification_test.rb
Ruby
mit
19
master
1,423
require 'test_helper' class OgoneNotificationTest < Test::Unit::TestCase include ActiveMerchant::Billing::Integrations Ogone.inbound_signature = '08445a31a78661b5c746feff39a9db6e4e2cc5cf' SUCCESSFULL_HTTP_RAW_DATA = "orderID=order_342&currency=EUR&amount=50&PM=CreditCard&ACCEPTANCE=test123&STATUS=9&CARDNO=XXXX...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
Gemfile
Ruby
mit
19
master
1,285
source 'https://rubygems.org' # Even if Bundler is told to install only one of these groups, it appear to # process the gem requirements of all groups. This would cause Bundler to fail # on CI builds where the Ruby version was older than what some of the gems in # the skipped groups required. To work around that the g...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
skippy/commands/example.rb
Ruby
mit
19
master
261
class Hello < Skippy::Command desc 'world PERSON', 'Oh, hi there!' def world(person) say "Hello #{person}" end default_command(:world) desc 'universe', 'Greets the universe in general' def universe say "DARK IN HERE, ISN'T IT?" end end
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend.rb
Ruby
mit
19
master
1,462
#------------------------------------------------------------------------------- # # Author: Thomas Thomassen # Copyright: Copyright (c) 2017-2024 # License: MIT License # #------------------------------------------------------------------------------- require 'json' require 'extensions' require 'sketchup' modu...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/command.rb
Ruby
mit
19
master
1,854
require 'tt_truebend/resource' module TT::Plugins::TrueBend module UICommand # SketchUp allocate the object by implementing `new` - probably part of # older legacy implementation when that was the norm. Because of that the # class cannot be sub-classed directly. This module simulates the interface #...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/validator.rb
Ruby
mit
19
master
667
module TT::Plugins::TrueBend # Interface for validating user input and applying constraints to it. class Validator # Raised when the input value doesn't fall within the constraints applied. class ValidationError < ArgumentError; end attr_reader :value # @param [Numeric] value def initialize(v...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/vcb_parser.rb
Ruby
mit
19
master
1,215
require 'tt_truebend/validator' module TT::Plugins::TrueBend # Parses the given input string. For the various types of values parsed # a {Validator} object is returned that is in turn used to enforce constraints # to the input value. class VCBParser # Raised when the input cannot be parsed. class Inpu...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/bender.rb
Ruby
mit
19
master
13,391
require 'tt_truebend/constants/view' require 'tt_truebend/gl/bender_drawer' require 'tt_truebend/gl/boundingbox' require 'tt_truebend/gl/drawing_helper' require 'tt_truebend/gl/grid' require 'tt_truebend/gl/slicer' require 'tt_truebend/gl/subdivided_segment' require 'tt_truebend/helpers/edge' require 'tt_truebend/helpe...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/bootstrap.rb
Ruby
mit
19
master
2,295
require 'tt_truebend/app_settings' module TT::Plugins::TrueBend ### CONSTANTS ### ------------------------------------------------------------ PLATFORM_WIN = (Sketchup.platform == :platform_win) PLATFORM_OSX = (Sketchup.platform == :platform_osx) # Minimum version of SketchUp required to run the extension. ...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/main.rb
Ruby
mit
19
master
1,524
require 'sketchup' require 'tt_truebend/helpers/instance' require 'tt_truebend/tools/truebend' require 'tt_truebend/app_settings' require 'tt_truebend/command' require 'tt_truebend/debug' module TT::Plugins::TrueBend PATH_IMAGES = File.join(PATH, 'images') unless file_loaded?(__FILE__) cmd = UICommand.new('...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/resource.rb
Ruby
mit
19
master
690
module TT::Plugins::TrueBend module Resource # The supported file format for vector icons depend on the platform. VECTOR_FILETYPE = Sketchup.platform == :platform_osx ? 'pdf' : 'svg' # @param [String] path # @return [String] def self.get_icon_path(path) return path unless Sketchup.version....
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/dpi.rb
Ruby
mit
19
master
4,182
require 'tt_truebend/dpi/inputpoint' require 'tt_truebend/dpi/pick_helper' require 'tt_truebend/dpi/view' require 'tt_truebend/app_settings' module TT::Plugins::TrueBend # Utility module for computing unit conversions based on monitor DPI. module DPI SKETCHUP_VERSION = Sketchup.version.to_i # To test sca...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/debug.rb
Ruby
mit
19
master
474
module TT::Plugins::TrueBend # TT::Plugins::TrueBend::SETTINGS.debug = true # @note Debug method to reload the plugin. # # @example # TT::Plugins::TrueBend.reload # # @return [Integer] Number of files reloaded. def self.reload original_verbose = $VERBOSE $VERBOSE = nil load __FILE__ ...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/settings.rb
Ruby
mit
19
master
1,652
module TT::Plugins::TrueBend class Settings # @param [Symbol] key # @param [Object] default def self.define(key, default = nil) read_method = boolean?(default) ? "#{key}?".to_sym : key.to_sym write_method = "#{key}=".to_sym self.class_eval { define_method(read_method) { |default...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/app_settings.rb
Ruby
mit
19
master
694
require 'tt_truebend/settings' module TT::Plugins::TrueBend class AppSettings < Settings def initialize super(EXTENSION[:product_id]) end define :error_server, 'sketchup.thomthom.net' define :bend_segmented, true define :bend_soft_smooth, true define :dpi_scale_factor, 1.0 defi...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/observers/transaction.rb
Ruby
mit
19
master
753
module TT::Plugins::TrueBend class TransactionObserver < Sketchup::ModelObserver def initialize(&block) # rubocop:disable Lint/MissingSuper @callback = block end def onTransactionAbort(model) callback(model, :abort) end def onTransactionCommit(model) callback(model, :commit) ...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/manipulators/drag_handle.rb
Ruby
mit
19
master
5,953
require 'tt_truebend/constants/view' require 'tt_truebend/dpi/view' module TT::Plugins::TrueBend class DragHandle include ViewConstants attr_accessor :origin, :normal, :color, :size attr_accessor :debug attr_reader :direction # @param [Geom::Point3d] origin # @param [Geom::Vector3d] normal...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/geom/polygon.rb
Ruby
mit
19
master
1,264
module TT::Plugins::TrueBend class Polygon attr_reader :points # @param [Array<Geom::Point3d>] args def initialize(*args) if args.size == 1 && args.first.is_a?(Array) @points = args.first elsif args.size >= 3 @points = args else raise ArgumentError, ...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/geom/segment.rb
Ruby
mit
19
master
2,314
module TT::Plugins::TrueBend class Segment attr_reader :points # @param [Geom::Point3d] point1 # @param [Geom::Point3d] point2 def initialize(point1, point2) @points = [point1.clone, point2.clone] end # @return [Geom::Point3d] def start @points.first end # @return [...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/geom/polar_projection.rb
Ruby
mit
19
master
2,439
module TT::Plugins::TrueBend class PolarProjection PI2 = Math::PI * 2 # The radius represents where the Cartesian X axis will be mapped to in the # polar coordinates. attr_accessor :radius # Transformation applied to the projected points. attr_accessor :transformation # @param [Float] ...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/helpers/edge.rb
Ruby
mit
19
master
975
require 'tt_truebend/helpers/instance' module TT::Plugins::TrueBend module EdgeHelper include InstanceHelper private def detect_new_edges(entities) raise ArgumentError, 'expected block' unless block_given? existing_edges = entities.grep(Sketchup::Edge) yield edges = entities.g...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/helpers/boundingbox.rb
Ruby
mit
19
master
2,804
require 'tt_truebend/constants/boundingbox' require 'tt_truebend/geom/segment' require 'tt_truebend/geom/polygon' module TT::Plugins::TrueBend module BoundingBoxHelper include BoundingBoxConstants # @return [Array<Geom::Point3d>] def points Array.new(8) { |i| corner(i) } end # @return [A...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/helpers/instance.rb
Ruby
mit
19
master
1,428
module TT::Plugins::TrueBend module InstanceHelper private # @param [Sketchup::ComponentInstance, Sketchup::Group] instance # @return [Sketchup::ComponentInstance, Sketchup::Group] def ensure_groups_are_uniqe(instance) if instance.is_a?(Sketchup::Group) instance.make_unique else ...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/constants/view.rb
Ruby
mit
19
master
766
#------------------------------------------------------------------------------- # # Thomas Thomassen # thomas[at]thomthom[dot]net # #------------------------------------------------------------------------------- module TT::Plugins::TrueBend module ViewConstants # Constants for Sketchup::View.draw_points ...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/constants/tool.rb
Ruby
mit
19
master
403
#------------------------------------------------------------------------------- # # Thomas Thomassen # thomas[at]thomthom[dot]net # #------------------------------------------------------------------------------- module TT::Plugins::TrueBend module ToolConstants # Constants for Tool.onCancel REASON_ESC ...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/constants/boundingbox.rb
Ruby
mit
19
master
789
#------------------------------------------------------------------------------- # # Thomas Thomassen # thomas[at]thomthom[dot]net # #------------------------------------------------------------------------------- module TT::Plugins::TrueBend module BoundingBoxConstants # Constants for Geom::BoundingBox.corner...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/tools/truebend.rb
Ruby
mit
19
master
10,215
require 'tt_truebend/constants/boundingbox' require 'tt_truebend/gl/boundingbox' require 'tt_truebend/helpers/instance' require 'tt_truebend/manipulators/drag_handle' require 'tt_truebend/observers/transaction' require 'tt_truebend/app_settings' require 'tt_truebend/bender' require 'tt_truebend/validator' require 'tt_t...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/dpi/pick_helper.rb
Ruby
mit
19
master
2,707
require 'delegate' require 'tt_truebend/dpi/view' require 'tt_truebend/dpi' module TT::Plugins::TrueBend # Shim that takes care of dealing monitor DPI. # # The users of this class work with logical units and they are automatically # converted to device pixels for the API to consume where appropriate. class ...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/dpi/view.rb
Ruby
mit
19
master
5,281
require 'tt_truebend/dpi/inputpoint' require 'tt_truebend/dpi/pick_helper' require 'tt_truebend/dpi' module TT::Plugins::TrueBend # Shim that takes care of dealing monitor DPI. # # The users of this class work with logical units and they are automatically # converted to device pixels for the API to consume wh...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/dpi/inputpoint.rb
Ruby
mit
19
master
1,806
require 'delegate' require 'tt_truebend/dpi/pick_helper' require 'tt_truebend/dpi/view' require 'tt_truebend/dpi' module TT::Plugins::TrueBend # Shim that takes care of dealing monitor DPI. # # The users of this class work with logical units and they are automatically # converted to device pixels for the API ...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/gl/bender_drawer.rb
Ruby
mit
19
master
6,457
require 'tt_truebend/constants/view' require 'tt_truebend/gl/boundingbox' require 'tt_truebend/gl/drawing_helper' require 'tt_truebend/gl/grid' require 'tt_truebend/gl/slicer' require 'tt_truebend/gl/subdivided_segment' require 'tt_truebend/helpers/edge' require 'tt_truebend/helpers/instance' require 'tt_truebend/geom/...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/gl/subdivided_segment.rb
Ruby
mit
19
master
1,438
require 'tt_truebend/constants/view' require 'tt_truebend/gl/drawing_helper' module TT::Plugins::TrueBend class SubdividedSegmentWidget include DrawingHelper include ViewConstants attr_accessor :segment attr_accessor :subdivisions, :color, :line_width # @param [Segment] segment # @param [I...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/gl/slicer.rb
Ruby
mit
19
master
4,631
require 'tt_truebend/geom/segment' require 'tt_truebend/helpers/instance' module TT::Plugins::TrueBend class Slicer include InstanceHelper def initialize(planes = []) @planes = planes end # The planes should be in world coordinates. def add_plane(plane) @planes << plane end ...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/gl/grid.rb
Ruby
mit
19
master
2,741
require 'tt_truebend/constants/view' module TT::Plugins::TrueBend class Grid include ViewConstants attr_accessor :x_subdivs, :y_subdivs attr_accessor :transformation # @param [Numeric] width # @param [Numeric] height def initialize(width, height) @width = width @height = height...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/gl/boundingbox.rb
Ruby
mit
19
master
2,983
require 'tt_truebend/constants/boundingbox' require 'tt_truebend/constants/view' require 'tt_truebend/helpers/boundingbox' require 'tt_truebend/helpers/instance' require 'tt_truebend/gl/drawing_helper' module TT::Plugins::TrueBend class BoundingBoxWidget include BoundingBoxConstants include DrawingHelper ...
github
thomthom/true-bend
https://github.com/thomthom/true-bend
src/tt_truebend/gl/drawing_helper.rb
Ruby
mit
19
master
1,834
module TT::Plugins::TrueBend module DrawingHelper include ViewConstants # @param [Sketchup::View] view # @param [Array(Geom::Point3d, Geom::Vector3d)] plane # @param [Numeric] size # @param [Sketchup::Color] color # @return [nil] def draw_plane(view, plane, size, color) color = Ske...
github
jrgns/sequel-elasticsearch
https://github.com/jrgns/sequel-elasticsearch
sequel-elasticsearch.gemspec
Ruby
mit
19
master
1,516
# frozen_string_literal: true lib = File.expand_path('lib', __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'sequel/plugins/elasticsearch/version' Gem::Specification.new do |spec| spec.name = 'sequel-elasticsearch' spec.version = Sequel::Elasticsearch::VERSION spec.author...
github
jrgns/sequel-elasticsearch
https://github.com/jrgns/sequel-elasticsearch
Rakefile
Ruby
mit
19
master
403
# frozen_string_literal: true libdir = File.expand_path(File.dirname(__FILE__) + '/lib') $LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir) require 'bundler/gem_tasks' begin require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:spec) rescue LoadError puts 'Did not load RSpec' end task default: :...
github
jrgns/sequel-elasticsearch
https://github.com/jrgns/sequel-elasticsearch
spec/spec_helper.rb
Ruby
mit
19
master
381
# frozen_string_literal: true ENV['RACK_ENV'] ||= 'test' ENV['DATABASE_URL'] ||= 'sqlite::memory:' ENV['ELASTICSEARCH_URL'] ||= 'http://localhost:9200' require 'sequel' require 'webmock/rspec' require 'simplecov' SimpleCov.start DB = Sequel.connect ENV['DATABASE_URL'] RSpec.configure do |config| config.filter_run...
github
jrgns/sequel-elasticsearch
https://github.com/jrgns/sequel-elasticsearch
spec/sequel/plugins/elasticsearch_spec.rb
Ruby
mit
19
master
9,188
# frozen-string-literal: true require 'sequel' require 'sequel/plugins/elasticsearch' require 'sequel/plugins/elasticsearch/result' require 'timecop' # rubocop: disable Metrics/BlockLength describe Sequel::Plugins::Elasticsearch do before(:all) do DB.create_table!(:documents) do primary_key :id Stri...
github
jrgns/sequel-elasticsearch
https://github.com/jrgns/sequel-elasticsearch
spec/sequel/plugins/elasticsearch/result_spec.rb
Ruby
mit
19
master
2,850
# frozen_string_literal: true require 'json' require 'sequel' require 'elasticsearch' require 'sequel/plugins/elasticsearch' describe Sequel::Plugins::Elasticsearch::Result do def fixture(name) File.read("spec/support/#{name}") end let(:result) do { 'took' => 234, 'timed_out' => false, ...
github
jrgns/sequel-elasticsearch
https://github.com/jrgns/sequel-elasticsearch
lib/sequel/plugins/elasticsearch.rb
Ruby
mit
19
master
8,834
# frozen_string_literal: true require 'elasticsearch' require 'sequel/plugins/elasticsearch/result' # Sequel: The Database Toolkit for Ruby module Sequel # Sequel Plugins - http://sequel.jeremyevans.net/plugins.html module Plugins # The Sequel::Elasticsearch model plugin # # @example Simple usage ...
github
jrgns/sequel-elasticsearch
https://github.com/jrgns/sequel-elasticsearch
lib/sequel/plugins/elasticsearch/result.rb
Ruby
mit
19
master
2,508
# frozen_string_literal: true module Sequel module Plugins module Elasticsearch # A wrapper around Elasticsearch results to make it behave more like a Sequel Dataset. class Result include Enumerable # The original result returned from the Elasticsearch client attr_reader :res...
github
jrgns/sequel-elasticsearch
https://github.com/jrgns/sequel-elasticsearch
lib/sequel/plugins/elasticsearch/version.rb
Ruby
mit
19
master
226
# frozen_string_literal: true module Sequel # The Sequel::Elasticsearch model plugin # # See https://jrgns.github.io/sequel-elasticsearch module Elasticsearch # The Gem's version. VERSION = '0.4.13' end end
github
vincent-163/syzoj-hustoj
https://github.com/vincent-163/syzoj-hustoj
process.rb
Ruby
mit
19
master
2,811
#!/usr/bin/ruby require 'mysql2' def escape(str) # FIXME: Mysql2::Client.escape is NOT charset aware so there may be sql injections return Mysql2::Client.escape(str) #return str.gsub("\\","\\\\").gsub("\x00",'\x00').gsub("\n",'\n').gsub("\r",'\r').gsub("'","\'").gsub("\x1a",'\x1a') end shell = open("download_all.sh"...
github
salsify/delayed_job_groups_plugin
https://github.com/salsify/delayed_job_groups_plugin
Appraisals
Ruby
mit
19
master
318
# frozen_string_literal: true appraise 'rails-7.2' do gem 'activerecord', '~> 7.2.1' gem 'activesupport', '~> 7.2.1' end appraise 'rails-8.0' do gem 'activerecord', '~> 8.0.0' gem 'activesupport', '~> 8.0.0' end appraise 'rails-8.1' do gem 'activerecord', '~> 8.1.0' gem 'activesupport', '~> 8.1.0' end
github
salsify/delayed_job_groups_plugin
https://github.com/salsify/delayed_job_groups_plugin
delayed_job_groups.gemspec
Ruby
mit
19
master
2,135
# frozen_string_literal: true lib = File.expand_path('lib', __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'delayed/job_groups/version' Gem::Specification.new do |spec| spec.name = 'delayed_job_groups_plugin' spec.version = Delayed::JobGroups::VERSION spec.authors ...
github
salsify/delayed_job_groups_plugin
https://github.com/salsify/delayed_job_groups_plugin
spec/spec_helper.rb
Ruby
mit
19
master
1,386
# frozen_string_literal: true require 'simplecov' require 'coveralls' SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new( [SimpleCov::Formatter::HTMLFormatter, Coveralls::SimpleCov::Formatter] ) SimpleCov.start do add_filter 'spec' end require 'rspec/its' require 'database_cleaner' require 'delayed_...
github
salsify/delayed_job_groups_plugin
https://github.com/salsify/delayed_job_groups_plugin
spec/support/test_jobs.rb
Ruby
mit
19
master
431
# frozen_string_literal: true module TestJobs class Foo; end class FailingJob def perform raise 'Test failure' end end class NoOpJob def perform end end class CompletionJob cattr_accessor :invoked def perform CompletionJob.invoked = true end end class Cance...
github
salsify/delayed_job_groups_plugin
https://github.com/salsify/delayed_job_groups_plugin
spec/support/destroyed_model.rb
Ruby
mit
19
master
327
# frozen_string_literal: true RSpec::Matchers.define :have_been_destroyed do match do |actual| !actual.class.where(id: actual.id).exists? end description do 'model should have been destroyed' end failure_message do |actual| "expected #{actual.class}(id: #{actual.id}) to have been destroyed" e...
github
salsify/delayed_job_groups_plugin
https://github.com/salsify/delayed_job_groups_plugin
spec/delayed/job_groups/job_extensions_spec.rb
Ruby
mit
19
master
267
# frozen_string_literal: true describe "delayed job extensions" do it "provides an optional job_group_id" do job_group = create(:job_group) expect(Delayed::Job.new(job_group_id: job_group.id)).to be_valid expect(Delayed::Job.new).to be_valid end end
github
salsify/delayed_job_groups_plugin
https://github.com/salsify/delayed_job_groups_plugin
spec/delayed/job_groups/job_group_spec.rb
Ruby
mit
19
master
10,014
# frozen_string_literal: true describe Delayed::JobGroups::JobGroup do let(:blocked) { false } let(:on_completion_job) { 'dummy on completion job' } let(:on_completion_job_options) do { foo: 'bar' } end let(:current_time) { Time.utc(2013) } subject(:job_group) do create( :job_group, o...
github
salsify/delayed_job_groups_plugin
https://github.com/salsify/delayed_job_groups_plugin
spec/delayed/job_groups/complete_stuck_job_groups_job_spec.rb
Ruby
mit
19
master
1,269
# frozen_string_literal: true describe Delayed::JobGroups::CompleteStuckJobGroupsJob do describe "#perform" do let(:job) { described_class.new } let!(:blocked) { create(:job_group, blocked: true) } let!(:not_queueing_complete) { create(:job_group, queueing_complete: false) } let!(:ready_without_jobs...
github
salsify/delayed_job_groups_plugin
https://github.com/salsify/delayed_job_groups_plugin
spec/delayed/job_groups/plugin_spec.rb
Ruby
mit
19
master
9,851
# frozen_string_literal: true describe Delayed::JobGroups::Plugin do before do @old_max_attempts = Delayed::Worker.max_attempts Delayed::Worker.max_attempts = 2 TestJobs::CompletionJob.invoked = false TestJobs::CancellationJob.invoked = false end after do Delayed::Worker.max_attempts = @old...
github
salsify/delayed_job_groups_plugin
https://github.com/salsify/delayed_job_groups_plugin
spec/delayed/job_groups/yaml_loader_spec.rb
Ruby
mit
19
master
1,169
# frozen_string_literal: true describe Delayed::JobGroups::YamlLoader do describe "#load" do context "with a correct yaml object representation" do let(:yaml) { '--- !ruby/object:TestJobs::Foo {}' } it "deserializes from YAML properly" do expect(Delayed::JobGroups::YamlLoader.load(yaml)).to ...
github
salsify/delayed_job_groups_plugin
https://github.com/salsify/delayed_job_groups_plugin
spec/factories/job_groups.rb
Ruby
mit
19
master
247
# frozen_string_literal: true FactoryBot.define do factory :job_group, class: 'Delayed::JobGroups::JobGroup' do blocked { false } queueing_complete { false } on_completion_job { nil } on_completion_job_options { nil } end end
github
salsify/delayed_job_groups_plugin
https://github.com/salsify/delayed_job_groups_plugin
spec/db/schema.rb
Ruby
mit
19
master
890
# frozen_string_literal: true ActiveRecord::Schema.define(version: 0) do create_table(:delayed_jobs, force: true) do |t| t.integer :priority, default: 0 t.integer :attempts, default: 0 t.text :handler t.text :last_error t.datetime :run_at t.datetime :locked_at t.datetime :failed_at t...
github
salsify/delayed_job_groups_plugin
https://github.com/salsify/delayed_job_groups_plugin
lib/delayed_job_groups_plugin.rb
Ruby
mit
19
master
876
# frozen_string_literal: true require 'active_support' require 'active_record' require 'delayed_job' require 'delayed_job_active_record' require 'delayed/job_groups/errors' require 'delayed/job_groups/compatibility' require 'delayed/job_groups/complete_stuck_job_groups_job' require 'delayed/job_groups/job_extensions' ...
github
salsify/delayed_job_groups_plugin
https://github.com/salsify/delayed_job_groups_plugin
lib/generators/delayed_job_groups_plugin/install_generator.rb
Ruby
mit
19
master
2,112
# frozen_string_literal: true require 'rails/generators' require 'rails/generators/migration' require 'rails/generators/active_record' module DelayedJobGroupsPlugin class InstallGenerator < Rails::Generators::Base include Rails::Generators::Migration source_paths << File.join(File.dirname(__FILE__), 'templ...
github
salsify/delayed_job_groups_plugin
https://github.com/salsify/delayed_job_groups_plugin
lib/delayed/job_groups/job_extensions.rb
Ruby
mit
19
master
573
# frozen_string_literal: true module Delayed module JobGroups module JobExtensions extend ActiveSupport::Concern module ReadyToRunExtension def ready_to_run(worker_name, max_run_time) super(worker_name, max_run_time).where(blocked: false) end end included do ...
github
salsify/delayed_job_groups_plugin
https://github.com/salsify/delayed_job_groups_plugin
lib/delayed/job_groups/yaml_loader.rb
Ruby
mit
19
master
456
# frozen_string_literal: true # This can be removed when we only support Rails 7.1+ because Rails 7.1 add a serialization # option for unsafe YAML loads module Delayed module JobGroups module YamlLoader def self.load(yaml) return yaml unless yaml.is_a?(String) && /^---/.match(yaml) YAML.lo...
github
salsify/delayed_job_groups_plugin
https://github.com/salsify/delayed_job_groups_plugin
lib/delayed/job_groups/complete_stuck_job_groups_job.rb
Ruby
mit
19
master
436
# frozen_string_literal: true module Delayed module JobGroups class CompleteStuckJobGroupsJob class << self def enqueue(**kwargs) Delayed::Job.enqueue(new, **kwargs) end end def perform Delayed::JobGroups::JobGroup.ready.with_no_open_jobs.find_each do |job_gro...
github
salsify/delayed_job_groups_plugin
https://github.com/salsify/delayed_job_groups_plugin
lib/delayed/job_groups/railtie.rb
Ruby
mit
19
master
981
# frozen_string_literal: true module Delayed module JobGroups class Railtie < ::Rails::Railtie config.after_initialize do # On cancellation checks are performed in the after failure delayed job lifecycle, however # https://github.com/collectiveidea/delayed_job/blob/master/lib/delayed/worke...
github
salsify/delayed_job_groups_plugin
https://github.com/salsify/delayed_job_groups_plugin
lib/delayed/job_groups/errors.rb
Ruby
mit
19
master
427
# frozen_string_literal: true module Delayed module JobGroups ConfigurationError = Class.new(StandardError) class IncompatibleWithDelayedJobError < ConfigurationError DEFAULT_MESSAGE = 'DelayedJobGroupsPlugin is incompatible with Delayed::Job ' \ 'when `destroy_failed_jobs` is ...
github
salsify/delayed_job_groups_plugin
https://github.com/salsify/delayed_job_groups_plugin
lib/delayed/job_groups/compatibility.rb
Ruby
mit
19
master
405
# frozen_string_literal: true require 'active_support/version' require 'active_record/version' module Delayed module JobGroups module Compatibility ACTIVE_RECORD_VERSION = ::Gem::Version.new(::ActiveRecord::VERSION::STRING).release VERSION_7_1 = ::Gem::Version.new('7.1.0') def self.rails_7_1_...
github
salsify/delayed_job_groups_plugin
https://github.com/salsify/delayed_job_groups_plugin
lib/delayed/job_groups/plugin.rb
Ruby
mit
19
master
2,407
# frozen_string_literal: true require 'delayed_job' require 'set' module Delayed module JobGroups class Plugin < Delayed::Plugin callbacks do |lifecycle| lifecycle.before(:error) do |_worker, job| # If the job group has been cancelled then don't let the job be retried if job.i...
github
salsify/delayed_job_groups_plugin
https://github.com/salsify/delayed_job_groups_plugin
lib/delayed/job_groups/job_group.rb
Ruby
mit
19
master
4,278
# frozen_string_literal: true require_relative 'yaml_loader' require_relative 'compatibility' module Delayed module JobGroups class JobGroup < ActiveRecord::Base self.table_name = "#{ActiveRecord::Base.table_name_prefix}delayed_job_groups" if Compatibility.rails_7_1_or_greater? serialize :...
github
meridianplaces/meridian
https://github.com/meridianplaces/meridian
import.rb
Ruby
mit
19
main
2,515
require "rubygems" require "nokogiri" require "json" FILES = [ ARGV[0] ] ICONS = JSON.parse(IO.read("config/icons.json")) TYPES = JSON.parse(IO.read("config/types.json")) # the key order matters # more specific categories are hit first, otherwise it can fall through to more generic icons TAG_KEYS = ICONS.keys class ...
github
meridianplaces/meridian
https://github.com/meridianplaces/meridian
app.rb
Ruby
mit
19
main
2,858
Bundler.require db = Sequel.connect(ENV["DATABASE_URL"]) ICONS = JSON.parse(IO.read("config/icons.json")) TYPES = JSON.parse(IO.read("config/types.json")) get "/" do @q = params[:q].to_s if @q.length > 0 pieces = @q.split(",") lat = pieces.first.strip.to_f long = pieces.last.strip.to_f sql = "SELECT id, ...
github
EmergeTools/emerge-cli
https://github.com/EmergeTools/emerge-cli
Rakefile
Ruby
mit
20
main
257
require 'bundler/gem_tasks' require 'rake/testtask' require 'rubocop/rake_task' RuboCop::RakeTask.new Rake::TestTask.new(:test) do |t| t.libs << 'test' t.libs << 'lib' t.test_files = Dir.glob('test/**/*_test.rb') end task default: %i[rubocop test]
github
EmergeTools/emerge-cli
https://github.com/EmergeTools/emerge-cli
Gemfile
Ruby
mit
20
main
285
source 'https://rubygems.org' gemspec group :development, :test do gem 'minitest', '~> 5.25.1' gem 'minitest-reporters', '~> 1.7.1' gem 'pry-byebug', '~> 3.10' gem 'rake', '~> 13.2.1' gem 'rspec', '~> 3.13.0' gem 'rubocop', '~> 1.68.0' gem 'simplecov', '~> 0.22.0' end
github
EmergeTools/emerge-cli
https://github.com/EmergeTools/emerge-cli
emerge_cli.gemspec
Ruby
mit
20
main
1,586
require_relative 'lib/version' Gem::Specification.new do |spec| spec.name = 'emerge' spec.version = EmergeCLI::VERSION spec.authors = ['Emerge Tools'] spec.email = ['support@emergetools.com'] spec.summary = 'Emerge CLI' spec.description = 'The official CLI for Emerge T...
github
EmergeTools/emerge-cli
https://github.com/EmergeTools/emerge-cli
lib/emerge_cli.rb
Ruby
mit
20
main
3,364
require_relative 'version' require_relative 'commands/global_options' require_relative 'commands/build/distribution/validate' require_relative 'commands/build/distribution/install' require_relative 'commands/config/snapshots/snapshots_ios' require_relative 'commands/config/orderfiles/orderfiles_ios' require_relative '...
github
EmergeTools/emerge-cli
https://github.com/EmergeTools/emerge-cli
lib/commands/global_options.rb
Ruby
mit
20
main
422
require 'dry/cli' require 'logger' module EmergeCLI module Commands class GlobalOptions < Dry::CLI::Command option :debug, type: :boolean, default: false, desc: 'Enable debug logging' def before(args) log_level = args[:debug] ? ::Logger::DEBUG : ::Logger::INFO EmergeCLI::Logger.confi...
github
EmergeTools/emerge-cli
https://github.com/EmergeTools/emerge-cli
lib/commands/build/distribution/install.rb
Ruby
mit
20
main
6,927
require 'dry/cli' require 'cfpropertylist' require 'zip' require 'rbconfig' require 'tmpdir' require 'tty-prompt' module EmergeCLI module Commands module Build module Distribution class Install < EmergeCLI::Commands::GlobalOptions desc 'Download and install a build from Build Distribution...
github
EmergeTools/emerge-cli
https://github.com/EmergeTools/emerge-cli
lib/commands/build/distribution/validate.rb
Ruby
mit
20
main
5,611
require 'dry/cli' require 'cfpropertylist' require 'zip' require 'rbconfig' module EmergeCLI module Commands module Build module Distribution class ValidateApp < EmergeCLI::Commands::GlobalOptions desc 'Validate app for build distribution' option :path, type: :string, required:...
github
EmergeTools/emerge-cli
https://github.com/EmergeTools/emerge-cli
lib/commands/snapshots/validate_app.rb
Ruby
mit
20
main
2,100
require 'dry/cli' require 'json' require 'uri' require 'yaml' require 'cfpropertylist' module EmergeCLI module Commands module Snapshots class ValidateApp < EmergeCLI::Commands::GlobalOptions desc 'Validate app for snapshot testing [iOS, macOS]' # Optional options option :path, typ...
github
EmergeTools/emerge-cli
https://github.com/EmergeTools/emerge-cli
lib/commands/integrate/fastlane.rb
Ruby
mit
20
main
4,751
require 'dry/cli' require 'fileutils' module EmergeCLI module Commands module Integrate class Fastlane < EmergeCLI::Commands::GlobalOptions desc 'Integrate Emerge into your iOS project via Fastlane' argument :path, type: :string, required: false, default: '.', desc:...
github
EmergeTools/emerge-cli
https://github.com/EmergeTools/emerge-cli
lib/commands/fix/exported_symbols.rb
Ruby
mit
20
main
2,189
require 'dry/cli' require 'xcodeproj' module EmergeCLI module Commands module Fix class ExportedSymbols < EmergeCLI::Commands::GlobalOptions desc 'Remove exported symbols from built binaries' option :path, type: :string, required: true, desc: 'Path to the xcarchive' # Constants ...
github
EmergeTools/emerge-cli
https://github.com/EmergeTools/emerge-cli
lib/commands/fix/minify_strings.rb
Ruby
mit
20
main
3,141
require 'dry/cli' require 'xcodeproj' module EmergeCLI module Commands module Fix class MinifyStrings < EmergeCLI::Commands::GlobalOptions desc 'Minify strings in the app' option :path, type: :string, required: true, desc: 'Path to the xcarchive' # Constants SCRIPT_NAME = ...
github
EmergeTools/emerge-cli
https://github.com/EmergeTools/emerge-cli
lib/commands/fix/strip_binary_symbols.rb
Ruby
mit
20
main
3,761
require 'dry/cli' require 'xcodeproj' module EmergeCLI module Commands module Fix class StripBinarySymbols < EmergeCLI::Commands::GlobalOptions desc 'Strip binary symbols from the app' option :path, type: :string, required: true, desc: 'Path to the xcarchive' # Constants S...
github
EmergeTools/emerge-cli
https://github.com/EmergeTools/emerge-cli
lib/commands/order_files/validate_linkmaps.rb
Ruby
mit
20
main
1,801
require 'dry/cli' require 'cfpropertylist' module EmergeCLI module Commands module OrderFiles class ValidateLinkmaps < EmergeCLI::Commands::GlobalOptions desc 'Validate linkmaps in xcarchive' option :path, type: :string, required: true, desc: 'Path to the xcarchive to validate' de...
github
EmergeTools/emerge-cli
https://github.com/EmergeTools/emerge-cli
lib/commands/order_files/validate_xcode_project.rb
Ruby
mit
20
main
2,659
require 'dry/cli' require 'xcodeproj' module EmergeCLI module Commands module OrderFiles class ValidateXcodeProject < EmergeCLI::Commands::GlobalOptions desc 'Validate xcodeproject for order files' option :path, type: :string, required: true, desc: 'Path to the xcodeproject to validate' ...
github
EmergeTools/emerge-cli
https://github.com/EmergeTools/emerge-cli
lib/commands/order_files/download_order_files.rb
Ruby
mit
20
main
2,704
require 'dry/cli' module EmergeCLI module Commands module OrderFiles class Download < EmergeCLI::Commands::GlobalOptions desc 'Download order files from Emerge' option :bundle_id, type: :string, required: true, desc: 'Bundle identifier to download order files for' option :api_toke...
github
EmergeTools/emerge-cli
https://github.com/EmergeTools/emerge-cli
lib/commands/config/orderfiles/orderfiles_ios.rb
Ruby
mit
20
main
3,945
require 'xcodeproj' module EmergeCLI module Commands module Config class OrderFilesIOS < EmergeCLI::Commands::GlobalOptions desc 'Configure order files for iOS' # Optional options option :skip_download_script, type: :boolean, required: false, desc: 'Only enable linkmaps' op...
github
EmergeTools/emerge-cli
https://github.com/EmergeTools/emerge-cli
lib/commands/config/snapshots/snapshots_ios.rb
Ruby
mit
20
main
8,839
require 'dry/cli' require 'json' require 'uri' require 'chunky_png' require 'async' require 'async/barrier' require 'async/semaphore' require 'async/http/internet/instance' require 'yaml' require 'tty-prompt' require 'tty-table' module EmergeCLI module Commands module Config class SnapshotsIOS < EmergeCLI...
github
EmergeTools/emerge-cli
https://github.com/EmergeTools/emerge-cli
lib/commands/upload/build.rb
Ruby
mit
20
main
5,114
require 'dry/cli' require 'json' require 'uri' require 'async' require 'async/barrier' require 'async/semaphore' require 'async/http/internet/instance' module EmergeCLI module Commands module Upload class Build < EmergeCLI::Commands::GlobalOptions desc 'Upload a build to Emerge' option :pa...
github
EmergeTools/emerge-cli
https://github.com/EmergeTools/emerge-cli
lib/commands/upload/snapshots/snapshots.rb
Ruby
mit
20
main
13,647
require 'dry/cli' require 'json' require 'uri' require 'chunky_png' require 'async' require 'async/barrier' require 'async/semaphore' require 'async/http/internet/instance' require 'zip' require 'tempfile' module EmergeCLI module Commands module Upload class Snapshots < EmergeCLI::Commands::GlobalOptions ...