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 | rack-amqp/jackalope | https://github.com/rack-amqp/jackalope | jackalope.gemspec | Ruby | mit | 49 | master | 1,122 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'rack/amqp/version'
Gem::Specification.new do |spec|
spec.name = "jackalope"
spec.version = Rack::AMQP::VERSION
spec.authors = ["Joshua Szmajda", "John Nestoriak"]
spe... |
github | rack-amqp/jackalope | https://github.com/rack-amqp/jackalope | spec/rack/amqp/server_spec.rb | Ruby | mit | 49 | master | 527 | require 'spec_helper'
describe Rack::AMQP::Server do
it 'passes input to rack'
it 'keeps running'
it 'calls handle_request on event input'
describe '#construct_app' do
it 'builds a Rack app with the given rackup file inside'
end
describe '#default_env' do
it 'looks like HTTP enough'
end
des... |
github | rack-amqp/jackalope | https://github.com/rack-amqp/jackalope | spec/rack/amqp/configuration_spec.rb | Ruby | mit | 49 | master | 696 | require 'spec_helper'
describe Rack::AMQP::Configuration do
it 'yields a configuration' do
x = nil
Rack::AMQP.configure do |c|
x = c
end
expect(x).to be_kind_of(Rack::AMQP::Configuration)
end
it 'allows configuration querying' do
expect(Rack::AMQP.configuration).to_not be_nil
end
... |
github | rack-amqp/jackalope | https://github.com/rack-amqp/jackalope | lib/rack/amqp/server.rb | Ruby | mit | 49 | master | 4,369 | require "rack/amqp/configuration"
module Rack
module AMQP
class Server
def self.start(options={})
new(options).start
end
attr_reader :options, :debug
def initialize(options)
@options = options.dup
@debug = options.delete(:debug)
Rack::AMQP.configure do ... |
github | rack-amqp/jackalope | https://github.com/rack-amqp/jackalope | lib/rack/amqp/configuration.rb | Ruby | mit | 49 | master | 1,182 | module Rack
module AMQP
class << self
attr_accessor :configuration
end
def self.configure
self.configuration ||= Configuration.new
yield(configuration)
end
class Configuration
attr_accessor :rabbit_host
attr_accessor :queue_name
attr_accessor :tls
attr_a... |
github | orta/gh_inspector | https://github.com/orta/gh_inspector | Rakefile | Ruby | mit | 49 | master | 1,644 | require 'bundler'
require 'bundler/gem_tasks'
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
warn e.message
warn 'Run `bundle install` to install missing gems'
exit e.status_code
end
require 'rspec/core/rake_task'
require 'rubocop/rake_task'
RSpec::Core::RakeTask.new(:specs)
ta... |
github | orta/gh_inspector | https://github.com/orta/gh_inspector | gh_inspector.gemspec | Ruby | mit | 49 | master | 1,086 | lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'gh_inspector/version'
Gem::Specification.new do |spec|
spec.name = 'gh_inspector'
spec.version = GhInspector::VERSION
spec.authors = ['Orta Therox', 'Felix Krause']
spec.email ... |
github | orta/gh_inspector | https://github.com/orta/gh_inspector | lib/gh_inspector/exception_hound.rb | Ruby | mit | 49 | master | 843 | module GhInspector
class ExceptionHound
attr_accessor :message
def initialize(error)
self.message = find_message error
end
def find_message(error)
error.to_s
end
def query
undefined
simple_nil
demangle_instances
message
end
private
def unde... |
github | orta/gh_inspector | https://github.com/orta/gh_inspector | lib/gh_inspector/inspector.rb | Ruby | mit | 49 | master | 2,454 | # Note that the README is generated from the class comments, so it's a bit
# wider scope than your average class comment.
module GhInspector
# To get started using The Issues Inspector, you will need to
# create an inspector instance. This class is main public API for querying issues.
#
# #### Getting Started
... |
github | orta/gh_inspector | https://github.com/orta/gh_inspector | lib/gh_inspector/evidence.rb | Ruby | mit | 49 | master | 4,522 | require 'gh_inspector/version'
require 'time'
module GhInspector
NUMBER_OF_ISSUES_INLINE = 3
# The default user interface for the inspector, its public API should be
# considered the protocol for other classes wanting to provide a user interface.
#
# Your custom objects will be verified at runtime that they... |
github | orta/gh_inspector | https://github.com/orta/gh_inspector | lib/gh_inspector/sidekick.rb | Ruby | mit | 49 | master | 4,200 | require 'erb'
require "net/http"
require 'uri'
module GhInspector
# The Sidekick is the one who does all the real work.
# They take the query, get the GitHub API results, etc
# then pass them back to the inspector who gets the public API credit.
class Sidekick
attr_accessor :repo_owner, :repo_name, :inspe... |
github | orta/gh_inspector | https://github.com/orta/gh_inspector | spec/spec_helper.rb | Ruby | mit | 49 | master | 852 | $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'gh_inspector'
# A quite version of Evidence, so tests don't `puts`
class SilentEvidence
def inspector_started_query(_query, _inspector); end
def inspector_is_still_investigating(_query, _inspector); end
def inspector_successfully_recieved_repo... |
github | orta/gh_inspector | https://github.com/orta/gh_inspector | spec/inspector/exception_hound_spec.rb | Ruby | mit | 49 | master | 746 | require 'spec_helper'
describe GhInspector::ExceptionHound do
before do
@hound = GhInspector::ExceptionHound.new(Object)
end
it "removes instances memory addresses" do
exception_string = "message for #<Danger::NewPlugin:0x007f806a3248e8>"
@hound.message = exception_string
expect(@hound.query).t... |
github | orta/gh_inspector | https://github.com/orta/gh_inspector | spec/inspector/sidekick_spec.rb | Ruby | mit | 49 | master | 3,623 | require 'spec_helper'
describe GhInspector::Sidekick do
before do
@inspector = GhInspector::Inspector.new('orta', 'my_repo')
@subject = GhInspector::Sidekick.new @inspector, 'orta', 'my_repo'
@evidence = SilentEvidence.new
@new_evidence = NewSilentEvidence.new
end
it 'keeps track of user / repo'... |
github | orta/gh_inspector | https://github.com/orta/gh_inspector | spec/inspector/inspector_spec.rb | Ruby | mit | 49 | master | 1,409 | require 'spec_helper'
describe GhInspector do
it 'has a version number' do
expect(GhInspector::VERSION).not_to be nil
end
end
describe GhInspector::Inspector do
before do
@subject = GhInspector::Inspector.new 'orta', 'my_repo'
end
it 'supports a slug class method' do
@subject = GhInspector::Ins... |
github | orta/gh_inspector | https://github.com/orta/gh_inspector | spec/inspector/evidence_spec.rb | Ruby | mit | 49 | master | 4,892 | require 'spec_helper'
describe GhInspector::Evidence do
before do
time = Time.new(2016, 5, 13)
allow(Time).to receive(:now).and_return time
inspector = GhInspector::Inspector.new('orta', 'my_repo')
@subject = inspector.sidekick
@evidence = GhInspector::Evidence.new
end
describe 'reaction to... |
github | pawurb/devloop | https://github.com/pawurb/devloop | devloop.gemspec | Ruby | mit | 49 | main | 1,247 | # -*- encoding: utf-8 -*-
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "devloop/version"
Gem::Specification.new do |s|
s.name = "devloop"
s.version = Devloop::VERSION
s.authors = ["pawurb"]
s.email = ["contact@pawelurbanek.com"]
s.summary = "An au... |
github | pawurb/devloop | https://github.com/pawurb/devloop | lib/devloop/diff_parser.rb | Ruby | mit | 49 | main | 1,414 | module Devloop
class DiffParser
def self.call(diff)
new.call(diff)
end
Diff = Struct.new(:filename, :line_number)
def call(diff)
_, diffs_data = diff.split("\n").reduce(["", []]) do |(file, diffs_data), line|
if line.start_with?("+++ b/")
[line[6..-1], diffs_data]
... |
github | pawurb/devloop | https://github.com/pawurb/devloop | spec/diff_parser_spec.rb | Ruby | mit | 49 | main | 6,711 | # frozen_string_literal: true
require "spec_helper"
require "devloop/diff_parser"
describe Devloop::DiffParser do
context "first line of a file was edited" do
let(:diff) do
<<~DIFF
diff --git a/spec/models/team_spec.rb b/spec/models/team_spec.rb
index 19772f2a..9f614e20 100644
... |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | Rakefile | Ruby | mit | 49 | master | 2,014 | require 'cucumber/rake/task'
module Cucover
module Rake
class Task < Cucumber::Rake::Task
def feature_pattern=(value)
@feature_pattern = value
end
def pretty!
@format = 'pretty'
end
def tags=(value)
@tags = value
end
private
... |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | cucover.gemspec | Ruby | mit | 49 | master | 8,421 | # Generated by jeweler
# DO NOT EDIT THIS FILE
# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = %q{cucover}
s.version = "0.1.3"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_versio... |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | features/support/env.rb | Ruby | mit | 49 | master | 1,159 | # require File.dirname(__FILE__) + '/../../lib/cucover'
require 'spec'
require 'test/unit/assertions'
module CucoverHelper
def edit(file)
original_mtime = File.mtime(file)
FileUtils.touch(file)
@edited_files ||= {}
@edited_files[file] = original_mtime
end
def restore_file_mtimes
return unles... |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | features/step_definitions/main_steps.rb | Ruby | mit | 49 | master | 1,096 | Given /^I have (tried to |)run cucover (.*)$/ do |tried, args|
When %{I run cucover #{args}}
if tried.blank?
assert(@status == 0, @out)
end
end
Given /^I am using the (.*) example app$/ do |app_name|
@example_app = app_name
clear_cache!
end
When /^I run cucover (.*)$/ do |args|
cucover_binary = File.e... |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | spec/cucover/controller_spec.rb | Ruby | mit | 49 | master | 492 | require File.dirname(__FILE__) + '/../spec_helper'
module Cucover
describe Controller do
describe "#should_execute?" do
before(:each) do
@store = mock(Store)
@example_id = 'foo.feature:123'
end
it "when no previous recording exists, it should always return true" do
@stor... |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | spec/cucover/cli_spec.rb | Ruby | mit | 49 | master | 860 | require File.dirname(__FILE__) + '/../spec_helper'
describe Cucover::Cli do
describe "given a --coverage-of command" do
before(:each) do
@args = ['--coverage-of', 'lib/foo.rb']
end
it "should create a CoverageOf command object and execute it" do
Cucover::CliCommands::CoverageOf.should_re... |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | spec/cucover/store_spec.rb | Ruby | mit | 49 | master | 938 | require File.dirname(__FILE__) + '/../spec_helper'
module Cucover
describe Store do
before(:each) do
@cache = mock('cache', :load => nil)
@store = Store.new(@cache)
end
describe "#latest_recording" do
it "should return nil if no recordings match the given identifier" do
@store.l... |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | spec/cucover/recording/covered_file_spec.rb | Ruby | mit | 49 | master | 590 | require File.dirname(__FILE__) + '/../../spec_helper'
class Cucover::Recording
describe CoveredFile do
describe "with a marked info" do
before(:each) do
@recording = mock('Recording')
@covered_file = CoveredFile.new("foo.rb", [true, true, false], @recording)
end
i... |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | lib/cucover.rb | Ruby | mit | 49 | master | 1,626 | $:.unshift(File.dirname(__FILE__))
require 'dependencies'
require 'cucover/logging_config'
require 'cucover/cli_commands/coverage_of'
require 'cucover/cli_commands/cucumber'
require 'cucover/cli_commands/show_recordings'
require 'cucover/cli_commands/version'
require 'cucover/controller'
require 'cucover/cli'
require '... |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | lib/cucover/monkey.rb | Ruby | mit | 49 | master | 321 | module Cucover
module Monkey
def self.extend_every(args)
class_to_extend = args.keys.first
module_to_extend_with = args.values.first
class_to_extend.instance_eval <<-PATCH
def new(*args)
super(*args).extend(#{module_to_extend_with})
end
PATCH
end
end
en... |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | lib/cucover/rails.rb | Ruby | mit | 49 | master | 574 | module Cucover
module Rails
class << self
def patch_if_necessary
return if @patched
return unless defined?(ActionView)
Monkey.extend_every ActionView::Base => Cucover::Rails::RecordsRenders
# Monkey.extend_every ActionView::Template => Cucover::Rails::RecordsRenders # ... |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | lib/cucover/logging_config.rb | Ruby | mit | 49 | master | 336 | Logging.configure do
logger('Cucover') do
level :debug
appenders 'logfile'
end
appender('logfile') do
type 'File'
level :debug
filename File.dirname(__FILE__) + '/../../tmp/cucover.log'
layout do
type 'Pattern'
pattern '[%d] %l %c : %m\n'
e... |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | lib/cucover/controller.rb | Ruby | mit | 49 | master | 620 | module Cucover
class Controller
def initialize(file_colon_line, store)
@file_colon_line = file_colon_line
@store = store
end
def should_execute?
dirty? or failed_on_last_run?
end
private
def failed_on_last_run?
return false unless recording
recordin... |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | lib/cucover/recording.rb | Ruby | mit | 49 | master | 1,420 | module Cucover
class Recording < Struct.new(
:file_colon_line,
:exception,
:additional_covered_files,
:analyzer,
:start_time, :end_time)
IGNORE_PATTERNS = [
/gem/,
/vendor/,
/lib\/ruby/,
/cucover\/lib/
]
def feature_filename
file_colon_line.spl... |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | lib/cucover/cli.rb | Ruby | mit | 49 | master | 1,331 | module Cucover
class Cli
def initialize(args)
@args = args
end
def start
command_type.new(@args).execute
end
private
def command_type
case @args.first
when '--'
CliCommands::Cucumber
when '--version', '-v'
CliCommands::Version
when... |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | lib/cucover/line_numbers.rb | Ruby | mit | 49 | master | 216 | require 'rbconfig'
module Cucover
module LineNumbers
# Different Ruby versions have slightly different line numbers with rcov
def self.offset
Config::CONFIG['MINOR'] == '9' ? 0 : 1
end
end
end |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | lib/cucover/cucumber_hooks.rb | Ruby | mit | 49 | master | 1,116 | module Cucover
module FeatureElementExtensions
def reset_skipped_steps!
return unless @steps
@steps.each do |step|
step.instance_variable_set("@skip_invoke", nil)
end
end
end
end
module Cucover
module ExampleRowExtensions
include FeatureElementExtensions
def file_colon_... |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | lib/cucover/store.rb | Ruby | mit | 49 | master | 1,730 | module Cucover
class Store
def initialize(cache = DiskCache.new)
@cache = cache
end
def latest_recordings
recordings.keys.map{ |file_colon_line| latest_recording(file_colon_line) }
end
def latest_recording(file_colon_line)
recordings[file_colon_line].sort{ |x, y| x.end_time <=>... |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | lib/cucover/recorder.rb | Ruby | mit | 49 | master | 1,046 | module Cucover
class Recorder
def initialize(scenario_or_table_row)
@scenario_or_table_row = scenario_or_table_row
@analyzer = Rcov::CodeCoverageAnalyzer.new
@additional_covered_files = []
end
def record_file!(source_file)
unless @additional_covered_files.include?(source_file)
... |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | lib/cucover/cli_commands/cucumber.rb | Ruby | mit | 49 | master | 1,001 | module Cucover
module CliCommands
class Cucumber
LANGUAGE = 'rb'
class << self
attr_accessor :exit_status
end
def initialize(cli_args)
Cucumber.exit_status = 0
@cli_args = cli_args
end
def execute
require 'rubygems'
require 'cucumber'... |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | lib/cucover/cli_commands/coverage_of.rb | Ruby | mit | 49 | master | 1,300 | module Cucover
module CliCommands
class CoverageOf
CODE_COLUMN_WIDTH = 15
def initialize(cli_args)
@filespec = cli_args[1]
@store = Store.new
end
def execute
load_cucumber_enviroment
return unless recordings.any?
File.open(@filespec).each_with_ind... |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | lib/cucover/cli_commands/version.rb | Ruby | mit | 49 | master | 223 | module Cucover
module CliCommands
class Version
def initialize(cli_args)
end
def execute
puts File.read(File.dirname(__FILE__) + '/../../../VERSION')
end
end
end
end |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | lib/cucover/cli_commands/show_recordings.rb | Ruby | mit | 49 | master | 763 | module Cucover
module CliCommands
class ShowRecordings
def initialize(cli_args)
@store = Store.new
end
def execute
unless recordings.any?
puts "No recordings to show. Run some tests with cucover first."
return
end
recordings.eac... |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | lib/cucover/recording/covered_file.rb | Ruby | mit | 49 | master | 1,384 | module Cucover
class Recording::CoveredFile
attr_reader :file
def initialize(full_filename, rcov_marked_info, recording)
@full_filename = full_filename
@rcov_marked_info = rcov_marked_info
@recording = recording
@file = File.expand_path(full_filename).gsub(/^#{Dir.pwd}\//, '... |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | examples/self_test/simple/features/step_definitions/main_steps.rb | Ruby | mit | 49 | master | 368 | require File.dirname(__FILE__) + '/../../lib/foo'
require File.dirname(__FILE__) + '/../../lib/bar'
require File.dirname(__FILE__) + '/../../lib/baz'
Given /^I have called ([\w]+)$/ do |class_name|
Object.const_get(class_name).new.execute
end
When /^I call ([\w]+)$/ do |class_name|
Given "I have called #{class_na... |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | examples/self_test/rails/features/support/env.rb | Ruby | mit | 49 | master | 2,595 | # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
# It is recommended to regenerate this file in the future when you upgrade to a
# newer version of cucumber-rails. Consider adding your own code to a new file
# instead of editing this one. Cucumber will automatically load all features/**... |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | examples/self_test/rails/features/support/paths.rb | Ruby | mit | 49 | master | 649 | module NavigationHelpers
# Maps a name to a path. Used by the
#
# When /^I go to (.+)$/ do |page_name|
#
# step definition in web_steps.rb
#
def path_to(page_name)
case page_name
when /the home\s?page/
'/'
when /the widgets/
'/widgets'
# Add more mappings here.
... |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | examples/self_test/rails/lib/tasks/cucumber.rake | Ruby | mit | 49 | master | 1,718 | # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
# It is recommended to regenerate this file in the future when you upgrade to a
# newer version of cucumber-rails. Consider adding your own code to a new file
# instead of editing this one. Cucumber will automatically load all features/**... |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | examples/self_test/rails/config/environments/cucumber.rb | Ruby | mit | 49 | master | 1,385 | # Edit at your own peril - it's recommended to regenerate this file
# in the future when you upgrade to a newer version of Cucumber.
# IMPORTANT: Setting config.cache_classes to false is known to
# break Cucumber's use_transactional_fixtures method.
# For more information see https://rspec.lighthouseapp.com/projects/1... |
github | mattwynne/cucover | https://github.com/mattwynne/cucover | examples/self_test/rails/config/initializers/session_store.rb | Ruby | mit | 49 | master | 798 | # Be sure to restart your server when you modify this file.
# Your secret key for verifying cookie session data integrity.
# If you change this key, all old sessions 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 attacks.
Act... |
github | kinduff/slack-big-emoji | https://github.com/kinduff/slack-big-emoji | slack-big-emoji.gemspec | Ruby | mit | 49 | master | 1,187 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'slack_big_emoji/version'
Gem::Specification.new do |s|
s.name = "slack-big-emoji"
s.version = SlackBigEmoji::VERSION
s.platform = Gem::Platform::RUBY
s.authors =... |
github | kinduff/slack-big-emoji | https://github.com/kinduff/slack-big-emoji | lib/slack_big_emoji.rb | Ruby | mit | 49 | master | 204 | module SlackBigEmoji
require_relative 'slack_big_emoji/version'
require_relative 'slack_big_emoji/cli'
require_relative 'slack_big_emoji/converter'
require_relative 'slack_big_emoji/uploader'
end |
github | kinduff/slack-big-emoji | https://github.com/kinduff/slack-big-emoji | lib/slack_big_emoji/cli.rb | Ruby | mit | 49 | master | 2,020 | require 'optparse'
module SlackBigEmoji
class CLI
attr_accessor :options
def initialize(args)
@options = parse(args)
end
def parse(args)
options = {}
opts = OptionParser.new do |opts|
opts.banner = "Usage: slack-big-emoji [options] FILE"
opts.version = SlackBigEmoj... |
github | kinduff/slack-big-emoji | https://github.com/kinduff/slack-big-emoji | lib/slack_big_emoji/uploader.rb | Ruby | mit | 49 | master | 2,448 | require 'highline/import'
require 'mechanize'
require 'logger'
# Grabbed from https://github.com/decomoji/slack-reaction-decomoji/blob/fd1f9b6a12b95ee27b9ad4173560db9ae3015ea0/scripts/import.rb
module SlackBigEmoji
class Uploader
BASE_DIR = File.expand_path(File.dirname(__FILE__))
def initialize(dir)
... |
github | kinduff/slack-big-emoji | https://github.com/kinduff/slack-big-emoji | lib/slack_big_emoji/converter.rb | Ruby | mit | 49 | master | 1,226 | require 'mini_magick'
require_relative 'uploader'
module SlackBigEmoji
class Converter
attr_accessor :image, :file_name, :ratio, :file_resize_spec, :tile_width, :crop_size, :output_dir, :output_filename, :output_path
def initialize(options={})
@image = ::MiniMagick::Image.open(options[:file])
@f... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | Gemfile | Ruby | mit | 49 | master | 398 | source "https://rubygems.org"
gemspec
gem "awesome_print", require: "ap"
gem "coveralls", require: false
gem "dotenv"
gem "guard-rspec", platforms: [:ruby_23]
gem "launchy"
gem "oauth"
gem "pry"
gem "pry-byebug", platforms: [:ruby_21, :ruby_22, :ruby_23]
gem "rake"
gem "rb-fsevent"
gem "rspec", "~> 3.3"
gem "rubocop"... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | tacokit.gemspec | Ruby | mit | 49 | master | 1,102 | # coding: utf-8
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "tacokit/version"
Gem::Specification.new do |spec|
spec.name = "tacokit"
spec.version = Tacokit::VERSION
spec.authors = ["Ross Kaffenberger"]
spec.email = ["ro... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | Guardfile | Ruby | mit | 49 | master | 367 | guard :rspec, cmd: "bundle exec rspec --format progress" do
require "ostruct"
rspec = OpenStruct.new
rspec.spec = ->(m) { "spec/#{m}_spec.rb" }
rspec.spec_dir = "spec"
rspec.spec_helper = "spec/spec_helper.rb"
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| rspec.spec.(m[1]) }
watch(... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | Rakefile | Ruby | mit | 49 | master | 582 | require "bundler"
Bundler::GemHelper.install_tasks
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = "--color --format progress"
end
require "rubocop/rake_task"
RuboCop::RakeTask.new
task test: [:spec, :rubocop]
task default: [:spec, :rubocop]
namespace :doc do
desc "Generate... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | lib/tacokit.rb | Ruby | mit | 49 | master | 393 | module Tacokit
class << self
def client
@client ||= Tacokit::Client.new
end
def method_missing(method_name, *args, &block)
return super unless client.respond_to?(method_name)
client.send(method_name, *args, &block)
end
end
end
require "tacokit/utils"
require "tacokit/resource"
re... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | lib/tacokit/client.rb | Ruby | mit | 49 | master | 3,222 | require "forwardable"
require "addressable/uri"
require "faraday"
require "faraday_middleware"
require "tacokit/authorization"
require "tacokit/collection"
require "tacokit/configuration"
require "tacokit/middleware"
require "tacokit/response"
require "tacokit/transform"
require "tacokit/client/actions"
require "ta... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | lib/tacokit/collection.rb | Ruby | mit | 49 | master | 1,187 | require "forwardable"
module Tacokit
class Collection
include Enumerable
extend Forwardable
MAX = 1000
def_delegators :@collection, :[], :empty?, :size
def initialize(client, method, path, options)
@client = client
@method = method
@path = path
@options = options
... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | lib/tacokit/response.rb | Ruby | mit | 49 | master | 519 | module Tacokit
class Response
attr_reader :client, :status, :headers, :env, :data
def initialize(client, res, options = {})
@client = client
@status = res.status
@headers = res.headers
@env = res.env
@data = process_data(@client.deserialize(res.body))
end
... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | lib/tacokit/utils.rb | Ruby | mit | 49 | master | 2,223 | # Emulate only what we need from activesupport
module Tacokit
module Utils
def deep_transform_keys(hash, &block)
_deep_transform_keys_in_object(hash, &block)
end
def extract_options(*args)
opts = args.last.is_a?(Hash) ? args.pop : {}
[args, opts]
end
# rubocop:disable Style/Dot... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | lib/tacokit/resource.rb | Ruby | mit | 49 | master | 3,408 | # frozen_string_literal: true
require "set"
require "time"
require "forwardable"
module Tacokit
class Resource
include Enumerable
extend Forwardable
SPECIAL_METHODS = Set.new(%w[fields])
attr_reader :_fields
attr_reader :attrs
alias to_hash attrs
alias to_h attrs
def_delegators :@_f... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | lib/tacokit/authorization.rb | Ruby | mit | 49 | master | 1,426 | module Tacokit
module Authorization
def get_app_key # rubocop:disable Style/AccessorMethodName
open_url web_url("app-key")
end
# Get a token for making authorized requests to the Trello API
#
# @param params [Hash] Repository information to update
# @option params [String] :name Name of... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | lib/tacokit/error.rb | Ruby | mit | 49 | master | 672 | module Tacokit
class Error < StandardError
ConfigurationError = Class.new(Error)
ClientError = Class.new(Error)
# Errors
# Code - Message
Unauthorized = Class.new(ClientError)
# 401 - invalid token
InvalidToken = Class.new(Unauthorized)
# 401 - invalid key
InvalidKey = Class... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | lib/tacokit/middleware.rb | Ruby | mit | 49 | master | 570 | require "tacokit/middleware/raise_error"
module Tacokit
module Middleware
Faraday::Response.register_middleware raise_error: -> { Tacokit::Middleware::RaiseError }
module_function
def default_stack(config = Tacokit.configuration)
proc do |http|
http.request :json
http.request :mul... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | lib/tacokit/configuration.rb | Ruby | mit | 49 | master | 1,429 | # frozen_string_literal: true
module Tacokit
class Configuration
API_URL = "https://api.trello.com".freeze
WEB_URL = "https://trello.com".freeze
API_VERSION = "1".freeze
def self.keys
[
:app_key,
:app_secret,
:app_token,
:oauth_token,
:oauth_secret,
... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | lib/tacokit/transform.rb | Ruby | mit | 49 | master | 2,590 | module Tacokit
class Transform
include Tacokit::Utils
def serialize_params(params)
normalize_request_params(params)
end
def serialize(body)
serialize_body(body)
end
def deserialize(body)
deserialize_body(body)
end
private
def normalize_request_params(params)
... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | lib/tacokit/middleware/raise_error.rb | Ruby | mit | 49 | master | 888 | module Tacokit
module Middleware
class RaiseError < Faraday::Response::Middleware
CLIENT_ERROR_STATUSES = 400...600
def on_complete(env)
case env[:status]
when 401
raise Tacokit::Error::Unauthorized, error_message(env)
when 404
raise Tacokit::Error::Resourc... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | lib/tacokit/client/actions.rb | Ruby | mit | 49 | master | 4,788 | module Tacokit
class Client
module Actions
# Retrieve an action
# @param action_id [String] the action identifier
# @return [Tacokit::Resource] the action resource
# @see https://developers.trello.com/advanced-reference/action#get-1-actions-idaction
def action(action_id, options = ni... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | lib/tacokit/client/types.rb | Ruby | mit | 49 | master | 431 | module Tacokit
class Client
# Methods for the Types API
# @see https://developers.trello.com/advanced-reference/type
module Types
# Get a resource type for a given identifier
# @param model_id [String] the resource identifier
# @see https://developers.trello.com/advanced-reference/type#g... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | lib/tacokit/client/boards.rb | Ruby | mit | 49 | master | 12,220 | module Tacokit
class Client
# Methods for the Boards API
# @see https://developers.trello.com/advanced-reference/board
module Boards
# Retrieve a board
# @param board_id [String] the board identifier
# @return [Tacokit::Resource<Board>] the board resource
# @example fetch a board
... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | lib/tacokit/client/tokens.rb | Ruby | mit | 49 | master | 1,163 | module Tacokit
class Client
# Methods for the Tokens API
# @see https://developers.trello.com/advanced-reference/token
module Tokens
# Get an authorization token
# @param token [String] the token identifier
# @param options [Hash] options to fetch the token with
# @return [Tacokit:... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | lib/tacokit/client/notifications.rb | Ruby | mit | 49 | master | 2,689 | module Tacokit
class Client
# Methods for the Notifications API
# @see https://developers.trello.com/advanced-reference/notification
module Notifications
# Retrieve a notification
# @param notification_id [String] the notification identifier
# @param options [Hash] options to fetch the n... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | lib/tacokit/client/webhooks.rb | Ruby | mit | 49 | master | 1,970 | module Tacokit
class Client
# Methods for the Webhooks API
# @see https://developers.trello.com/advanced-reference/webhook
module Webhooks
# Update a webhook
# @param webhook_id [String] the webhook identifier
# @param options [Hash] options to update the webhook with
# @return [Ta... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | lib/tacokit/client/searches.rb | Ruby | mit | 49 | master | 1,364 | module Tacokit
class Client
# Methods for the Search API
# @see https://developers.trello.com/advanced-reference/search
module Searches
# Search across resources with a query
# @param query [String] the text of the search query
# @param options [Hash] options to retrieve the search resul... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | lib/tacokit/client/checklists.rb | Ruby | mit | 49 | master | 4,014 | module Tacokit
class Client
module Checklists
# Retrieve a checklist
# @param checklist_id [String] the checklist identifier
# @param options [Hash] options to fetch the checklist with
# @return [Tacokit::Resource] the checklist resource
# @see https://developers.trello.com/advanced-... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | lib/tacokit/client/labels.rb | Ruby | mit | 49 | master | 1,654 | module Tacokit
class Client
module Labels
# Retrieve a label
# @param label_id [String] the label identifier
# @param options [Hash] options to fetch the label with
# @return [Tacokit::Resource] the label resource
# @see https://developers.trello.com/advanced-reference/label#get-1-la... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | lib/tacokit/client/organizations.rb | Ruby | mit | 49 | master | 2,115 | module Tacokit
class Client
# Methods for the Organizations API
# @see https://developers.trello.com/advanced-reference/organization
module Organizations
# Retrieve an organization
# @param org_id [String] the organization identifier
# @param options [Hash] options to fetch the organizat... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | lib/tacokit/client/lists.rb | Ruby | mit | 49 | master | 6,396 | module Tacokit
class Client
# Methods for the Lists API
# @see https://developers.trello.com/advanced-reference/list
module Lists
# Retrieve a list by id
# @param list_id [String] the list identifier or shortlink
# @return [Tacokit::Resource<List>] the list resource
# @example Retr... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | lib/tacokit/client/members.rb | Ruby | mit | 49 | master | 10,234 | module Tacokit
class Client
# Methods for the Members API
# @see https://developers.trello.com/advanced-reference/member
module Members
# @overload member(username = "me", options = nil)
# Retrieve a Trello member by username
# @param username [String] the member's username
# ... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | lib/tacokit/client/cards.rb | Ruby | mit | 49 | master | 26,673 | require "uri"
module Tacokit
class Client
# Methods for the Cards API
# @see https://developers.trello.com/advanced-reference/card
module Cards
# Retrieve a card by id or shortlink
# @param card_id [String] the card identifier or shortlink
# @return [Tacokit::Resource<Card>] the card re... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | spec/spec_helper.rb | Ruby | mit | 49 | master | 3,382 | require "bundler/setup"
Bundler.setup
require "coveralls"
Coveralls.wear!
require "dotenv"
Dotenv.load(File.expand_path("../../.env", __FILE__))
require "tacokit"
require "rspec"
require "webmock/rspec"
require "pry"
WebMock.disable_net_connect!
RSpec.configure do |config|
config.before(:suite) do
warn "Usin... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | spec/tacokit_spec.rb | Ruby | mit | 49 | master | 316 | require "spec_helper"
describe Tacokit do
describe "#method_missing" do
it "forwards messages to client" do
expect(Tacokit.client).to receive(:get_app_key)
Tacokit.get_app_key
end
it "raises otherwise" do
expect { Tacokit.no_method }.to raise_error(NoMethodError)
end
end
end |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | spec/tacokit/resource_spec.rb | Ruby | mit | 49 | master | 4,037 | require "spec_helper"
module Tacokit
describe Resource do
describe "#initialize" do
it "handles given attributes" do
res = Resource.new one: "one", "two" => :two
expect(res).to be_a(Resource)
expect(res.one).to eq "one"
expect(res.two).to eq :two
end
it "handle... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | spec/tacokit/authorization_spec.rb | Ruby | mit | 49 | master | 1,328 | require "spec_helper"
require "launchy"
describe Tacokit::Authorization do
before do
allow(Launchy).to receive(:open)
end
describe "#get_app_key" do
it "launches app key endpoint" do
expect(Launchy).to receive(:open).with("https://trello.com/1/app-key")
Tacokit.client.get_app_key
end
... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | spec/tacokit/client_spec.rb | Ruby | mit | 49 | master | 850 | require "spec_helper"
describe Tacokit::Client do
describe "#configuration" do
it "accepts configuration" do
opts = { app_key: "joel", app_secret: "0ns0ftw@re" }
client = Tacokit::Client.new(opts)
expect(client.app_key).to eq("joel")
expect(client.app_secret).to eq("0ns0ftw@re")
end
... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | spec/tacokit/configuration_spec.rb | Ruby | mit | 49 | master | 2,264 | require "spec_helper"
describe Tacokit::Configuration do
let(:configuration) { Tacokit::Configuration.new }
it "has an app_key attribute" do
configuration.app_key = "app_key"
expect(configuration.app_key).to eq("app_key")
end
it "has an app_secret attribute" do
configuration.app_secret = "app_sec... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | spec/tacokit/transform_spec.rb | Ruby | mit | 49 | master | 3,558 | require "spec_helper"
module Tacokit
describe Transform do
subject(:transform) { Transform.new }
describe "#serialize" do
def process(body)
transform.serialize(body)
end
it "does not change no body" do
result = process(nil)
expect(result).to be_nil
end
... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | spec/tacokit/middleware/raise_error_spec.rb | Ruby | mit | 49 | master | 932 | require "spec_helper"
describe Tacokit::Middleware::RaiseError do
let(:app) { Object.new }
let(:env) { Faraday::Env.new }
let(:middleware) { described_class.new(app) }
describe "#on_complete" do
it "raises 404" do
env[:status] = 404
expect { middleware.on_complete(env) }.to raise_error(Tacokit... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | spec/tacokit/client/webhooks_spec.rb | Ruby | mit | 49 | master | 1,714 | require "spec_helper"
describe Tacokit::Client::Webhooks do
describe "#update_webhook", :vcr do
before do
@webhook = app_client.create_webhook \
test_org_id,
tacokit_web_endpoint("webhook?create_webhook")
end
it "updates a webhook" do
@webhook = app_client.update_webhook(@web... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | spec/tacokit/client/labels_spec.rb | Ruby | mit | 49 | master | 1,562 | require "spec_helper"
describe Tacokit::Client::Labels do
def test_label_id
"548a675574d650d567d52ad0"
end
def test_board_id
"548a675581d1d669c9e8184e"
end
describe "#label", :vcr do
it "returns a label by id" do
label = app_client.label(test_label_id)
expect(label.name).to match(/L... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | spec/tacokit/client/organizations_spec.rb | Ruby | mit | 49 | master | 2,446 | require "spec_helper"
describe Tacokit::Client::Organizations do
describe "#organization", :vcr do
it "returns an organization by id" do
org = app_client.organization(test_org_name)
expect(org.name).to eq "teamtacokit"
end
end
describe "#organization_resource", :vcr do
it "returns organ... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | spec/tacokit/client/actions_spec.rb | Ruby | mit | 49 | master | 3,305 | require "spec_helper"
describe Tacokit::Client::Actions do
def test_action_id
"548e3153ea7ca8f9cd3cb77b"
end
def test_card_id
"548dd95c8ca25ac9d0d9ce71"
end
describe "#action", :vcr do
it "returns a token authorized action" do
action = app_client.action(test_action_id)
expect(actio... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | spec/tacokit/client/lists_spec.rb | Ruby | mit | 49 | master | 3,328 | require "spec_helper"
describe Tacokit::Client::Lists do
def test_list_id
"548dd948ffd374221926b4c8"
end
def test_board_id
"548a675581d1d669c9e8184e"
end
def test_alternate_list_id
"54f3724e8a0bbe01a80f8712"
end
def test_alternate_board_id
"54f371b4086781e1a71b6111"
end
describe "... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | spec/tacokit/client/notifications_spec.rb | Ruby | mit | 49 | master | 762 | require "spec_helper"
describe Tacokit::Client::Notifications do
# TODO: notifications disappear overtime... need to grab notification id dynamically
def test_notification_id
"549102431b607566bafc93ab"
end
pending "#notification", :vcr do
it "returns a notification by id" do
notification = app_c... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | spec/tacokit/client/tokens_spec.rb | Ruby | mit | 49 | master | 875 | require "spec_helper"
describe Tacokit::Client::Tokens do
describe "#token", :vcr do
it "returns a token for token string" do
token = app_client.token(test_trello_app_token)
expect(token.identifier).to be_present
end
end
describe "#token_resource", :vcr do
it "returns token member" do
... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | spec/tacokit/client/cards_spec.rb | Ruby | mit | 49 | master | 12,526 | require "spec_helper"
describe Tacokit::Client::Cards do
def test_card_link
"k7GHJj7Q"
end
def test_card_id
"548dd95c8ca25ac9d0d9ce71"
end
describe "#card", :vcr do
it "returns a card by short link" do
card = app_client.card(test_card_link)
expect(card.name).to eq "Card 1"
end
... |
github | rossta/tacokit.rb | https://github.com/rossta/tacokit.rb | spec/tacokit/client/checklists_spec.rb | Ruby | mit | 49 | master | 2,493 | require "spec_helper"
describe Tacokit::Client::Checklists do
def test_checklist_id
"548ddd3f5402eb674035334f"
end
def test_card_id
"548dd95c8ca25ac9d0d9ce71"
end
describe "#checklist", :vcr do
it "returns a checklist by id" do
checklist = app_client.checklist(test_checklist_id)
ex... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.