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
csg-tokyo/yadriggy
https://github.com/csg-tokyo/yadriggy
test/yadriggy/c/ctype_test.rb
Ruby
mit
91
master
927
require 'test_helper' require 'yadriggy/c' class CType_Tester < Test::Unit::TestCase include Yadriggy::C::CType test 'int array' do assert_raise do IntCArray.new end a = IntCArray.new(2,3,4) a.debug = true a[0,0,0] = 1 b = a[0,0,0] assert_raise { a[0] = 3 } assert_raise { a...
github
csg-tokyo/yadriggy
https://github.com/csg-tokyo/yadriggy
test/yadriggy/c/opencl_test.rb
Ruby
mit
91
master
1,658
require 'test_helper' require 'yadriggy/c' require 'yadriggy/c/opencl' class OpenCL_Tester < Test::Unit::TestCase T = 0 class Test1 < Yadriggy::C::Program S = 10.0 def initialize @data = OclArray.new(512) end def foo(arr, n) ! Float32 typedecl arr: Float32Array, n: Int @data.copyf...
github
samvincent/jekyll-haml
https://github.com/samvincent/jekyll-haml
jekyll-haml.gemspec
Ruby
mit
91
master
852
# -*- encoding: utf-8 -*- lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'jekyll-haml/version' Gem::Specification.new do |gem| gem.name = "jekyll-haml" gem.version = Jekyll::Haml::VERSION gem.authors = ["Sam Vincent"] gem.email ...
github
samvincent/jekyll-haml
https://github.com/samvincent/jekyll-haml
lib/jekyll-haml.rb
Ruby
mit
91
master
432
require "jekyll-haml/version" require "haml" require "jekyll-haml/tags/haml_partial" require "jekyll-haml/ext/convertible" module Jekyll module Converters class Haml < Converter safe true priority :low def matches(_ext) _ext =~ /haml/i end def output_ext(ext) ".ht...
github
samvincent/jekyll-haml
https://github.com/samvincent/jekyll-haml
lib/jekyll-haml/ext/convertible.rb
Ruby
mit
91
master
322
# Re-open Layout class to convert our HAML Layout content. module Jekyll class Layout alias old_initialize initialize def initialize(*args) old_initialize(*args) self.content = transform end def transform renderer.convert(content) end def extname ext end end en...
github
samvincent/jekyll-haml
https://github.com/samvincent/jekyll-haml
lib/jekyll-haml/tags/haml_partial.rb
Ruby
mit
91
master
1,792
require 'haml' module Jekyll module Tags class HamlIncludeTag < IncludeTag def initialize(tag_name, file, tokens) super @file = file.strip end def load_cached_partial(path, context) context.registers[:cached_partials] ||= {} cached_partial = context.regist...
github
jules2689/extended_bundler-errors
https://github.com/jules2689/extended_bundler-errors
extended_bundler-errors.gemspec
Ruby
mit
91
master
1,575
lib = File.expand_path("../lib", __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "extended_bundler/errors/version" Gem::Specification.new do |spec| spec.name = "extended_bundler-errors" spec.version = ExtendedBundler::Errors::VERSION spec.authors = ["jules2689"] s...
github
jules2689/extended_bundler-errors
https://github.com/jules2689/extended_bundler-errors
Rakefile
Ruby
mit
91
master
411
require "bundler/gem_tasks" require "rake/testtask" Rake::TestTask.new(:test) do |t| t.libs << "test" t.libs << "lib" t.test_files = FileList["test/**/*_test.rb"] end task :default => :test task :index_handlers do require 'time' File.open("cache/index", "w") do |f| Dir.glob("lib/extended_bundler/handle...
github
jules2689/extended_bundler-errors
https://github.com/jules2689/extended_bundler-errors
Gemfile
Ruby
mit
91
master
205
source "https://rubygems.org" git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } # Specify your gem's dependencies in extended_bundler-errors.gemspec gemspec gem 'mocha', group: :test
github
jules2689/extended_bundler-errors
https://github.com/jules2689/extended_bundler-errors
lib/extended_bundler/backports.rb
Ruby
mit
91
master
616
require 'bundler/version' # We need to make sure ParallelInstaller is defined before we can patch it require 'bundler/installer/parallel_installer' # In Bundler <= 1.17, we do not have the `after-install` hook, so monkey patch Bundler to include it if Gem::Version.new(Bundler::VERSION) < Gem::Version.new('1.17') mod...
github
jules2689/extended_bundler-errors
https://github.com/jules2689/extended_bundler-errors
lib/extended_bundler/errors.rb
Ruby
mit
91
master
5,135
require "extended_bundler/errors/version" require "extended_bundler/errors/formatter" require "extended_bundler/backports" require "bundler" require "fileutils" require "yaml" module ExtendedBundler module Errors NATIVE_EXTENSION_MSG = ExtendedBundler::Errors::Formatter.new(<<-EOF).format #{'=' * 20} We weren't...
github
jules2689/extended_bundler-errors
https://github.com/jules2689/extended_bundler-errors
lib/extended_bundler/errors/formatter.rb
Ruby
mit
91
master
4,873
# frozen_string_literal: true require 'strscan' module ExtendedBundler module Errors class Formatter # Available mappings of formattings # To use any of them, you can use {{<key>:<string>}} # There are presentational (colours and formatters) # and semantic (error, info, command) formatte...
github
jules2689/extended_bundler-errors
https://github.com/jules2689/extended_bundler-errors
test/extended_bundler/errors_test.rb
Ruby
mit
91
master
5,459
require "test_helper" require 'bundler/plugin' class ExtendedBundler::ErrorsTest < Minitest::Test def test_that_it_has_a_version_number refute_nil ::ExtendedBundler::Errors::VERSION end class BaseTest < Minitest::Test def setup super Bundler::Plugin.instance_variable_set(:@hooks_by_event, Ha...
github
jules2689/extended_bundler-errors
https://github.com/jules2689/extended_bundler-errors
test/extended_bundler/handlers_test.rb
Ruby
mit
91
master
2,179
require "test_helper" class ExtendedBundler::HandlersTest < Minitest::Test def test_all_handlers_valid_yml_files each_handler do |file| assert_equal '.yml', File.extname(file), "#{file} should use the extension yml" begin YAML.load_file(file) rescue => e flunk "#{file} was not a...
github
igorkasyanchuk/benchmark_methods
https://github.com/igorkasyanchuk/benchmark_methods
Gemfile
Ruby
mit
91
master
226
source 'https://rubygems.org' # Specify your gem's dependencies in benchmark_methods.gemspec gemspec gem 'pry' gem 'rspec' gem 'rspec-core' gem 'sqlite3' gem 'activerecord' gem 'simplecov', :require => false, :group => :test
github
igorkasyanchuk/benchmark_methods
https://github.com/igorkasyanchuk/benchmark_methods
benchmark_methods.gemspec
Ruby
mit
91
master
1,366
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'benchmark_methods/version' Gem::Specification.new do |spec| spec.name = "benchmark_methods" spec.version = BenchmarkMethods::VERSION spec.authors = ["Igor Kasyanchuk"] ...
github
igorkasyanchuk/benchmark_methods
https://github.com/igorkasyanchuk/benchmark_methods
spec/methods_benchmarker_spec.rb
Ruby
mit
91
master
626
require 'spec_helper' describe BenchmarkMethods do before :each do clean_db end it 'has a version number' do expect(BenchmarkMethods::VERSION).not_to be_nil end it 'can benchmark class method 1' do expect{User.create_user_and_comments}.not_to raise_error end it 'can benchmark class method...
github
igorkasyanchuk/benchmark_methods
https://github.com/igorkasyanchuk/benchmark_methods
spec/spec_helper.rb
Ruby
mit
91
master
292
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require 'rubygems' require 'active_record' require 'pry' require 'simplecov' SimpleCov.start require 'benchmark_methods' require_relative 'app.rb' def clean_db User.delete_all Comment.delete_all Db::Account.delete_all end
github
igorkasyanchuk/benchmark_methods
https://github.com/igorkasyanchuk/benchmark_methods
spec/app.rb
Ruby
mit
91
master
1,261
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:") ActiveRecord::Schema.define do self.verbose = false create_table :users, :force => true do |t| t.string :name end create_table :comments, :force => true do |t| t.integer :user_id t.string :comment end cre...
github
igorkasyanchuk/benchmark_methods
https://github.com/igorkasyanchuk/benchmark_methods
lib/benchmark_methods.rb
Ruby
mit
91
master
2,293
require 'securerandom' require 'benchmark' require_relative 'string_ext.rb' require 'benchmark_methods/version' module BenchmarkMethods def self.included(base_klass) unless const_defined?("#{base_klass.name.demodulize_for_bm}Interceptor") base_klass.extend(ClassMethods) interceptor = const_set("#{ba...
github
vaneyckt/Jently
https://github.com/vaneyckt/Jently
jently.rb
Ruby
mit
91
master
519
#!/usr/bin/env ruby # add lib directory to LOAD_PATH require 'pathname' lib = Pathname.new(__FILE__).parent.join('lib').to_s $: << lib require 'core' require 'github' require 'jenkins' require 'helpers/logger' require 'helpers/repository' require 'helpers/config_file' require 'helpers/pull_requests_data' while true ...
github
vaneyckt/Jently
https://github.com/vaneyckt/Jently
Rakefile
Ruby
mit
91
master
314
require 'bundler/setup' require 'rspec/core/rake_task' RSpec::Core::RakeTask.new('spec') namespace :jently do desc "Start the Jently server and write a PID file." task :start do sh 'ruby jently_control.rb start' end desc "Stop Jently." task :stop do sh 'ruby jently_control.rb stop' end end
github
vaneyckt/Jently
https://github.com/vaneyckt/Jently
lib/github.rb
Ruby
mit
91
master
3,054
require 'octokit' module Github def Github.get_open_pull_requests_ids begin client = Github.new_client repository_id = Repository.get_id open_pull_requests = client.pull_requests(repository_id, 'open') open_pull_requests_ids = open_pull_requests.collect { |pull_request| pull_r...
github
vaneyckt/Jently
https://github.com/vaneyckt/Jently
lib/jenkins.rb
Ruby
mit
91
master
3,737
require 'faraday' require 'faraday_middleware' module Jenkins def Jenkins.wait_for_idle_executor config = ConfigFile.read while true return if get_nb_of_idle_executors >= 1 sleep config[:jenkins_polling_interval_seconds] end end def Jenkins.get_nb_of_idle_executors begin config...
github
vaneyckt/Jently
https://github.com/vaneyckt/Jently
lib/core.rb
Ruby
mit
91
master
2,032
module Core def Core.test_pull_request(pull_request_id) begin config = ConfigFile.read pull_request = PullRequestsData.read[pull_request_id] if pull_request[:mergeable] == false Github.set_pull_request_status(pull_request_id, {:status => 'failure', :description => 'Unmergeable pul...
github
vaneyckt/Jently
https://github.com/vaneyckt/Jently
lib/helpers/config_file.rb
Ruby
mit
91
master
736
require 'set' require 'erb' require 'yaml' module ConfigFile def ConfigFile.get_path root = Pathname.new(__FILE__).parent.parent.parent (root + 'config' + 'config.yaml.erb').to_s end def ConfigFile.read path = get_path if File.exists?(path) raw_data = IO.read path erbified_data ...
github
vaneyckt/Jently
https://github.com/vaneyckt/Jently
lib/helpers/pull_requests_data.rb
Ruby
mit
91
master
3,443
require 'yaml' module PullRequestsData def PullRequestsData.get_path root = Pathname.new(__FILE__).parent.parent.parent (root + 'db' + 'pull_requests.yaml').to_s end def PullRequestsData.read path = get_path data = YAML.load(File.read(path)) if File.exists?(path) data || {} end def Pull...
github
vaneyckt/Jently
https://github.com/vaneyckt/Jently
lib/helpers/logger.rb
Ruby
mit
91
master
479
module Logger def Logger.get_path root = Pathname.new(__FILE__).parent.parent.parent (root + 'log').to_s end def Logger.log(message, exception = nil) exception_output = " - #{exception} -\n#{exception.backtrace.join("\n")}" if exception File.open(get_path, 'a') { |file| file << log_prefix + messa...
github
vaneyckt/Jently
https://github.com/vaneyckt/Jently
spec/spec_helper.rb
Ruby
mit
91
master
1,019
# 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"` to ensure that it is only # loaded once. # # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration requi...
github
vaneyckt/Jently
https://github.com/vaneyckt/Jently
spec/jenkins_spec.rb
Ruby
mit
91
master
11,735
require 'spec_helper' describe Jenkins do let(:jenkins_url) { 'http://valid.jenkins.url' } before do Jenkins.stub(:sleep) # don't actually want to sleep during our test runs Logger.stub(:log) end describe '.get_nb_of_idle_executors' do let(:api_url) { "#{jenkins_url}/api/json" } let(:...
github
vaneyckt/Jently
https://github.com/vaneyckt/Jently
spec/core_spec.rb
Ruby
mit
91
master
7,269
require 'spec_helper' describe Core do describe '.poll_pull_requests_and_queue_next_job' do let(:pull_request_id) { 1234 } let(:base_branch) { 'abc_branch' } let(:pull_request) { { :id => pull_request_id, :base_branch => base_branch } } before do Github.stub(:get_open_pull_requests_ids)...
github
vaneyckt/Jently
https://github.com/vaneyckt/Jently
spec/github_spec.rb
Ruby
mit
91
master
23,267
require 'spec_helper' describe Github do let(:github_login) { 'valid_login' } let(:github_password) { 'valid_password' } let(:github_oauth_token) { 'valid_oauth_token' } let(:repo_id) { 'valid_repo/id' } before do Github.stub(:sleep) Logger.stub(:log) ConfigFile.stub(:read).a...
github
vaneyckt/Jently
https://github.com/vaneyckt/Jently
spec/helpers/repository_spec.rb
Ruby
mit
91
master
550
require 'spec_helper' describe Repository do let(:github_username) { 'rspec_username' } let(:github_reponame) { 'rspec_reponame' } let(:repo_id) { "#{github_username}/#{github_reponame}" } let(:local_repos_dir) { File.join('rspec_repositories') } describe '.get_id' do it 'parses :github_ssh_repo...
github
vaneyckt/Jently
https://github.com/vaneyckt/Jently
spec/helpers/logger_spec.rb
Ruby
mit
91
master
1,173
require 'spec_helper' describe Logger do describe '.log' do let(:log_path) { File.join(Dir.pwd, 'rspec_log') } before do Logger.stub(:get_path).and_return(log_path) File.delete(log_path) if File.exists?(log_path) end after do File.delete(log_path) if File.exists?(log_path) end...
github
vaneyckt/Jently
https://github.com/vaneyckt/Jently
spec/helpers/config_file_spec.rb
Ruby
mit
91
master
2,853
require 'spec_helper' describe ConfigFile do describe '.read' do let(:config_path) { File.join('rspec_config.yaml') } before do ConfigFile.stub(:get_path).and_return(config_path) File.delete(config_path) if File.exists?(config_path) end after do File.delete(config_path) if File.ex...
github
vaneyckt/Jently
https://github.com/vaneyckt/Jently
spec/helpers/pull_requests_data_spec.rb
Ruby
mit
91
master
15,342
require 'spec_helper' describe PullRequestsData do let(:datafile_path) { "#{Dir.pwd}/db/rspec_pull_requests.yaml" } before do PullRequestsData.stub(:get_path).and_return(datafile_path) File.delete(datafile_path) if File.exists?(datafile_path) end after do File.delete(datafile_path) if File.exists...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
vagrant-nfs_guest.gemspec
Ruby
mit
91
master
926
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'vagrant-nfs_guest/version' Gem::Specification.new do |spec| spec.name = "vagrant-nfs_guest" spec.version = VagrantPlugins::SyncedFolderNFSGuest::VERSION spec.authors = ...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
Gemfile
Ruby
mit
91
master
407
source 'https://rubygems.org' group :development do # We depend on Vagrant for development, but we don't add it as a # gem dependency because we expect to be installed within the # Vagrant environment itself using `vagrant plugin`. gem "vagrant", :git => "https://github.com/mitchellh/vagrant.git", :tag => "v...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
example_box/Vagrantfile
Ruby
mit
91
master
1,146
# -*- mode: ruby -*- # vi: set ft=ruby : # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # Every Vagrant virtual environment requires a box to build off of. #config.vm.box = "ubuntu/trusty64" ...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest.rb
Ruby
mit
91
master
539
require "pathname" require "vagrant-nfs_guest/plugin" module VagrantPlugins module SyncedFolderNFSGuest lib_path = Pathname.new(File.expand_path("../vagrant-nfs_guest", __FILE__)) autoload :Errors, lib_path.join("errors") # This returns the path to the source of this plugin. # # @return [Pathna...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/config.rb
Ruby
mit
91
master
757
require "vagrant" module VagrantPlugins module SyncedFolderNFSGuest class Config < Vagrant.plugin("2", :config) attr_accessor :functional attr_accessor :map_uid attr_accessor :map_gid attr_accessor :verify_installed def initialize super @functional = UNSET_VALUE ...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/errors.rb
Ruby
mit
91
master
811
require "vagrant" module VagrantPlugins module SyncedFolderNFSGuest module Errors class Error < Vagrant::Errors::VagrantError error_namespace("vagrant_nfs_guest.errors") end class GuestNFSError < Error error_key(:nfs_server_missing) error_key(:nfs_start_failed) ...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/plugin.rb
Ruby
mit
91
master
3,337
begin require "vagrant" rescue LoadError raise "The Vagrant NFS Guest plugin must be run within Vagrant." end # This is a sanity check to make sure no one is attempting to install # this into an early Vagrant version. if Vagrant::VERSION < "1.2.0" raise "The Vagrant NFS Guest plugin is only compatible with Vagra...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/synced_folder.rb
Ruby
mit
91
master
3,533
require 'zlib' module VagrantPlugins module SyncedFolderNFSGuest class SyncedFolder < Vagrant.plugin("2", :synced_folder) def initialize(*args) super @logger = Log4r::Logger.new("vagrant::synced_folders::nfs_guest") end def usable?(machine, raise_error=false) # If the...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/action/unmount_nfs.rb
Ruby
mit
91
master
1,655
module VagrantPlugins module SyncedFolderNFSGuest module Action class UnmountNFS def initialize(app,env) @app = app @logger = Log4r::Logger.new("vagrant-nfs_guest::action::unmount_nfs") end def call(env) @machine = env[:machine] if @machine....
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/action/mount_nfs.rb
Ruby
mit
91
master
3,021
module VagrantPlugins module SyncedFolderNFSGuest module Action class MountNFS def initialize(app,env) @app = app @logger = Log4r::Logger.new("vagrant-nfs_guest::action::unmount_nfs") end def call(env) @machine = env[:machine] # because we'r...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/guests/redhat/plugin.rb
Ruby
mit
91
master
957
require "vagrant" module VagrantPlugins module SyncedFolderNFSGuest class Plugin < Vagrant.plugin("2") name "Red Hat Enterprise Linux guest" description "Red Hat Enterprise Linux guest support." guest_capability(:redhat, :nfs_server_installed) do require_relative "cap/nfs_server" ...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/guests/redhat/cap/nfs_server.rb
Ruby
mit
91
master
3,694
module VagrantPlugins module SyncedFolderNFSGuest module GuestRedHat module Cap class NFSServer def self.systemd?(machine) machine.communicate.test("test $(ps -o comm= 1) == 'systemd'") end def self.firewalld?(machine) machine.communicate.test(...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/guests/linux/plugin.rb
Ruby
mit
91
master
1,318
require "vagrant" module VagrantPlugins module SyncedFolderNFSGuest class Plugin < Vagrant.plugin("2") name "Linux guest." description "Linux guest support." guest_capability(:linux, :nfs_export) do require_relative "cap/nfs_server" GuestLinux::Cap::NFSServer end g...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/guests/linux/cap/read_user_ids.rb
Ruby
mit
91
master
716
module VagrantPlugins module SyncedFolderNFSGuest module GuestLinux module Cap class ReadUserIDs def self.read_uid(machine) command = "id -u" result = "" machine.communicate.execute(command) do |type, data| result << data if type == :stdou...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/guests/linux/cap/nfs_server.rb
Ruby
mit
91
master
5,763
require "vagrant/util/retryable" module VagrantPlugins module SyncedFolderNFSGuest module GuestLinux module Cap class NFSServer extend Vagrant::Util::Retryable def self.nfs_apply_command(machine) machine.communicate.sudo( "exportfs -r", e...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/guests/ubuntu/plugin.rb
Ruby
mit
91
master
488
require "vagrant" module VagrantPlugins module SyncedFolderNFSGuest class Plugin < Vagrant.plugin("2") name "Ubuntu guest" description "Ubuntu guest support." guest_capability(:ubuntu, :nfs_server_installed) do require_relative "cap/nfs_server" GuestUbuntu::Cap::NFSServer ...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/guests/ubuntu/cap/nfs_server.rb
Ruby
mit
91
master
491
module VagrantPlugins module SyncedFolderNFSGuest module GuestUbuntu module Cap class NFSServer def self.nfs_server_install(machine) machine.communicate.sudo("apt-get update") machine.communicate.sudo("apt-get -y install nfs-kernel-server") end ...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/guests/debian/plugin.rb
Ruby
mit
91
master
631
require "vagrant" module VagrantPlugins module SyncedFolderNFSGuest class Plugin < Vagrant.plugin("2") name "Debian guest" description "Debian guest support." guest_capability(:debian, :nfs_test_command) do require_relative "cap/nfs_server" GuestDebian::Cap::NFSServer end...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/guests/debian/cap/nfs_server.rb
Ruby
mit
91
master
646
module VagrantPlugins module SyncedFolderNFSGuest module GuestDebian module Cap class NFSServer def self.nfs_server_install(machine) machine.communicate.sudo("apt-get update") machine.communicate.sudo("apt-get -y install nfs-kernel-server") end ...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/hosts/linux/plugin.rb
Ruby
mit
91
master
460
require "vagrant" module VagrantPlugins module SyncedFolderNFSGuest class Plugin < Vagrant.plugin("2") name "Linux host" description "Linux host support." host_capability(:linux, "nfs_mount") do require_relative "cap/mount_nfs" HostLinux::Cap::MountNFS end host_cap...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/hosts/linux/cap/mount_nfs.rb
Ruby
mit
91
master
911
module VagrantPlugins module SyncedFolderNFSGuest module HostLinux module Cap class MountNFS def self.nfs_mount(environment, ui, id, ips, folders) folders.each do |name, opts| ips.each do |ip| ui.detail(I18n.t("vagrant.actions.vm.share_folders.mou...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/hosts/linux/cap/unmount_nfs.rb
Ruby
mit
91
master
910
module VagrantPlugins module SyncedFolderNFSGuest module HostLinux module Cap class UnmountNFS def self.nfs_unmount(environment, ui, folders) folders.each do |name, opts| ui.detail(I18n.t("vagrant.actions.vm.share_folders.mounting_entry", ...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/hosts/bsd/plugin.rb
Ruby
mit
91
master
450
require "vagrant" module VagrantPlugins module SyncedFolderNFSGuest class Plugin < Vagrant.plugin("2") name "BSD host" description "BSD host support." host_capability("bsd", "nfs_mount") do require_relative "cap/mount_nfs" HostBSD::Cap::MountNFS end host_capability...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/hosts/bsd/cap/mount_nfs.rb
Ruby
mit
91
master
904
module VagrantPlugins module SyncedFolderNFSGuest module HostBSD module Cap class MountNFS def self.nfs_mount(environment, ui, id, ips, folders) folders.each do |name, opts| ips.each do |ip| ui.detail(I18n.t("vagrant.actions.vm.share_folders.mount...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/hosts/bsd/cap/unmount_nfs.rb
Ruby
mit
91
master
860
module VagrantPlugins module SyncedFolderNFSGuest module HostBSD module Cap class UnmountNFS def self.nfs_unmount(environment, ui, folders) folders.each do |name, opts| ui.detail(I18n.t("vagrant.actions.vm.share_folders.mounting_entry", ...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/providers/lxc/plugin.rb
Ruby
mit
91
master
325
require "vagrant" module VagrantPlugins module SyncedFolderNFSGuest class Plugin < Vagrant.plugin("2") name "lxc-provider" description "vagrant-lxc provider" provider_capability(:lxc, :nfs_settings) do require_relative "cap/nfs_settings" ProviderLxc::Cap end end end...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/providers/lxc/cap/nfs_settings.rb
Ruby
mit
91
master
585
module VagrantPlugins module SyncedFolderNFSGuest module ProviderLxc module Cap def self.read_host_ip(machine) machine.communicate.execute 'echo $SSH_CLIENT' do |buffer, output| return output.chomp.split(' ')[0] if buffer == :stdout end end def self.nfs_settings(machine)...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/providers/docker/plugin.rb
Ruby
mit
91
master
329
require "vagrant" module VagrantPlugins module SyncedFolderNFSGuest class Plugin < Vagrant.plugin("2") name "docker-provider" description "Docker provider" provider_capability(:docker, :nfs_settings) do require_relative "cap/nfs_settings" ProviderDocker::Cap end end ...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/providers/docker/cap/nfs_settings.rb
Ruby
mit
91
master
438
module VagrantPlugins module SyncedFolderNFSGuest module ProviderDocker module Cap def self.nfs_settings(machine) provider = machine.provider host_ip = provider.driver.docker_bridge_ip machine_ip = provider.ssh_info[:host] raise Vagrant::Errors::NFSNoHos...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/providers/parallels/plugin.rb
Ruby
mit
91
master
340
require "vagrant" module VagrantPlugins module SyncedFolderNFSGuest class Plugin < Vagrant.plugin("2") name "vagrant-parallels" description "Parallels provider" provider_capability(:parallels, :nfs_settings) do require_relative "cap/nfs_settings" ProviderParallels::Cap en...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/providers/parallels/cap/nfs_settings.rb
Ruby
mit
91
master
431
module VagrantPlugins module SyncedFolderNFSGuest module ProviderParallels module Cap def self.nfs_settings(machine) host_ip = machine.provider.driver.read_shared_interface[:ip] machine_ip = machine.provider.driver.read_guest_ip raise Vagrant::Errors::NFSNoHostonlyNe...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/providers/vmware_fusion/plugin.rb
Ruby
mit
91
master
513
require "vagrant" module VagrantPlugins module SyncedFolderNFSGuest class Plugin < Vagrant.plugin("2") name "vmware_fusion-provider" description "vagrant-vmware_fusion provider" provider_capability(:vmware_fusion, :nfs_settings) do require_relative "cap/nfs_settings" ProviderVM...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/providers/vmware_fusion/cap/nfs_settings.rb
Ruby
mit
91
master
648
module VagrantPlugins module SyncedFolderNFSGuest module ProviderVMwareFusion module Cap def self.read_host_ip # In practice, we need the host's IP on the vmnet device this VM uses. # It seems a bit tricky to get the right one, so let's allow all. return `for N in $(ifc...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/providers/virtualbox/plugin.rb
Ruby
mit
91
master
345
require "vagrant" module VagrantPlugins module SyncedFolderNFSGuest class Plugin < Vagrant.plugin("2") name "VirtualBox provider" description "VirtualBox provider" provider_capability(:virtualbox, :nfs_settings) do require_relative "cap/nfs_settings" ProviderVirtualBox::Cap ...
github
Learnosity/vagrant-nfs_guest
https://github.com/Learnosity/vagrant-nfs_guest
lib/vagrant-nfs_guest/providers/virtualbox/cap/nfs_settings.rb
Ruby
mit
91
master
3,174
require "vagrant/util/retryable" module VagrantPlugins module SyncedFolderNFSGuest module ProviderVirtualBox module Cap extend Vagrant::Util::Retryable def self.nfs_settings(machine) adapter, host_ip = self.find_host_only_adapter(machine) machine_ip = self.read_st...
github
piotrmurach/tty-screen
https://github.com/piotrmurach/tty-screen
Gemfile
Ruby
mit
91
master
461
source "https://rubygems.org" gemspec gem "json", "2.4.1" if RUBY_VERSION == "2.0.0" gem "yardstick", "~> 0.9.9" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.1.0") gem "rspec-benchmark", "~> 0.6.0" end if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.7.0") gem "coveralls_reborn", "~> 0.28.0"...
github
piotrmurach/tty-screen
https://github.com/piotrmurach/tty-screen
tty-screen.gemspec
Ruby
mit
91
master
1,390
# frozen_string_literal: true require_relative "lib/tty/screen/version" Gem::Specification.new do |spec| spec.name = "tty-screen" spec.version = TTY::Screen::VERSION spec.authors = ["Piotr Murach"] spec.email = ["piotr@piotrmurach.com"] spec.summary = "Terminal screen size detection." spec.description = "...
github
piotrmurach/tty-screen
https://github.com/piotrmurach/tty-screen
spec/spec_helper.rb
Ruby
mit
91
master
1,955
# frozen_string_literal: true if ENV["COVERAGE"] == "true" require "simplecov" require "coveralls" SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([ SimpleCov::Formatter::HTMLFormatter, Coveralls::SimpleCov::Formatter ]) SimpleCov.start do command_name "spec" add_filter "spec...
github
piotrmurach/tty-screen
https://github.com/piotrmurach/tty-screen
spec/perf/screen_spec.rb
Ruby
mit
91
master
4,116
# frozen_string_literal: true require "io/console" require "rspec-benchmark" RSpec.describe TTY::Screen do include RSpec::Benchmark::Matchers describe ".size" do it "detects size 14.5x slower than io-console" do expect { TTY::Screen.size }.to perform_slower_than { IO.console.winsi...
github
piotrmurach/tty-screen
https://github.com/piotrmurach/tty-screen
spec/unit/screen_spec.rb
Ruby
mit
91
master
20,692
# frozen_string_literal: true require "delegate" require "readline" require "stringio" RSpec.describe TTY::Screen do subject(:screen) { described_class } describe ".size" do it "falls through to the first detected size" do size_from_methods = { size_from_java: nil, size_from_win_api: ni...
github
piotrmurach/tty-screen
https://github.com/piotrmurach/tty-screen
lib/tty/screen.rb
Ruby
mit
91
master
12,338
# frozen_string_literal: true begin require "rbconfig" rescue LoadError end require_relative "screen/version" module TTY # Responsible for detecting terminal screen size # # @api public module Screen # The Ruby configuration # # @return [Hash] # # @api private RUBY_CONFIG = defined?...
github
piotrmurach/tty-screen
https://github.com/piotrmurach/tty-screen
tasks/console.rake
Ruby
mit
91
master
247
# frozen_string_literal: true desc "Load gem inside IRB console" task :console do require "irb" require "irb/completion" require_relative "../lib/tty-screen" ARGV.clear IRB.start end desc "Alias for the :console task" task c: :console
github
makandra/edge_rider
https://github.com/makandra/edge_rider
edge_rider.gemspec
Ruby
mit
91
master
1,184
lib = File.expand_path('lib', __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "edge_rider/version" Gem::Specification.new do |spec| spec.name = 'edge_rider' spec.version = EdgeRider::VERSION spec.required_ruby_version = '>= 2.7.4' spec.authors = ['Henning Koch'] spec.email = ['hennin...
github
makandra/edge_rider
https://github.com/makandra/edge_rider
spec/spec_helper.rb
Ruby
mit
91
master
426
require 'edge_rider' require 'edge_rider/development' require 'database_cleaner' require 'gemika' require 'pry' require 'byebug' require 'db-query-matchers' # Requires supporting files with custom matchers and macros, etc in ./support/ and its subdirectories. Dir["#{File.dirname(__FILE__)}/support/*.rb"].sort.each {|f...
github
makandra/edge_rider
https://github.com/makandra/edge_rider
spec/support/database.rb
Ruby
mit
91
master
685
Gemika::Database.new.rewrite_schema! do create_table :forums do |t| t.string :name t.boolean :trashed end create_table :topics do |t| t.string :subject t.references :forum t.references :author t.boolean :trashed end create_table :posts do |t| t.text :body t.references :topic...
github
makandra/edge_rider
https://github.com/makandra/edge_rider
spec/support/models.rb
Ruby
mit
91
master
2,016
require 'has_defaults' # Since our specs are mostly about working with IDs, this module can be # included in an ActiveRecord model class to allow setting the :id attribute # on create. This is forbidden by default. # http://stackoverflow.com/questions/431617/overriding-id-on-create-in-activerecord module AllowSettingI...
github
makandra/edge_rider
https://github.com/makandra/edge_rider
spec/edge_rider/scoped_spec.rb
Ruby
mit
91
master
1,905
describe EdgeRider::Scoped do describe 'scoped' do it 'returns a scope when called without parameters' do EdgeRider::Util.scope?( Forum.scoped ).should == true end it 'returns a scope when called with an empty hash' do EdgeRider::Util.scope?( Forum.scoped({}) ).should == true end...
github
makandra/edge_rider
https://github.com/makandra/edge_rider
spec/edge_rider/origin_class_spec.rb
Ruby
mit
91
master
968
describe EdgeRider::OriginClass do describe '#origin_class' do it "should return the class a scope is based on" do Forum.create!(id: 1) Forum.create!(id: 2) scope = Forum.scoped(conditions: { id: [1] }) scope.origin_class.should == Forum scope.origin_class.collect_ids.should == [1,...
github
makandra/edge_rider
https://github.com/makandra/edge_rider
spec/edge_rider/collect_column_spec.rb
Ruby
mit
91
master
2,697
describe EdgeRider::CollectColumn do describe '#collect_column' do it 'should collect the given value from a scope' do Forum.create!(id: 1, name: 'Name 1') Forum.create!(id: 2, name: 'Name 2') Forum.create!(id: 3, name: 'Name 3') scope = Forum.scoped(conditions: { id: [2, 3] }) sco...
github
makandra/edge_rider
https://github.com/makandra/edge_rider
spec/edge_rider/preload_associations_spec.rb
Ruby
mit
91
master
821
describe EdgeRider::PreloadAssociations do describe '.preload_associations' do it 'should preload the given named associations so they are no longer fetched lazily' do forum = Forum.create! topic = Topic.create!(forum: forum) post = Post.create!(topic: topic) Forum.preload_associations([...
github
makandra/edge_rider
https://github.com/makandra/edge_rider
spec/edge_rider/to_id_query_spec.rb
Ruby
mit
91
master
1,080
describe EdgeRider::ToIdQuery do describe '#to_id_query' do it 'should simplify a scope to a IN query that selects IDs' do Forum.create!(id: 1, name: 'Name 1') Forum.create!(id: 2, name: 'Name 2') Forum.create!(id: 3, name: 'Name 2') scope = Forum.scoped(conditions: { name: 'Name 2' }) ...
github
makandra/edge_rider
https://github.com/makandra/edge_rider
spec/edge_rider/collect_ids_spec.rb
Ruby
mit
91
master
4,740
describe EdgeRider::CollectIds do describe '#collect_ids' do context 'when called on an ActiveRecord class' do it 'should return the ids for all records of that class' do Forum.create!(id: 1) Forum.create!(id: 2) Forum.collect_ids.should =~ [1, 2] end end context '...
github
makandra/edge_rider
https://github.com/makandra/edge_rider
spec/edge_rider/traverse_association_spec.rb
Ruby
mit
91
master
7,302
describe EdgeRider::TraverseAssociation do describe '#traverse_association' do it 'should traverse a belongs_to associations' do forum_1 = Forum.create! forum_2 = Forum.create! forum_3 = Forum.create! topic_1 = Topic.create!(forum: forum_1) topic_2 = Topic.create!(forum: forum_1) ...
github
makandra/edge_rider
https://github.com/makandra/edge_rider
lib/edge_rider.rb
Ruby
mit
91
master
348
# encoding: utf-8 require 'active_record' require 'edge_rider/version' require 'edge_rider/util' require 'edge_rider/collect_column' require 'edge_rider/collect_ids' require 'edge_rider/preload_associations' require 'edge_rider/origin_class' require 'edge_rider/scoped' require 'edge_rider/traverse_association' requi...
github
makandra/edge_rider
https://github.com/makandra/edge_rider
lib/edge_rider/to_id_query.rb
Ruby
mit
91
master
228
module EdgeRider module ToIdQuery def to_id_query ids = collect_ids EdgeRider::Util.exclusive_query(self, id: ids) end end end ActiveSupport.on_load :active_record do extend(EdgeRider::ToIdQuery) end
github
makandra/edge_rider
https://github.com/makandra/edge_rider
lib/edge_rider/preload_associations.rb
Ruby
mit
91
master
794
module EdgeRider module PreloadAssociations module PreloadAssociationsInstanceMethod def preload_associations(*args) self.class.preload_associations([self], *args) end end def preload_associations(*args) preloader = ActiveRecord::Associations::Preloader if preloader.metho...
github
makandra/edge_rider
https://github.com/makandra/edge_rider
lib/edge_rider/collect_column.rb
Ruby
mit
91
master
436
module EdgeRider module CollectColumn def collect_column(column_name, find_options = {}) distinct = find_options.delete(:distinct) qualified_column_name = EdgeRider::Util.qualify_column_name(self, column_name) scope = scoped({}) scope = scope.distinct if distinct scope.pluck(qualif...
github
makandra/edge_rider
https://github.com/makandra/edge_rider
lib/edge_rider/development.rb
Ruby
mit
91
master
383
module EdgeRider module Development extend self def selects_star_with_conditions_pattern(table, conditions) table = Regexp.quote(table) conditions = Regexp.quote(conditions) unless conditions.is_a?(Regexp) quote = '[`"]?' /\ASELECT (#{quote}#{table}#{quote}\.)?\* FROM #{quote}#{table}...
github
makandra/edge_rider
https://github.com/makandra/edge_rider
lib/edge_rider/collect_ids.rb
Ruby
mit
91
master
1,302
module EdgeRider module CollectIds class Uncollectable < StandardError; end module Array def collect_ids collect do |obj| case obj when Integer obj when ActiveRecord::Base obj.id when String if obj.match(/\A\d+\z/) ...
github
makandra/edge_rider
https://github.com/makandra/edge_rider
lib/edge_rider/util.rb
Ruby
mit
91
master
1,292
# encoding: utf-8 module EdgeRider module Util extend self def qualify_column_name(model, column_name) column_name = column_name.to_s column_name = "#{model.table_name}.#{column_name}" unless column_name.include?('.') column_name end def exclusive_query(model, conditions) mo...
github
makandra/edge_rider
https://github.com/makandra/edge_rider
lib/edge_rider/traverse_association.rb
Ruby
mit
91
master
1,885
module EdgeRider module TraverseAssociation class UnsupportedAssociation < StandardError; end class UnknownAssociation < StandardError; end def traverse_association(*associations) scope = scoped({}) associations.each do |association| reflection = scope.reflect_on_association(assoc...
github
makandra/edge_rider
https://github.com/makandra/edge_rider
lib/edge_rider/scoped.rb
Ruby
mit
91
master
855
module EdgeRider module Scoped VALID_FIND_OPTIONS = [ :conditions, :include, :joins, :limit, :offset, :order, :select, :readonly, :group, :having, :from, :lock ] def scoped(options = nil) options ||= {} relation = all options.assert_valid_keys(VALID_FIND_OPTIONS...
github
makandra/edge_rider
https://github.com/makandra/edge_rider
lib/edge_rider/origin_class.rb
Ruby
mit
91
master
276
module EdgeRider module OriginClass def origin_class scope = scoped({}) while scope.respond_to?(:klass, true) scope = scope.klass end scope end end end ActiveSupport.on_load :active_record do extend(EdgeRider::OriginClass) end
github
lacostej/apple-dev
https://github.com/lacostej/apple-dev
apple-dev.gemspec
Ruby
mit
91
master
1,155
# -*- encoding: utf-8 -*- require File.expand_path('../lib/apple-dev/version', __FILE__) Gem::Specification.new do |gem| gem.authors = ["Jerome Lacoste"] gem.email = ["jerome.lacoste@gmail.com"] gem.description = %q{a library and set of programs to manage Apple development site and data programat...