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 | ruby-amqp/march_hare | https://github.com/ruby-amqp/march_hare | spec/higher_level_api/integration/exchange_bind_spec.rb | Ruby | mit | 99 | main | 1,032 | RSpec.describe MarchHare::Exchange do
let(:connection) { MarchHare.connect }
after :each do
connection.close
end
it "should bind two exchanges using exchange instances" do
ch = connection.create_channel
source = ch.fanout("march_hare.spec.exchanges.source", :auto_delete => true)
... |
github | ruby-amqp/march_hare | https://github.com/ruby-amqp/march_hare | spec/higher_level_api/integration/queue_delete_spec.rb | Ruby | mit | 99 | main | 589 | RSpec.describe "Queue" do
#
# Environment
#
let(:connection) { MarchHare.connect }
let(:channel) { connection.create_channel }
after :each do
channel.close
connection.close
end
context "that exists" do
it "can be deleted" do
q = channel.queue("")
q.delete
end
end... |
github | ruby-amqp/march_hare | https://github.com/ruby-amqp/march_hare | spec/higher_level_api/integration/tls_spec.rb | Ruby | mit | 99 | main | 618 | RSpec.describe "MarchHare.connect with TLS" do
#
# Examples
#
if !ENV["CI"] && ENV["TLS_TESTS"]
it "supports TLS w/o custom protocol or trust manager" do
c1 = MarchHare.connect(:tls => true, :port => 5671)
c1.close
end
it "supports TLS with a client key" do
c = MarchHare.connect... |
github | ruby-amqp/march_hare | https://github.com/ruby-amqp/march_hare | spec/higher_level_api/integration/queue_bind_spec.rb | Ruby | mit | 99 | main | 2,024 | RSpec.describe "A queue" do
#
# Environment
#
let(:connection) { MarchHare.connect }
after :each do
connection.close
end
#
# Examples
#
it "can be bound to amq.fanout" do
ch = connection.create_channel
x = ch.exchange("amq.fanout", :type => :fanout, :durable => true, :auto_delete ... |
github | ruby-amqp/march_hare | https://github.com/ruby-amqp/march_hare | spec/higher_level_api/integration/exchange_declaration_failure_spec.rb | Ruby | mit | 99 | main | 813 | require "rabbitmq/http/client"
RSpec.describe "Exchange declaration error handling" do
def with_open(c = MarchHare.connect(automatically_recover: false), &block)
begin
block.call(c)
ensure
c.close if c.open?
end
end
#
# Examples
#
it "does not throw Java exceptions" do
with_op... |
github | ruby-amqp/march_hare | https://github.com/ruby-amqp/march_hare | spec/higher_level_api/integration/connection_recovery_spec.rb | Ruby | mit | 99 | main | 7,114 | require "rabbitmq/http/client"
RSpec.describe "Connection recovery" do
before :all do
@connections = []
end
let(:http_client) { RabbitMQ::HTTP::Client.new("http://127.0.0.1:15672") }
let(:amqp_uri) { "amqp://localhost:5672/%2F" }
def close_all_connections!
# wait for stats to refresh, make sure to ... |
github | ruby-amqp/march_hare | https://github.com/ruby-amqp/march_hare | spec/higher_level_api/integration/queue_declare_spec.rb | Ruby | mit | 99 | main | 3,898 | RSpec.describe "Queue" do
let(:connection) { MarchHare.connect }
let(:channel) { connection.create_channel }
after :each do
channel.close
connection.close
end
it "cannot be created using a symbol as name" do
expect {
channel.queue(:not_valid_name)
}.to raise_error(ArgumentError)
e... |
github | ruby-amqp/march_hare | https://github.com/ruby-amqp/march_hare | spec/higher_level_api/integration/channel_close_spec.rb | Ruby | mit | 99 | main | 1,112 | require "spec_helper"
RSpec.describe "A channel" do
#
# Environment
#
let(:connection) { MarchHare.connect }
after :each do
connection.close
end
#
# Examples
#
context "when closed" do
it "releases the id" do
ch = connection.create_channel
n = ch.number
expect(ch).to... |
github | ruby-amqp/march_hare | https://github.com/ruby-amqp/march_hare | spec/higher_level_api/integration/queue_unbind_spec.rb | Ruby | mit | 99 | main | 1,071 | RSpec.describe "Any queue" do
#
# Environment
#
let(:connection) { MarchHare.connect }
let(:channel) { connection.create_channel }
after :each do
channel.close
connection.close
end
#
# Examples
#
it "can be unbound from amq.fanout" do
exchange = channel.exchange("amq.fanout", ... |
github | ruby-amqp/march_hare | https://github.com/ruby-amqp/march_hare | spec/higher_level_api/integration/basic_ack_spec.rb | Ruby | mit | 99 | main | 725 | RSpec.describe MarchHare::Channel, "#ack" do
let(:connection) { MarchHare.connect }
after :each do
connection.close
end
context "with a valid (known) delivery tag" do
let(:ch) { connection.create_channel }
it "acknowledges a message" do
q = ch.queue("hotbunnies.basic.ack.manual-acks", :e... |
github | ruby-amqp/march_hare | https://github.com/ruby-amqp/march_hare | spec/higher_level_api/integration/alternate_exchanges_spec.rb | Ruby | mit | 99 | main | 741 | RSpec.describe "Any exchange" do
let(:connection) { MarchHare.connect }
after :each do
connection.close
end
#
# Examples
#
it "can have an alternate exchange (a RabbitMQ-specific extension to AMQP 0.9.1)" do
ch = connection.create_channel
ch.confirm_select
q = ch.queue("", :exclusive ... |
github | ruby-amqp/march_hare | https://github.com/ruby-amqp/march_hare | spec/higher_level_api/integration/consumer_cancellation_notification_spec.rb | Ruby | mit | 99 | main | 758 | RSpec.describe "Non-blocking consumer" do
let(:connection) do
MarchHare.connect
end
after :each do
connection.close if connection.open?
end
let(:queue_name) { "basic.consume#{rand}" }
it "supports consumer cancellation notifications" do
cancelled = false
ch = connection.create_channel
... |
github | ruby-amqp/march_hare | https://github.com/ruby-amqp/march_hare | spec/higher_level_api/integration/exchange_unbind_spec.rb | Ruby | mit | 99 | main | 731 | RSpec.describe MarchHare::Exchange do
let(:connection) { MarchHare.connect }
after :each do
connection.close
end
it "unbinds two existing exchanges" do
ch = connection.create_channel
source = ch.fanout("bunny.exchanges.source#{rand}")
destination = ch.fanout("bunny.exchanges.des... |
github | ruby-amqp/march_hare | https://github.com/ruby-amqp/march_hare | spec/higher_level_api/integration/merry_go_round_spec.rb | Ruby | mit | 99 | main | 2,322 | RSpec.describe "A message that is proxied by multiple intermediate consumers" do
let(:c1) do
MarchHare.connect
end
let(:c2) do
MarchHare.connect
end
let(:c3) do
MarchHare.connect
end
let(:c4) do
MarchHare.connect
end
let(:c5) do
MarchHare.connect
end
after :each do
[c1... |
github | ruby-amqp/march_hare | https://github.com/ruby-amqp/march_hare | spec/higher_level_api/integration/sender_selected_distribution_spec.rb | Ruby | mit | 99 | main | 1,122 | RSpec.describe "Any AMQP 0.9.1 client using RabbitMQ" do
#
# Environment
#
let(:connection) { MarchHare.connect }
let(:channel) { connection.create_channel }
after :each do
channel.close
connection.close
end
#
# Examples
#
it "can have use CC and BCC headers for sender selected ro... |
github | ruby-amqp/march_hare | https://github.com/ruby-amqp/march_hare | spec/higher_level_api/integration/basic_cancel_spec.rb | Ruby | mit | 99 | main | 2,958 | RSpec.describe 'A consumer' do
let(:connection) { MarchHare.connect }
after :each do
connection.close
end
context "that does not block the caller" do
it 'receives messages until cancelled' do
x = connection.create_channel.default_exchange
q = connection.create_channel.queue("", :exclusiv... |
github | ruby-amqp/march_hare | https://github.com/ruby-amqp/march_hare | spec/higher_level_api/integration/message_metadata_access_spec.rb | Ruby | mit | 99 | main | 6,744 | RSpec.describe "A consumer" do
let(:connection) { MarchHare.connect }
let(:channel) { connection.create_channel }
after :each do
channel.close
connection.close
end
it "can access message metadata (both message properties and delivery information)" do
latch = java.util.concurrent.CountDownL... |
github | ruby-amqp/march_hare | https://github.com/ruby-amqp/march_hare | spec/higher_level_api/integration/connection_spec.rb | Ruby | mit | 99 | main | 4,688 | java_import java.util.concurrent.CountDownLatch
java_import java.util.concurrent.TimeUnit
RSpec.describe "MarchHare.connect" do
#
# Examples
#
it "lets you specify requested heartbeat interval" do
c = MarchHare.connect(requested_heartbeat: 10)
c.close
end
it "lets you specify connection timeout ... |
github | ruby-amqp/march_hare | https://github.com/ruby-amqp/march_hare | spec/higher_level_api/integration/exchange_declare_spec.rb | Ruby | mit | 99 | main | 3,300 | RSpec.describe "Direct exchange" do
let(:connection) { MarchHare.connect }
let(:channel) { connection.create_channel }
after :each do
channel.close
connection.close
end
it "can be declared" do
exchange = channel.exchange("march.hare.exchanges.direct1", :type => :direct)
queue = channel... |
github | ruby-amqp/march_hare | https://github.com/ruby-amqp/march_hare | spec/higher_level_api/integration/basic_reject_spec.rb | Ruby | mit | 99 | main | 1,209 | RSpec.describe MarchHare::Channel, "#reject" do
let(:connection) { MarchHare.connect }
after :each do
connection.close
end
context "with a valid (known) delivery tag" do
let(:ch) { connection.create_channel }
context "with requeue = true" do
it "requeues a message" do
q = ch.queu... |
github | ruby-amqp/march_hare | https://github.com/ruby-amqp/march_hare | spec/higher_level_api/integration/publisher_confirmations_spec.rb | Ruby | mit | 99 | main | 810 | RSpec.describe "Any channel" do
#
# Environment
#
let(:connection) { MarchHare.connect }
after :each do
connection.close
end
#
# Examples
#
it "can use publisher confirmations" do
ch = connection.create_channel
q = ch.queue("", :exclusive => true)
ch.confirm_select
ch.def... |
github | ruby-amqp/march_hare | https://github.com/ruby-amqp/march_hare | spec/higher_level_api/integration/basic_consume_spec.rb | Ruby | mit | 99 | main | 5,324 | RSpec.describe "A consumer" do
let(:connection) { MarchHare.connect }
after :each do
connection.close
end
it "provides predicates" do
ch = connection.create_channel
q = ch.queue("", :exclusive => true)
consumer = q.subscribe(:blocking => false) { |_, _| nil }
# consumer tag ... |
github | ruby-amqp/march_hare | https://github.com/ruby-amqp/march_hare | spec/higher_level_api/integration/queue_purge_spec.rb | Ruby | mit | 99 | main | 713 | RSpec.describe "Any queue" do
#
# Environment
#
let(:connection) { MarchHare.connect }
let(:channel) { connection.create_channel }
after :each do
channel.close
connection.close
end
#
# Examples
#
it "can be purged" do
exchange = channel.exchange("amq.fanout", :type => :fanout,... |
github | ruby-amqp/march_hare | https://github.com/ruby-amqp/march_hare | spec/higher_level_api/integration/exchange_publish_spec.rb | Ruby | mit | 99 | main | 605 | RSpec.describe MarchHare::Exchange do
let(:connection) { MarchHare.connect }
after do
connection.close
end
it 'allows a message timestamp to be included when publishing a message' do
ch = connection.create_channel
ch.confirm_select
queue = ch.queue('publish_spec', exclusive: true)
timestam... |
github | garethrees/readingtime | https://github.com/garethrees/readingtime | readingtime.gemspec | Ruby | mit | 99 | master | 999 | # -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "readingtime/version"
Gem::Specification.new do |s|
s.name = "readingtime"
s.version = Readingtime::VERSION
s.authors = ["Gareth Rees"]
s.email = ["gareth@garethrees.co.uk"]
s.homepage = "http://github.com/... |
github | garethrees/readingtime | https://github.com/garethrees/readingtime | lib/readingtime.rb | Ruby | mit | 99 | master | 1,397 | # encoding: utf-8
Dir[File.dirname(__FILE__) + '/readingtime/*.rb'].each do |file|
require file
end
module Readingtime
class << self
attr_accessor :configuration
end
def self.configure
yield(configuration)
end
def self.configuration
@configuration ||= Configuration.new
end
def self.readi... |
github | garethrees/readingtime | https://github.com/garethrees/readingtime | lib/readingtime/calculator.rb | Ruby | mit | 99 | master | 1,918 | # encoding: utf-8
module Readingtime
class Calculator
attr_reader :reading_speed
def initialize(opts = {})
@reading_speed = opts[:reading_speed] || 200
end
def reading_time(words, opts = {})
format_options = opts[:format] || :basic
word_size = calculate_size(words)
minutes =... |
github | garethrees/readingtime | https://github.com/garethrees/readingtime | lib/readingtime/core_ext.rb | Ruby | mit | 99 | master | 318 | # encoding: utf-8
String.class_eval do
def reading_time(options = {})
calculator = options[:calculator] || Readingtime::Calculator.new
format_options = options[:format] || :basic
calculator.reading_time(self, :format => format_options)
end
def calculate_size
self.scan(/(\w|-)+/).size
end
end |
github | garethrees/readingtime | https://github.com/garethrees/readingtime | spec/readingtime_spec.rb | Ruby | mit | 99 | master | 3,183 | # encoding: utf-8
path = File.expand_path(File.dirname(__FILE__) + "/../lib/")
$LOAD_PATH.unshift(path) unless $LOAD_PATH.include?(path)
require "readingtime"
describe Readingtime do
let(:two_hundred_words) { ("Lorem " * 200) }
let(:three_hundred_words) { ("Lorem " * 300) }
let(:ten_words) { ("Lorem " * 10) }
... |
github | garethrees/readingtime | https://github.com/garethrees/readingtime | spec/readingtime/calculator_spec.rb | Ruby | mit | 99 | master | 3,878 | # encoding: utf-8
path = File.expand_path(File.dirname(__FILE__) + "/../../lib/")
$LOAD_PATH.unshift(path) unless $LOAD_PATH.include?(path)
require "readingtime"
describe Readingtime::Calculator do
let(:two_hundred_words) { ("Lorem " * 200) }
let(:three_hundred_words) { ("Lorem " * 300) }
let(:ten_words) { ("Lor... |
github | garethrees/readingtime | https://github.com/garethrees/readingtime | spec/readingtime/configuration_spec.rb | Ruby | mit | 99 | master | 612 | # encoding: utf-8
path = File.expand_path(File.dirname(__FILE__) + "/../../lib/")
$LOAD_PATH.unshift(path) unless $LOAD_PATH.include?(path)
require "readingtime"
describe Readingtime::Configuration do
describe '.new' do
it 'sets the default reading_speed' do
subject.reading_speed.should == 200
end
e... |
github | flazz/semver | https://github.com/flazz/semver | semver2.gemspec | Ruby | mit | 99 | master | 563 | $:.push File.expand_path("../lib", __FILE__)
require 'semver'
Gem::Specification.new do |spec|
spec.name = "semver2"
spec.version = SemVer.find.format '%M.%m.%p'
spec.summary = "Semantic Versioning"
spec.description = "maintain versions as per http://semver.org"
spec.email = "henrik@haf.se"
spec.authors = ... |
github | flazz/semver | https://github.com/flazz/semver | spec/semver_spec.rb | Ruby | mit | 99 | master | 1,488 | require 'semver'
require 'tempfile'
describe SemVer do
it "should compare against another version versions" do
v1 = SemVer.new 0,1,0
v2 = SemVer.new 0,1,1
v1.should < v2
end
it "should serialize to and from a file" do
tf = Tempfile.new 'semver.spec'
path = tf.path
tf.close!
v1 = Se... |
github | flazz/semver | https://github.com/flazz/semver | lib/semver.rb | Ruby | mit | 99 | master | 2,481 | require 'yaml'
require 'semver/semvermissingerror'
class SemVer
FILE_NAME = '.semver'
TAG_FORMAT = 'v%M.%m.%p%s'
def SemVer.find dir=nil
v = SemVer.new
f = SemVer.find_file dir
v.load f
v
end
def SemVer.find_file dir=nil
dir ||= Dir.pwd
raise "#{dir} is not a directory" unless File... |
github | sous-chefs/ark | https://github.com/sous-chefs/ark | metadata.rb | Ruby | apache-2.0 | 99 | main | 717 | name 'ark'
maintainer 'Sous Chefs'
maintainer_email 'help@sous-chefs.org'
license 'Apache-2.0'
description 'Provides a custom resource for installing runtime artifacts in a predictable fashion'
version '6.0.33'
source_url 'https://github.com/sous-chefs/ark'
issues_u... |
github | sous-chefs/ark | https://github.com/sous-chefs/ark | spec/spec_helper.rb | Ruby | apache-2.0 | 99 | main | 3,111 | require 'ostruct'
require 'chefspec'
require 'chefspec/berkshelf'
RSpec.configure do |config|
config.color = true
config.alias_example_group_to :describe_recipe, type: :recipe
config.alias_example_group_to :describe_helpers, type: :helpers
config.alias_example_group_to :describe_resource, type: :resource
con... |
github | sous-chefs/ark | https://github.com/sous-chefs/ark | spec/libraries/resource_defaults_spec.rb | Ruby | apache-2.0 | 99 | main | 7,231 | require 'spec_helper'
require './libraries/default'
describe Ark::ResourceDefaults do
before(:each) do
allow_any_instance_of(Ark::ResourceDefaults).to receive(:file_cache_path).and_return('/var/chef/cache')
end
describe '#extension' do
it 'returns the extension parameter specified on the resource' do
... |
github | sous-chefs/ark | https://github.com/sous-chefs/ark | spec/libraries/tar_command_builder_spec.rb | Ruby | apache-2.0 | 99 | main | 2,098 | require 'spec_helper'
require './libraries/default'
describe Ark::TarCommandBuilder do
let(:subject) { described_class.new(resource) }
let(:resource) do
double(release_file: 'release_file',
creates: 'creates',
path: 'path',
strip_components: 1,
extension: 'tar.gz')
... |
github | sous-chefs/ark | https://github.com/sous-chefs/ark | spec/libraries/general_owner_spec.rb | Ruby | apache-2.0 | 99 | main | 400 | require 'spec_helper'
require './libraries/default'
describe Ark::GeneralOwner do
let(:subject) { described_class.new(resource) }
let(:resource) do
double(owner: 'owner',
group: 'group',
path: '/resource/path')
end
it 'generates the correct command for windows file ownership' do
... |
github | sous-chefs/ark | https://github.com/sous-chefs/ark | spec/libraries/unzip_command_builder_spec.rb | Ruby | apache-2.0 | 99 | main | 1,711 | require 'spec_helper'
require './libraries/default'
describe Ark::UnzipCommandBuilder do
let(:subject) { described_class.new(resource) }
let(:resource) do
double(release_file: 'release_file',
creates: 'creates',
path: 'path',
strip_components: 0)
end
describe '#unpack' do... |
github | sous-chefs/ark | https://github.com/sous-chefs/ark | spec/libraries/default_spec.rb | Ruby | apache-2.0 | 99 | main | 9,364 | require 'spec_helper'
require './libraries/default'
describe_helpers Ark::ProviderHelpers do
before(:each) do
allow_any_instance_of(Ark::ResourceDefaults).to receive(:file_cache_path).and_return('/var/chef/cache')
allow(ENV).to receive(:fetch).and_call_original
allow(ENV).to receive(:fetch).with('SystemR... |
github | sous-chefs/ark | https://github.com/sous-chefs/ark | spec/libraries/sevenzip_command_builder_spec.rb | Ruby | apache-2.0 | 99 | main | 2,151 | require 'spec_helper'
require './libraries/default'
describe Ark::SevenZipCommandBuilder do
let(:subject) { described_class.new(resource) }
let(:resource) do
double(release_file: 'release_file',
creates: 'creates',
path: 'path',
home_dir: 'home_dir',
strip_component... |
github | sous-chefs/ark | https://github.com/sous-chefs/ark | spec/libraries/windows_owner_spec.rb | Ruby | apache-2.0 | 99 | main | 590 | require 'spec_helper'
require './libraries/default'
describe Ark::WindowsOwner do
let(:subject) { described_class.new(resource) }
let(:resource) { double(path: 'c:\\resource with spaces\\path', owner: 'the new owner') }
before(:each) do
allow(ENV).to receive(:fetch).and_call_original
allow(ENV).to rece... |
github | sous-chefs/ark | https://github.com/sous-chefs/ark | spec/resources/default_spec.rb | Ruby | apache-2.0 | 99 | main | 18,595 | require 'spec_helper'
require './libraries/default'
describe_resource 'ark' do
describe 'install' do
let(:example_recipe) { 'ark_spec::install' }
it 'installs' do
expect(chef_run).to install_ark('test_install')
expect(chef_run).to create_directory('/usr/local/test_install-2')
resource = c... |
github | sous-chefs/ark | https://github.com/sous-chefs/ark | spec/recipes/default_spec.rb | Ruby | apache-2.0 | 99 | main | 913 | require 'spec_helper'
describe_recipe 'ark::default' do
platform 'ubuntu'
it 'installs core packages' do
expect(chef_run).to install_package(%w(libtool autoconf make unzip rsync gcc autogen shtool pkg-config))
end
it 'does not install the gcc-c++ package' do
expect(chef_run).not_to install_package('g... |
github | sous-chefs/ark | https://github.com/sous-chefs/ark | spec/recipes/debian/default_spec.rb | Ruby | apache-2.0 | 99 | main | 265 | require 'spec_helper'
describe_recipe 'ark::default' do
def node_attributes
{ platform: 'debian' }
end
it 'installs core packages' do
expect(chef_run).to install_package(%w(libtool autoconf make unzip rsync gcc autogen shtool pkg-config))
end
end |
github | sous-chefs/ark | https://github.com/sous-chefs/ark | spec/recipes/fedora/default_spec.rb | Ruby | apache-2.0 | 99 | main | 264 | require 'spec_helper'
describe_recipe 'ark::default' do
def node_attributes
{ platform: 'fedora' }
end
it 'installs core packages' do
expect(chef_run).to install_package(%w(libtool autoconf make unzip rsync gcc xz-lzma-compat bzip2 tar))
end
end |
github | sous-chefs/ark | https://github.com/sous-chefs/ark | spec/recipes/freebsd/default_spec.rb | Ruby | apache-2.0 | 99 | main | 254 | require 'spec_helper'
describe_recipe 'ark::default' do
def node_attributes
{ platform: 'freebsd' }
end
it 'installs core packages' do
expect(chef_run).to install_package(%w(libtool autoconf unzip rsync gcc autogen gtar gmake))
end
end |
github | sous-chefs/ark | https://github.com/sous-chefs/ark | spec/recipes/centos/default_spec.rb | Ruby | apache-2.0 | 99 | main | 522 | require 'spec_helper'
describe_recipe 'ark::default' do
def node_attributes
{ platform: 'centos', version: '6' }
end
it 'installs core packages' do
expect(chef_run).to install_package(%w(libtool autoconf make unzip rsync gcc xz-lzma-compat bzip2 tar))
end
end
describe_recipe 'ark::default' do
def n... |
github | sous-chefs/ark | https://github.com/sous-chefs/ark | spec/recipes/ubuntu/default_spec.rb | Ruby | apache-2.0 | 99 | main | 265 | require 'spec_helper'
describe_recipe 'ark::default' do
def node_attributes
{ platform: 'ubuntu' }
end
it 'installs core packages' do
expect(chef_run).to install_package(%w(libtool autoconf make unzip rsync gcc autogen shtool pkg-config))
end
end |
github | sous-chefs/ark | https://github.com/sous-chefs/ark | spec/recipes/suse/default_spec.rb | Ruby | apache-2.0 | 99 | main | 254 | require 'spec_helper'
describe_recipe 'ark::default' do
def node_attributes
{ platform: 'opensuse' }
end
it 'installs core packages' do
expect(chef_run).to install_package(%w(libtool autoconf make unzip rsync gcc xz bzip2 tar))
end
end |
github | sous-chefs/ark | https://github.com/sous-chefs/ark | resources/default.rb | Ruby | apache-2.0 | 99 | main | 15,240 | #
# Cookbook:: ark
# Resource:: Ark
#
# Author:: Bryan W. Berry <bryan.berry@gmail.com>
# Copyright:: 2012-2017, Bryan W. Berry
# Copyright:: 2016-2017, Chef Software Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... |
github | sous-chefs/ark | https://github.com/sous-chefs/ark | attributes/default.rb | Ruby | apache-2.0 | 99 | main | 1,800 | #
# Cookbook:: ark
# Attributes:: default
#
#
# 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 required by applicable law or agreed ... |
github | sous-chefs/ark | https://github.com/sous-chefs/ark | recipes/default.rb | Ruby | apache-2.0 | 99 | main | 823 | #
# Cookbook:: ark
# Recipe:: default
#
# Author:: Bryan W. Berry <bryan.berry@gmail.com>
# Copyright:: 2012-2017, Bryan W. Berry
#
# 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:... |
github | sous-chefs/ark | https://github.com/sous-chefs/ark | libraries/default.rb | Ruby | apache-2.0 | 99 | main | 3,384 | require_relative 'platform_specific_builders'
require_relative 'resource_deprecations'
require_relative 'resource_defaults'
require_relative 'sevenzip_command_builder'
require_relative 'unzip_command_builder'
require_relative 'tar_command_builder'
require_relative 'general_owner'
require_relative 'windows_owner'
modul... |
github | sous-chefs/ark | https://github.com/sous-chefs/ark | libraries/sevenzip_command_builder.rb | Ruby | apache-2.0 | 99 | main | 2,277 | module Ark
class SevenZipCommandBuilder
def unpack
sevenzip_command
end
def dump
sevenzip_command_builder(resource.path, 'e')
end
def cherry_pick
"#{sevenzip_command_builder(resource.path, 'x')} -r #{resource.creates}"
end
def initialize(resource)
@resource = res... |
github | sous-chefs/ark | https://github.com/sous-chefs/ark | libraries/tar_command_builder.rb | Ruby | apache-2.0 | 99 | main | 1,535 | module Ark
class TarCommandBuilder
def unpack
"#{tar_binary} #{args} #{resource.release_file}#{strip_args}"
end
def dump
"tar -mxf \"#{resource.release_file}\" -C \"#{resource.path}\""
end
def cherry_pick
"#{tar_binary} #{args} #{resource.release_file} -C #{resource.path}#{stri... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | xcode-archive-cache.gemspec | Ruby | mit | 99 | master | 666 | Gem::Specification.new do |spec|
spec.name = "xcode-archive-cache"
spec.version = "0.0.13"
spec.files = Dir.glob("lib/**/*")
spec.executables = "xcode-archive-cache"
spec.authors = "Ilya Dyakonov"
spec.license = "MIT"
spec.homepage = "https://github.com/sweatco/xcode-archive-cache"
spec.summary = "Nati... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/xcode-archive-cache.rb | Ruby | mit | 99 | master | 1,563 | require 'zip'
require 'pathname'
require 'fileutils'
require 'logger'
require 'tempfile'
require 'find'
require 'digest'
require 'xcodeproj'
require 'open3'
require 'claide'
require 'logs/logs'
require 'command/command'
require 'command/inject'
require 'config/dsl'
require 'config/config'
require 'build_graph/graph... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/build_settings/filter.rb | Ruby | mit | 99 | master | 8,515 | module XcodeArchiveCache
module BuildSettings
class Filter
# @param [Hash{String => String}] settings
#
# @return [Hash{String => String}]
#
# Meaningful settings affecting build result
# Machine-dependent settings i.e. paths, user names, group names are rejected
#
... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/build_settings/parser.rb | Ruby | mit | 99 | master | 2,524 | module XcodeArchiveCache
module BuildSettings
class SettingEntry
attr_reader :name
attr_reader :modifiers
attr_reader :full_string
def initialize(name, modifiers, full_string)
@name = name
@modifiers = modifiers
@full_string = full_string
end
end
cla... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/build_settings/loader.rb | Ruby | mit | 99 | master | 3,361 | module XcodeArchiveCache
module BuildSettings
PRODUCT_NAME_KEY = "PRODUCT_NAME".freeze
TARGET_NAME_KEY = "TARGET_NAME".freeze
FULL_PRODUCT_NAME_KEY = "FULL_PRODUCT_NAME".freeze
DWARF_DSYM_FILE_NAME_KEY = "DWARF_DSYM_FILE_NAME".freeze
MODULEMAP_FILE_KEY = "MODULEMAP_FILE".freeze
SWIFT_OBJC_INT... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/build_settings/string_interpolator.rb | Ruby | mit | 99 | master | 1,103 | module XcodeArchiveCache
module BuildSettings
class StringInterpolator
def initialize
@parser = Parser.new
end
# @param [String] string
# @param [Container] build_settings
#
# @return [String]
#
def interpolate(string, build_settings)
return nil if... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/build_settings/extractor.rb | Ruby | mit | 99 | master | 3,061 | module XcodeArchiveCache
module BuildSettings
class Extractor
def initialize
@parser = Parser.new
@filter = Filter.new
end
# @param [String] build_settings
# Raw `xcodebuild -alltargets -showBuildSettings` output
#
# @return [Hash{String => Container}]
... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/logs/logs.rb | Ruby | mit | 99 | master | 941 | module XcodeArchiveCache
module Logs
private
COMMON_LOGGER = Logger.new(STDOUT)
COMMON_LOGGER.formatter = proc do |_, _, _, msg|
"#{msg}\n"
end
ERROR_LOGGER = Logger.new(STDERR)
ERROR_LOGGER.formatter = COMMON_LOGGER.formatter
public
def set_log_level(level)
case level... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/runner/runner.rb | Ruby | mit | 99 | master | 6,408 | module XcodeArchiveCache
class Runner
include XcodeArchiveCache::Logs
# @param [XcodeArchiveCache::Config::Entry] config
#
def initialize(config)
@config = config
projects = list_projects
@native_target_finder = XcodeArchiveCache::BuildGraph::NativeTargetFinder.new(projects, confi... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/injection/build_flags_changer.rb | Ruby | mit | 99 | master | 12,126 | module XcodeArchiveCache
module Injection
class BuildFlagsChanger
include XcodeArchiveCache::Logs
# @param [Xcodeproj::Project::Object::XCBuildConfiguration] build_configuration
# @param [String] path
#
def replace_or_add_framework_search_path(build_configuration, target_name, path... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/injection/injector.rb | Ruby | mit | 99 | master | 10,111 | module XcodeArchiveCache
module Injection
class Injector
include XcodeArchiveCache::Logs
# @param [String] configuration_name
# @param [XcodeArchiveCache::Injection::Storage] storage
#
def initialize(configuration_name, storage)
@configuration_name = configuration_name
... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/injection/storage.rb | Ruby | mit | 99 | master | 4,602 | module XcodeArchiveCache
module Injection
class Storage
# @return [String]
#
attr_reader :container_dir_path
# @return [Hash{XcodeArchiveCache::BuildGraph::Node => String}]
#
attr_reader :headers_storage_dir_paths
# @param [String] path
#
def initialize(pat... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/injection/dependency_remover.rb | Ruby | mit | 99 | master | 6,182 | module XcodeArchiveCache
module Injection
class DependencyRemover
include XcodeArchiveCache::Logs
# @param [XcodeArchiveCache::BuildGraph::Node] prebuilt_node
# @param [Xcodeproj::Project::Object::PBXNativeTarget] dependent_target
#
def remove_dependency(prebuilt_node, dependent_ta... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/injection/pods_script_fixer.rb | Ruby | mit | 99 | master | 2,641 | module XcodeArchiveCache
module Injection
class PodsScriptFixer
include XcodeArchiveCache::Logs
# @param [XcodeArchiveCache::Injection::Storage] storage
#
def initialize(storage)
@storage = storage
@build_settings_interpolator = XcodeArchiveCache::BuildSettings::StringInt... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/injection/framework_embedder.rb | Ruby | mit | 99 | master | 1,895 | module XcodeArchiveCache
module Injection
class FrameworkEmbedder
include XcodeArchiveCache::Logs
def initialize
@shell_executor = XcodeArchiveCache::Shell::Executor.new
end
# @param [Array<String>] framework_file_paths
# @param [Xcodeproj::Project::Object::PBXNativeTarget... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/injection/pods_xcframework_fixer.rb | Ruby | mit | 99 | master | 4,330 | module XcodeArchiveCache
module Injection
class PodsXCFrameworkFixer
include XcodeArchiveCache::Logs
# @param [XcodeArchiveCache::Injection::Storage] storage
# @param [XcodeArchive::BuildGraph::NativeTargetFinder] native_target_finder
# @param [String] configuration_name
#
de... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/injection/headers_mover.rb | Ruby | mit | 99 | master | 3,086 | module XcodeArchiveCache
module Injection
class HeadersMover
include XcodeArchiveCache::Logs
# @param [Storage] storage
#
def initialize(storage)
@storage = storage
@build_settings_interpolator = XcodeArchiveCache::BuildSettings::StringInterpolator.new
@modulemap_... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/extensions/target.rb | Ruby | mit | 99 | master | 1,763 | module TargetEqualityCheck
# @return [String]
#
def equatable_identifier
uuid + display_name
end
end
module BuildConfigurationSearch
# @param [String] configuration_name
#
# @return [Xcodeproj::Project::Object::XCBuildConfiguration]
#
def find_build_configuration(configuration_name, raise_if_not_... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/extensions/build_configuration.rb | Ruby | mit | 99 | master | 435 | module XCConfigExtensions
# @return [Bool]
#
def has_xcconfig?
base_configuration_reference != nil
end
# @return [String]
#
def get_xcconfig_path
base_configuration_reference.real_path
end
end
module ProjectDir
# @return [String]
#
def get_project_dir
File.dirname(project.path)
end... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/shell/executor.rb | Ruby | mit | 99 | master | 1,994 | module XcodeArchiveCache
module Shell
class Executor
# @param [String] command
# @param [Boolean] print_command
#
# @return [String]
#
def execute_for_output(command, print_command = false)
actual_command = extend_for_pipefail(command, print_command)
output, st... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/xcodebuild/executor.rb | Ruby | mit | 99 | master | 4,704 | module XcodeArchiveCache
module Xcodebuild
ARCHIVE_ACTION = "archive"
GENERIC_DESTINATION = "generic"
class Executor
# @return [String]
#
attr_reader :arguments_state
# @param [String] configuration
# @param [String] platform
# @param [String] destination
# @pa... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/command/command.rb | Ruby | mit | 99 | master | 1,042 | module XcodeArchiveCache
class Command < CLAide::Command
include XcodeArchiveCache::Logs
self.abstract_command = true
self.command = "xcode-archive-cache"
self.description = "XcodeArchiveCache, cache for Xcode archive action"
def self.options
[
["--log-level=[nothing|info|verbos... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/command/inject.rb | Ruby | mit | 99 | master | 1,655 | module XcodeArchiveCache
class Command
class Inject < Command
include XcodeArchiveCache::Logs
self.description = "Setup workspace or project for being built using cached dependencies"
def self.options
[
["--cachefile=/path/to/Cachefile", "Explicit Cachefile location, defau... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/modulemap/header_path_extractor.rb | Ruby | mit | 99 | master | 1,669 | module XcodeArchiveCache
module Modulemap
class HeaderPathDeclaration
# @return [String]
#
attr_reader :type
# @return [String]
#
attr_reader :path
# @param [String] type
# @param [String] path
#
def initialize(type, path)
@type = type
... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/modulemap/file_handler.rb | Ruby | mit | 99 | master | 501 | module XcodeArchiveCache
module Modulemap
class FileHandler
# @param [String] modulemap_path
#
# @return [Array<String>]
#
def read_modulemap_lines(modulemap_path)
File.read(modulemap_path).split("\n")
end
# @param [Array<String>] lines
# @param [String] mo... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/modulemap/header_path_fixer.rb | Ruby | mit | 99 | master | 2,273 | module XcodeArchiveCache
module Modulemap
class HeaderPathFixer
include XcodeArchiveCache::Logs
# @param [Storage] storage
#
def initialize(storage)
@storage = storage
@header_path_extractor = HeaderPathExtractor.new
end
# @param [XcodeArchiveCache::BuildGrap... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/artifact_cache/local_storage.rb | Ruby | mit | 99 | master | 2,202 | module XcodeArchiveCache
module ArtifactCache
class LocalStorage < AbstractStorage
# @param [String] cache_dir_path
#
def initialize(cache_dir_path)
@cache_dir_path = cache_dir_path
@archiver = Archiver.new
end
# @param [XcodeArchiveCache::BuildGraph::Node] node
... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/artifact_cache/artifact_extractor.rb | Ruby | mit | 99 | master | 772 | module XcodeArchiveCache
module ArtifactCache
class ArtifactExtractor
# @param [XcodeArchiveCache::ArtifactCache::AbstractStorage] storage
#
def initialize(storage)
@storage = storage
@archiver = Archiver.new
end
# @param [XcodeArchiveCache::BuildGraph::Node] node
... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/artifact_cache/abstract_storage.rb | Ruby | mit | 99 | master | 345 | module XcodeArchiveCache
module ArtifactCache
class AbstractStorage
# @param [XcodeArchiveCache::BuildGraph::Node] node
#
# @return [String] cached artifact path, nil if no cached artifact found
#
def cached_artifact_path(node)
nil
end
def store(node, path)
... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/artifact_cache/archiver.rb | Ruby | mit | 99 | master | 3,292 | module XcodeArchiveCache
module ArtifactCache
class Archiver
include XcodeArchiveCache::Logs
# @param [String] path
# @param [String] destination
#
def archive(path, destination)
if File.exists?(destination)
warn "Replacing artifact archive at path #{destination}"... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/build_graph/builder.rb | Ruby | mit | 99 | master | 5,158 | module XcodeArchiveCache
module BuildGraph
class Builder
include XcodeArchiveCache::Logs
# @param [XcodeArchiveCache::Xcodebuild::Executor] xcodebuild_executor
#
def initialize(native_target_finder, build_settings_loader)
@build_settings_loader = build_settings_loader
@na... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/build_graph/native_target_finder.rb | Ruby | mit | 99 | master | 8,820 | module XcodeArchiveCache
module BuildGraph
class NativeTargetFinder
# @param [Array<Xcodeproj::Project>] projects
# @param [String] build_configuration_name
#
def initialize(projects, build_configuration_name)
@all_targets = extract_targets(projects)
@build_configuration_n... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/build_graph/graph.rb | Ruby | mit | 99 | master | 1,038 | module XcodeArchiveCache
module BuildGraph
class Graph
# @return [Array<Node>] graph nodes
#
attr_reader :nodes
# @return [Xcodeproj::Project] project
#
attr_reader :project
# @return [XcodeArchiveCache::BuildSettings::Container] root target build settings
#
... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/build_graph/rebuild_evaluator.rb | Ruby | mit | 99 | master | 1,895 | module XcodeArchiveCache
module BuildGraph
class RebuildEvaluator
# @param [XcodeArchiveCache::ArtifactCache::AbstractStorage] cache_storage
#
def initialize(cache_storage)
@cache_storage = cache_storage
end
# @param [XcodeArchiveCache::BuildGraph::Graph] graph
#
... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/build_graph/node.rb | Ruby | mit | 99 | master | 5,262 | module XcodeArchiveCache
module BuildGraph
class Node
# @return [String] native target display name
#
attr_reader :name
# @return [Boolean]
#
attr_reader :is_root
# @return [Symbol] should target be rebuilt
#
attr_accessor :state
# @return [String] s... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/build_graph/sha_calculator.rb | Ruby | mit | 99 | master | 3,312 | module XcodeArchiveCache
module BuildGraph
class NodeShaCalculator
def initialize
@own_sha = calculate_own_sources_sha
end
# @param [XcodeArchiveCache::BuildGraph::Node] node
#
def calculate(node)
return if node.sha
dependency_shas = []
node.depende... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/build/product_extractor.rb | Ruby | mit | 99 | master | 6,890 | module XcodeArchiveCache
module Build
class ProductExtractor
include XcodeArchiveCache::Logs
# @param [String] configuration
# @param [String] derived_data_path
#
def initialize(configuration, derived_data_path)
@configuration = configuration
@derived_data_path = de... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/build/performer.rb | Ruby | mit | 99 | master | 1,800 | module XcodeArchiveCache
module Build
class Performer
include XcodeArchiveCache::Logs
# @param [String] derived_data_path
#
def initialize(xcodebuild_executor, derived_data_path, workspace_path=nil)
@xcodebuild_executor = xcodebuild_executor
@derived_data_path = derived_d... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/config/dsl.rb | Ruby | mit | 99 | master | 1,364 | module XcodeArchiveCache
class Config
module DSL
# @param [String] name
#
def workspace(name)
self.entry = Workspace.new(name)
yield
end
# @param [String] name
#
def project(name)
self.entry = Project.new(name)
yield
end
# ... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | lib/config/config.rb | Ruby | mit | 99 | master | 4,073 | module XcodeArchiveCache
class Config
include XcodeArchiveCache::Config::DSL
class Entry
# @return [String]
#
attr_reader :name
# @return [Array<Configuration>]
#
attr_reader :configurations
# @return [String]
#
attr_accessor :active_configuration_nam... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | spec/spec_helper.rb | Ruby | mit | 99 | master | 461 | require 'pathname'
ROOT = Pathname.new(File.expand_path('../../', __FILE__))
$LOAD_PATH.unshift((ROOT + 'lib').to_s)
require 'xcode-archive-cache'
RSpec.configure do |config|
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end
config.mock... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | spec/build_graph/graph_spec.rb | Ruby | mit | 99 | master | 823 | RSpec.describe XcodeArchiveCache::BuildGraph::Graph, "#graph" do
before :each do
@graph = XcodeArchiveCache::BuildGraph::Graph.new(nil)
first_target = Xcodeproj::Project::Object::PBXNativeTarget.new(nil, "first_node_uuid")
@first_node = XcodeArchiveCache::BuildGraph::Node.new("first_node", first_target)
... |
github | sweatco/xcode-archive-cache | https://github.com/sweatco/xcode-archive-cache | spec/build_graph/native_target_finder_spec.rb | Ruby | mit | 99 | master | 8,879 | RSpec.describe XcodeArchiveCache::BuildGraph::NativeTargetFinder, "#find" do
describe "valid searches" do
before :each do
@project = double("project")
allow(@project).to receive(:path).and_return("/project")
@first_native_target = double("first_native_target")
@first_product_ref = double(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.