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
voxpupuli/puppet-r10k
https://github.com/voxpupuli/puppet-r10k
spec/classes/postrun_command_spec.rb
Ruby
apache-2.0
98
master
3,024
# frozen_string_literal: true require 'spec_helper' describe 'r10k::postrun_command', type: :class do on_supported_os.each do |os, facts| context "on #{os}" do let :facts do facts end context 'with Puppet Enterprise' do let :facts do facts.merge( is_pe: tr...
github
voxpupuli/puppet-r10k
https://github.com/voxpupuli/puppet-r10k
spec/classes/mcollective_spec.rb
Ruby
apache-2.0
98
master
1,408
# frozen_string_literal: true require 'spec_helper' describe 'r10k::mcollective', type: :class do on_supported_os.each do |os, facts| context "on #{os}" do let :facts do facts end # Gentoo has no choria package and upstream doesn't offer a 3rd party repo context 'With defaults', ...
github
voxpupuli/puppet-r10k
https://github.com/voxpupuli/puppet-r10k
spec/classes/r10k_spec.rb
Ruby
apache-2.0
98
master
870
# frozen_string_literal: true require 'spec_helper' describe 'r10k', type: :class do on_supported_os.each do |os, facts| context "on #{os}" do let :facts do facts end context 'with a github remote' do let :params do { remote: 'git@github.com:someuser/puppe...
github
voxpupuli/puppet-r10k
https://github.com/voxpupuli/puppet-r10k
spec/classes/prerun_command_spec.rb
Ruby
apache-2.0
98
master
3,512
# frozen_string_literal: true require 'spec_helper' describe 'r10k::prerun_command', type: :class do on_supported_os.each do |os, facts| context "on #{os}" do let :facts do facts end context 'with Puppet Enterprise' do let :facts do facts.merge( is_pe: tru...
github
voxpupuli/puppet-r10k
https://github.com/voxpupuli/puppet-r10k
spec/classes/install/puppet_gem_spec.rb
Ruby
apache-2.0
98
master
563
# frozen_string_literal: true require 'spec_helper' describe 'r10k::install::puppet_gem', type: :class do on_supported_os.each do |os, facts| context "on #{os}" do let :facts do facts end let :pre_condition do 'include r10k' end context 'with defaults' do i...
github
voxpupuli/puppet-r10k
https://github.com/voxpupuli/puppet-r10k
spec/classes/install/bundle_spec.rb
Ruby
apache-2.0
98
master
2,192
# frozen_string_literal: true require 'spec_helper' describe 'r10k::install::bundle', type: :class do on_supported_os.each do |os, facts| context "on #{os}" do let :facts do facts end context 'Puppet with bundle & no params' do let :facts do facts end ...
github
voxpupuli/puppet-r10k
https://github.com/voxpupuli/puppet-r10k
spec/acceptance/r10k_spec.rb
Ruby
apache-2.0
98
master
709
# frozen_string_literal: true require 'spec_helper_acceptance' describe 'r10k tests' do context 'when defaults used' do it_behaves_like 'an idempotent resource' do let(:manifest) do <<-PUPPET include 'r10k' PUPPET end end describe command('r10k version') do its...
github
voxpupuli/puppet-r10k
https://github.com/voxpupuli/puppet-r10k
spec/acceptance/r10k_webhook_spec.rb
Ruby
apache-2.0
98
master
2,017
# frozen_string_literal: true require 'spec_helper_acceptance' describe 'r10k::webhook tests', if: fact('os.name') != 'Archlinux' do context 'when defaults used' do it_behaves_like 'an idempotent resource' do let(:manifest) do <<-PUPPET class { 'r10k': } -> class { 'r10k::webhook':...
github
voxpupuli/puppet-r10k
https://github.com/voxpupuli/puppet-r10k
spec/type_aliases/webhook/config_spec.rb
Ruby
apache-2.0
98
master
1,159
# frozen_string_literal: true require 'spec_helper' describe 'R10k::Webhook::Config' do context 'full valid configuration' do let(:data) do { server: { protected: true, user: 'foo', password: 'bar', port: 4000, tls: { enabled: true, ...
github
voxpupuli/puppet-r10k
https://github.com/voxpupuli/puppet-r10k
tasks/deploy.rb
Ruby
apache-2.0
98
master
1,415
#!/usr/bin/env ruby # frozen_string_literal: true require 'json' require 'open3' params = JSON.parse($stdin.read) # Munge items into arrays of things to deploy environments = params['environments'] || params['environment'] environments = environments.split(',') if environments modules = params['modules']...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
perfectsched.gemspec
Ruby
apache-2.0
98
master
1,222
# encoding: utf-8 $:.push File.expand_path('../lib', __FILE__) require 'perfectsched/version' Gem::Specification.new do |gem| gem.name = "perfectsched" gem.description = "Highly available distributed cron built on RDBMS" gem.homepage = "https://github.com/treasure-data/perfectsched" gem.summary =...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
Rakefile
Ruby
apache-2.0
98
master
376
require 'bundler' Bundler::GemHelper.install_tasks require 'rspec/core' require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:spec) do |t| t.rspec_opts = ["-c", "-f progress", "-r ./spec/spec_helper.rb"] t.pattern = 'spec/**/*_spec.rb' t.verbose = true end task :coverage do |t| ENV['SIMPLE_COV'] = '1' ...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
lib/perfectsched.rb
Ruby
apache-2.0
98
master
2,557
# # PerfectSched # # Copyright (C) 2012 FURUHASHI Sadayuki # # 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 require...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
lib/perfectsched/task.rb
Ruby
apache-2.0
98
master
1,183
# # PerfectSched # # Copyright (C) 2012 FURUHASHI Sadayuki # # 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 require...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
lib/perfectsched/signal_queue.rb
Ruby
apache-2.0
98
master
814
# # PerfectSched # # Copyright (C) 2012 FURUHASHI Sadayuki # # 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 require...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
lib/perfectsched/client.rb
Ruby
apache-2.0
98
master
3,383
# # PerfectSched # # Copyright (C) 2012 FURUHASHI Sadayuki # # 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 require...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
lib/perfectsched/schedule.rb
Ruby
apache-2.0
98
master
1,445
# # PerfectSched # # Copyright (C) 2012 FURUHASHI Sadayuki # # 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 require...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
lib/perfectsched/model.rb
Ruby
apache-2.0
98
master
873
# # PerfectSched # # Copyright (C) 2012 FURUHASHI Sadayuki # # 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 require...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
lib/perfectsched/runner.rb
Ruby
apache-2.0
98
master
848
# # PerfectSched # # Copyright (C) 2012 FURUHASHI Sadayuki # # 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 require...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
lib/perfectsched/signal_thread.rb
Ruby
apache-2.0
98
master
745
# # PerfectSched # # Copyright (C) 2012 FURUHASHI Sadayuki # # 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 require...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
lib/perfectsched/backend.rb
Ruby
apache-2.0
98
master
1,260
# # PerfectSched # # Copyright (C) 2012 FURUHASHI Sadayuki # # 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 require...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
lib/perfectsched/engine.rb
Ruby
apache-2.0
98
master
1,523
# # PerfectSched # # Copyright (C) 2012 FURUHASHI Sadayuki # # 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 require...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
lib/perfectsched/schedule_collection.rb
Ruby
apache-2.0
98
master
1,343
# # PerfectSched # # Copyright (C) 2012 FURUHASHI Sadayuki # # 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 require...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
lib/perfectsched/application.rb
Ruby
apache-2.0
98
master
1,090
# # PerfectSched # # Copyright (C) 2012 FURUHASHI Sadayuki # # 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 require...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
lib/perfectsched/blocking_flag.rb
Ruby
apache-2.0
98
master
745
# # PerfectSched # # Copyright (C) 2012 FURUHASHI Sadayuki # # 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 require...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
lib/perfectsched/worker.rb
Ruby
apache-2.0
98
master
3,470
# # PerfectSched # # Copyright (C) 2012 FURUHASHI Sadayuki # # 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 require...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
lib/perfectsched/daemons_logger.rb
Ruby
apache-2.0
98
master
747
# # PerfectSched # # Copyright (C) 2012 FURUHASHI Sadayuki # # 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 require...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
lib/perfectsched/schedule_metadata.rb
Ruby
apache-2.0
98
master
1,229
# # PerfectSched # # Copyright (C) 2012 FURUHASHI Sadayuki # # 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 require...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
lib/perfectsched/error.rb
Ruby
apache-2.0
98
master
1,403
# # PerfectSched # # Copyright (C) 2012 FURUHASHI Sadayuki # # 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 require...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
lib/perfectsched/command/perfectsched.rb
Ruby
apache-2.0
98
master
3,894
require 'optparse' require 'perfectsched/version' op = OptionParser.new op.banner += %[ <command> commands: list Show list of registered schedules add <key> <type> <cron> <data> Register a new schedule delete <key> Delete a registered schedule run <cl...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
lib/perfectsched/application/base.rb
Ruby
apache-2.0
98
master
1,558
# # PerfectSched # # Copyright (C) 2012 FURUHASHI Sadayuki # # 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 require...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
lib/perfectsched/application/decider.rb
Ruby
apache-2.0
98
master
1,310
# # PerfectSched # # Copyright (C) 2012 FURUHASHI Sadayuki # # 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 require...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
lib/perfectsched/application/router.rb
Ruby
apache-2.0
98
master
837
# # PerfectSched # # Copyright (C) 2012 FURUHASHI Sadayuki # # 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 require...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
lib/perfectsched/application/dispatch.rb
Ruby
apache-2.0
98
master
1,134
# # PerfectSched # # Copyright (C) 2012 FURUHASHI Sadayuki # # 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 require...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
lib/perfectsched/backend/rdb_compat.rb
Ruby
apache-2.0
98
master
9,025
# # PerfectSched # # Copyright (C) 2012 FURUHASHI Sadayuki # # 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 require...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
spec/schedule_spec.rb
Ruby
apache-2.0
98
master
1,936
require 'spec_helper' describe Schedule do let (:schedule){ Schedule.new(client, key) } let (:client){ double('client') } let (:key){ double('key') } let (:ret){ double('ret') } let (:options){ double('options') } describe '.new' do subject { schedule } it { is_expected.to be_an_instance_of(Schedu...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
spec/engine_spec.rb
Ruby
apache-2.0
98
master
2,475
require 'spec_helper' describe PerfectSched::Engine do let (:logger){ double('logger').as_null_object } let (:runner){ double('runner') } let (:scheds){ double('scheds') } let (:config){ {logger: logger} } let (:engine) do Engine.new(runner, config) end before do expect(PerfectSched).to receive(:...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
spec/schedule_collection_spec.rb
Ruby
apache-2.0
98
master
4,889
describe ScheduleCollection do let :sc do create_test_sched end after do sc.client.close end it 'is a ScheduleCollection' do expect(sc.class).to eq(PerfectSched::ScheduleCollection) end it 'succeess add' do sc.add('sched01', 't01', {:cron=>'* * * * *', :timezone=>'UTC'}) end it 'fa...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
spec/perfect_sched_spec.rb
Ruby
apache-2.0
98
master
3,676
require 'spec_helper' describe PerfectSched do describe '.open' do let (:config){ double('config') } let (:client){ double('client') } let (:schedule_collection){ double('schedule_collection') } before do expect(Client).to receive(:new).with(config).and_return(client) expect(ScheduleColle...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
spec/task_spec.rb
Ruby
apache-2.0
98
master
1,534
require 'spec_helper' describe PerfectSched::Task do let (:client){ double('client') } let (:key){ double('key') } let (:attributes){ double('attributes') } let (:scheduled_time){ double('scheduled_time') } let (:task_token){ double('task_token') } let (:task){ Task.new(client, key, attributes, scheduled_t...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
spec/spec_helper.rb
Ruby
apache-2.0
98
master
958
$LOAD_PATH.unshift(File.expand_path('../lib', File.dirname(__FILE__))) if ENV['SIMPLE_COV'] require 'simplecov' SimpleCov.start do add_filter 'spec/' add_filter 'pkg/' add_filter 'vendor/' end end require 'perfectsched' if ENV['CI'] require 'coveralls' Coveralls.wear! end require 'fileutils' ...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
spec/client_spec.rb
Ruby
apache-2.0
98
master
4,375
require 'spec_helper' describe Client do let (:config){ {} } let (:client){ Client.new(config) } let (:ret){ double('ret') } let (:backend){ double('backend') } let (:options){ double('options') } let (:task_token){ double('task_token') } let (:key){ double('key') } before do allow(Backend).to rece...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
spec/runner_spec.rb
Ruby
apache-2.0
98
master
639
require 'spec_helper' describe Runner do let (:client){ double('client') } let (:task){ double('task', client: client) } let (:runner){ Runner.new(task) } describe '.new' do subject { runner } it { is_expected.to be_an_instance_of(Runner) } end describe '#task' do subject { runner.task } it...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
spec/rdb_compat_backend_spec.rb
Ruby
apache-2.0
98
master
9,516
require 'spec_helper' require 'perfectsched/backend/rdb_compat' describe Backend::RDBCompatBackend do let (:now){ Time.now.to_i } let (:client){ double('client') } let (:config){ {url: 'sqlite://spec/test.db', table: 'test_scheds'} } let (:db) do d = Backend::RDBCompatBackend.new(client, config) s = d....
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
spec/worker_spec.rb
Ruby
apache-2.0
98
master
6,596
require 'spec_helper' describe Worker do let (:logger){ double('logger').as_null_object } let (:runner){ double('runner') } let (:config){ {} } let (:worker){ Worker.new(runner, config) } before do allow(DaemonsLogger).to receive(:new).and_return(logger) end describe '.run' do it 'calls Worker.n...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
spec/model_spec.rb
Ruby
apache-2.0
98
master
656
require 'spec_helper' describe PerfectSched::Model do let (:config){ double('config') } let (:client){ double('client', config: config) } let (:klass){ Class.new{include PerfectSched::Model} } let (:model){ klass.new(client) } describe '.new' do it 'creates an instance' do expect(model).to be_a(Per...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
spec/application/base_spec.rb
Ruby
apache-2.0
98
master
3,045
require 'spec_helper' describe PerfectSched::Application::Base do describe '.decider=' do it 'defines .decider which returns the decider' do decider_klass = double('decider_klass') klass = PerfectSched::Application::Base allow(klass).to receive(:decider).and_call_original allow(klass).to ...
github
treasure-data/perfectsched
https://github.com/treasure-data/perfectsched
spec/application/decider_spec.rb
Ruby
apache-2.0
98
master
1,817
require 'spec_helper' describe PerfectSched::Application::UndefinedDecisionError do it { is_expected.to be_an_instance_of(PerfectSched::Application::UndefinedDecisionError) } it { is_expected.to be_a(Exception) } end describe PerfectSched::Application::Decider do let (:task){ double('task') } let (:schedules)...
github
yuroyoro/lambda_driver
https://github.com/yuroyoro/lambda_driver
lambda_driver.gemspec
Ruby
mit
98
master
864
# -*- encoding: utf-8 -*- lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'lambda_driver/version' Gem::Specification.new do |gem| gem.name = "lambda_driver" gem.version = LambdaDriver::VERSION gem.authors = ["Tomohito Ozaki"] gem.e...
github
yuroyoro/lambda_driver
https://github.com/yuroyoro/lambda_driver
spec/class_spec.rb
Ruby
mit
98
master
335
# -*- encoding : utf-8 -*- require 'spec_helper' describe 'class' do describe './' do subject { String / :index } it { should be_a_kind_of UnboundMethod } it("(klass / method_name).bind(obj).call(x) should be obj.method_name(x)"){ subject.bind("foobarbaz").call("bar") == "foobarbaz".index("bar") ...
github
yuroyoro/lambda_driver
https://github.com/yuroyoro/lambda_driver
spec/op_spec.rb
Ruby
mit
98
master
1,704
# -*- encoding : utf-8 -*- require 'spec_helper' shared_examples_for 'method_or_lambda' do |label| let(:method_name) { :+ } context 'given method name (is reciever object responds)' do subject { method } it { should be_a_kind_of Method } it("#{label}.call(args) should be obj.send(method_name, args)"){...
github
yuroyoro/lambda_driver
https://github.com/yuroyoro/lambda_driver
spec/revapply_spec.rb
Ruby
mit
98
master
1,255
# -*- encoding : utf-8 -*- require 'spec_helper' describe LambdaDriver::Revapply do let(:object) { "foobarbaz" } let(:f) { lambda{|x| x * 2 } } describe '#revapply'do context 'given none' do subject { object.revapply } it { should be_a_kind_of Method } it('obj.revapply.call(f) should be f...
github
yuroyoro/lambda_driver
https://github.com/yuroyoro/lambda_driver
spec/lambda_spec.rb
Ruby
mit
98
master
1,367
# -*- encoding : utf-8 -*- require 'spec_helper' describe 'lambda' do describe '#compose' do subject { lambda{|x| x.to_s} } it_should_behave_like 'composable' end describe '#compose_with_lifting' do subject { lambda{|x| x.mzero? ? x : x.to_s} } it_should_behave_like 'liftable' end describ...
github
yuroyoro/lambda_driver
https://github.com/yuroyoro/lambda_driver
spec/disjunction_spec.rb
Ruby
mit
98
master
2,383
# -*- encoding : utf-8 -*- require 'spec_helper' describe LambdaDriver::Disjunction do let(:obj) { "foobarbaz" } let(:f) { lambda{|x| x * 2 } } describe '#disjunction'do context 'f(obj) returns nil' do context 'given none' do subject { obj.disjunction } it { should be_a_kind_of Method...
github
yuroyoro/lambda_driver
https://github.com/yuroyoro/lambda_driver
spec/method_spec.rb
Ruby
mit
98
master
1,854
# -*- encoding : utf-8 -*- require 'spec_helper' describe Method do describe '#compose' do subject { "aaa".method(:+) } it_should_behave_like 'composable' do let(:x) { "foo" } end end describe '#with_args' do subject { "foobarbaz".method(:delete) } it_should_behave_like 'with_args' d...
github
yuroyoro/lambda_driver
https://github.com/yuroyoro/lambda_driver
spec/spec_helper.rb
Ruby
mit
98
master
621
# -*- encoding : utf-8 -*- # This file was generated by the `rspec --init` command. Conventionally, all # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. # Require this file using `require "spec_helper.rb"` to ensure that it is only # loaded once. # # See http://rubydoc.info/gems/rspec-core/R...
github
yuroyoro/lambda_driver
https://github.com/yuroyoro/lambda_driver
spec/context_spec.rb
Ruby
mit
98
master
2,580
# -*- encoding : utf-8 -*- require 'spec_helper' describe LambdaDriver::Context do let(:f){ lambda{|x| x.to_s} } let(:g){ lambda{|x| x * 2} } describe LambdaDriver::Context::Identify do let(:ctx) { :identify } let(:x){ :foo } it("f.lift(:identify).call(x).should == f(x)"){ f.lift(:identify).c...
github
yuroyoro/lambda_driver
https://github.com/yuroyoro/lambda_driver
spec/proc_spec.rb
Ruby
mit
98
master
1,385
# -*- encoding : utf-8 -*- require 'spec_helper' describe Proc do describe '#compose' do subject { Proc.new{|x| x.to_s} } it_should_behave_like 'composable' end describe '#compose_with_lifting' do subject { Proc.new{|x| x.mzero? ? x : x.to_s} } it_should_behave_like 'liftable' end describ...
github
yuroyoro/lambda_driver
https://github.com/yuroyoro/lambda_driver
spec/symbol_spec.rb
Ruby
mit
98
master
2,573
# -*- encoding : utf-8 -*- require 'spec_helper' describe Symbol do describe '#compose' do subject { :to_s } it_should_behave_like 'composable' end describe '#with_args' do subject {:delete } it_should_behave_like 'with_args' do let(:x) { 'foobar' } let(:y) { 'o' } let(:z) {...
github
yuroyoro/lambda_driver
https://github.com/yuroyoro/lambda_driver
spec/unbound_method_spec.rb
Ruby
mit
98
master
420
# -*- encoding : utf-8 -*- require 'spec_helper' describe UnboundMethod do describe '#<' do let(:unbound_method){ String.instance_method(:index) } subject { unbound_method < "foobarbaz" } it { should be_a_kind_of Method } it('(unbound_method < obj).call(x) should be unbound_method.bind(obj).call(x)'...
github
yuroyoro/lambda_driver
https://github.com/yuroyoro/lambda_driver
spec/shared/liftable.rb
Ruby
mit
98
master
2,020
# -*- encoding : utf-8 -*- require 'spec_helper' shared_examples_for 'liftable' do it { should respond_to :compose_with_lifting } it { should respond_to :>= } it { should respond_to :<= } it { should respond_to :ymsr} let(:x) { :foo } let(:y) { [1,2] } let(:z) { {:a => 1, :b => 2} } let(:g) { lambda{|...
github
yuroyoro/lambda_driver
https://github.com/yuroyoro/lambda_driver
spec/shared/composable_spec.rb
Ruby
mit
98
master
5,210
# -*- encoding : utf-8 -*- require 'spec_helper' shared_examples_for 'composable' do it { should respond_to :to_proc} it { should respond_to :>> } it { should respond_to :<< } it { should respond_to :compose } let(:x) { :foo } let(:y) { 12 } let(:g) { lambda{|x| (x.to_s * 2) + "_g" } } it('" f >> g" ...
github
yuroyoro/lambda_driver
https://github.com/yuroyoro/lambda_driver
lib/lambda_driver.rb
Ruby
mit
98
master
645
# -*- encoding : utf-8 -*- require "lambda_driver/version" Dir["#{File.dirname(__FILE__)}/lambda_driver/*.rb"].sort.each do |path| next if File.basename(path, '.rb') == 'core_ext' require "lambda_driver/#{File.basename(path, '.rb')}" end require "lambda_driver/core_ext" module LambdaDriver # SKI combinators I...
github
yuroyoro/lambda_driver
https://github.com/yuroyoro/lambda_driver
lib/lambda_driver/op.rb
Ruby
mit
98
master
791
# -*- encoding : utf-8 -*- module LambdaDriver::Op module Proxy def _(method = nil) method ? ::LambdaDriver::Op.method_or_lambda(self, method) : OpProxy.new(self) end end def method_or_lambda(obj, method) (obj.respond_to?(method) && obj.method(method)) || lambda{|*args| obj.__send__(metho...
github
yuroyoro/lambda_driver
https://github.com/yuroyoro/lambda_driver
lib/lambda_driver/context.rb
Ruby
mit
98
master
1,366
# -*- encoding : utf-8 -*- module LambdaDriver::Context Identify = lambda{|f, x| f.call(x) } Maybe = lambda{|f, x| mzero_method = x.respond_to?(:mzero?) ? :mzero? : :nil? x.send(mzero_method) ? x : f.call(x) } List = lambda{|f, x| x.map(&f) } Reader = lambda{|f, (r, x)| # set reader env to thr...
github
yuroyoro/lambda_driver
https://github.com/yuroyoro/lambda_driver
lib/lambda_driver/liftable.rb
Ruby
mit
98
master
3,446
# -*- encoding : utf-8 -*- module LambdaDriver::Liftable # Compose self and given function on the context-function. # The context-funciton is passed by `lift` method. # # This method returns composed funciton like bellow. # # lambda{|args| context.call(self, context.call(g,*args) } # # For example, s...
github
yuroyoro/lambda_driver
https://github.com/yuroyoro/lambda_driver
lib/lambda_driver/flipable.rb
Ruby
mit
98
master
995
# -*- encoding : utf-8 -*- module LambdaDriver::Flipable # Returns function whose parameter order spawed 1st for 2nd. # A result of filped fuction is curried by Proc#curry. # # f = lambda{|x, y, z| [x, y, z]} # h = f.flip # h.(:a).(:b).(:c) # => [:b, :a, :c] # # If arguments is var-args, pass expl...
github
yuroyoro/lambda_driver
https://github.com/yuroyoro/lambda_driver
lib/lambda_driver/disjunction.rb
Ruby
mit
98
master
247
# -*- encoding : utf-8 -*- module LambdaDriver::Disjunction def disjunction(f = nil, &block) if f.nil? && (not block_given?) return self.method(:disjunction) end (block_given? ? (yield self) : f.call(self)) || self end end
github
yuroyoro/lambda_driver
https://github.com/yuroyoro/lambda_driver
lib/lambda_driver/revapply.rb
Ruby
mit
98
master
228
# -*- encoding : utf-8 -*- module LambdaDriver::Revapply def revapply(f = nil, &block) if f.nil? && (not block_given?) return self.method(:revapply) end block_given? ? (yield self) : f.call(self) end end
github
yuroyoro/lambda_driver
https://github.com/yuroyoro/lambda_driver
lib/lambda_driver/composable.rb
Ruby
mit
98
master
1,258
# -*- encoding : utf-8 -*- module LambdaDriver::Composable if RUBY_VERSION < "2.6.0" # Returns new lambda which composed self and given function. # A composed proc called with args, executes `self.(g(*args)). # # f = lambda{|x| x.to_s } # g = lambda{|y| y.length } # h = f compose g #...
github
yuroyoro/lambda_driver
https://github.com/yuroyoro/lambda_driver
lib/lambda_driver/with_args.rb
Ruby
mit
98
master
519
# -*- encoding : utf-8 -*- module LambdaDriver::WithArgs # Returns partially applied function that has 2nd and more parameters # fixed by given *args. # # f = lambda{|x, y, z| [x, y, z]} # h = f.with_args(:a, :b) # h.(:c) # => [:c, :a, :b] # # This method is aliased as `*`. # # f * :foo # ...
github
yuroyoro/lambda_driver
https://github.com/yuroyoro/lambda_driver
lib/lambda_driver/currying.rb
Ruby
mit
98
master
667
# -*- encoding : utf-8 -*- module LambdaDriver::Currying if RUBY_VERSION < '1.9.0' def curry(arity = nil) f = self.to_proc arity ||= __arity(f) return f if arity == 0 lambda{|arg| __curry(f, arity, arg, []) } end else def curry(arity = nil) self.to_proc.curry(arity) e...
github
yuroyoro/lambda_driver
https://github.com/yuroyoro/lambda_driver
lib/lambda_driver/core_ext/symbol.rb
Ruby
mit
98
master
492
# -*- encoding : utf-8 -*- class Symbol include LambdaDriver::Callable include LambdaDriver::Composable include LambdaDriver::WithArgs include LambdaDriver::Flipable include LambdaDriver::ProcConvertable include LambdaDriver::Currying include LambdaDriver::Liftable def to_method lambda{|obj| obj._(...
github
yuroyoro/lambda_driver
https://github.com/yuroyoro/lambda_driver
lib/lambda_driver/core_ext/proc.rb
Ruby
mit
98
master
720
# -*- encoding : utf-8 -*- # Override Proc#>> and << these are implemented from Ruby 2.6 # to ensure passed argument is callable. # Convert argument to proc obj by calling :to_proc before call super implementaion module ProcOverride def compose(g) self << g end # g compose self def <<(g) super(g.to_pr...
github
yuroyoro/lambda_driver
https://github.com/yuroyoro/lambda_driver
lib/lambda_driver/core_ext/method.rb
Ruby
mit
98
master
284
# -*- encoding : utf-8 -*- class Method include LambdaDriver::Callable include LambdaDriver::Composable include LambdaDriver::WithArgs include LambdaDriver::Flipable include LambdaDriver::ProcConvertable include LambdaDriver::Currying include LambdaDriver::Liftable end
github
forward3d/rbhive
https://github.com/forward3d/rbhive
rbhive.gemspec
Ruby
mit
98
master
947
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'rbhive/version' Gem::Specification.new do |spec| spec.name = 'rbhive' spec.version = RBHive::VERSION spec.authors = %w(Forward3D KolobocK) spec.description = 'Simple gem for executing Hiv...
github
forward3d/rbhive
https://github.com/forward3d/rbhive
lib/rbhive.rb
Ruby
mit
98
master
572
require File.join(File.dirname(__FILE__), 'rbhive', 'connection') require File.join(File.dirname(__FILE__), 'rbhive', 'table_schema') require File.join(File.dirname(__FILE__), 'rbhive', 'result_set') require File.join(File.dirname(__FILE__), 'rbhive', 'explain_result') require File.join(File.dirname(__FILE__), 'rbhive'...
github
forward3d/rbhive
https://github.com/forward3d/rbhive
lib/rbhive/schema_definition.rb
Ruby
mit
98
master
2,845
require 'json' module RBHive class SchemaDefinition attr_reader :schema NAN = Float::NAN rescue 0.0/0.0 INFINITY = Float::INFINITY rescue 1.0/0.0 TYPES = { :boolean => :to_s, :string => :to_s, :bigint => :to_i, :float => :to_f, :double => :to_f, :int ...
github
forward3d/rbhive
https://github.com/forward3d/rbhive
lib/rbhive/t_c_l_i_schema_definition.rb
Ruby
mit
98
master
2,934
require 'json' module RBHive class TCLISchemaDefinition attr_reader :schema NAN = Float::NAN rescue 0.0/0.0 INFINITY = Float::INFINITY rescue 1.0/0.0 TYPES = { :boolean => :to_s, :string => :to_s, :float => :to_f, :double => :to_f, :int => :to_i, :big...
github
forward3d/rbhive
https://github.com/forward3d/rbhive
lib/rbhive/connection.rb
Ruby
mit
98
master
3,469
# suppress warnings old_verbose, $VERBOSE = $VERBOSE, nil # require thrift autogenerated files require File.join(File.split(File.dirname(__FILE__)).first, *%w[thrift thrift_hive]) # require 'thrift' # restore warnings $VERBOSE = old_verbose module RBHive def connect(server, port=10_000) connection = RBHive::Conn...
github
forward3d/rbhive
https://github.com/forward3d/rbhive
lib/rbhive/result_set.rb
Ruby
mit
98
master
783
module RBHive class ResultSet < Array def initialize(rows, schema) @schema = schema super(rows.map {|r| @schema.coerce_row(r) }) end def column_names @schema.column_names end def column_type_map @schema.column_type_map end def to_csv(out_file=nil) to_separa...
github
forward3d/rbhive
https://github.com/forward3d/rbhive
lib/rbhive/t_c_l_i_connection.rb
Ruby
mit
98
master
13,867
# suppress warnings old_verbose, $VERBOSE = $VERBOSE, nil raise 'Thrift is not loaded' unless defined?(Thrift) raise 'RBHive is not loaded' unless defined?(RBHive) # require thrift autogenerated files require File.join(File.dirname(__FILE__), *%w[.. thrift t_c_l_i_service_constants]) require File.join(File.dirname(__...
github
forward3d/rbhive
https://github.com/forward3d/rbhive
lib/rbhive/explain_result.rb
Ruby
mit
98
master
754
class ExplainResult def initialize(rows) @rows = rows end def ast by_section[:abstract_syntax_tree].first end def stage_count stage_dependencies.length end def stage_dependencies by_section[:stage_dependencies] || [] end def to_tsv @rows.join("\n") end def raw ...
github
forward3d/rbhive
https://github.com/forward3d/rbhive
lib/rbhive/table_schema.rb
Ruby
mit
98
master
3,007
module RBHive class TableSchema attr_accessor :name attr_reader :columns, :partitions def initialize(name, comment=nil, options={}, &blk) @name, @comment = name, comment @location = options[:location] || nil @field_sep = options[:field_sep] || "\t" @line_sep = options[:line_sep] ||...
github
forward3d/rbhive
https://github.com/forward3d/rbhive
lib/thrift/thrift_hive.rb
Ruby
mit
98
master
13,946
# # Autogenerated by Thrift Compiler (0.9.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # require 'thrift' require_relative 'thrift_hive_metastore' require_relative 'hive_service_types' module Hive module Thrift module ThriftHive class Client < ::ThriftHiveMetastore::Client ...
github
forward3d/rbhive
https://github.com/forward3d/rbhive
lib/thrift/serde_constants.rb
Ruby
mit
98
master
1,613
# # Autogenerated by Thrift Compiler (0.9.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # require 'thrift' require 'serde_types' SERIALIZATION_LIB = %q"serialization.lib" SERIALIZATION_CLASS = %q"serialization.class" SERIALIZATION_FORMAT = %q"serialization.format" SERIALIZATION_DDL = %q"s...
github
forward3d/rbhive
https://github.com/forward3d/rbhive
lib/thrift/hive_metastore_constants.rb
Ruby
mit
98
master
787
# # Autogenerated by Thrift Compiler (0.9.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # require 'thrift' require_relative 'hive_metastore_types' DDL_TIME = %q"transient_lastDdlTime" IS_ARCHIVED = %q"is_archived" ORIGINAL_LOCATION = %q"original_location" META_TABLE_COLUMNS = %q"columns" ...
github
forward3d/rbhive
https://github.com/forward3d/rbhive
lib/thrift/hive_metastore_types.rb
Ruby
mit
98
master
17,694
# # Autogenerated by Thrift Compiler (0.9.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # require 'thrift' require_relative 'fb303_types' module HiveObjectType GLOBAL = 1 DATABASE = 2 TABLE = 3 PARTITION = 4 COLUMN = 5 VALUE_MAP = {1 => "GLOBAL", 2 => "DATABASE", 3 => "TABLE", 4...
github
forward3d/rbhive
https://github.com/forward3d/rbhive
lib/thrift/queryplan_types.rb
Ruby
mit
98
master
10,150
# # Autogenerated by Thrift Compiler (0.9.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # require 'thrift' module Hive module Thrift module AdjacencyType CONJUNCTIVE = 0 DISJUNCTIVE = 1 VALUE_MAP = {0 => "CONJUNCTIVE", 1 => "DISJUNCTIVE"} VALID_VALUES = Set.new(...
github
forward3d/rbhive
https://github.com/forward3d/rbhive
lib/thrift/hive_service_constants.rb
Ruby
mit
98
master
211
# # Autogenerated by Thrift Compiler (0.9.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # require 'thrift' require_relative 'hive_service_types' module Hive module Thrift end end
github
forward3d/rbhive
https://github.com/forward3d/rbhive
lib/thrift/t_c_l_i_service_constants.rb
Ruby
mit
98
master
1,373
# # Autogenerated by Thrift Compiler (0.9.1) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # require 'thrift' require_relative 't_c_l_i_service_types' module Hive2 module Thrift PRIMITIVE_TYPES = Set.new([ 0, 1, 2, 3, 4, ...
github
forward3d/rbhive
https://github.com/forward3d/rbhive
lib/thrift/thrift_hive_metastore.rb
Ruby
mit
98
master
119,476
# # Autogenerated by Thrift Compiler (0.9.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # require 'thrift' require_relative 'facebook_service' require_relative 'hive_metastore_types' module ThriftHiveMetastore class Client < ::FacebookService::Client include ::Thrift::Client def ...
github
forward3d/rbhive
https://github.com/forward3d/rbhive
lib/thrift/t_c_l_i_service_types.rb
Ruby
mit
98
master
65,831
# # Autogenerated by Thrift Compiler (0.9.1) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # require 'thrift' module Hive2 module Thrift module TProtocolVersion HIVE_CLI_SERVICE_PROTOCOL_V1 = 0 HIVE_CLI_SERVICE_PROTOCOL_V2 = 1 HIVE_CLI_SERVICE_PROTOCOL_V3 = 2 HIVE_...
github
forward3d/rbhive
https://github.com/forward3d/rbhive
lib/thrift/facebook_service.rb
Ruby
mit
98
master
15,892
# # Autogenerated by Thrift Compiler (0.9.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # require 'thrift' require_relative 'fb303_types' module FacebookService class Client include ::Thrift::Client def getName() send_getName() return recv_getName() end def se...
github
forward3d/rbhive
https://github.com/forward3d/rbhive
lib/thrift/queryplan_constants.rb
Ruby
mit
98
master
208
# # Autogenerated by Thrift Compiler (0.9.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # require 'thrift' require_relative 'queryplan_types' module Hive module Thrift end end
github
forward3d/rbhive
https://github.com/forward3d/rbhive
lib/thrift/t_c_l_i_service.rb
Ruby
mit
98
master
31,246
# # Autogenerated by Thrift Compiler (0.9.1) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # require 'thrift' require_relative 't_c_l_i_service_types' module Hive2 module Thrift module TCLIService class Client include ::Thrift::Client def OpenSession(req) ...
github
forward3d/rbhive
https://github.com/forward3d/rbhive
lib/thrift/hive_service_types.rb
Ruby
mit
98
master
2,118
# # Autogenerated by Thrift Compiler (0.9.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # require 'thrift' require_relative 'fb303_types' require_relative 'hive_metastore_types' require_relative 'queryplan_types' module Hive module Thrift module JobTrackerState INITIALIZING = 1 ...
github
forward3d/rbhive
https://github.com/forward3d/rbhive
lib/thrift/sasl_client_transport.rb
Ruby
mit
98
master
2,760
module Thrift class SaslClientTransport < BufferedTransport attr_reader :challenge STATUS_BYTES = 1 PAYLOAD_LENGTH_BYTES = 4 AUTH_MECHANISM = 'PLAIN' NEGOTIATION_STATUS = { START: 0x01, OK: 0x02, BAD: 0x03, ERROR: 0x04, COMPLETE: 0x05 } def ...
github
forward3d/rbhive
https://github.com/forward3d/rbhive
lib/thrift/fb303_types.rb
Ruby
mit
98
master
431
# # Autogenerated by Thrift Compiler (0.9.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # require 'thrift' module Fb_status DEAD = 0 STARTING = 1 ALIVE = 2 STOPPING = 3 STOPPED = 4 WARNING = 5 VALUE_MAP = {0 => "DEAD", 1 => "STARTING", 2 => "ALIVE", 3 => "STOPPING", 4 => "STOPP...
github
jpush/jpush-api-ruby-client
https://github.com/jpush/jpush-api-ruby-client
jpush.gemspec
Ruby
mit
98
master
1,546
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'jpush/version' Gem::Specification.new do |spec| spec.name = "jpush" spec.version = JPush::VERSION spec.authors = ["JPush Offical"] spec.email = ["support@jpus...