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
sishen/uber-ruby
https://github.com/sishen/uber-ruby
lib/uber/models/request.rb
Ruby
mit
46
master
1,463
module Uber class Request < Base attr_accessor :request_id, :status, :vehicle, :driver, :location, :pickup, :destination, :eta, :surge_multiplier, :meta, :errors def driver=(value) @driver = value.nil? ? nil : Driver.new(value) end def vehicle=(value) @vehicle = value.n...
github
sishen/uber-ruby
https://github.com/sishen/uber-ruby
lib/uber/models/user.rb
Ruby
mit
46
master
203
module Uber class User < Base attr_accessor :first_name, :last_name, :email, :picture, :promo_code, :mobile_verified, :uuid def mobile_verified? !!self.mobile_verified end end end
github
sishen/uber-ruby
https://github.com/sishen/uber-ruby
lib/uber/models/reminder.rb
Ruby
mit
46
master
644
module Uber class Reminder < Base attr_accessor :event, :product_id, :reminder_id, :reminder_time, :reminder_status, :trip_branding def event=(value) @event = value && Event.new(value) end def trip_branding=(value) @trip_branding = value && TripBranding.new(value) end def remind...
github
sishen/uber-ruby
https://github.com/sishen/uber-ruby
lib/uber/models/estimate.rb
Ruby
mit
46
master
724
module Uber class Estimate < Base attr_accessor :pickup_estimate, :price, :trip, :errors def price=(value) @price = value.nil? ? nil : Price.new(value) end def trip=(value) @trip = value.nil? ? nil : Trip.new(value) end def humanized_estimate unless pickup_estimate.nil? ...
github
sishen/uber-ruby
https://github.com/sishen/uber-ruby
lib/uber/models/delivery/quote.rb
Ruby
mit
46
master
359
module Uber module Delivery class Quote < Base attr_accessor :quote_id, :estimated_at, :expires_at, :fee, :currency_code, :pickup_eta, :dropoff_eta def estimated_at @estimated_at && ::Time.at(@estimated_at) end def expires_at @expires_at && ::Time.at(@...
github
sishen/uber-ruby
https://github.com/sishen/uber-ruby
lib/uber/models/delivery/delivery.rb
Ruby
mit
46
master
360
module Uber module Delivery class Delivery < Base attr_accessor :courier, :created_at, :currency_code, :delivery_id, :dropoff, :fee, :items, :order_reference_id, :pickup, :quote_id, :status, :tracking_url, :batch def created_at @created_at && ::Time.at(...
github
sishen/uber-ruby
https://github.com/sishen/uber-ruby
lib/uber/models/partner/trip.rb
Ruby
mit
46
master
700
module Uber module Partner class TripActivity < Base attr_accessor :count, :limit, :offset, :trips def trips=(values) @trips = values.map { |value| Uber::Partner::Trip.new value } end end class Trip < Base attr_accessor :dropoff, :vehicle_id, :distance, :start_city, :sta...
github
sishen/uber-ruby
https://github.com/sishen/uber-ruby
lib/uber/models/partner/partner.rb
Ruby
mit
46
master
222
module Uber module Partner class Partner < Base attr_accessor :driver_id, :first_name, :last_name, :phone_number, :email, :picture, :rating, :promo_code, :activation_status end end end
github
sishen/uber-ruby
https://github.com/sishen/uber-ruby
lib/uber/models/partner/payment.rb
Ruby
mit
46
master
513
module Uber module Partner class PaymentActivity < Base attr_accessor :offset, :limit, :count, :payments def payments=(values) @payments = values.map { |value| Uber::Partner::Payment.new value } end end class Payment < Base attr_accessor :category, :breakdown, :rider_fee...
github
sishen/uber-ruby
https://github.com/sishen/uber-ruby
spec/spec_helper.rb
Ruby
mit
46
master
266
require 'rspec' require 'webmock/rspec' Dir[File.join(File.dirname(__FILE__), "./support/**/*.rb")].each do |f| require f end RSpec.configure do |c| c.include ClientHelpers c.before :each do WebMock.disable_net_connect!(allow_localhost: true) end end
github
sishen/uber-ruby
https://github.com/sishen/uber-ruby
spec/support/client_helpers.rb
Ruby
mit
46
master
766
require 'uber' module ClientHelpers def setup_client(opts = {}) Uber::Client.new do |c| c.bearer_token = 'UBER_BEARER_TOKEN' c.sandbox = opts[:sandbox] c.debug = opts[:debug] end end def stub_uber_request(method, api_endpoint, response_hash, opts = {}) with_opts = {head...
github
sishen/uber-ruby
https://github.com/sishen/uber-ruby
spec/lib/rate_limit_spec.rb
Ruby
mit
46
master
586
require "spec_helper" require "uber" describe Uber::RateLimit do let!(:now) { Time.at(1449638388) } let(:rate_limit) { Uber::RateLimit.new({ 'x-rate-limit-limit' => 500, 'x-rate-limit-remaining' => 499, 'x-rate-limit-reset' => now.to_i }) } it 'should return rate limit values' do ...
github
sishen/uber-ruby
https://github.com/sishen/uber-ruby
spec/lib/api/promotions_spec.rb
Ruby
mit
46
master
941
require 'spec_helper' require 'uber' describe Uber::API::Promotions do let!(:client) { setup_client } before do stub_uber_request(:get, 'v1/promotions?end_latitude=0.0&end_longitude=0.6&start_latitude=0.0&start_longitude=0.5', # From: https://developer.uber.com/v1/endpoints/#promotions...
github
sishen/uber-ruby
https://github.com/sishen/uber-ruby
spec/lib/api/products_spec.rb
Ruby
mit
46
master
10,028
require 'spec_helper' require 'uber' describe Uber::API::Products do let!(:client) { setup_client } describe '#products' do context 'with a valid response' do before do stub_uber_request(:get, "v1/products", # From: https://developer.uber.com/v1/endpoints/#product-types...
github
sishen/uber-ruby
https://github.com/sishen/uber-ruby
spec/lib/api/reminders_spec.rb
Ruby
mit
46
master
4,904
require 'spec_helper' require 'uber' describe Uber::API::Reminders do let!(:client) { setup_client } describe "get reminder" do before do # From: https://developer.uber.com/docs/rides/api/v1-reminders-get stub_uber_request(:get, 'v1/reminders/48ee034e-311d-41ea-9794-02fc8dcd8696', ...
github
sishen/uber-ruby
https://github.com/sishen/uber-ruby
spec/lib/api/price_estimates_spec.rb
Ruby
mit
46
master
4,830
require 'spec_helper' require 'uber' describe Uber::API::PriceEstimates do let!(:client) { setup_client } before do stub_uber_request(:get, 'v1/estimates/price?start_latitude=0.0&start_longitude=0.5&end_latitude=0.0&end_longitude=0.6', # From: https://developer.uber.com/v1/endpoints/#pri...
github
sishen/uber-ruby
https://github.com/sishen/uber-ruby
spec/lib/api/places_spec.rb
Ruby
mit
46
master
837
require "spec_helper" require "uber" describe Uber::API::Places do let!(:client) { setup_client } before do stub_uber_request(:get, 'v1/places/home', {address: 'Mumbai, India'}) end it 'should return information about place' do place_request = client.place('home') expect(place_request.class).to e...
github
sishen/uber-ruby
https://github.com/sishen/uber-ruby
spec/lib/api/requests_spec.rb
Ruby
mit
46
master
18,511
require 'spec_helper' require 'uber' describe Uber::API::Requests do let!(:client) { setup_client } describe '#trip_estimate' do context 'with a valid response' do before do stub_uber_request(:post, "v1/requests/estimate", # From: https://developer.uber.com/docs/v1-requ...
github
sishen/uber-ruby
https://github.com/sishen/uber-ruby
spec/lib/api/me_spec.rb
Ruby
mit
46
master
1,201
require "spec_helper" require "uber" describe Uber::API::Me do let!(:client) { setup_client } before do stub_uber_request(:get, "v1/me", # From: https://developer.uber.com/v1/endpoints/#user-profile { "first_name" => "Uber", ...
github
sishen/uber-ruby
https://github.com/sishen/uber-ruby
spec/lib/api/activities_spec.rb
Ruby
mit
46
master
1,828
require 'spec_helper' require 'uber' describe Uber::API::Activities do let!(:client) { setup_client } before do stub_uber_request(:get, 'v1.2/history', # From: https://developer.uber.com/docs/v12-history { "offset" => 0, "limit" => 1, "count" => 5, "history" => [ { "request_time" => 1401884...
github
sishen/uber-ruby
https://github.com/sishen/uber-ruby
spec/lib/api/time_estimates_spec.rb
Ruby
mit
46
master
2,327
require 'spec_helper' require 'uber' describe Uber::API::TimeEstimates do let!(:client) { setup_client } before do stub_uber_request(:get, 'v1/estimates/time?start_latitude=0.6&start_longitude=0.6', # From: https://developer.uber.com/v1/endpoints/#time-estimates { ...
github
sishen/uber-ruby
https://github.com/sishen/uber-ruby
spec/lib/api/partners_spec.rb
Ruby
mit
46
master
12,264
require "spec_helper" require "uber" describe Uber::API::Partners do let!(:client) { setup_client } describe "profile" do before do stub_uber_request(:get, 'v1/partners/me', {"driver_id" => "3ag923b1-ff5d-4422-80da-a5cefdca3cea", "first_name" => "John", ...
github
sishen/uber-ruby
https://github.com/sishen/uber-ruby
spec/lib/api/deliveries_spec.rb
Ruby
mit
46
master
36,588
require 'spec_helper' require 'uber' describe Uber::API::Deliveries do let!(:client) { setup_client } describe 'on requesting deliveries' do before do stub_uber_request(:get, 'v1/deliveries', { "count" => 172, "next_page" => "st...
github
openstack/puppet-horizon
https://github.com/openstack/puppet-horizon
lib/puppet/functions/validate_available_themes.rb
Ruby
apache-2.0
46
master
479
Puppet::Functions.create_function(:validate_available_themes) do def validate_available_themes(themes) req_keys = Set.new(['name', 'label', 'path']) themes.each do |theme| if theme.keys.to_set != req_keys if theme.keys.to_set.subset?(req_keys) raise Puppet::Error, "Some of the require...
github
openstack/puppet-horizon
https://github.com/openstack/puppet-horizon
spec/spec_helper.rb
Ruby
apache-2.0
46
master
727
require 'puppetlabs_spec_helper/module_spec_helper' require 'shared_examples' require 'puppet-openstack_spec_helper/facts' fixture_path = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures')) RSpec.configure do |c| c.alias_it_should_behave_like_to :it_configures, 'configures' c.alias_it_should_behave_li...
github
openstack/puppet-horizon
https://github.com/openstack/puppet-horizon
spec/type_aliases/availablethemes_spec.rb
Ruby
apache-2.0
46
master
782
require 'spec_helper' describe 'Horizon::AvailableThemes' do describe 'valid types' do context 'with valid types' do [ [ {'name' => 'default'} ], [ {'name' => 'default'}, {'name' => 'custom'} ], ].each do |value| describe value.ins...
github
openstack/puppet-horizon
https://github.com/openstack/puppet-horizon
spec/type_aliases/webssochoices_spec.rb
Ruby
apache-2.0
46
master
827
require 'spec_helper' describe 'Horizon::WebSsoChoices' do describe 'valid types' do context 'with valid types' do [ [ ['oidc', 'OpenID Connect'], ], [ ['oidc', 'OpenID Connect'], ['acme_oidc', 'ACME - OpenID Connect'], ], ].each do |value...
github
openstack/puppet-horizon
https://github.com/openstack/puppet-horizon
spec/acceptance/horizon_with_apache_spec.rb
Ruby
apache-2.0
46
master
2,083
require 'spec_helper_acceptance' describe 'horizon class' do context 'default parameters' do it 'should work with no errors' do pp= <<-EOS include openstack_integration include openstack_integration::repos include openstack_integration::apache include openstack_integration::memcac...
github
openstack/puppet-horizon
https://github.com/openstack/puppet-horizon
spec/defines/horizon_dashboard_spec.rb
Ruby
apache-2.0
46
master
2,505
# # Copyright (C) 2018 Binero # # Author: Tobias Urdin <tobias.urdin@binero.se> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
github
openstack/puppet-horizon
https://github.com/openstack/puppet-horizon
spec/defines/horizon_policy_base_spec.rb
Ruby
apache-2.0
46
master
2,328
require 'spec_helper' describe 'horizon::policy::base' do let (:title) { 'keystone_policy.yaml' } shared_examples 'horizon::policy::base' do context 'with default' do let :pre_condition do <<-eos class { 'horizon': secret_key => 'elj1IWiLoWHgcyYxFVLj7cM5rGOOxWl0', ...
github
openstack/puppet-horizon
https://github.com/openstack/puppet-horizon
spec/classes/horizon_init_spec.rb
Ruby
apache-2.0
46
master
31,992
require 'spec_helper' describe 'horizon' do let :params do { 'secret_key' => 'elj1IWiLoWHgcyYxFVLj7cM5rGOOxWl0' } end let :pre_condition do 'include apache' end let :fixtures_path do File.expand_path(File.join(__FILE__, '..', '..', 'fixtures')) end shared_examples_for 'horizon' do co...
github
openstack/puppet-horizon
https://github.com/openstack/puppet-horizon
spec/classes/horizon_wsgi_apache_spec.rb
Ruby
apache-2.0
46
master
18,249
require 'spec_helper' describe 'horizon::wsgi::apache' do let :params do {} end let :pre_condition do "include apache class { 'horizon': secret_key => 's3cr3t', configure_apache => false }" end let :fixtures_path do File.expand_path(File.join(__FILE__, '..', '..', 'fixtures')) end shar...
github
openstack/puppet-horizon
https://github.com/openstack/puppet-horizon
spec/classes/horizon_dashboards_cloudkitty_spec.rb
Ruby
apache-2.0
46
master
2,143
require 'spec_helper' describe 'horizon::dashboards::cloudkitty' do let :params do {} end shared_examples_for 'horizon::dashboards::cloudkitty' do context 'with default parameters' do let(:pre_condition) do <<-eos class { 'horizon': secret_key => 'elj1IWiLoWHgcyYxFV...
github
openstack/puppet-horizon
https://github.com/openstack/puppet-horizon
spec/classes/horizon_dashboards_heat_spec.rb
Ruby
apache-2.0
46
master
4,517
require 'spec_helper' describe 'horizon::dashboards::heat' do let :params do {} end shared_examples_for 'horizon::dashboards::heat' do context 'with default parameters' do let(:pre_condition) do <<-eos class { 'horizon': secret_key => 'elj1IWiLoWHgcyYxFVLj7cM5rGOOxW...
github
openstack/puppet-horizon
https://github.com/openstack/puppet-horizon
spec/classes/horizon_dashboards_designate_spec.rb
Ruby
apache-2.0
46
master
2,731
require 'spec_helper' describe 'horizon::dashboards::designate' do let :params do {} end shared_examples_for 'horizon::dashboards::designate' do context 'with default parameters' do let(:pre_condition) do <<-eos class { 'horizon': secret_key => 'elj1IWiLoWHgcyYxFVLj...
github
openstack/puppet-horizon
https://github.com/openstack/puppet-horizon
spec/classes/horizon_dashboards_manila_spec.rb
Ruby
apache-2.0
46
master
3,185
require 'spec_helper' describe 'horizon::dashboards::manila' do let :params do {} end shared_examples_for 'horizon::dashboards::manila' do context 'with default parameters' do let(:pre_condition) do <<-eos class { 'horizon': secret_key => 'elj1IWiLoWHgcyYxFVLj7cM5rG...
github
openstack/puppet-horizon
https://github.com/openstack/puppet-horizon
spec/classes/horizon_dashboards_octavia_spec.rb
Ruby
apache-2.0
46
master
2,737
require 'spec_helper' describe 'horizon::dashboards::octavia' do let :params do {} end shared_examples_for 'horizon::dashboards::octavia' do context 'with default parameters' do let(:pre_condition) do <<-eos class { 'horizon': secret_key => 'elj1IWiLoWHgcyYxFVLj7cM5...
github
openstack/puppet-horizon
https://github.com/openstack/puppet-horizon
spec/classes/horizon_policy_spec.rb
Ruby
apache-2.0
46
master
3,433
require 'spec_helper' describe 'horizon::policy' do let :params do {} end shared_examples_for 'horizon::policy' do context 'with default parameters' do let(:pre_condition) do <<-eos class { 'horizon': secret_key => 'elj1IWiLoWHgcyYxFVLj7cM5rGOOxWl0', ...
github
openstack/puppet-horizon
https://github.com/openstack/puppet-horizon
spec/classes/horizon_dashboards_ironic_spec.rb
Ruby
apache-2.0
46
master
1,305
require 'spec_helper' describe 'horizon::dashboards::ironic' do let :params do {} end shared_examples_for 'horizon::dashboards::ironic' do context 'with default parameters' do let(:pre_condition) do <<-eos class { 'horizon': secret_key => 'elj1IWiLoWHgcyYxFVLj7cM5rG...
github
visualphoenix/jenkins-xml-to-jobdsl
https://github.com/visualphoenix/jenkins-xml-to-jobdsl
server.rb
Ruby
apache-2.0
46
develop
794
#!/usr/bin/env ruby require 'rubygems' require 'sinatra' require 'haml' require 'json' set :bind, '0.0.0.0' # Handle GET-request (Show the upload form) get "/" do haml :upload end # Handle POST-request (Receive and save the uploaded file) post "/" do unless (jobname = params[:name]) && (tempfile = para...
github
visualphoenix/jenkins-xml-to-jobdsl
https://github.com/visualphoenix/jenkins-xml-to-jobdsl
jenkins-xml-to-jobdsl.rb
Ruby
apache-2.0
46
develop
57,017
require 'nokogiri' require 'pp' require 'optparse' # Bucket to dump any helpers multiple classes may need. module Helper # Escape Strings that are not valid groovy syntax. def escape str str.gsub(/\\/,"\\\\\\").gsub("'''", %q(\\\'\\\'\\\')) end def removeCarriage str str.tr " ", "\n" end def for...
github
maddox/imdb
https://github.com/maddox/imdb
imdb_og.gemspec
Ruby
mit
46
master
1,960
# Generated by jeweler # DO NOT EDIT THIS FILE # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec` # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = %q{imdb_og} s.version = "0.6.0" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_versio...
github
maddox/imdb
https://github.com/maddox/imdb
Rakefile
Ruby
mit
46
master
1,419
require 'rubygems' require 'rake' begin require 'jeweler' Jeweler::Tasks.new do |gem| gem.name = "imdb_og" gem.summary = %Q{Simple library to look up movies on IMDB} gem.description = %Q{Simple library to look up movies on IMDB} gem.email = "jon@mustacheinc.com" gem.homepage = "http://github.co...
github
maddox/imdb
https://github.com/maddox/imdb
test/test_helper.rb
Ruby
mit
46
master
215
require 'rubygems' require 'test/unit' require 'shoulda' $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH.unshift(File.dirname(__FILE__)) require 'imdb' class Test::Unit::TestCase end
github
maddox/imdb
https://github.com/maddox/imdb
test/imdb_test.rb
Ruby
mit
46
master
8,162
require 'test_helper' class ImdbTest < Test::Unit::TestCase # context "Imdb" do # should "have an imdb movie base url" do # assert_equal "http://www.imdb.com/title/", Imdb::IMDB_MOVIE_BASE_URL # end # should "have an imdb search base url" do # assert_equal "http://imdb.com/find?s=all&q=", Im...
github
maddox/imdb
https://github.com/maddox/imdb
lib/imdb.rb
Ruby
mit
46
master
256
require 'rubygems' require 'hpricot' require 'open-uri' require 'date' require 'cgi' require 'htmlentities' require 'imdb/imdb' require 'imdb/imdb_company' require 'imdb/imdb_movie' require 'imdb/imdb_name' require 'imdb/imdb_genre' require 'imdb/patches'
github
maddox/imdb
https://github.com/maddox/imdb
lib/imdb/imdb_movie.rb
Ruby
mit
46
master
464
class ImdbMovie attr_accessor :imdb_id, :title, :directors, :writers, :tagline, :company, :plot, :runtime, :rating, :poster_url, :release_date, :certification, :genres, :actors def writers self.instance_variable_get(:@writers) || [] end def actors self.instance_variable_get(:@actors) || [] end ...
github
maddox/imdb
https://github.com/maddox/imdb
lib/imdb/patches.rb
Ruby
mit
46
master
219
require 'iconv' module StringPatches def unescape_html Iconv.conv("UTF-8", 'ISO-8859-1', CGI::unescapeHTML(self)) end def strip_tags gsub(/<\/?[^>]*>/, "") end end String.send :include, StringPatches
github
maddox/imdb
https://github.com/maddox/imdb
lib/imdb/imdb.rb
Ruby
mit
46
master
6,766
class Imdb IMDB_MOVIE_BASE_URL = "http://www.imdb.com/title/" IMDB_NAME_BASE_URL = "http://www.imdb.com/name/" IMDB_COMPANY_BASE_URL = "http://www.imdb.com/company/" IMDB_GENRE_BASE_URL = "http://www.imdb.com/Sections/Genres/" IMDB_SEARCH_BASE_URL = "http://imdb.com/find?s=all&q=" IMDB_TOP_250_URL = "http:...
github
purify/hey_sorty
https://github.com/purify/hey_sorty
lib/hey_sorty.rb
Ruby
mit
46
master
217
require 'hey_sorty/named_scope' require 'hey_sorty/helpers' module HeySorty class InvalidColumnName < StandardError; end class InvalidOrderValue < StandardError; end class ArgumentError < StandardError; end end
github
purify/hey_sorty
https://github.com/purify/hey_sorty
lib/hey_sorty/helpers.rb
Ruby
mit
46
master
510
module HeySortyHelpers def sorty(column, options = {}) # Options options = { :label => column.to_s.humanize.titleize }.merge(options) # Add params query = params.merge({ :column => column, :order => (params[:order].eql?('asc') ? 'desc' : 'asc') }) # Build new query string ...
github
purify/hey_sorty
https://github.com/purify/hey_sorty
lib/hey_sorty/named_scope.rb
Ruby
mit
46
master
1,986
module HeySorty module NamedScope def self.included(base) base.extend(ClassMethods) end module ClassMethods def sortable(column = :id, order = :asc) # Defaults @options = { :column => column.to_s, :order => order.to_s } # Available options valid_orde...
github
purify/hey_sorty
https://github.com/purify/hey_sorty
spec/spec_helper.rb
Ruby
mit
46
master
1,249
$: << File.dirname(__FILE__) + '/../lib' require 'rubygems' require 'spec' require 'active_record' require 'action_controller' require 'active_support' require 'action_view' require 'hey_sorty' include ActionView::Helpers::UrlHelper include ActionController::UrlWriter # Setup test database file test_database = File...
github
purify/hey_sorty
https://github.com/purify/hey_sorty
spec/schema.rb
Ruby
mit
46
master
335
ActiveRecord::Schema.define :version => 0 do create_table :sortables, :force => true do |t| t.column :user_id, :integer t.column :title, :string end create_table :users, :force => true do |t| t.column :name, :string end create_table :unsortables, :force => true do |t| t.column :title, :s...
github
purify/hey_sorty
https://github.com/purify/hey_sorty
spec/hey_sorty/helpers_spec.rb
Ruby
mit
46
master
444
require File.join(File.dirname(__FILE__), '..', 'spec_helper') describe HeySortyHelpers do include HeySortyHelpers before(:all) do # TODO: Get this shit working. @params = {} @controller = ActionController::Base.new @controller.stub!(:params).and_return(@params) @view = ActionView:...
github
purify/hey_sorty
https://github.com/purify/hey_sorty
spec/hey_sorty/named_scope_spec.rb
Ruby
mit
46
master
3,706
require File.join(File.dirname(__FILE__), '..', 'spec_helper') describe 'Hey Sorty' do it "should add a sortable? method to active records which returns false for non sortables" do Unsortable.should_not be_sortable end it "should add a sortable? method to active records which returns true for sortables" d...
github
wr0ngway/resque-dynamic-queues
https://github.com/wr0ngway/resque-dynamic-queues
Rakefile
Ruby
mit
46
master
1,693
require 'bundler' Bundler::GemHelper.install_tasks task :my_release => ['changelog', 'release'] do end task :changelog do helper = Bundler::GemHelper.new(Dir.pwd) version = "v#{helper.gemspec.version}" changelog_file = 'CHANGELOG' entries = "" # Get a list of current tags tags = `git tag -l`.split ta...
github
wr0ngway/resque-dynamic-queues
https://github.com/wr0ngway/resque-dynamic-queues
config.ru
Ruby
mit
46
master
223
#!/usr/bin/env ruby require 'logger' $LOAD_PATH.unshift ::File.expand_path(::File.dirname(__FILE__) + '/lib') require 'resque/server' require 'resque-dynamic-queues-server' use Rack::ShowExceptions run Resque::Server.new
github
wr0ngway/resque-dynamic-queues
https://github.com/wr0ngway/resque-dynamic-queues
resque-dynamic-queues.gemspec
Ruby
mit
46
master
1,235
# -*- encoding: utf-8 -*- $:.push File.expand_path("../lib", __FILE__) require 'resque/plugins/dynamic_queues/version' Gem::Specification.new do |s| s.name = "resque-dynamic-queues" s.version = Resque::Plugins::DynamicQueues::VERSION s.platform = Gem::Platform::RUBY s.authors = ["Matt Conway...
github
wr0ngway/resque-dynamic-queues
https://github.com/wr0ngway/resque-dynamic-queues
lib/resque-dynamic-queues.rb
Ruby
mit
46
master
348
require 'resque' require 'resque/worker' require 'resque/plugins/dynamic_queues/attributes' require 'resque/plugins/dynamic_queues/queues' #module Resque # extend Resque::Plugins::DynamicQueues::Attributes #end Resque.send(:extend, Resque::Plugins::DynamicQueues::Attributes) Resque::Worker.send(:include, Resque::Plug...
github
wr0ngway/resque-dynamic-queues
https://github.com/wr0ngway/resque-dynamic-queues
lib/resque/plugins/dynamic_queues/queues.rb
Ruby
mit
46
master
2,162
module Resque module Plugins module DynamicQueues module Queues # Returns a list of queues to use when searching for a job. # # A splat ("*") means you want every queue (in alpha order) - this # can be useful for dynamically adding new queues. # # The splat c...
github
wr0ngway/resque-dynamic-queues
https://github.com/wr0ngway/resque-dynamic-queues
lib/resque/plugins/dynamic_queues/attributes.rb
Ruby
mit
46
master
1,403
module Resque module Plugins module DynamicQueues DYNAMIC_QUEUE_KEY = "dynamic_queue" FALLBACK_KEY = "default" module Attributes def get_dynamic_queue(key, fallback=['*']) data = redis.hget(DYNAMIC_QUEUE_KEY, key) queue_names = Resque.decode(data) if que...
github
wr0ngway/resque-dynamic-queues
https://github.com/wr0ngway/resque-dynamic-queues
lib/resque/plugins/dynamic_queues/server.rb
Ruby
mit
46
master
1,739
require 'resque-dynamic-queues' module Resque module Plugins module DynamicQueues module Server VIEW_PATH = File.join(File.dirname(__FILE__), 'server', 'views') def self.registered(app) app.get "/dynamicqueues" do @queues = [] dqueues = Resque.get_dynamic...
github
wr0ngway/resque-dynamic-queues
https://github.com/wr0ngway/resque-dynamic-queues
spec/spec_helper.rb
Ruby
mit
46
master
858
require 'rspec' require 'resque-dynamic-queues' # No need to start redis when running in Travis unless ENV['CI'] begin Resque.queues rescue Errno::ECONNREFUSED spec_dir = File.dirname(File.expand_path(__FILE__)) REDIS_CMD = "redis-server #{spec_dir}/redis-test.conf" puts "Starting redis for t...
github
wr0ngway/resque-dynamic-queues
https://github.com/wr0ngway/resque-dynamic-queues
spec/queues_spec.rb
Ruby
mit
46
master
6,776
require "spec_helper" describe "Dynamic Queues" do before(:each) do Resque.redis.flushall end context "basic resque behavior still works" do it "can work on multiple queues" do Resque::Job.create(:high, SomeJob) Resque::Job.create(:critical, SomeJob) worker = Resque::Worker.new(:cri...
github
wr0ngway/resque-dynamic-queues
https://github.com/wr0ngway/resque-dynamic-queues
spec/server_spec.rb
Ruby
mit
46
master
3,760
ENV['RACK_ENV'] = 'test' require 'spec_helper' require 'rack' require 'rack/test' require 'resque/server' require 'resque-dynamic-queues-server' Sinatra::Base.set :environment, :test # ::Test::Unit::TestCase.send :include, Rack::Test::Methods describe "Dynamic Queues pages" do include Rack::Test::Methods def a...
github
mguymon/paseto.rb
https://github.com/mguymon/paseto.rb
Gemfile
Ruby
mit
46
master
238
# frozen_string_literal: true source 'https://rubygems.org' git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } # Specify your gem's dependencies in paseto.gemspec gemspec gem 'codecov', require: false, group: :test
github
mguymon/paseto.rb
https://github.com/mguymon/paseto.rb
paseto.gemspec
Ruby
mit
46
master
1,131
# frozen_string_literal: true lib = File.expand_path('lib', __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'paseto/version' Gem::Specification.new do |spec| spec.name = 'paseto' spec.version = Paseto::VERSION spec.authors = ['Michael Guymon', 'Frank Murphy'] spec...
github
mguymon/paseto.rb
https://github.com/mguymon/paseto.rb
spec/paseto_spec.rb
Ruby
mit
46
master
1,847
# frozen_string_literal: true RSpec.describe Paseto do it 'has a version number' do expect(Paseto::VERSION).not_to be nil end describe '#encode_length' do it 'encodes empty' do expect(described_class.encode_length(0)).to eq("\x00\x00\x00\x00\x00\x00\x00\x00") end it 'encodes a length' do ...
github
mguymon/paseto.rb
https://github.com/mguymon/paseto.rb
spec/spec_helper.rb
Ruby
mit
46
master
545
# frozen_string_literal: true require 'bundler/setup' require 'pry' require 'paseto' if ENV['CODECOV'] require 'simplecov' SimpleCov.start require 'codecov' SimpleCov.formatter = SimpleCov::Formatter::Codecov end RSpec.configure do |config| # Enable flags like --only-failures and --next-failure config.e...
github
mguymon/paseto.rb
https://github.com/mguymon/paseto.rb
spec/paseto/v2/local_spec.rb
Ruby
mit
46
master
5,713
# frozen_string_literal: true require 'securerandom' RSpec.describe Paseto::V2::Local do let(:local) { described_class } # Generated using https://github.com/paragonie/paseto: # # use ParagonIE\Paseto\Protocol\Version2; # use ParagonIE\Paseto\Keys\SymmetricKey; # use ParagonIE\ConstantTime\Base64UrlSafe;...
github
mguymon/paseto.rb
https://github.com/mguymon/paseto.rb
spec/paseto/v2/public_spec.rb
Ruby
mit
46
master
6,233
# frozen_string_literal: true require 'securerandom' RSpec.describe Paseto::V2::Public do let(:public) { described_class } # Generated using https://github.com/paragonie/paseto: # # use ParagonIE\Paseto\Protocol\Version2; # use ParagonIE\Paseto\Keys\AsymmetricSecretKey; # use ParagonIE\ConstantTime\Base6...
github
mguymon/paseto.rb
https://github.com/mguymon/paseto.rb
lib/paseto.rb
Ruby
mit
46
master
1,149
# frozen_string_literal: true require 'base64' require 'rbnacl' require 'paseto/version' require 'paseto/error' require 'paseto/token' require 'paseto/public' require 'paseto/local' # Platform-Agnostic SEcurity TOkens module Paseto EMPTY_FOOTER = '' # An Array#pack format to pack an unsigned little-endian 64-bi...
github
mguymon/paseto.rb
https://github.com/mguymon/paseto.rb
lib/paseto/token.rb
Ruby
mit
46
master
996
# frozen_string_literal: true # Helper for verifying and parsing tokens module Paseto Token = Struct.new(:header, :payload, :footer) do def to_message message = [ header, Paseto.encode64(payload) ] message << Paseto.encode64(footer) if footer && footer != EMPTY_FOOTER me...
github
mguymon/paseto.rb
https://github.com/mguymon/paseto.rb
lib/paseto/public.rb
Ruby
mit
46
master
3,088
# frozen_string_literal: true module Paseto module V2 # Asymmetric Authentication (Public-Key Signatures) module Public HEADER = 'v2.public' SIGNATURE_BYTES = RbNaCl::SigningKey.signature_bytes BadMessageError = Class.new(Paseto::Error) # Encode a message + footer in a Paseto payload...
github
mguymon/paseto.rb
https://github.com/mguymon/paseto.rb
lib/paseto/local.rb
Ruby
mit
46
master
2,764
# frozen_string_literal: true module Paseto module V2 # Symmetric Encryption module Local HEADER = 'v2.local' NONCE_BYTES = RbNaCl::AEAD::XChaCha20Poly1305IETF.nonce_bytes NonceError = Class.new(Paseto::Error) # Encryption key class Key def self.generate new(...
github
akm/schema_comments
https://github.com/akm/schema_comments
Rakefile
Ruby
mit
46
master
250
begin require 'bundler/setup' rescue LoadError puts 'You must `gem install bundler` and `bundle install` to run rake tasks' end require "bundler/gem_tasks" require "rspec/core/rake_task" RSpec::Core::RakeTask.new(:spec) task :default => :spec
github
akm/schema_comments
https://github.com/akm/schema_comments
schema_comments.gemspec
Ruby
mit
46
master
1,043
$:.push File.expand_path("../lib", __FILE__) require "schema_comments/version" Gem::Specification.new do |s| s.name = "schema_comments" s.version = SchemaComments::VERSION s.authors = ["akm"] s.email = ["akm2000@gmail.com"] s.homepage = "http://github.com/akm/schema_comments" s.summ...
github
akm/schema_comments
https://github.com/akm/schema_comments
Gemfile
Ruby
mit
46
master
741
source 'https://rubygems.org' # Declare your gem's dependencies in schema_comments.gemspec. # Bundler will treat runtime dependencies like base dependencies, and # development dependencies will be added by default to the :development group. gemspec # Declare any dependencies that are still in development here instead...
github
akm/schema_comments
https://github.com/akm/schema_comments
lib/schema_comments.rb
Ruby
mit
46
master
2,444
require 'active_support/core_ext/module' require 'schema_comments/version' require 'schema_comments/railtie' module SchemaComments autoload :Base , 'schema_comments/base' autoload :ConnectionAdapters, 'schema_comments/connection_adapters' autoload :DummyMigration , 'schema_comments/dummy_migrat...
github
akm/schema_comments
https://github.com/akm/schema_comments
lib/hash_key_orderable.rb
Ruby
mit
46
master
526
module HashKeyOrderable attr_accessor :key_order def each_with_key_order(&block) if @key_order.nil? || @key_order.empty? each_without_key_order(&block) return self end unexist_keys = @key_order - self.keys actual_order = (@key_order - unexist_keys) | self.keys actual_order.each do |...
github
akm/schema_comments
https://github.com/akm/schema_comments
lib/schema_comments/railtie.rb
Ruby
mit
46
master
282
require 'schema_comments' require 'rails' module SchemaScomments class Railtie < ::Rails::Railtie rake_tasks do SchemaComments.yaml_path = Rails.root.join("db/schema_comments.yml").to_s SchemaComments.setup require 'schema_comments/task' end end end
github
akm/schema_comments
https://github.com/akm/schema_comments
lib/schema_comments/schema_comment.rb
Ruby
mit
46
master
6,468
# -*- coding: utf-8 -*- require 'yaml/store' require 'hash_key_orderable' module SchemaComments class SchemaComment TABLE_KEY = 'table_comments' COLUMN_KEY = 'column_comments' class << self def table_comment(table_name) @table_names ||= yaml_read{|db| db[TABLE_KEY]}.dup @table_na...
github
akm/schema_comments
https://github.com/akm/schema_comments
lib/schema_comments/connection_adapters.rb
Ruby
mit
46
master
5,258
# -*- coding: utf-8 -*- module SchemaComments module ConnectionAdapters module ColumnDefinition attr_accessor :comment end module TableDefinition attr_accessor :comment def column(name, type, options = {}) result = super(name, type, options) column = self[name] ...
github
akm/schema_comments
https://github.com/akm/schema_comments
lib/schema_comments/schema_dumper.rb
Ruby
mit
46
master
8,281
# -*- coding: utf-8 -*- module SchemaComments class SchemaDumper < ActiveRecord::SchemaDumper include ActiveRecord::ConnectionAdapters::ColumnDumper # for schema_default if ActiveRecord.version < Gem::Version.new("4.2.0") def schema_default(column) default_string(column.default) end e...
github
akm/schema_comments
https://github.com/akm/schema_comments
lib/schema_comments/schema.rb
Ruby
mit
46
master
304
module SchemaComments module Schema def self.prepended(mod) mod.singleton_class.prepend(ClassMethods) end module ClassMethods def define(*args, &block) SchemaComments::SchemaComment.yaml_access do super(*args, &block) end end end end end
github
akm/schema_comments
https://github.com/akm/schema_comments
lib/schema_comments/schema_dumper/mysql.rb
Ruby
mit
46
master
9,028
# -*- coding: utf-8 -*- require 'schema_comments/schema_dumper' module SchemaComments class SchemaDumper::Mysql < SchemaComments::SchemaDumper include ActiveRecord::ConnectionAdapters::ColumnDumper # for schema_default if ActiveRecord.version < Gem::Version.new("4.2.0") def schema_default(column) ...
github
akm/schema_comments
https://github.com/akm/schema_comments
lib/schema_comments/tasks/schema_comments.rake
Ruby
mit
46
master
1,184
namespace :schema_comments do desc 'Dump schema to db/schema.rb' task :dump => :environment do require 'active_record/schema_dumper' filename = ENV['SCHEMA'] || Rails.root.join('db/schema.rb').to_s File.open(filename, "w:utf-8") do |file| ActiveRecord::Base.establish_connection(Rails.env) # ...
github
akm/schema_comments
https://github.com/akm/schema_comments
spec/yaml_export_spec.rb
Ruby
mit
46
master
1,785
# -*- coding: utf-8 -*- require File.join(File.dirname(__FILE__), 'spec_helper') describe SchemaComments::SchemaComment do let(:ignored_tables){ %w(schema_migrations) } before(:each) do SchemaComments.yaml_path = File.expand_path('../tmp/human_readable_schema_comments.yml', __FILE__) FileUtils.rm(SchemaCo...
github
akm/schema_comments
https://github.com/akm/schema_comments
spec/spec_helper.rb
Ruby
mit
46
master
629
require "simplecov" SimpleCov.start do add_filter "/spec/" end # Configure Rails Environment ENV["RAILS_ENV"] = "test" # Configure Rails Environment ENV["DB"] ||= 'sqlite3' # "mysql2" require File.expand_path("../dummy/config/environment.rb", __FILE__) ActiveRecord::Migrator.migrations_paths = [File.expand_path("...
github
akm/schema_comments
https://github.com/akm/schema_comments
spec/locale_spec.rb
Ruby
mit
46
master
1,405
# -*- coding: utf-8 -*- require File.join(File.dirname(__FILE__), 'spec_helper') describe SchemaComments::SchemaComment do before(:each) do SchemaComments.yaml_path = File.expand_path('../locale_spec/schema_comments.yml', __FILE__) end describe :model_comments do let(:result) do { 'person...
github
akm/schema_comments
https://github.com/akm/schema_comments
spec/migration_spec.rb
Ruby
mit
46
master
5,073
# -*- coding: utf-8 -*- require 'spec_helper' describe ActiveRecord::Migrator do let(:migration_path){ File.expand_path('../migrations', __FILE__) } let(:ignored_tables){ %w(schema_migrations) } before(:each) do SchemaComments.yaml_path = File.expand_path(File.join(File.dirname(__FILE__), 'schema_comments.y...
github
akm/schema_comments
https://github.com/akm/schema_comments
spec/hash_key_orderable_spec.rb
Ruby
mit
46
master
1,460
require File.expand_path(File.dirname(__FILE__) + '/spec_helper') require 'hash_key_orderable' describe HashKeyOrderable do describe :each do it "should each with key order" do hash = {'a' => 1, 'b' => 2, 'c' => 3, 'd' => 4} hash.extend(HashKeyOrderable) hash.key_order = %w(b d c a) actu...
github
akm/schema_comments
https://github.com/akm/schema_comments
spec/migrations/001_create_products.rb
Ruby
mit
46
master
500
# -*- coding: utf-8 -*- class CreateProducts < ActiveRecord::Migration def self.up create_table "products", :comment => '商品' do |t| t.string "product_type_cd", :comment => '種別コード' t.integer "price", :comment => "価格", default: 0 t.string "name", :comment => "商品名" t.datetime "created_a...
github
akm/schema_comments
https://github.com/akm/schema_comments
spec/migrations/002_rename_products.rb
Ruby
mit
46
master
208
# -*- coding: utf-8 -*- class RenameProducts < ActiveRecord::Migration def self.up rename_table "products", "product_names" end def self.down rename_table "product_names", "products" end end
github
akm/schema_comments
https://github.com/akm/schema_comments
spec/migrations/008_create_users_without_comment.rb
Ruby
mit
46
master
431
# -*- coding: utf-8 -*- class CreateUsersWithoutComment < ActiveRecord::Migration def self.up create_table :users do |t| t.string :login t.string :email t.string :crypted_password t.string :password_salt t.string :persistence_token t.string :single_access_token t.string :...
github
akm/schema_comments
https://github.com/akm/schema_comments
spec/migrations/003_rename_products_again.rb
Ruby
mit
46
master
213
# -*- coding: utf-8 -*- class RenameProductsAgain < ActiveRecord::Migration def self.up rename_table "product_names", "products" end def self.down rename_table "products", "product_names" end end
github
akm/schema_comments
https://github.com/akm/schema_comments
spec/migrations/007_change_comments.rb
Ruby
mit
46
master
378
# -*- coding: utf-8 -*- class ChangeComments < ActiveRecord::Migration def self.up column_comments(:products, {:name => "商品名称"}) column_comments("products", "product_type_cd" => 'カテゴリコード') end def self.down column_comments(:products, {:name => "名称"}) column_comments("products", "product_type_cd" ...
github
akm/schema_comments
https://github.com/akm/schema_comments
spec/migrations/006_change_products_name_with_comment.rb
Ruby
mit
46
master
301
# -*- coding: utf-8 -*- class ChangeProductsNameWithComment < ActiveRecord::Migration def self.up change_column "products", 'name', :string, :limit => 100, :comment => "名称" end def self.down change_column "products", 'name', :string, :limit => 50, :comment => "商品名" end end
github
akm/schema_comments
https://github.com/akm/schema_comments
spec/migrations/004_remove_price.rb
Ruby
mit
46
master
259
# -*- coding: utf-8 -*- class RemovePrice < ActiveRecord::Migration def self.up # remove_column "products", "price" remove_column "products", :price end def self.down add_column "products", "price", :integer, :comment => "価格" end end