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 | rwz/mock5 | https://github.com/rwz/mock5 | spec/mock5_api_spec.rb | Ruby | mit | 298 | master | 1,992 | require "mock5/api"
require "rack/mock"
describe Mock5::Api do
describe "#endpoint" do
it "matches all by default" do
expect(subject.endpoint).to eq(/.*/)
end
it "can be specified as a regex" do
api = described_class.new(/foo/)
expect(api.endpoint).to eq(/foo/)
end
it "can be ... |
github | rwz/mock5 | https://github.com/rwz/mock5 | spec/mock5_spec.rb | Ruby | mit | 298 | master | 6,007 | require "mock5"
describe Mock5 do
describe ".mock" do
it "creates an Api" do
expect(described_class::Api).to receive(:new).with(/foo/).and_yield
described_class.mock /foo/ do
# mock definition goes here
end
end
it "returns an Api" do
expect(described_class.mock).to be_kin... |
github | rwz/mock5 | https://github.com/rwz/mock5 | lib/mock5.rb | Ruby | mit | 298 | master | 3,740 | require "set"
# The main module of the gem, exposing all API management methods.
# Can be included into class.
module Mock5
extend self
autoload :VERSION, "mock5/version"
autoload :Api, "mock5/api"
# Returns a set of currently mounted APIs
#
# @return [Set] a list of currently mounted APIs
def mounted_... |
github | rwz/mock5 | https://github.com/rwz/mock5 | lib/mock5/api.rb | Ruby | mit | 298 | master | 2,346 | require "uri"
require "sinatra"
require "webmock"
module Mock5
# A class representing an API mock
class Api
# @return [Sinatra::Base] a Sinatra app mocking the API
attr_reader :app
# @return [Regexp] a regexp to match the API request urls
attr_reader :endpoint
# Returns an instance of +Mock5... |
github | jeremyevans/ruby-warning | https://github.com/jeremyevans/ruby-warning | Rakefile | Ruby | mit | 298 | master | 1,293 | require "rake"
require "rake/clean"
CLEAN.include ["warning-*.gem", "rdoc"]
desc "Build warning gem"
task :package=>[:clean] do |p|
sh %{#{FileUtils::RUBY} -S gem build warning.gemspec}
end
### Specs
desc "Run tests"
task :test do
sh "#{FileUtils::RUBY} -w #{'-W:strict_unused_block' if RUBY_VERSION >= '3.4'} te... |
github | jeremyevans/ruby-warning | https://github.com/jeremyevans/ruby-warning | warning.gemspec | Ruby | mit | 298 | master | 1,418 | spec = Gem::Specification.new do |s|
s.name = 'warning'
s.version = '1.5.0'
s.platform = Gem::Platform::RUBY
s.extra_rdoc_files = ["README.rdoc", "CHANGELOG", "MIT-LICENSE"]
s.rdoc_options += ["--quiet", "--line-numbers", "--inline-source", '--title', 'ruby-warning: Add custom processing for warnings', '--mai... |
github | jeremyevans/ruby-warning | https://github.com/jeremyevans/ruby-warning | lib/warning.rb | Ruby | mit | 298 | master | 11,580 | require 'monitor'
module Warning
module Processor
# Map of symbols to regexps for warning messages to ignore.
IGNORE_MAP = {
ambiguous_slash: /: warning: ambiguous first argument; put parentheses or a space even after [`']\/' operator\n\z|: warning: ambiguity between regexp and two divisions: wrap rege... |
github | jeremyevans/ruby-warning | https://github.com/jeremyevans/ruby-warning | test/test_helper.rb | Ruby | mit | 298 | master | 511 | if coverage_type = ENV.delete('COVERAGE')
require 'simplecov'
SimpleCov.start do
enable_coverage :branch
command_name coverage_type
add_filter{|f| f.filename.match(%r{\A#{Regexp.escape(File.dirname(__FILE__))}/})}
add_group('Missing'){|src| src.covered_percent < 100}
add_group('Covered'){|src| ... |
github | jeremyevans/ruby-warning | https://github.com/jeremyevans/ruby-warning | test/test_warning.rb | Ruby | mit | 298 | master | 17,062 | require_relative 'test_helper'
require 'pathname'
require 'open3'
require 'rbconfig'
class WarningTest < Minitest::Test
module EnvUtil
def verbose_warning
stderr = String.new
class << stderr
alias write <<
def puts(*a)
self << a.join("\n")
end
end
stderr,... |
github | jeremyevans/ruby-warning | https://github.com/jeremyevans/ruby-warning | test/test_freeze_warning.rb | Ruby | mit | 298 | master | 1,713 | require_relative 'test_helper'
class WarningFreezeTest < Minitest::Test
module EnvUtil
def verbose_warning
stderr = String.new
class << stderr
alias write <<
end
stderr, $stderr, verbose, $VERBOSE = $stderr, stderr, $VERBOSE, true
yield stderr
return $stderr
ensure... |
github | tpope/pickler | https://github.com/tpope/pickler | pickler.gemspec | Ruby | mit | 297 | master | 1,038 | Gem::Specification.new do |s|
s.name = "pickler"
s.version = "0.2.1"
s.summary = "PIvotal traCKer Liaison to cucumbER"
s.description = "Synchronize between Cucumber and Pivotal Tracker"
s.authors = ["Tim Pope"]
s.email = "ruby@tpope.o... |
github | tpope/pickler | https://github.com/tpope/pickler | Rakefile | Ruby | mit | 297 | master | 211 | require 'bundler'
Bundler::GemHelper.install_tasks
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = "--color"
t.pattern = "spec/**/*_spec.rb"
end
task :default => :spec |
github | tpope/pickler | https://github.com/tpope/pickler | spec/spec_helper.rb | Ruby | mit | 297 | master | 1,152 | $LOAD_PATH.unshift(File.join(File.dirname(File.dirname(__FILE__)),'lib'))
require 'pickler'
begin; require 'rubygems'; rescue LoadError; end
require 'rspec'
RSpec.configure do |config|
config.before(:all) do
require 'fake_web'
directory = File.join(File.dirname(__FILE__), 'tracker')
Dir.chdir(directory) ... |
github | tpope/pickler | https://github.com/tpope/pickler | spec/pickler_spec.rb | Ruby | mit | 297 | master | 268 | require File.expand_path(File.dirname(__FILE__) + '/../spec/spec_helper')
describe Pickler do
before do
@pickler = Pickler.new(File.dirname(__FILE__))
end
it "should detect the project" do
expect(@pickler.project.name).to eq "Sample Project"
end
end |
github | tpope/pickler | https://github.com/tpope/pickler | spec/pickler/tracker_spec.rb | Ruby | mit | 297 | master | 293 | require File.expand_path(File.dirname(__FILE__) + '/../../spec/spec_helper')
describe Pickler::Tracker do
before do
@tracker = Pickler::Tracker.new('')
end
it "should retrieve a project by id" do
expect(@tracker.project(1)).to be_kind_of(Pickler::Tracker::Project)
end
end |
github | tpope/pickler | https://github.com/tpope/pickler | spec/pickler/tracker/note_spec.rb | Ruby | mit | 297 | master | 893 | require File.expand_path(File.dirname(__FILE__) + '/../../../spec/spec_helper')
describe Pickler::Tracker::Note do
before do
@text = ""
@note = Pickler::Tracker::Note.new(nil, :noted_at => Time.utc(2008, 1, 2), :text => @text)
end
it "should have a date" do
expect(@note.date).to eq Date.new(2008,1,... |
github | tpope/pickler | https://github.com/tpope/pickler | spec/pickler/tracker/story_spec.rb | Ruby | mit | 297 | master | 2,227 | require File.expand_path(File.dirname(__FILE__) + '/../../../spec/spec_helper')
describe Pickler::Tracker::Story do
before do
@tracker = Pickler::Tracker.new('')
@project = @tracker.project(1)
@story = @project.story(1)
end
it "should have an id Integer" do
expect(@story.id).to be_kind_of(Int... |
github | tpope/pickler | https://github.com/tpope/pickler | spec/pickler/tracker/project_spec.rb | Ruby | mit | 297 | master | 1,341 | require File.expand_path(File.dirname(__FILE__) + '/../../../spec/spec_helper')
describe Pickler::Tracker::Project do
before do
@tracker = Pickler::Tracker.new('')
@project = @tracker.project(1)
end
it "should have an id Integer" do
expect(@project.id).to be_kind_of(Integer)
end
it "should hav... |
github | tpope/pickler | https://github.com/tpope/pickler | spec/pickler/tracker/iteration_spec.rb | Ruby | mit | 297 | master | 781 | require File.expand_path(File.dirname(__FILE__) + '/../../../spec/spec_helper')
describe Pickler::Tracker::Iteration do
before do
@iteration = Pickler::Tracker::Iteration.new(nil, :start => "Jan 01, 2008", :finish => "Jan 08, 2008")
end
it "should have a start Date" do
expect(@iteration.start).to eq Da... |
github | tpope/pickler | https://github.com/tpope/pickler | lib/pickler.rb | Ruby | mit | 297 | master | 3,262 | require 'yaml'
class Pickler
class Error < RuntimeError
end
autoload :Runner, 'pickler/runner'
autoload :Feature, 'pickler/feature'
autoload :Tracker, 'pickler/tracker'
def self.config
@config ||= {'api_token' => ENV["TRACKER_API_TOKEN"]}.merge(
if File.exist?(path = File.expand_path('~/.trac... |
github | tpope/pickler | https://github.com/tpope/pickler | lib/pickler/runner.rb | Ruby | mit | 297 | master | 14,293 | require 'optparse'
class Pickler
class Runner
class Base
attr_reader :argv
def initialize(argv)
@argv = argv
@tty = $stdout.tty?
@opts = OptionParser.new
@opts.version = "0.0"
@opts.banner = "Usage: pickler #{self.class.command_name} #{self.class.banner_argum... |
github | tpope/pickler | https://github.com/tpope/pickler | lib/pickler/tracker.rb | Ruby | mit | 297 | master | 3,766 | require 'date'
require 'cgi'
require 'crack/xml'
require 'json'
class Pickler
class Tracker
ADDRESS = 'www.pivotaltracker.com'
BASE_PATH = '/services/v3'
V5_BASE_PATH = '/services/v5'
SEARCH_KEYS = %w(label type state requester owner mywork id includedone)
class Error < Pickler::Error; end
... |
github | tpope/pickler | https://github.com/tpope/pickler | lib/pickler/feature.rb | Ruby | mit | 297 | master | 2,886 | class Pickler
class Feature
URL_REGEX = %r{\bhttps?://www\.pivotaltracker\.com/\S*/(\d+)\b}
attr_reader :pickler
def initialize(pickler, identifier)
@pickler = pickler
case identifier
when nil, /^\s+$/
raise Error, "No feature given"
when Pickler::Tracker::Story
@... |
github | tpope/pickler | https://github.com/tpope/pickler | lib/pickler/tracker/story.rb | Ruby | mit | 297 | master | 5,940 | class Pickler
class Tracker
class Story < Abstract
TYPES = %w(bug feature chore release)
STATES = %w(unscheduled unstarted started finished delivered rejected accepted)
attr_reader :project, :labels
reader :url
date_reader :created_at, :accepted_at, :deadline
accessor :curren... |
github | tpope/pickler | https://github.com/tpope/pickler | lib/pickler/tracker/note.rb | Ruby | mit | 297 | master | 739 | class Pickler
class Tracker
class Note < Abstract
attr_reader :story
reader :text, :author
date_reader :noted_at
def date
noted_at && Date.new(noted_at.year, noted_at.mon, noted_at.day)
end
def initialize(story, attributes = {})
@story = story
super(at... |
github | tpope/pickler | https://github.com/tpope/pickler | lib/pickler/tracker/iteration.rb | Ruby | mit | 297 | master | 896 | class Pickler
class Tracker
class Iteration < Abstract
attr_reader :project
def initialize(project, attributes = {})
@project = project
super(attributes)
end
def start
Date.parse(attributes['start'].to_s)
end
def finish
Date.parse(attributes['... |
github | tpope/pickler | https://github.com/tpope/pickler | lib/pickler/tracker/project.rb | Ruby | mit | 297 | master | 1,844 | class Pickler
class Tracker
class Project < Abstract
attr_reader :tracker
reader :point_scale, :week_start_day, :name, :iteration_length
def id
id = @id || attributes['id'] and Integer(id)
end
def attributes
unless defined?(@attributes)
self.class.supercl... |
github | samvincent/rqrcode-rails3 | https://github.com/samvincent/rqrcode-rails3 | Gemfile | Ruby | mit | 297 | master | 246 | source "http://rubygems.org"
gem "rails", ">= 3.0.0"
gem "capybara", ">= 0.4.0"
gem "sqlite3"
gem "rqrcode"
gem "mini_magick"
# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
# gem 'ruby-debug'
# gem 'ruby-debug19' |
github | samvincent/rqrcode-rails3 | https://github.com/samvincent/rqrcode-rails3 | rqrcode_rails3.gemspec | Ruby | mit | 297 | master | 578 | # Provide a simple gemspec so you can easily use your enginex
# project in your rails apps through git.
Gem::Specification.new do |s|
s.name = "rqrcode-rails3"
s.summary = "Render QR codes with Rails 3"
s.description = "Render QR codes with Rails 3"
s.files = Dir["{app,lib,config}/**/*"] + ["M... |
github | samvincent/rqrcode-rails3 | https://github.com/samvincent/rqrcode-rails3 | Rakefile | Ruby | mit | 297 | master | 622 | # encoding: UTF-8
require 'rubygems'
begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end
require 'rake'
require 'rdoc/task'
require 'rake/testtask'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.libs << 'test'
t.pattern = 'test... |
github | samvincent/rqrcode-rails3 | https://github.com/samvincent/rqrcode-rails3 | test/test_helper.rb | Ruby | mit | 297 | master | 694 | # Configure Rails Envinronment
ENV["RAILS_ENV"] = "test"
require File.expand_path("../dummy/config/environment.rb", __FILE__)
require "rails/test_help"
ActionMailer::Base.delivery_method = :test
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.default_url_options[:host] = "test.com"
Rails.backtrace_c... |
github | samvincent/rqrcode-rails3 | https://github.com/samvincent/rqrcode-rails3 | test/dummy/app/controllers/home_controller.rb | Ruby | mit | 297 | master | 353 | class HomeController < ApplicationController
def index
respond_to do |format|
format.html
format.svg { render options }
format.png { render options }
format.jpeg { render options }
format.gif { render options }
end
end
private
def options
{:qrcode => "http://hellow... |
github | samvincent/rqrcode-rails3 | https://github.com/samvincent/rqrcode-rails3 | test/dummy/config/application.rb | Ruby | mit | 297 | master | 1,915 | require File.expand_path('../boot', __FILE__)
require "active_model/railtie"
require "active_record/railtie"
require "action_controller/railtie"
require "action_view/railtie"
require "action_mailer/railtie"
Bundler.require
require "rqrcode-rails3"
module Dummy
class Application < Rails::Application
# Settings ... |
github | samvincent/rqrcode-rails3 | https://github.com/samvincent/rqrcode-rails3 | test/dummy/config/initializers/secret_token.rb | Ruby | mit | 297 | master | 496 | # Be sure to restart your server when you modify this file.
# Your secret key for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attac... |
github | samvincent/rqrcode-rails3 | https://github.com/samvincent/rqrcode-rails3 | test/unit/size_calculator_test.rb | Ruby | mit | 297 | master | 536 | require 'test_helper'
class RQRCode::SizeCalculatorTest < ActiveSupport::TestCase
include RQRCode::SizeCalculator
test "size returned is 1 for 'apple'" do
assert_equal(1, minimum_qr_size_from_string('apple'))
end
test "size returned is 5 for 'http://guides.rubyonrails.org/testing.html'" do
assert... |
github | samvincent/rqrcode-rails3 | https://github.com/samvincent/rqrcode-rails3 | test/integration/navigation_test.rb | Ruby | mit | 297 | master | 946 | require 'test_helper'
class NavigationTest < ActiveSupport::IntegrationCase
test "truth" do
assert_kind_of Dummy::Application, Rails.application
end
test 'svg request returns an SVG file' do
visit home_path
click_link 'SVG'
assert_equal 'image/svg+xml; charset=utf-8', headers['Content-Type']
... |
github | samvincent/rqrcode-rails3 | https://github.com/samvincent/rqrcode-rails3 | lib/rqrcode-rails3.rb | Ruby | mit | 297 | master | 1,280 | require 'action_controller'
require 'rqrcode'
require 'rqrcode-rails3/size_calculator.rb'
require 'rqrcode-rails3/renderers/svg.rb'
module RQRCode
Mime::Type.register "image/svg+xml", :svg unless Mime::Type.lookup_by_extension(:svg)
Mime::Type.register "image/png", :png unless Mime::Type.lookup_by_extension(... |
github | samvincent/rqrcode-rails3 | https://github.com/samvincent/rqrcode-rails3 | lib/rqrcode-rails3/size_calculator.rb | Ruby | mit | 297 | master | 1,199 | module RQRCode
module SizeCalculator
# size - seems to follow this logic
# # | input | modules
# | size | created
#-------|-------|--------
# 1 | 7 | 21
# 2 | 14 | 25 (+4)
# 3 | 24 | 29 -
# 4 | 34 | 33 -
# 5 | ... |
github | samvincent/rqrcode-rails3 | https://github.com/samvincent/rqrcode-rails3 | lib/rqrcode-rails3/renderers/svg.rb | Ruby | mit | 297 | master | 1,769 | module RQRCode
module Renderers
class SVG
class << self
# Render the SVG from the qrcode string provided from the RQRCode gem
# Options:
# offset - Padding around the QR Code (e.g. 10)
# unit - How many pixels per module (Default: 11)
# fill - Background c... |
github | jlund/spotify-export | https://github.com/jlund/spotify-export | bin/spotify-export.rb | Ruby | mit | 297 | master | 790 | #!/usr/bin/env ruby
require 'bundler/setup'
require 'fileutils'
require 'ruby-progressbar'
require_relative '../lib/spotify-playlist'
# Copy the template SQLite file for new users, unless it
# already exists
unless File.exist?("#{ ROOT }/db/spotify-cache.db")
FileUtils.cp("#{ ROOT }/db/spotify-cache-template.db",
... |
github | jlund/spotify-export | https://github.com/jlund/spotify-export | spec/spotify-playlist_spec.rb | Ruby | mit | 297 | master | 841 | require 'spec_helper'
describe SpotifyPlaylist do
let(:filename) { 'spec/support/single-track.txt' }
let(:playlist) { SpotifyPlaylist.new(filename) }
describe ".new" do
context "if no filename is provided" do
it "raises a MissingFileError" do
expect { SpotifyPlaylist.new }.to raise_error(Spot... |
github | jlund/spotify-export | https://github.com/jlund/spotify-export | spec/spotify-track_spec.rb | Ruby | mit | 297 | master | 1,797 | # encoding: utf-8
require 'spec_helper'
describe SpotifyTrack do
let(:filename) { 'spec/support/single-track.txt' }
let(:playlist) { SpotifyPlaylist.new(filename) }
let(:track) { playlist.tracks.first }
describe "#name" do
it "should return the track name" do
expect(track.name).to eq("Fineshrine... |
github | jlund/spotify-export | https://github.com/jlund/spotify-export | lib/spotify-cache.rb | Ruby | mit | 297 | master | 264 | require 'active_record'
# So excited for __dir__ in Ruby 2.0!
ROOT = "#{ File.dirname(File.expand_path(__FILE__)) }/.."
class SpotifyCache < ActiveRecord::Base
establish_connection(
adapter: "sqlite3",
database: "#{ ROOT }/db/spotify-cache.db"
)
end |
github | jlund/spotify-export | https://github.com/jlund/spotify-export | lib/spotify-track.rb | Ruby | mit | 297 | master | 2,113 | require 'net/https'
require 'json'
require_relative 'spotify-cache'
class SpotifyTrack
attr_reader :local, :uri
def initialize(uri)
@local = uri.include? ':local:'
@uri = uri
end
def album
attributes[:album]
end
def artist
attributes[:artist]
end
def name
attributes[:name]
e... |
github | jlund/spotify-export | https://github.com/jlund/spotify-export | lib/spotify-playlist.rb | Ruby | mit | 297 | master | 525 | require_relative 'spotify-track'
class SpotifyPlaylist
class MissingFileError < StandardError; end
attr_reader :filename
def initialize(filename=nil)
raise MissingFileError, "Usage: spotify-export.rb <filename>" unless filename
raise MissingFileError, "That file does not exist" unless File.exist?(filen... |
github | sous-chefs/redisio | https://github.com/sous-chefs/redisio | metadata.rb | Ruby | apache-2.0 | 296 | main | 579 | # frozen_string_literal: true
name 'redisio'
maintainer 'Sous Chefs'
maintainer_email 'help@sous-chefs.org'
license 'Apache-2.0'
description 'Provides custom resources for installing and managing Redis instances and Sentinels'
version '7.2.5'
source_url 'https://gi... |
github | sous-chefs/redisio | https://github.com/sous-chefs/redisio | resources/sentinel_instance.rb | Ruby | apache-2.0 | 296 | main | 9,252 | # frozen_string_literal: true
provides :redisio_sentinel_instance
unified_mode true
use '_partial/_base'
property :instance_name, String, name_property: true
property :name_override, String
property :sentinel_bind, [String, Array, nil], default: nil
property :sentinel_port, [String, Integer], default: 26_379
propert... |
github | sous-chefs/redisio | https://github.com/sous-chefs/redisio | resources/server.rb | Ruby | apache-2.0 | 296 | main | 12,216 | # frozen_string_literal: true
provides :redisio_server
unified_mode true
use '_partial/_base'
use '_partial/_server'
property :instance_name, String, name_property: true
action_class do
include RedisioCookbook::Helpers
include Chef::Util::Selinux
def resolved_instance_name
(new_resource.name_override || ... |
github | sous-chefs/redisio | https://github.com/sous-chefs/redisio | resources/sentinel.rb | Ruby | apache-2.0 | 296 | main | 5,807 | # frozen_string_literal: true
provides :redisio_sentinel
unified_mode true
property :version, [String, NilClass]
property :base_piddir, String, default: '/var/run/redis'
property :user, String, default: 'redis'
property :group, String, default: 'redis'
property :sentinel_defaults, Hash, default: {}
property :sentinel... |
github | sous-chefs/redisio | https://github.com/sous-chefs/redisio | resources/install.rb | Ruby | apache-2.0 | 296 | main | 4,363 | # frozen_string_literal: true
provides :redisio_install
unified_mode true
property :package_install, [true, false], default: false
property :package_name, [String, NilClass]
property :version, [String, NilClass]
property :download_url, [String, NilClass]
property :download_dir, String, default: lazy { Chef::Config[:f... |
github | sous-chefs/redisio | https://github.com/sous-chefs/redisio | resources/configure.rb | Ruby | apache-2.0 | 296 | main | 6,851 | # frozen_string_literal: true
provides :redisio_configure
unified_mode true
property :version, [String, NilClass]
property :base_piddir, String, default: '/var/run/redis'
property :user, String, default: 'redis'
property :group, String, default: 'redis'
property :default_settings, Hash, default: {}
property :servers,... |
github | sous-chefs/redisio | https://github.com/sous-chefs/redisio | resources/_partial/_server.rb | Ruby | apache-2.0 | 296 | main | 3,087 | # frozen_string_literal: true
property :port, [String, Integer], default: 6379
property :permissions, String, default: '0644'
property :name_override, default: nil
property :tcpbacklog, String, default: '511'
property :address, default: nil
property :databases, String, default: '16'
property :backuptype, String, defau... |
github | sous-chefs/redisio | https://github.com/sous-chefs/redisio | resources/_partial/_base.rb | Ruby | apache-2.0 | 296 | main | 1,697 | # frozen_string_literal: true
property :version
property :base_piddir, String, default: '/var/run/redis'
property :user, String, default: 'redis'
property :group, String, default: 'redis'
property :uid
property :systemuser, [true, false], default: true
property :homedir
property :shell
property :configdir
property :lo... |
github | sous-chefs/redisio | https://github.com/sous-chefs/redisio | test/cookbooks/test/recipes/multisentinel.rb | Ruby | apache-2.0 | 296 | main | 516 | # frozen_string_literal: true
redisio_install 'default' do
package_install true
end
redisio_server '6379' do
package_install true
end
redisio_server '6380' do
package_install true
port 6380
end
redisio_sentinel_instance 'cluster' do
package_install true
sentinel_bind '0.0.0.0'
masters [
{
ma... |
github | sous-chefs/redisio | https://github.com/sous-chefs/redisio | test/cookbooks/test/recipes/sentinel.rb | Ruby | apache-2.0 | 296 | main | 332 | # frozen_string_literal: true
redisio_install 'default' do
package_install true
end
redisio_server '6379' do
package_install true
end
redisio_sentinel_instance 'mycluster' do
package_install true
masters [
{
master_name: 'mycluster_master',
master_ip: '127.0.0.1',
master_port: 6379,
... |
github | sous-chefs/redisio | https://github.com/sous-chefs/redisio | test/cookbooks/test/recipes/default.rb | Ruby | apache-2.0 | 296 | main | 316 | # frozen_string_literal: true
redisio_install 'default' do
package_install true
end
redisio_server '6379' do
package_install true
end
redisio_server 'savetest' do
package_install true
port 16_379
permissions '0640'
save ['3600 1', '300 100', '60 10000']
logfile '/var/log/redis/redis-16379.log'
end |
github | sous-chefs/redisio | https://github.com/sous-chefs/redisio | test/integration/spec_helper.rb | Ruby | apache-2.0 | 296 | main | 479 | # frozen_string_literal: true
def amazon_linux?
os.family == 'amazon' || os.name == 'amazon'
end
def redis_package_name
return 'redis-server' if os.family == 'debian'
return 'redis6' if amazon_linux?
'redis'
end
def redis_service_name(instance_name)
"redis@#{instance_name}"
end
def redis_sentinel_service... |
github | sous-chefs/redisio | https://github.com/sous-chefs/redisio | test/integration/default/controls/default_spec.rb | Ruby | apache-2.0 | 296 | main | 1,624 | # frozen_string_literal: true
require_relative '../../spec_helper'
control 'redisio-default-package-01' do
impact 1.0
title 'The Redis package is installed'
describe package(redis_package_name) do
it { should be_installed }
end
end
control 'redisio-default-service-01' do
impact 1.0
title 'The primar... |
github | sous-chefs/redisio | https://github.com/sous-chefs/redisio | test/integration/multisentinel/controls/multisentinel_spec.rb | Ruby | apache-2.0 | 296 | main | 2,086 | # frozen_string_literal: true
require_relative '../../spec_helper'
control 'redisio-multisentinel-service-01' do
impact 1.0
title 'The multi-sentinel service is enabled and running'
describe systemd_service(redis_sentinel_service_name('cluster')) do
it { should be_installed }
it { should be_enabled }
... |
github | sous-chefs/redisio | https://github.com/sous-chefs/redisio | test/integration/sentinel/controls/sentinel_spec.rb | Ruby | apache-2.0 | 296 | main | 807 | # frozen_string_literal: true
require_relative '../../spec_helper'
control 'redisio-sentinel-service-01' do
impact 1.0
title 'The sentinel service is enabled and running'
describe systemd_service(redis_sentinel_service_name('mycluster')) do
it { should be_installed }
it { should be_enabled }
it { s... |
github | sous-chefs/redisio | https://github.com/sous-chefs/redisio | libraries/helpers.rb | Ruby | apache-2.0 | 296 | main | 4,013 | # frozen_string_literal: true
require 'shellwords'
module RedisioCookbook
module Helpers
def platform_package_name
return 'redis6' if platform_family?('amazon')
return 'redis-server' if platform_family?('debian')
'redis'
end
def platform_default_home
'/var/lib/redis'
end
... |
github | sous-chefs/redisio | https://github.com/sous-chefs/redisio | spec/helpers_spec.rb | Ruby | apache-2.0 | 296 | main | 625 | # frozen_string_literal: true
require 'spec_helper'
require_relative '../libraries/helpers'
RSpec.describe RedisioCookbook::Helpers do
let(:helper_class) do
Class.new do
include RedisioCookbook::Helpers
end
end
subject(:helper) { helper_class.new }
it 'parses Redis versions into a hash' do
... |
github | sous-chefs/redisio | https://github.com/sous-chefs/redisio | spec/spec_helper.rb | Ruby | apache-2.0 | 296 | main | 323 | # frozen_string_literal: true
require 'chefspec'
require 'chefspec/berkshelf'
RSpec.configure do |config|
config.color = true
config.formatter = :documentation
config.log_level = :error
end
def stub_service_inactive(service_name)
stub_command("systemctl is-active --quiet #{service_name}").and_return(false)
e... |
github | sous-chefs/redisio | https://github.com/sous-chefs/redisio | spec/unit/resources/redisio_install_spec.rb | Ruby | apache-2.0 | 296 | main | 1,373 | # frozen_string_literal: true
require 'spec_helper'
describe 'redisio_install' do
step_into :redisio_install
context 'with package install on ubuntu' do
platform 'ubuntu', '24.04'
recipe do
redisio_install 'default' do
package_install true
end
end
it { is_expected.to install... |
github | sous-chefs/redisio | https://github.com/sous-chefs/redisio | spec/unit/resources/redisio_sentinel_spec.rb | Ruby | apache-2.0 | 296 | main | 1,257 | # frozen_string_literal: true
require 'spec_helper'
describe 'redisio_sentinel' do
step_into :redisio_sentinel, :redisio_sentinel_instance
platform 'ubuntu', '24.04'
before do
version_output = 'Redis server v=7.4.8 sha=000:0 malloc=jemalloc-5.3.0 bits=64 build=00000000'
stub_service_inactive('redis-se... |
github | sous-chefs/redisio | https://github.com/sous-chefs/redisio | spec/unit/resources/redisio_configure_spec.rb | Ruby | apache-2.0 | 296 | main | 1,510 | # frozen_string_literal: true
require 'spec_helper'
describe 'redisio_configure' do
step_into :redisio_configure, :redisio_server
platform 'ubuntu', '24.04'
before do
version_output = 'Redis server v=7.4.8 sha=000:0 malloc=jemalloc-5.3.0 bits=64 build=00000000'
stub_service_inactive('redis@6379')
... |
github | sous-chefs/redisio | https://github.com/sous-chefs/redisio | spec/unit/resources/redisio_sentinel_instance_spec.rb | Ruby | apache-2.0 | 296 | main | 1,417 | # frozen_string_literal: true
require 'spec_helper'
describe 'redisio_sentinel_instance' do
step_into :redisio_sentinel_instance
platform 'ubuntu', '24.04'
before do
version_output = 'Redis server v=7.4.8 sha=000:0 malloc=jemalloc-5.3.0 bits=64 build=00000000'
stub_service_inactive('redis-sentinel@clu... |
github | sous-chefs/redisio | https://github.com/sous-chefs/redisio | spec/unit/resources/redisio_server_spec.rb | Ruby | apache-2.0 | 296 | main | 1,924 | # frozen_string_literal: true
require 'spec_helper'
describe 'redisio_server' do
step_into :redisio_server
platform 'ubuntu', '24.04'
before do
version_output = 'Redis server v=7.4.8 sha=000:0 malloc=jemalloc-5.3.0 bits=64 build=00000000'
stub_service_inactive('redis@6379')
stub_service_inactive('... |
github | redinger/validation_reflection | https://github.com/redinger/validation_reflection | validation_reflection.gemspec | Ruby | mit | 296 | master | 1,430 | # Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = %q{validation_reflection}
s.version = "1.0.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_t... |
github | redinger/validation_reflection | https://github.com/redinger/validation_reflection | Rakefile | Ruby | mit | 296 | master | 1,124 | # encoding: utf-8
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
desc 'Default: run unit tests.'
task :default => :test
desc 'Test the validation_reflection plugin.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.pattern = 'test/**/*_test.rb'
t.verbose = true
end
desc 'Generate documentatio... |
github | redinger/validation_reflection | https://github.com/redinger/validation_reflection | lib/validation_reflection.rb | Ruby | mit | 296 | master | 3,050 | require 'ostruct'
module ValidationReflection # :nodoc:
extend self
CORE_VALIDATONS = [
:validates_acceptance_of,
:validates_associated,
:validates_confirmation_of,
:validates_exclusion_of,
:validates_format_of,
:validates_inclusion_of,
:validates_length_of,
:validates_num... |
github | redinger/validation_reflection | https://github.com/redinger/validation_reflection | test/test_helper.rb | Ruby | mit | 296 | master | 325 | # encoding: utf-8
ENV['RAILS_ENV'] = 'test'
RAILS_ROOT = File.join(File.dirname(__FILE__))
require 'rubygems'
begin
require 'active_record'
rescue LoadError
gem 'activerecord', '>= 1.2.3'
require 'active_record'
end
begin
require 'test/unit'
rescue LoadError
gem 'test-unit', '>= 1.2.3'
require 'test/unit... |
github | redinger/validation_reflection | https://github.com/redinger/validation_reflection | test/validation_reflection_test.rb | Ruby | mit | 296 | master | 4,022 | # encoding: utf-8
require File.join(File.dirname(__FILE__), 'test_helper')
ActiveRecord::Base.class_eval do
def self.validates_something_weird(*cols)
cols.each do |col|
validates_format_of col, :with => /weird/
end
end
def self.validates_something_selfcontained(*cols)
cols.each do |col|
v... |
github | thinreports/thinreports-generator | https://github.com/thinreports/thinreports-generator | thinreports.gemspec | Ruby | mit | 297 | main | 1,031 | # frozen_string_literal: true
rootdir = File.expand_path(File.dirname(__FILE__))
require "#{rootdir}/lib/thinreports/version"
Gem::Specification.new do |s|
s.name = 'thinreports'
s.version = Thinreports::VERSION
s.author = 'Matsukei Co.,Ltd.'
s.email = 'thinreports@gmail.com'
s.summar... |
github | thinreports/thinreports-generator | https://github.com/thinreports/thinreports-generator | Rakefile | Ruby | mit | 297 | main | 742 | require 'bundler/gem_tasks'
require 'rake/testtask'
task default: :test
Rake::TestTask.new do |t|
t.name = 'test:main'
t.description = 'Run tests for main'
t.libs << 'test/main'
t.test_files = Dir['test/main/**/test_*.rb']
end
Rake::TestTask.new do |t|
t.name = 'test:basic_report'
t.description = 'Run te... |
github | thinreports/thinreports-generator | https://github.com/thinreports/thinreports-generator | Gemfile | Ruby | mit | 297 | main | 411 | # frozen_string_literal: true
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gemspec
gem 'rake'
gem 'minitest'
gem 'mocha'
gem 'pdf-inspector'
gem 'pdf_matcher-testing'
# suppress warning: assigned but unused variable - y1
# https://github.com/yob/pdf-reader/pull/502
g... |
github | thinreports/thinreports-generator | https://github.com/thinreports/thinreports-generator | lib/thinreports.rb | Ruby | mit | 297 | main | 318 | # frozen_string_literal: true
require 'pathname'
module Thinreports
def self.root
@root ||= Pathname.new(__FILE__).join('..', '..')
end
end
require_relative 'thinreports/version'
require_relative 'thinreports/config'
require_relative 'thinreports/basic_report'
require_relative 'thinreports/section_report' |
github | thinreports/thinreports-generator | https://github.com/thinreports/thinreports-generator | lib/thinreports/config.rb | Ruby | mit | 297 | main | 914 | # frozen_string_literal: true
module Thinreports
# @yield [config]
# @yieldparam [Thinreports::Configuration] config
def self.configure(&block)
block.call(config)
end
# @return [Thinreports::Configuration]
def self.config
@config ||= Thinreports::Configuration.new
end
class Configuration
... |
github | thinreports/thinreports-generator | https://github.com/thinreports/thinreports-generator | lib/thinreports/section_report.rb | Ruby | mit | 297 | main | 291 | # frozen_string_literal: true
module Thinreports
Core = BasicReport::Core
Generator = BasicReport::Generator
def self.generate(report_params, filename: nil)
SectionReport::Generate.new.call(report_params, filename: filename)
end
end
require_relative 'section_report/generate' |
github | thinreports/thinreports-generator | https://github.com/thinreports/thinreports-generator | lib/thinreports/basic_report.rb | Ruby | mit | 297 | main | 463 | # frozen_string_literal: true
require_relative 'basic_report/core/utils'
require_relative 'basic_report/core/errors'
require_relative 'basic_report/core/format/base'
require_relative 'basic_report/core/shape'
require_relative 'basic_report/core/utils'
require_relative 'basic_report/report'
require_relative 'basic_repo... |
github | thinreports/thinreports-generator | https://github.com/thinreports/thinreports-generator | lib/thinreports/section_report/generate.rb | Ruby | mit | 297 | main | 499 | # frozen_string_literal: true
require_relative 'build'
require_relative 'pdf/render'
module Thinreports
module SectionReport
class Generate
def initialize
@pdf = Thinreports::Generator::PDF::Document.new
end
def call(report_params, filename: nil)
report = Build.new.call(report... |
github | thinreports/thinreports-generator | https://github.com/thinreports/thinreports-generator | lib/thinreports/section_report/build.rb | Ruby | mit | 297 | main | 756 | # frozen_string_literal: true
require_relative 'schema/loader'
require_relative 'builder/report_builder'
module Thinreports
module SectionReport
class Build
def call(report_params)
schema = load_schema(report_params)
params = report_params[:params] || {}
Builder::ReportBuilder.new... |
github | thinreports/thinreports-generator | https://github.com/thinreports/thinreports-generator | lib/thinreports/section_report/schema/loader.rb | Ruby | mit | 297 | main | 497 | # frozen_string_literal: true
require_relative 'parser'
module Thinreports
module SectionReport
module Schema
class Loader
def initialize
@parser = Schema::Parser.new
end
def load_from_file(filename)
data = File.read(filename, encoding: 'UTF-8')
load_... |
github | thinreports/thinreports-generator | https://github.com/thinreports/thinreports-generator | lib/thinreports/section_report/schema/section.rb | Ruby | mit | 297 | main | 1,071 | # frozen_string_literal: true
module Thinreports
module SectionReport
module Schema
module Section
class Base < Core::Shape::Manager::Format
config_reader :id, :type
config_reader :height
config_checker true, :display
config_checker true, auto_stretch: 'auto-... |
github | thinreports/thinreports-generator | https://github.com/thinreports/thinreports-generator | lib/thinreports/section_report/schema/report.rb | Ruby | mit | 297 | main | 881 | # frozen_string_literal: true
module Thinreports
module SectionReport
module Schema
class Report < Core::Shape::Manager::Format
config_reader last_version: %w( version )
config_reader report_title: %w( title )
config_reader page_paper_type: %w( report paper-type ),
... |
github | thinreports/thinreports-generator | https://github.com/thinreports/thinreports-generator | lib/thinreports/section_report/schema/parser.rb | Ruby | mit | 297 | main | 1,603 | # frozen_string_literal: true
require 'json'
require_relative 'report'
require_relative 'section'
module Thinreports
module SectionReport
module Schema
class Parser
def parse(schema_json_data)
schema_data = JSON.parse(schema_json_data)
section_schema_datas = schema_data['sect... |
github | thinreports/thinreports-generator | https://github.com/thinreports/thinreports-generator | lib/thinreports/section_report/builder/report_data.rb | Ruby | mit | 297 | main | 301 | # frozen_string_literal: true
module Thinreports
module SectionReport
module Builder
module ReportData
Main = Struct.new :schema, :groups
Group = Struct.new :headers, :details, :footers
Section = Struct.new :schema, :items, :min_height
end
end
end
end |
github | thinreports/thinreports-generator | https://github.com/thinreports/thinreports-generator | lib/thinreports/section_report/builder/stack_view_builder.rb | Ruby | mit | 297 | main | 1,367 | # frozen_string_literal: true
require_relative 'stack_view_data'
module Thinreports
module SectionReport
module Builder
class StackViewBuilder
def initialize(item)
@item = item
end
def update(params)
rows_params = params[:rows] || {}
rows_schema = ite... |
github | thinreports/thinreports-generator | https://github.com/thinreports/thinreports-generator | lib/thinreports/section_report/builder/stack_view_data.rb | Ruby | mit | 297 | main | 201 | # frozen_string_literal: true
module Thinreports
module SectionReport
module Builder
module StackViewData
Row = Struct.new :schema, :items, :min_height
end
end
end
end |
github | thinreports/thinreports-generator | https://github.com/thinreports/thinreports-generator | lib/thinreports/section_report/builder/report_builder.rb | Ruby | mit | 297 | main | 2,539 | # frozen_string_literal: true
require_relative 'report_data'
require_relative 'item_builder'
module Thinreports
module SectionReport
module Builder
class ReportBuilder
def initialize(schema)
@schema = schema
end
def build(params)
ReportData::Main.new(
... |
github | thinreports/thinreports-generator | https://github.com/thinreports/thinreports-generator | lib/thinreports/section_report/builder/item_builder.rb | Ruby | mit | 297 | main | 1,179 | # frozen_string_literal: true
require_relative 'stack_view_builder'
module Thinreports
module SectionReport
module Builder
class ItemBuilder
Context = Struct.new(:parent_schema)
def initialize(item_schema, parent_schema)
@item = Core::Shape::Interface(nil, item_schema)
... |
github | thinreports/thinreports-generator | https://github.com/thinreports/thinreports-generator | lib/thinreports/section_report/pdf/render.rb | Ruby | mit | 297 | main | 451 | # frozen_string_literal: true
require_relative 'renderer/group_renderer'
module Thinreports
module SectionReport
module PDF
class Render
def initialize(pdf)
@group_renderer = Renderer::GroupRenderer.new(pdf)
end
def call!(report)
report.groups.each { |group| gr... |
github | thinreports/thinreports-generator | https://github.com/thinreports/thinreports-generator | lib/thinreports/section_report/pdf/renderer/group_renderer.rb | Ruby | mit | 297 | main | 1,782 | # frozen_string_literal: true
require_relative 'section_renderer'
module Thinreports
module SectionReport
module Renderer
class GroupRenderer
def initialize(pdf)
@pdf = pdf
@section_renderer = Renderer::SectionRenderer.new(pdf)
end
def render(report, group)
... |
github | thinreports/thinreports-generator | https://github.com/thinreports/thinreports-generator | lib/thinreports/section_report/pdf/renderer/stack_view_renderer.rb | Ruby | mit | 297 | main | 1,442 | # frozen_string_literal: true
require_relative 'stack_view_row_renderer'
module Thinreports
module SectionReport
module Renderer
class StackViewRenderer
def initialize(pdf)
@pdf = pdf
@row_renderer = Renderer::StackViewRowRenderer.new(pdf)
end
RowLayout = Struc... |
github | thinreports/thinreports-generator | https://github.com/thinreports/thinreports-generator | lib/thinreports/section_report/pdf/renderer/section_height.rb | Ruby | mit | 297 | main | 3,925 | # frozen_string_literal: true
module Thinreports
module SectionReport
module Renderer
module SectionHeight
LayoutInfo = Struct.new(:shape, :content_height, :top_margin, :bottom_margin)
def section_height(section)
return [section.min_height || 0, section.schema.height].max if !sec... |
github | thinreports/thinreports-generator | https://github.com/thinreports/thinreports-generator | lib/thinreports/section_report/pdf/renderer/draw_item.rb | Ruby | mit | 297 | main | 2,774 | # frozen_string_literal: true
module Thinreports
module SectionReport
module Renderer
module DrawItem
def draw_item(item, expanded_height = 0)
shape = item.internal
if shape.type_of?(Core::Shape::TextBlock::TYPE_NAME)
computed_height = shape.format.attributes['heigh... |
github | thinreports/thinreports-generator | https://github.com/thinreports/thinreports-generator | lib/thinreports/section_report/pdf/renderer/section_renderer.rb | Ruby | mit | 297 | main | 882 | # frozen_string_literal: true
require_relative 'stack_view_renderer'
require_relative 'section_height'
require_relative 'draw_item'
module Thinreports
module SectionReport
module Renderer
class SectionRenderer
include SectionHeight
include DrawItem
def initialize(pdf)
@p... |
github | thinreports/thinreports-generator | https://github.com/thinreports/thinreports-generator | lib/thinreports/section_report/pdf/renderer/stack_view_row_renderer.rb | Ruby | mit | 297 | main | 856 | # frozen_string_literal: true
require_relative 'section_height'
require_relative 'draw_item'
module Thinreports
module SectionReport
module Renderer
class StackViewRowRenderer
include SectionHeight
include DrawItem
def initialize(pdf)
@pdf = pdf
end
def ... |
github | thinreports/thinreports-generator | https://github.com/thinreports/thinreports-generator | lib/thinreports/basic_report/report.rb | Ruby | mit | 297 | main | 620 | # frozen_string_literal: true
module Thinreports
module BasicReport
module Report
# @see Thinreports::BasicReport::Report::Base#initialize
def self.new(*args)
Base.new(*args)
end
# @see Thinreports::BasicReport::Report::Base#create
def self.create(*args, &block)
Bas... |
github | thinreports/thinreports-generator | https://github.com/thinreports/thinreports-generator | lib/thinreports/basic_report/layout.rb | Ruby | mit | 297 | main | 398 | # frozen_string_literal: true
module Thinreports
module BasicReport
module Layout
# @see Thinreports::BasicReport::Layout::Base#initialize
def self.new(filename, options = {})
Base.new(filename, options)
end
end
end
end
require_relative 'layout/version'
require_relative 'layout/b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.