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 | shreyasbharath/cpp-dependency-graph | https://github.com/shreyasbharath/cpp-dependency-graph | lib/cpp_dependency_graph/link.rb | Ruby | mit | 45 | master | 843 | # frozen_string_literal: true
require 'json'
require 'set'
# Represents a link between two entities, a source and a target
class Link
attr_reader :source
attr_reader :target
def initialize(source, target, cyclic = false)
@source = source
@target = target
@cyclic = cyclic
end
def cyclic?
@c... |
github | shreyasbharath/cpp-dependency-graph | https://github.com/shreyasbharath/cpp-dependency-graph | lib/cpp_dependency_graph/graph_to_svg_visualiser.rb | Ruby | mit | 45 | master | 848 | # frozen_string_literal: true
require 'ruby-graphviz'
# Outputs a `dot` language representation of a dependency graph
class GraphToSvgVisualiser
def generate(deps, file)
@g = GraphViz.new('dependency_graph')
create_nodes(deps)
connect_nodes(deps)
@g.output(svg: file)
end
private
def create_n... |
github | shreyasbharath/cpp-dependency-graph | https://github.com/shreyasbharath/cpp-dependency-graph | lib/cpp_dependency_graph/tsortable_hash.rb | Ruby | mit | 45 | master | 264 | # frozen_string_literal: true
require 'tsort'
# Hash that topologically sorts itself upon insertion of a key
class TsortableHash < Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end |
github | shreyasbharath/cpp-dependency-graph | https://github.com/shreyasbharath/cpp-dependency-graph | lib/cpp_dependency_graph/source_component.rb | Ruby | mit | 45 | master | 804 | # frozen_string_literal: true
require_relative 'config'
require_relative 'directory_parser'
require_relative 'source_file'
# Abstracts a source directory containing source files
class SourceComponent
include Config
include DirectoryParser
attr_reader :path
def initialize(path)
@path = path
end
def ... |
github | shreyasbharath/cpp-dependency-graph | https://github.com/shreyasbharath/cpp-dependency-graph | lib/cpp_dependency_graph/cyclic_link.rb | Ruby | mit | 45 | master | 555 | # frozen_string_literal: true
require 'set'
# Represents a cyclic link betwee two nodes, it is special in the sense it is designed to be used as a key in a hash
class CyclicLink
attr_reader :node_a
attr_reader :node_b
def initialize(node_a, node_b)
@node_a = node_a
@node_b = node_b
end
def eql?(ot... |
github | shreyasbharath/cpp-dependency-graph | https://github.com/shreyasbharath/cpp-dependency-graph | lib/cpp_dependency_graph/logging.rb | Ruby | mit | 45 | master | 411 | require "logger"
module Logging
def logger
Logging.logger
end
def self.logger
@logger ||= initialise_logger
end
def self.initialise_logger
logger = Logger.new(STDOUT, level: :info)
logger.formatter = proc do |severity, datetime, progname, msg|
date_format = datetime.strftime("%Y-%m-%d... |
github | shreyasbharath/cpp-dependency-graph | https://github.com/shreyasbharath/cpp-dependency-graph | lib/cpp_dependency_graph/dir_tree.rb | Ruby | mit | 45 | master | 932 | # frozen_string_literal: true
require 'json'
require_relative 'config'
# Returns a root directory as a tree of directories
class DirTree
include Config
attr_reader :tree
def initialize(path)
@tree = File.directory?(path) ? parse_dirs(path) : {}
end
private
def parse_dirs(path, name = nil)
dat... |
github | shreyasbharath/cpp-dependency-graph | https://github.com/shreyasbharath/cpp-dependency-graph | lib/cpp_dependency_graph/directory_parser.rb | Ruby | mit | 45 | master | 402 | # frozen_string_literal: true
# Utility methods for parsing directories
module DirectoryParser
def fetch_all_dirs(root_dir)
Find.find(root_dir).select { |e| File.directory?(e) && e != root_dir}
end
def glob_files(path, extensions)
path = File.join(path, File::SEPARATOR, '**', File::SEPARATOR, '*' + exte... |
github | shreyasbharath/cpp-dependency-graph | https://github.com/shreyasbharath/cpp-dependency-graph | lib/cpp_dependency_graph/cycle_detector.rb | Ruby | mit | 45 | master | 667 | # frozen_string_literal: true
require_relative "cyclic_link"
require_relative "logging"
# Detects cycles between nodes
class CycleDetector
include Logging
def initialize(links)
logger.debug "Resolving cyclic dependendencies..."
@cyclic_links = links.flat_map do |source, source_links|
logger.debug "... |
github | shreyasbharath/cpp-dependency-graph | https://github.com/shreyasbharath/cpp-dependency-graph | lib/cpp_dependency_graph/bidirectional_hash.rb | Ruby | mit | 45 | master | 570 | # frozen_string_literal: true
# Hash that allows lookup by key and value
class BidirectionalHash
def initialize
@forward = Hash.new { |h, k| h[k] = [] }
@reverse = Hash.new { |h, k| h[k] = [] }
end
def insert(key, value)
@forward[key].push(value)
@reverse[value].push(key)
value
end
def ... |
github | shreyasbharath/cpp-dependency-graph | https://github.com/shreyasbharath/cpp-dependency-graph | lib/cpp_dependency_graph/include_file_dependency_graph.rb | Ruby | mit | 45 | master | 570 | # frozen_string_literal: true
require_relative 'project'
require_relative 'link'
require_relative 'cycle_detector'
# Returns a hash of individual file include links
class IncludeFileDependencyGraph
def initialize(project)
@project = project
end
def all_cyclic_links
# TODO: Implement
end
def links(... |
github | shreyasbharath/cpp-dependency-graph | https://github.com/shreyasbharath/cpp-dependency-graph | lib/cpp_dependency_graph/graph_to_html_visualiser.rb | Ruby | mit | 45 | master | 702 | # frozen_string_literal: true
require 'json'
# Outputs a `d3 force graph layout` equipped HTML representation of a dependency graph
class GraphToHtmlVisualiser
def generate(deps, file)
connections = deps.flat_map do |_, links|
links.map do |link|
{ source: link.source, dest: link.target }
en... |
github | shreyasbharath/cpp-dependency-graph | https://github.com/shreyasbharath/cpp-dependency-graph | lib/cpp_dependency_graph/circle_packing_visualiser.rb | Ruby | mit | 45 | master | 543 | # frozen_string_literal: true
require 'json'
# Outputs a `d3 circle packing layout` equipped HTML representation of a hierarchical tree
class CirclePackingVisualiser
def generate(tree, file)
json_tree = JSON.pretty_generate(tree)
template_file = resolve_file_path('views/circle_packing.html.template')
te... |
github | shreyasbharath/cpp-dependency-graph | https://github.com/shreyasbharath/cpp-dependency-graph | lib/cpp_dependency_graph/component_dependency_graph.rb | Ruby | mit | 45 | master | 1,471 | # frozen_string_literal: true
require_relative 'project'
require_relative 'link'
require_relative 'cycle_detector'
# Dependency tree/graph of entire project
class ComponentDependencyGraph
def initialize(project)
@project = project
end
def all_links
@all_links ||= build_hash_links
end
def all_cycli... |
github | shreyasbharath/cpp-dependency-graph | https://github.com/shreyasbharath/cpp-dependency-graph | lib/cpp_dependency_graph/include_to_component_resolver.rb | Ruby | mit | 45 | master | 1,995 | # frozen_string_literal: true
require_relative 'source_component'
# Resolves a given include to a source component
class IncludeToComponentResolver
def initialize(components)
@components = components
@component_external_include_cache = {}
@component_include_map_cache = {}
end
def external_includes(... |
github | shreyasbharath/cpp-dependency-graph | https://github.com/shreyasbharath/cpp-dependency-graph | lib/cpp_dependency_graph/file_dependency_graph.rb | Ruby | mit | 45 | master | 1,459 | # frozen_string_literal: true
require_relative 'project'
require_relative 'link'
require_relative 'cycle_detector'
# Dependency tree/graph of entire project
class FileDependencyGraph
def initialize(project)
@project = project
end
def all_links
@all_links ||= build_hash_links
end
def all_cyclic_lin... |
github | shreyasbharath/cpp-dependency-graph | https://github.com/shreyasbharath/cpp-dependency-graph | lib/cpp_dependency_graph/include_component_dependency_graph.rb | Ruby | mit | 45 | master | 983 | # frozen_string_literal: true
require_relative 'project'
require_relative 'link'
require_relative 'cycle_detector'
# Returns a hash of intra-component include links
class IncludeComponentDependencyGraph
def initialize(project)
@project = project
end
def all_links
@project.source_files.map do |file|
... |
github | shreyasbharath/cpp-dependency-graph | https://github.com/shreyasbharath/cpp-dependency-graph | lib/cpp_dependency_graph/project.rb | Ruby | mit | 45 | master | 1,783 | # frozen_string_literal: true
require 'find'
require_relative 'directory_parser'
require_relative 'include_to_component_resolver'
require_relative 'source_component'
require_relative 'logging'
# Parses all components of a project
class Project
include DirectoryParser
include Logging
def initialize(path)
@... |
github | puppetlabs/homebrew-puppet | https://github.com/puppetlabs/homebrew-puppet | Rakefile | Ruby | apache-2.0 | 45 | master | 4,806 | require 'digest'
require 'erb'
require 'net/http'
require 'tmpdir'
def fetch(uri, limit = 10)
# puts "Fetching #{uri}" # Uncomment to debug what URI's are being fetched
raise 'too many HTTP redirects' if limit == 0
response = Net::HTTP.get_response(URI(uri))
case response
when Net::HTTPSuccess then
respo... |
github | puppetlabs/homebrew-puppet | https://github.com/puppetlabs/homebrew-puppet | Formula/ruby@2.7.rb | Ruby | apache-2.0 | 45 | master | 8,513 | class RubyAT27 < Formula
desc "Powerful, clean, object-oriented scripting language"
homepage "https://www.ruby-lang.org/"
url "https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.8.tar.xz"
sha256 "f22f662da504d49ce2080e446e4bea7008cee11d5ec4858fc69000d0e5b1d7fb"
license "Ruby"
livecheck do
url "https://w... |
github | puppetlabs/homebrew-puppet | https://github.com/puppetlabs/homebrew-puppet | Formula/gettext.rb | Ruby | apache-2.0 | 45 | master | 1,406 | class Gettext < Formula
desc "GNU internationalization (i18n) and localization (l10n) library"
homepage "https://www.gnu.org/software/gettext/"
url "https://ftpmirror.gnu.org/gnu/gettext/gettext-0.26.tar.gz"
mirror "https://ftp.gnu.org/gnu/gettext/gettext-0.26.tar.gz"
mirror "http://ftp.gnu.org/gnu/gettext/ge... |
github | puppetlabs/homebrew-puppet | https://github.com/puppetlabs/homebrew-puppet | Formula/libunistring.rb | Ruby | apache-2.0 | 45 | master | 1,516 | class Libunistring < Formula
desc "C string library for manipulating Unicode strings"
homepage "https://www.gnu.org/software/libunistring/"
url "https://ftpmirror.gnu.org/gnu/libunistring/libunistring-1.3.tar.gz"
mirror "https://ftp.gnu.org/gnu/libunistring/libunistring-1.3.tar.gz"
mirror "http://ftp.gnu.org/... |
github | puppetlabs/homebrew-puppet | https://github.com/puppetlabs/homebrew-puppet | Formula/wash.rb | Ruby | apache-2.0 | 45 | master | 823 | class Wash < Formula
version = "0.23.3"
homepage "https://puppetlabs.github.io/wash"
url "https://github.com/puppetlabs/wash/archive/#{version}.tar.gz"
sha256 "006258aa19f4f62c356db83b52f1858674991839eeb2bb3f36fc06494f9fa458"
head "https://github.com/puppetlabs/wash.git"
depends_on "go" => [:build, "1.12.... |
github | puppetlabs/homebrew-puppet | https://github.com/puppetlabs/homebrew-puppet | Formula/relay.rb | Ruby | apache-2.0 | 45 | master | 470 | class Relay < Formula
version "v5.2.0"
homepage "https://relay.sh/"
url "https://github.com/puppetlabs/relay/releases/download/#{version}/relay-#{version}-darwin-amd64",
:using => :nounzip
sha256 "ad75452b15b2c02dd6f16f45ed7c41a181cabb7f51232fd5a34ff757af12a85f"
deprecate! date: "2024-07-25", because: :... |
github | puppetlabs/homebrew-puppet | https://github.com/puppetlabs/homebrew-puppet | Formula/perl.rb | Ruby | apache-2.0 | 45 | master | 1,384 | class Perl < Formula
desc "Highly capable, feature-rich programming language"
homepage "https://www.perl.org/"
url "https://www.cpan.org/src/5.0/perl-5.40.2.tar.xz"
sha256 "0551c717458e703ef7972307ab19385edfa231198d88998df74e12226abf563b"
license any_of: ["Artistic-1.0-Perl", "GPL-1.0-or-later"]
head "https... |
github | puppetlabs/homebrew-puppet | https://github.com/puppetlabs/homebrew-puppet | Formula/kubectl-ran.rb | Ruby | apache-2.0 | 45 | master | 1,563 | # typed: false
# frozen_string_literal: true
# This file was generated by GoReleaser. DO NOT EDIT.
class KubectlRan < Formula
desc "A Kubernetes addon for running an ephemeral container with a mounted volume."
homepage "https://github.com/puppetlabs/kubectl-ran"
version "0.1.3"
license "Apache 2.0"
on_macos... |
github | puppetlabs/homebrew-puppet | https://github.com/puppetlabs/homebrew-puppet | Formula/cmake.rb | Ruby | apache-2.0 | 45 | master | 1,899 | class Cmake < Formula
desc "Cross-platform make"
homepage "https://www.cmake.org/"
url "https://github.com/Kitware/CMake/releases/download/v3.31.6/cmake-3.31.6.tar.gz"
mirror "http://fresh-center.net/linux/misc/cmake-3.31.6.tar.gz"
mirror "http://fresh-center.net/linux/misc/legacy/cmake-3.31.6.tar.gz"
sha25... |
github | puppetlabs/homebrew-puppet | https://github.com/puppetlabs/homebrew-puppet | Formula/cmake@3.rb | Ruby | apache-2.0 | 45 | master | 4,223 | class CmakeAT3 < Formula
desc "Cross-platform make"
homepage "https://www.cmake.org/"
url "https://github.com/Kitware/CMake/releases/download/v3.31.6/cmake-3.31.6.tar.gz"
mirror "http://fresh-center.net/linux/misc/cmake-3.31.6.tar.gz"
mirror "http://fresh-center.net/linux/misc/legacy/cmake-3.31.6.tar.gz"
sh... |
github | puppetlabs/homebrew-puppet | https://github.com/puppetlabs/homebrew-puppet | Casks/puppet-agent-5.rb | Ruby | apache-2.0 | 45 | master | 1,498 | cask 'puppet-agent-5' do
case MacOS.version
when '10.10'
os_ver = '10.10'
version '5.5.0'
sha256 '3f30c36e9b39763839148aaea400193c7b52d8feea2765121f6dabace658ec25'
when '10.11'
os_ver = '10.11'
version '5.5.0'
sha256 'fe60c24d2b964f161599bf4594c9e871f161707375b81c6b1e998e8cfce13058'
when... |
github | puppetlabs/homebrew-puppet | https://github.com/puppetlabs/homebrew-puppet | Casks/pe-client-tools-2019.8.rb | Ruby | apache-2.0 | 45 | master | 716 | cask 'pe-client-tools-2019.8' do
case MacOS.version
when '10.14'
os_ver = '10.14'
version '19.8.6'
sha256 'ce9c2db02c9fbb6b1cbf6ba9be4a2c569aa485a563350718a4435dc2a8185f3d'
else
os_ver = '10.15'
version '19.8.6'
sha256 '3cb72c8ac071b46b8b60a40a2018b44346205b386a1ee07e2006cd66ce98e3cb'
en... |
github | puppetlabs/homebrew-puppet | https://github.com/puppetlabs/homebrew-puppet | Casks/puppet-agent-6.rb | Ruby | apache-2.0 | 45 | master | 2,199 | cask 'puppet-agent-6' do
if MacOS.version < :catalina
arch = 'x86_64'
else
arch = Hardware::CPU.intel? ? 'x86_64' : 'arm64'
end
case MacOS.version
when '10.12'
os_ver = '10.12'
version '6.13.0'
if arch == 'arm64'
sha256 'nil'
elsif arch == 'x86_64'
sha256 '3577c3656b40014a... |
github | puppetlabs/homebrew-puppet | https://github.com/puppetlabs/homebrew-puppet | Casks/puppet-agent-7.rb | Ruby | apache-2.0 | 45 | master | 1,820 | cask 'puppet-agent-7' do
if MacOS.version < :catalina
arch = 'x86_64'
else
arch = Hardware::CPU.intel? ? 'x86_64' : 'arm64'
end
case MacOS.version
when '11'
os_ver = '11'
version '7.34.0'
if arch == 'arm64'
sha256 '54c880828b6ffee0c3f713bff6d87e391ffb00a6efd09acbdcf4e2995b548194'
... |
github | puppetlabs/homebrew-puppet | https://github.com/puppetlabs/homebrew-puppet | Casks/pe-client-tools.rb | Ruby | apache-2.0 | 45 | master | 709 | cask 'pe-client-tools' do
case MacOS.version
when '10.14'
os_ver = '10.14'
version '21.1.0'
sha256 'b8a808800091e481cf5b779d795203c84f8caabdaf8608ad6d7af23c136aa30e'
else
os_ver = '10.15'
version '21.1.0'
sha256 '212568a6af374e40537c7180ae28d2083dc4f1ef8bbf26654019b1033a52d06c'
end
de... |
github | puppetlabs/homebrew-puppet | https://github.com/puppetlabs/homebrew-puppet | Casks/puppet-bolt@2.rb | Ruby | apache-2.0 | 45 | master | 1,294 | cask 'puppet-bolt@2' do
case MacOS.version
when '10.11'
os_ver = '10.11'
version '2.0.0'
sha256 'a5956c7d075a6219f04cda8890732bb8e31b4e10ad0096e18046531b43cfdd7d'
when '10.12'
os_ver = '10.12'
version '2.0.0'
sha256 '9d14f5106bb1c882971658ca00537fd1f1e176685f31588637eab8b95feba0d7'
when ... |
github | puppetlabs/homebrew-puppet | https://github.com/puppetlabs/homebrew-puppet | Casks/puppet-agent-8.rb | Ruby | apache-2.0 | 45 | master | 1,759 | cask 'puppet-agent-8' do
if MacOS.version < :monterey
arch = 'x86_64'
else
arch = Hardware::CPU.intel? ? 'x86_64' : 'arm64'
end
case MacOS.version
when '11'
os_ver = '11'
version '8.10.0'
if arch == 'arm64'
sha256 'nil'
elsif arch == 'x86_64'
sha256 '18da16a381eeaaf4de8ff3... |
github | puppetlabs/homebrew-puppet | https://github.com/puppetlabs/homebrew-puppet | Casks/pe-client-tools-2018.1.rb | Ruby | apache-2.0 | 45 | master | 716 | cask 'pe-client-tools-2018.1' do
case MacOS.version
when '10.12'
os_ver = '10.12'
version '18.1.8'
sha256 'dab4d62b803bc322ce07c66820f443e1f85a967f77b752cf55262a500c1dce1a'
else
os_ver = '10.13'
version '18.1.8'
sha256 '327891491b80567b2af035de53422f81e010e727373f055f13626eb10c9c4553'
en... |
github | puppetlabs/homebrew-puppet | https://github.com/puppetlabs/homebrew-puppet | Casks/puppet-agent.rb | Ruby | apache-2.0 | 45 | master | 1,817 | cask 'puppet-agent' do
if MacOS.version < :catalina
arch = 'x86_64'
else
arch = Hardware::CPU.intel? ? 'x86_64' : 'arm64'
end
case MacOS.version
when '11'
os_ver = '11'
version '7.34.0'
if arch == 'arm64'
sha256 '54c880828b6ffee0c3f713bff6d87e391ffb00a6efd09acbdcf4e2995b548194'
... |
github | puppetlabs/homebrew-puppet | https://github.com/puppetlabs/homebrew-puppet | Casks/pdk@1.rb | Ruby | apache-2.0 | 45 | master | 1,273 | cask 'pdk@1' do
case MacOS.version
when '10.11'
os_ver = '10.11'
version '1.16.0.2'
sha256 'ead0d9089225efe5270e59790253011392b02a37d615d82c7d19faa78df1fa4b'
when '10.12'
os_ver = '10.12'
version '1.16.0.2'
sha256 '2c1c39ee111be3325c8bc2e36323d3b60d504ba5038053a1aa8d4d3567f79642'
when '1... |
github | puppetlabs/homebrew-puppet | https://github.com/puppetlabs/homebrew-puppet | Casks/pe-client-tools-2019.3.rb | Ruby | apache-2.0 | 45 | master | 716 | cask 'pe-client-tools-2019.3' do
case MacOS.version
when '10.12'
os_ver = '10.12'
version '19.3.0'
sha256 'd784e74325079ebecdbbc72ab5214c7f54be8ae1a38a6d4954bf52f7c02b1142'
else
os_ver = '10.13'
version '19.3.0'
sha256 'bccf0c588dd7d5e9dab92716e8471214c381e60f4f9246ba605091b253fb59f5'
en... |
github | puppetlabs/homebrew-puppet | https://github.com/puppetlabs/homebrew-puppet | Casks/puppet-bolt.rb | Ruby | apache-2.0 | 45 | master | 2,459 | cask 'puppet-bolt' do
## TODO: BOLT-1604, enable this when we build packsages for ARM.
## For now the x86 emulator on mac seems to work well enough (and users are already on it),
## so just statically set arch to x86_64 now
arch = 'x86_64'
# if MacOS.version < :catalina
# arch = 'x86_64'
# else
# ar... |
github | puppetlabs/homebrew-puppet | https://github.com/puppetlabs/homebrew-puppet | Casks/pdk.rb | Ruby | apache-2.0 | 45 | master | 1,393 | cask 'pdk' do
if MacOS.version < :catalina
arch = 'x86_64'
else
arch = Hardware::CPU.intel? ? 'x86_64' : 'arm64'
end
case MacOS.version
when '11'
os_ver = '11'
version '3.4.0.1'
if arch == 'arm64'
sha256 'nil'
elsif arch == 'x86_64'
sha256 'a0b2226e82513dbbb180c412a00cc6c3... |
github | murat/tors | https://github.com/murat/tors | tors.gemspec | Ruby | mit | 45 | master | 1,361 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'tors/version'
Gem::Specification.new do |spec|
spec.name = 'tors'
spec.version = TorS::VERSION
spec.authors = ['Murat Bastas']
spec.email = ['muratbsts@gmail... |
github | murat/tors | https://github.com/murat/tors | spec/spec_helper.rb | Ruby | mit | 45 | master | 360 | require 'bundler/setup'
require 'tors'
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = '.rspec_status'
# Disable RSpec exposing methods globally on `Module` and `main`
config.disable_monkey_patching!
config.expect_with :rspec ... |
github | murat/tors | https://github.com/murat/tors | lib/tors.rb | Ruby | mit | 45 | master | 1,987 | require 'tors/version'
require 'tors/search'
require 'slop'
# Main module for passing options and initializing TorS::Search class
module TorS
REQUIRE_AUTH = %w[zamunda].freeze
opts = Slop.parse do |o|
o.banner = 'usage: tors [options] SEARCH_STRING'
o.string '-d', '--directory', 'Destination path for down... |
github | murat/tors | https://github.com/murat/tors | lib/tors/search.rb | Ruby | mit | 45 | master | 6,491 | require 'yaml'
require 'net/http'
require 'nokogiri'
require 'mechanize'
require 'open-uri'
require 'tty-table'
require 'tty-prompt'
require 'colorize'
module TorS
class Search
attr_accessor :from, :username, :password, :directory, :auto_download, :open_torrent
# Initialize class. Only query string is requi... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | test/test_call.rb | Ruby | mit | 45 | master | 400 | require File.dirname(__FILE__) + '/common'
include Rdio
class TestCall < RdioTestCase
def test_get
c = Call.new
args = ['get', 'keys=t7609753']
have = c.real_main args
assert_equal true, !!have.index(/"ok"/)
end
def test_get_indent
c = Call.new
args = ['get', 'keys=t7609753','-i']
h... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | test/test_base.rb | Ruby | mit | 45 | master | 2,916 | require File.dirname(__FILE__) + '/common'
class TestSearch < RdioTestCase
def test_add_to_array
assert_equal ['1'],Rdio::add_to_array(nil,'1')
assert_equal ['1'],Rdio::add_to_array('','1')
assert_equal '2,1',Rdio::add_to_array('2','1')
assert_equal ['1'],Rdio::add_to_array([],'1')
assert_equal ... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | test/test_user.rb | Ruby | mit | 45 | master | 1,842 | require File.dirname(__FILE__) + '/common'
include Rdio
class TestUser < RdioTestCase
def test_find_by_email
email = 'jeff@jeffpalm.com'
user = User.find_by_email email
assert_not_nil user
assert_equal 'Jeffrey',user.first_name
assert_equal 'Palm',user.last_name
end
def test_find_by_vanity_... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | test/test_no_auth.rb | Ruby | mit | 45 | master | 324 | require File.dirname(__FILE__) + '/common'
include Rdio
class TestNoAuth < Test::Unit::TestCase
def test_find_by_email
Rdio::reset
email = 'jeff@jeffpalm.com'
user = User.find_by_email email
assert_not_nil user
assert_equal 'Jeffrey',user.first_name
assert_equal 'Palm',user.last_name
end
... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | test/test_jewgonewild.rb | Ruby | mit | 45 | master | 391 | require File.dirname(__FILE__) + '/common'
include Rdio
#
# https://github.com/spudtrooper/rdiorb/issues/10
#
class TestJewGoneWild < TestCase
def test_search_Jewgonewild
Rdio::reset
key = ENV['RDIO_KEY']
secret = ENV['RDIO_SECRET']
rdio = Rdio::init(key,secret)
res = rdio.search('yellow ostrich... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | test/test_album.rb | Ruby | mit | 45 | master | 1,508 | require File.dirname(__FILE__) + '/common'
include Rdio
class TestAlbum < RdioTestCase
def test_artist
album = Album.get 'a446068'
artist = album.artist
assert_equal Artist,artist.class
assert_equal 'Built To Spill',artist.name
end
def test_artist_name
album = Album.get 'a446068'
artist... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | test/test_access_token.rb | Ruby | mit | 45 | master | 509 | require File.dirname(__FILE__) + '/common'
include Rdio
class TestAccessToken < Test::Unit::TestCase
ACCESS_TOKEN_FILE = '.rdio_access_token'
def test_current
if not File.exist? ACCESS_TOKEN_FILE
raise '.access_token must be a file holding ' +
'the string value of an authorized ' +
'acc... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | test/test_oauth.rb | Ruby | mit | 45 | master | 369 | require File.dirname(__FILE__) + '/common'
include Rdio
class TestOAuth < RdioTestCase
def test_set_get_pin
api = Rdio::api
api.get_pin = lambda {|url| url+url}
get_pin = api.get_pin
url = 'test'
assert_equal (url+url),get_pin.call(url)
get_pin = api.oauth.get_pin
url = 'test2'
asser... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | test/test_auth.rb | Ruby | mit | 45 | master | 264 | require File.dirname(__FILE__) + '/common'
include Rdio
class TestAuth < RdioTestCase
def test_current
Rdio::reset
user = User.current
assert_not_nil user
assert_equal 'Jeffrey',user.first_name
assert_equal 'Palm',user.last_name
end
end |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | test/test_search.rb | Ruby | mit | 45 | master | 2,140 | require File.dirname(__FILE__) + '/common'
include Rdio
class TestSearch < RdioTestCase
def test_search
res = Search.counts 'Kanye West'
assert_at_least 10,res.artist_count,'artist_count'
assert_at_least 10,res.album_count,'album_count'
assert_at_least 10,res.track_count,'track_count'
assert_at_... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | test/test_user3.rb | Ruby | mit | 45 | master | 526 | require File.dirname(__FILE__) + '/common'
include Rdio
class TestUser3 < RdioTestCase
def test_is_trial
user = User.current 'isTrial'
assert_equal false,user.trial?
assert_equal false,user.is_trial
end
def test_is_subscriber
user = User.current 'isSubscriber'
assert_equal true,user.subscri... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | test/test_track.rb | Ruby | mit | 45 | master | 1,587 | require File.dirname(__FILE__) + '/common'
include Rdio
class TestTrack < RdioTestCase
track = nil
def setup
if not @track
@track = Track.get 't5483181'
end
end
def test_album
album = @track.album
assert_equal Album,album.class
assert_equal 'a446068',album.key
end
def test_a... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | test/test_user2.rb | Ruby | mit | 45 | master | 2,696 | require File.dirname(__FILE__) + '/common'
include Rdio
class TestUser2 < RdioTestCase
@user = nil
def other_setup
if not @user
@user = User.find_by_email 'jeff@jeffpalm.com'
end
end
def test_albums_in_collection
albums = @user.albums_in_collection
assert_length_at_least 20,albums,'alb... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | test/test_no_auth_no_include.rb | Ruby | mit | 45 | master | 326 | require File.dirname(__FILE__) + '/common'
class TestNoAuthNoInclude < Test::Unit::TestCase
def test_find_by_email
Rdio::reset
email = 'jeff@jeffpalm.com'
user = Rdio::User.find_by_email email
assert_not_nil user
assert_equal 'Jeffrey',user.first_name
assert_equal 'Palm',user.last_name
end... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | test/common.rb | Ruby | mit | 45 | master | 1,258 | require 'rubygems'
require 'test/unit'
include Test::Unit
require File.dirname(__FILE__) + '/../lib/rdio'
class TestCase
def assert_not_nil(o)
if not o
assert false,'Should not be nil'
end
end
def assert_length_at_least(num,arr,thing)
if arr.length < num
assert false,"Not enough #{thing}... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | test/test_artist.rb | Ruby | mit | 45 | master | 588 | require File.dirname(__FILE__) + '/common'
include Rdio
class TestArtist < RdioTestCase
def test_get
artist = Artist.get 'r87304'
assert_equal Artist,artist.class
assert_equal 'Bad Religion',artist.name
end
def test_from_url
artist = Artist.from_url 'http://www.rdio.com/#/artist/Bad_Religion/'
... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | test/test_playlist_add_delete.rb | Ruby | mit | 45 | master | 524 | require File.dirname(__FILE__) + '/common'
include Rdio
class TestPlaylist < RdioTestCase
def test_add_delete
name = 'test playlist'
desc = 'description for test playlist'
tracks = [Track.get('t5483181')]
playlist = Playlist.create name,desc,tracks,'trackKeys'
assert_not_nil playlist
have =... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | test/test_api.rb | Ruby | mit | 45 | master | 1,016 | require File.dirname(__FILE__) + '/common'
require 'test/unit'
include Rdio
class TestUser < RdioTestCase
def test_find_user_by_email
email = 'jeff@jeffpalm.com'
user = Rdio::api.findUserByEmail email
assert_not_nil user
assert_equal 'Jeffrey',user.first_name
assert_equal 'Palm',user.last_name
... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | test/test_playlist.rb | Ruby | mit | 45 | master | 1,330 | require File.dirname(__FILE__) + '/common'
include Rdio
class TestPlaylist < RdioTestCase
@playlist = nil
@playlist_key = nil
def other_setup
name = 'test playlist'
desc = 'description for test playlist'
tracks = [Track.get('t5483181')]
playlist = Playlist.create name,desc,tracks,'trackKeys'
... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | test/test_johan.rb | Ruby | mit | 45 | master | 429 | require File.dirname(__FILE__) + '/common'
include Rdio
class TestJohan < RdioTestCase
def test_johan
r_tracks = [Track.get('t2979981')]
if (!r_tracks.empty?)
pl = Rdio::Playlist.create("Playlistify","Description...", r_tracks)
#
# This still isn't totally fixed because we get an owner wit... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | test/test_current_no_include.rb | Ruby | mit | 45 | master | 282 | require File.dirname(__FILE__) + '/common'
class TestNoAuthNoInclude < Test::Unit::TestCase
def test_find_by_email
Rdio::reset
user = Rdio::User.current
assert_not_nil user
assert_equal 'Jeffrey',user.first_name
assert_equal 'Palm',user.last_name
end
end |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | lib/rdio.rb | Ruby | mit | 45 | master | 2,472 | $:.unshift File.dirname(__FILE__) # For use/testing when no gem is installed
# core
# stdlib
require 'logger'
# third party
module Rdio
VERSION = '0.0.1'
RDIO_KEY = 'RDIO_KEY'
RDIO_SECRET = 'RDIO_SECRET'
class << self
attr_accessor :debug
attr_accessor :logger
attr_accessor :log_json
attr_... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | lib/rdio/oauth.rb | Ruby | mit | 45 | master | 2,751 | require 'rubygems'
require 'oauth'
module Rdio
# ----------------------------------------------------------------------
# Performs oob OAuth authentication based on a key and secret
# ----------------------------------------------------------------------
class RdioOAuth
SITE = 'http://api.rdio.com'
... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | lib/rdio/api.rb | Ruby | mit | 45 | master | 13,673 | module Rdio
# ----------------------------------------------------------------------
# Provides main API functionality by translating Ruby calls to REST
# calls to the super class
# ----------------------------------------------------------------------
class Api < BaseApi
def initialize(key=nil,se... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | lib/rdio/types.rb | Ruby | mit | 45 | master | 20,151 | # -*- coding: utf-8 -*-
module Rdio
# ----------------------------------------------------------------------
# Represents an artist on Rdio, either an individual performer or a
# group
# ----------------------------------------------------------------------
class Artist < ArtistData
def initialize(api)... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | lib/rdio/simple_rdio.rb | Ruby | mit | 45 | master | 3,018 | # (c) 2011 Rdio Inc
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | lib/rdio/call.rb | Ruby | mit | 45 | master | 2,364 | module Rdio
class Call
def real_main(argv)
# Check the command line for the key,secret,etc...
args = []
while true
arg = argv.shift
break if not arg
case arg
when '--consumer-key'
key = argv.shift
when '-h','--help'
print_help
... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | lib/rdio/base.rb | Ruby | mit | 45 | master | 10,702 | require 'rubygems'
require 'json'
# Make sure objects return 'self' by default to 'to_k', then we can
# override this for subsequent types -- like Artist, Track, etc --
# that need to use their key for this value
class Object
def to_k
return self
end
end
# When putting classes into arguments to BaseApi.call w... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | lib/rdio/datatypes.rb | Ruby | mit | 45 | master | 6,479 | module Rdio
class ArtistData < BaseObj
def initialize(api)
super api
end
# the name of the artist
attr_accessor :name
# the object type, always "r"
attr_accessor :type
# the URL of the artist on the Rdio web site
attr_accessor :url
# the number of tracks that the artist ... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | lib/rdio/simple_om.rb | Ruby | mit | 45 | master | 5,090 | # om is oauth-mini - a simple implementation of a useful subset of OAuth.
# It's designed to be useful and reusable but not general purpose.
#
# (c) 2011 Rdio Inc
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to dea... |
github | spudtrooper/rdiorb | https://github.com/spudtrooper/rdiorb | examples/command-line.rb | Ruby | mit | 45 | master | 1,785 | #!/usr/bin/env ruby
# (c) 2011 Rdio Inc
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, d... |
github | alexford/is_bullshit | https://github.com/alexford/is_bullshit | is_bullshit.gemspec | Ruby | mit | 45 | master | 871 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'is_bullshit/version'
Gem::Specification.new do |spec|
spec.name = "is_bullshit"
spec.version = IsBullshit::VERSION
spec.authors = ["Alex Ford"]
spec.email = [... |
github | alexford/is_bullshit | https://github.com/alexford/is_bullshit | lib/is_bullshit.rb | Ruby | mit | 45 | master | 498 | require "is_bullshit/version"
class Object
def bullshit?
respond_to?(:empty?) ? !!empty? : !self
end
def legit?
!bullshit?
end
def is_bullshit?
bullshit?
end
def seems_legit?
legit?
end
end
class Integer
def bullshit?
zero?
end
end
class String
BS_REGEX = /\A[[:space:]]*\... |
github | alexford/is_bullshit | https://github.com/alexford/is_bullshit | test/is_bullshit_test.rb | Ruby | mit | 45 | master | 2,139 | require 'test_helper'
class IsBullshitTest < Minitest::Test
def test_that_it_has_a_version_number
refute_nil ::IsBullshit::VERSION
end
def test_bullshit
assert nil.bullshit?
assert [].bullshit?
assert Hash[].bullshit?
assert 0.bullshit?
assert false.bullshit?
assert 'undefined'.bulls... |
github | dannyyu92/barebones | https://github.com/dannyyu92/barebones | barebones.gemspec | Ruby | mit | 45 | master | 528 | require "./lib/barebones/version"
require "date"
Gem::Specification.new do |s|
s.name = "barebones"
s.version = "1.0.0.6"
s.date = Date.today.to_s
s.licenses = ['MIT']
s.summary = "Rails template generator"
s.description = "A personal Rails template generator."
s.authors = ["... |
github | dannyyu92/barebones | https://github.com/dannyyu92/barebones | templates/api_defaults_concern.rb | Ruby | mit | 45 | master | 359 | module ApiDefaults
extend ActiveSupport::Concern
# Default Paths
API_VIEW_PATH = "api/v1"
API_DEFAULT_PATH = "defaults/default"
included do
layout 'api/v1/application'
def render_api(status, path=ApiDefaults::API_DEFAULT_PATH)
@status = status
return render template: "#{API_VIEW_PATH}/#{pat... |
github | dannyyu92/barebones | https://github.com/dannyyu92/barebones | templates/carrierwave.rb | Ruby | mit | 45 | master | 939 | # Uncomment for Google Cloud Storage
# CarrierWave.configure do |config|
# config.fog_credentials = {
# provider: 'Google',
# google_storage_access_key_id: Rails.application.secrets.cw_access_key_id,
# google_storage_secret_access_key: Rails.application.secrets.cw_secret_access... |
github | dannyyu92/barebones | https://github.com/dannyyu92/barebones | templates/sidekiq.rb | Ruby | mit | 45 | master | 216 | Sidekiq.configure_server do |config|
config.redis = { url: Rails.application.secrets.redis_provider }
end
Sidekiq.configure_client do |config|
config.redis = { url: Rails.application.secrets.redis_provider }
end |
github | dannyyu92/barebones | https://github.com/dannyyu92/barebones | templates/puma.rb | Ruby | mit | 45 | master | 2,665 | # Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum, this matches ... |
github | dannyyu92/barebones | https://github.com/dannyyu92/barebones | templates/api_application_controller.rb | Ruby | mit | 45 | master | 253 | class Api::V1::ApplicationController < ActionController::Base
include ApiDefaults
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery unless: -> { request.format.json? }
end |
github | dannyyu92/barebones | https://github.com/dannyyu92/barebones | lib/barebones/text_format_helpers.rb | Ruby | mit | 45 | master | 252 | module Barebones
module TextFormatHelpers
def spaces(num_spaces)
"\s" * num_spaces
end
def replace_regex_in_file(file, regex, replacement)
gsub_file file, regex do |match|
replacement
end
end
end
end |
github | dannyyu92/barebones | https://github.com/dannyyu92/barebones | lib/barebones/generators/app_generator.rb | Ruby | mit | 45 | master | 4,401 | require 'rails/generators/rails/app/app_generator'
module Barebones
class AppGenerator < Rails::Generators::AppGenerator
class_option :skip_bundle, type: :boolean, aliases: "-B", default: false,
desc: "Don't run bundle install"
class_option :skip_api, type: :boolean, default: false,
desc: "Ski... |
github | dannyyu92/barebones | https://github.com/dannyyu92/barebones | lib/barebones/builders/app_builder.rb | Ruby | mit | 45 | master | 6,266 | module Barebones
class AppBuilder < Rails::AppBuilder
include Barebones::TextFormatHelpers
# Overrides
def readme
template "README.md.erb", "README.md"
end
def gemfile
template "Gemfile.erb", "Gemfile"
replace_regex_in_file("Gemfile", /\n{2,}/, "\n\n")
end
def gitignor... |
github | tpope/pry-editline | https://github.com/tpope/pry-editline | Rakefile | Ruby | mit | 45 | master | 238 | require "bundler/gem_tasks"
task :default => :build
include_path = "-I#{File.expand_path('../lib', __FILE__)}"
task :pry do
exec 'pry', include_path, '-rpry-editline'
end
task :irb do
exec 'irb', include_path, '-rpry-editline'
end |
github | tpope/pry-editline | https://github.com/tpope/pry-editline | pry-editline.gemspec | Ruby | mit | 45 | master | 648 | # -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
Gem::Specification.new do |s|
s.name = 'pry-editline'
s.version = '1.1.2'
s.authors = ['Tim Pope']
s.email = ["code@tpop"+'e.net']
s.homepage = 'https://github.com/tpope/pry-editline'
s.summary = 'C-x C-e to ... |
github | tpope/pry-editline | https://github.com/tpope/pry-editline | lib/pry-editline.rb | Ruby | mit | 45 | master | 2,446 | module PryEditline
def self.editor
if defined?(Pry)
Pry.editor
else
ENV.values_at('VISUAL', 'EDITOR').compact.first || 'vi'
end
end
def self.edit(file)
if defined?(Pry::Editor.invoke_editor)
Pry::Editor.invoke_editor(file, 1, true)
elsif editor.is_a?(Proc)
system(edit... |
github | ganmacs/grpc_mock | https://github.com/ganmacs/grpc_mock | grpc_mock.gemspec | Ruby | mit | 45 | master | 1,150 | # frozen_string_literal: true
lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'grpc_mock/version'
Gem::Specification.new do |spec|
spec.name = 'grpc_mock'
spec.version = GrpcMock::VERSION
spec.authors = ['Yuta Iwama']
spec.email ... |
github | ganmacs/grpc_mock | https://github.com/ganmacs/grpc_mock | lib/grpc_mock.rb | Ruby | mit | 45 | master | 600 | # frozen_string_literal: true
require 'grpc_mock/api'
require 'grpc_mock/version'
require 'grpc_mock/configuration'
require 'grpc_mock/adapter'
require 'grpc_mock/stub_registry'
module GrpcMock
extend GrpcMock::Api
class << self
def enable!
adapter.enable!
end
def disable!
adapter.disabl... |
github | ganmacs/grpc_mock | https://github.com/ganmacs/grpc_mock | lib/grpc_mock/mocked_call.rb | Ruby | mit | 45 | master | 2,776 | # frozen_string_literal: true
require 'grpc'
require 'grpc_mock/mocked_operation'
module GrpcMock
class MockedCall
attr_reader :deadline, :metadata
def initialize(metadata: {}, deadline: nil)
@metadata = sanitize_metadata(metadata)
@deadline = deadline
end
def multi_req_view
GRPC... |
github | ganmacs/grpc_mock | https://github.com/ganmacs/grpc_mock | lib/grpc_mock/response_sequence.rb | Ruby | mit | 45 | master | 604 | # frozen_string_literal: true
module GrpcMock
class ResponsesSequence
attr_accessor :repeat
def initialize(responses)
@repeat = 1
@responses = responses
@current = 0
@last = @responses.length - 1
end
def end?
@repeat == 0
end
def next
if @repeat > 0
... |
github | ganmacs/grpc_mock | https://github.com/ganmacs/grpc_mock | lib/grpc_mock/errors.rb | Ruby | mit | 45 | master | 347 | # frozen_string_literal: true
module GrpcMock
class NetConnectNotAllowedError < StandardError
def initialize(sigunature)
super("Real gRPC connections are disabled. #{sigunature} is requested")
end
end
class NoResponseError < StandardError
def initialize(msg)
super("There is no response: ... |
github | ganmacs/grpc_mock | https://github.com/ganmacs/grpc_mock | lib/grpc_mock/rspec.rb | Ruby | mit | 45 | master | 245 | # frozen_string_literal: true
require 'grpc_mock'
RSpec.configure do |config|
config.before(:suite) do
GrpcMock.enable!
end
config.after(:suite) do
GrpcMock.disable!
end
config.after(:each) do
GrpcMock.reset!
end
end |
github | ganmacs/grpc_mock | https://github.com/ganmacs/grpc_mock | lib/grpc_mock/stub_registry.rb | Ruby | mit | 45 | master | 562 | # frozen_string_literal: true
module GrpcMock
class StubRegistry
def initialize
@request_stubs = []
end
def reset!
@request_stubs = []
end
# @param stub [GrpcMock::RequestStub]
def register_request_stub(stub)
@request_stubs.unshift(stub)
stub
end
# @param pa... |
github | ganmacs/grpc_mock | https://github.com/ganmacs/grpc_mock | lib/grpc_mock/adapter.rb | Ruby | mit | 45 | master | 284 | # frozen_string_literal: true
require 'grpc_mock/grpc_stub_adapter'
module GrpcMock
class Adapter
def enable!
adapter.enable!
end
def disable!
adapter.disable!
end
private
def adapter
@adapter ||= GrpcStubAdapter.new
end
end
end |
github | ganmacs/grpc_mock | https://github.com/ganmacs/grpc_mock | lib/grpc_mock/response.rb | Ruby | mit | 45 | master | 1,019 | # frozen_string_literal: true
module GrpcMock
module Response
class ExceptionValue
def initialize(exception)
@exception = case exception
when String
StandardError.new(exception)
when Class
exception.new('Excepti... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.