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 | storuky/oxymoron | https://github.com/storuky/oxymoron | lib/oxymoron/oxymoron_form_builder.rb | Ruby | mit | 49 | master | 3,078 | class OxymoronFormBuilder < ActionView::Helpers::FormBuilder
(field_helpers - [:label, :check_box, :radio_button, :fields_for, :hidden_field, :file_field]).each do |selector|
class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
def #{selector}(method, options = {}) # def text_field(method, options = {})
... |
github | storuky/oxymoron | https://github.com/storuky/oxymoron | lib/oxymoron/concern.rb | Ruby | mit | 49 | master | 536 | module Oxymoron
module Concern
extend ActiveSupport::Concern
included do
after_action :set_xsrf_token_cookie
end
def set_xsrf_token_cookie
cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?
end
def verified_request?
if respond_to?(:valid_authentici... |
github | storuky/oxymoron | https://github.com/storuky/oxymoron | lib/oxymoron/extensions/form_helper.rb | Ruby | mit | 49 | master | 3,258 | module Oxymoron
module ActionViewExtensions
module FormHelperRewrite
def form_for(record, options = {}, &block)
raise ArgumentError, "Missing block" unless block_given?
options[:html] ||= {}
html_options = options[:html].with_indifferent_access
case record
when Stri... |
github | storuky/oxymoron | https://github.com/storuky/oxymoron | test/dummy/config/application.rb | Ruby | mit | 49 | master | 1,018 | require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(*Rails.groups)
require "oxymoron"
module Dummy
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/i... |
github | basecamp/cognition | https://github.com/basecamp/cognition | cognition.gemspec | Ruby | mit | 49 | master | 1,166 | # coding: utf-8
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "cognition/version"
Gem::Specification.new do |spec|
spec.name = "cognition"
spec.version = Cognition::VERSION
spec.authors = ["Nathan Anderson"]
spec.email = ... |
github | basecamp/cognition | https://github.com/basecamp/cognition | lib/cognition/matcher.rb | Ruby | mit | 49 | master | 931 | module Cognition
class Matcher
attr_reader :trigger, :action, :response, :help, :match_data
def initialize(trigger, options = {}, &action)
fail ArgumentError, "matcher must have a trigger" unless trigger
fail ArgumentError, "matcher must have an action" unless action
@trigger = trigger
... |
github | basecamp/cognition | https://github.com/basecamp/cognition | lib/cognition/bot.rb | Ruby | mit | 49 | master | 1,521 | require "cognition/message"
require "cognition/matcher"
require "cognition/responder"
require "cognition/plugins/base"
require "cognition/plugins/default"
module Cognition
class Bot
attr_accessor :plugins, :matchers
def initialize
# Default plugin, responds to "ping" with "PONG" and provides help text... |
github | basecamp/cognition | https://github.com/basecamp/cognition | lib/cognition/message.rb | Ruby | mit | 49 | master | 955 | module Cognition
class Message
attr_reader :command, :filter, :metadata, :responder
def initialize(command, metadata = {})
@command, @filter = split_on_unquoted_pipe(command).map { |s| s&.strip }
@metadata = metadata
@responder = Cognition::Responder.new(metadata["callback_url"]) if metadat... |
github | basecamp/cognition | https://github.com/basecamp/cognition | lib/cognition/responder.rb | Ruby | mit | 49 | master | 350 | require "httparty"
module Cognition
class Responder
include HTTParty
attr_reader :url
def initialize(uri)
@options = { timeout: 5 }
@uri = uri
end
def reply(text)
self.class.post(@uri, @options.merge(body: { content: text }))
rescue Timeout::Error
"Request to #{@uri} ... |
github | basecamp/cognition | https://github.com/basecamp/cognition | lib/cognition/plugins/default.rb | Ruby | mit | 49 | master | 854 | module Cognition
module Plugins
class Default < Cognition::Plugins::Base
# rubocop:disable Lint/AmbiguousRegexpLiteral
match /^ping$/i, :pong, help: {
"ping" => "Test if the endpoint is responding. Returns PONG."
}
match /^help\s*(?<command>.*)/i, :help, help: {
"help" => ... |
github | basecamp/cognition | https://github.com/basecamp/cognition | lib/cognition/plugins/base.rb | Ruby | mit | 49 | master | 2,604 | require "erb"
require "tilt"
require "cgi"
module Cognition
module Plugins
class PluginTemplateNotFound < StandardError; end
class Base
class <<self
attr_accessor :view_root
end
RENDER_DEFAULTS = {
type: "html",
extension: "erb"
}
# Inherited callback ... |
github | basecamp/cognition | https://github.com/basecamp/cognition | test/test_message.rb | Ruby | mit | 49 | master | 1,789 | require "minitest/autorun"
require "cognition"
class CognitionTest < Minitest::Test
def test_sets_metadata
msg = Cognition::Message.new("test", user_id: 15, foo: "bar")
assert_equal 15, msg.metadata[:user_id]
assert_equal "bar", msg.metadata[:foo]
end
def test_sets_responder_if_callback_url
msg ... |
github | basecamp/cognition | https://github.com/basecamp/cognition | test/test_plugin.rb | Ruby | mit | 49 | master | 956 | require "minitest/autorun"
require "cognition"
class PluginTest < Minitest::Test
def setup
require_relative "fixtures/hello"
bot = Cognition::Bot.new
@hello = Hello.new(bot)
end
def test_sets_matchers
assert_equal 1, @hello.matchers.count
end
def test_renders_default_template
assert_equ... |
github | basecamp/cognition | https://github.com/basecamp/cognition | test/test_default_plugin.rb | Ruby | mit | 49 | master | 525 | require "minitest/autorun"
require "cognition"
class DefaultPluginTest < Minitest::Test
def setup
@bot = Cognition::Bot.new
end
def test_returns_help
help = "help - Lists all commands with help\nhelp <command> - Lists help for <command>\nping - Test if the endpoint is responding. Returns PONG."
asse... |
github | basecamp/cognition | https://github.com/basecamp/cognition | test/test_responder.rb | Ruby | mit | 49 | master | 579 | require "minitest/autorun"
require "cognition"
require "test_helper"
class ResponderTest < Minitest::Test
def test_sends_reply
stub_request(:any, "http://foo.bar/path")
.to_return(status: 200)
responder = Cognition::Responder.new("http://foo.bar/path")
assert_equal 200, responder.reply("foobar").c... |
github | basecamp/cognition | https://github.com/basecamp/cognition | test/test_matcher.rb | Ruby | mit | 49 | master | 3,032 | require "minitest/autorun"
require "cognition"
class MatcherTest < Minitest::Test
def test_raises_error_without_a_trigger
assert_raises ArgumentError do
_ = Cognition::Matcher.new(action: "foo")
end
end
def test_raises_error_without_an_action
assert_raises ArgumentError do
_ = Cognition:... |
github | basecamp/cognition | https://github.com/basecamp/cognition | test/test_cognition.rb | Ruby | mit | 49 | master | 1,298 | require "minitest/autorun"
require "cognition"
require_relative "fixtures/hello"
require_relative "fixtures/anchor"
class CognitionTest < Minitest::Test
def setup
@bot = Cognition::Bot.new
end
def test_registers_plugins
@bot.register(Hello)
assert_equal 2, @bot.plugin_names.count
end
def test_... |
github | digital-fabric/qeweney | https://github.com/digital-fabric/qeweney | qeweney.gemspec | Ruby | mit | 49 | main | 1,027 | require_relative './lib/qeweney/version'
Gem::Specification.new do |s|
s.name = 'qeweney'
s.version = Qeweney::VERSION
s.licenses = ['MIT']
s.summary = 'Qeweney - cross library HTTP request / response API'
s.author = 'Sharon Rosner'
s.email = 'sharon@noteflakes.com'
s.files ... |
github | digital-fabric/qeweney | https://github.com/digital-fabric/qeweney | examples/routing_benchmark.rb | Ruby | mit | 49 | main | 3,025 | # frozen_string_literal: true
require 'bundler/setup'
require 'qeweney'
require 'benchmark/ips'
module Qeweney
class MockAdapter
attr_reader :calls
def initialize
@calls = []
end
def method_missing(sym, *args)
calls << [sym, *args]
end
end
def self.mock(headers = {})
Reque... |
github | digital-fabric/qeweney | https://github.com/digital-fabric/qeweney | test/test_response.rb | Ruby | mit | 49 | main | 5,026 | # frozen_string_literal: true
require_relative 'helper'
class RedirectTest < Minitest::Test
def test_redirect
r = Qeweney::MockAdapter.mock
r.redirect('/foo')
assert_equal [
[:respond, r, nil, {":status"=>302, "Location"=>"/foo"}]
], r.adapter.calls
end
def test_redirect_wirth_status
... |
github | digital-fabric/qeweney | https://github.com/digital-fabric/qeweney | test/test_request_info.rb | Ruby | mit | 49 | main | 2,471 | # frozen_string_literal: true
require_relative 'helper'
class RequestInfoTest < Minitest::Test
def test_uri
r = Qeweney::MockAdapter.mock(':path' => '/test/path')
assert_equal '/test/path', r.path
assert_equal({}, r.query)
r = Qeweney::MockAdapter.mock(':path' => '/test/path?a=1&b=2&c=3%2f4')
a... |
github | digital-fabric/qeweney | https://github.com/digital-fabric/qeweney | test/test_routing.rb | Ruby | mit | 49 | main | 4,120 | # frozen_string_literal: true
require_relative 'helper'
class RoutingTest < Minitest::Test
App1 = ->(r) do
r.route do
r.on_root { r.redirect '/hello' }
r.on('hello') do
r.on_get('world') { r.respond 'Hello world' }
r.on_get { r.respond 'Hello' }
r.on_post do
r.redir... |
github | digital-fabric/qeweney | https://github.com/digital-fabric/qeweney | test/test_mock_adapter.rb | Ruby | mit | 49 | main | 1,764 | # frozen_string_literal: true
require_relative 'helper'
class MockAdapterTest < Minitest::Test
def test_mock_adapter
adapter = Qeweney::MockAdapter.new(nil)
req = Qeweney::Request.new({ ':path' => '/foo' }, adapter)
req.respond('bar', 'Content-Type' => 'baz')
assert_equal 'bar', adapter.response_bo... |
github | digital-fabric/qeweney | https://github.com/digital-fabric/qeweney | test/helper.rb | Ruby | mit | 49 | main | 201 | # frozen_string_literal: true
require 'bundler/setup'
require 'qeweney'
require 'qeweney/mock_adapter'
require 'fileutils'
require 'minitest/autorun'
require_relative './coverage' if ENV['COVERAGE'] |
github | digital-fabric/qeweney | https://github.com/digital-fabric/qeweney | test/run_loop.rb | Ruby | mit | 49 | main | 614 | #!/usr/bin/env ruby
# frozen_string_literal: true
require 'bundler/setup'
require 'listen'
def run_all_tests
puts
system('bundle exec ruby test/run.rb')
end
def run_test(fn)
system("bundle exec ruby #{fn}")
end
listener = Listen.to('lib', 'test') do |modified, added, removed|
puts '*' * 40
fns = []
m... |
github | digital-fabric/qeweney | https://github.com/digital-fabric/qeweney | lib/qeweney/response.rb | Ruby | mit | 49 | main | 4,476 | # frozen_string_literal: true
require 'time'
require 'zlib'
require 'stringio'
require 'digest/sha1'
require_relative 'status'
require_relative 'mime_types'
module Qeweney
module StaticFileCaching
class << self
def file_stat_to_etag(stat)
"#{stat.mtime.to_i.to_s(36)}#{stat.size.to_s(36)}"
e... |
github | digital-fabric/qeweney | https://github.com/digital-fabric/qeweney | lib/qeweney/request.rb | Ruby | mit | 49 | main | 2,624 | # frozen_string_literal: true
require_relative './request_info'
require_relative './routing'
require_relative './response'
require_relative './rack'
module Qeweney
# HTTP request
class Request
include RequestInfoMethods
include RoutingMethods
include ResponseMethods
extend RequestInfoClassMethods... |
github | digital-fabric/qeweney | https://github.com/digital-fabric/qeweney | lib/qeweney/rack.rb | Ruby | mit | 49 | main | 3,302 | # frozen_string_literal: true
module Qeweney
class RackRequestAdapter
def initialize(env)
@env = env
@response_headers = {}
@response_body = []
end
def request_headers
request_http_headers.merge(
':scheme' => @env['rack.url_scheme'],
':method' => @env['REQUEST_MET... |
github | digital-fabric/qeweney | https://github.com/digital-fabric/qeweney | lib/qeweney/request_info.rb | Ruby | mit | 49 | main | 5,193 | # frozen_string_literal: true
require 'uri'
require 'escape_utils'
require_relative './errors'
module Qeweney
module RequestInfoMethods
def host
@headers['host'] || @headers[':authority']
end
alias_method :authority, :host
def connection
@headers['connection']
end
def upgrade_... |
github | digital-fabric/qeweney | https://github.com/digital-fabric/qeweney | lib/qeweney/mock_adapter.rb | Ruby | mit | 49 | main | 1,314 | # frozen_string_literal: true
require 'qeweney'
module Qeweney
class MockAdapter
attr_reader :response_body, :response_headers, :calls
def get_body_chunk(_req, _buffered_only)
@request_body_chunks.shift
end
def get_body(_req)
body = @request_body_chunks.join('')
@request_body_chu... |
github | digital-fabric/qeweney | https://github.com/digital-fabric/qeweney | lib/qeweney/status.rb | Ruby | mit | 49 | main | 3,916 | # frozen_string_literal: true
module Qeweney
# HTTP status codes
module Status
# translated from https://golang.org/pkg/net/http/#pkg-constants
# https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
CONTINUE = 100 # RFC 7231, 6.2.1
SWITCHING_PROTOCOLS ... |
github | digital-fabric/qeweney | https://github.com/digital-fabric/qeweney | lib/qeweney/routing.rb | Ruby | mit | 49 | main | 2,707 | # frozen_string_literal: true
module Qeweney
def self.route(&block)
->(r) { r.route(&block) }
end
module RoutingMethods
def route(&block)
@path_parts ||= path.split('/')
@path_parts_idx ||= 1
res = catch(:stop) { yield self }
return if res == :found
respond(nil, ':status' ... |
github | digital-fabric/qeweney | https://github.com/digital-fabric/qeweney | lib/qeweney/mime_types.rb | Ruby | mit | 49 | main | 850 | # frozen_string_literal: true
module Qeweney
# File extension to MIME type mapping
module MimeTypes
TYPES = {
'html' => 'text/html',
'css' => 'text/css',
'js' => 'application/javascript',
'txt' => 'text/plain',
'text' => 'text/plain',
'gif' => 'image/gif',
... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | Rakefile | Ruby | mit | 49 | master | 397 | require "bundler"
require "rspec/core"
require "rspec/core/rake_task"
require "rubocop/rake_task"
Bundler::GemHelper.install_tasks
RSpec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = FileList["spec/**/*_spec.rb"]
end
RSpec::Core::RakeTask.new(:rcov) do |spec|
spec.pattern = "spec/**/*_spec.rb"
spec.rcov ... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | jiralicious.gemspec | Ruby | mit | 49 | master | 1,320 | # -*- encoding: utf-8 -*-
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "jiralicious/version"
Gem::Specification.new do |s|
s.name = "jiralicious"
s.version = Jiralicious::VERSION
s.platform = Gem::Platform::RUBY
s.homepage = "http:/... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | lib/jiralicious.rb | Ruby | mit | 49 | master | 1,414 | # encoding: utf-8
require "hashie"
require "crack"
require "httparty"
require "json"
require "jiralicious/parsers/field_parser"
require "jiralicious/errors"
require "jiralicious/base"
require "jiralicious/field"
require "jiralicious/custom_field_option"
require "jiralicious/issue"
require "jiralicious/issue/fields"
re... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | lib/jiralicious/search.rb | Ruby | mit | 49 | master | 1,183 | # encoding: utf-8
module Jiralicious
##
# Provides the interface to access the JQL search functionality.
# Uses the same syntax as Rest interface for JQL criteria.
#
# [Arguments]
# :jql (required) JQL string
#
# :start_at (optional) offset to start at
#
# :max_results (opt... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | lib/jiralicious/component.rb | Ruby | mit | 49 | master | 2,508 | # encoding: utf-8
module Jiralicious
class Component < Jiralicious::Field
##
# Holds the Component Key
#
property :component_key, from: :id
class << self
##
# Creates a new component
#
# [Arguments]
# :details (required) Component details to be created
#... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | lib/jiralicious/avatar.rb | Ruby | mit | 49 | master | 2,556 | # encoding: utf-8
module Jiralicious
##
# Avatars in the Project class.
#
class Avatar < Jiralicious::Base
##
# Initialization Method
#
# [Arguments]
# :decoded_json (optional) decoded json object
#
def initialize(decoded_json = nil)
@loaded = false
return if decode... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | lib/jiralicious/configuration.rb | Ruby | mit | 49 | master | 2,804 | # encoding: utf-8
require "ostruct"
module Jiralicious
##
# Base configuration module for Jiralicious
#
module Configuration
# Array of available attributes
VALID_OPTIONS = [:username, :password, :uri, :api_version, :auth_type, :project, :oauth_secret, :oauth_secret_filename, :oauth_pass_phrase, :oauth_... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | lib/jiralicious/errors.rb | Ruby | mit | 49 | master | 953 | # encoding: utf-8
module Jiralicious
# General Jira error
class JiraError < StandardError; end
# AuthenticateError
class AuthenticationError < StandardError; end
# NotLoggedIn error
class NotLoggedIn < AuthenticationError; end
# InvalidLogin error
class InvalidLogin < AuthenticationError; end
# Thes... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | lib/jiralicious/search_result.rb | Ruby | mit | 49 | master | 1,339 | module Jiralicious
##
# The SearchResult class organizes the response from the Jira API
# In a way that is easily parsable into Issues.
#
class SearchResult
# Attributes available for usage regarding the current position in the list
attr_reader :offset, :num_results
##
# Initialization Method... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | lib/jiralicious/project.rb | Ruby | mit | 49 | master | 2,995 | # encoding: utf-8
module Jiralicious
##
# The Project class rolls up the basic functionality for
# managing Projects within Jira through the Rest API.
#
class Project < Jiralicious::Base
# Contains the Fields Class
attr_accessor :components
# Contains the Fields Class
attr_accessor :versions
... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | lib/jiralicious/session.rb | Ruby | mit | 49 | master | 1,627 | # encoding: utf-8
require "jiralicious/configuration"
module Jiralicious
##
# The Session class handles the interactions with the Jira Rest API
# Through the HTTParty gem.
#
class Session
include HTTParty
# Sets the default format to JSON for send and return
format :json
# Sets the de... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | lib/jiralicious/cookie_session.rb | Ruby | mit | 49 | master | 3,254 | # encoding: utf-8
module Jiralicious
##
# The CookieSesssion class extends the Session class with the
# functionality of utilizing cookies for authorization management.
#
# Deprecated:: CookieSession is deprecated as of version 0.2.0
#
class CookieSession < Session
# Adds attributes to the CookieSessi... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | lib/jiralicious/oauth_session.rb | Ruby | mit | 49 | master | 4,434 | require "oauth"
require "nokogiri"
module Jiralicious
##
# The OauthSesion class extends the default OAuth::AccessToken
# The functions herein convert between the current Jiralicious
# and HTTParty formats and those required by OAuth. This is a
# Bidirectional conversion.
#
class OauthSession < OAuth::Ac... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | lib/jiralicious/user.rb | Ruby | mit | 49 | master | 4,639 | # encoding: utf-8
module Jiralicious
##
# The User class rolls up the functionality of user management.
# This class contains methods to manage Users from Ruby via the
# API.
#
class User < Jiralicious::Base
##
# Initialization Method
#
# [Arguments]
# :decoded_json (optional) ruby... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | lib/jiralicious/issue.rb | Ruby | mit | 49 | master | 8,109 | # encoding: utf-8
module Jiralicious
##
# The Issue class rolls up all functionality of issues from Jira.
# This class contains methods to manage Issues from Ruby via the
# API. Several child classes are added in order to facilitate
# several different aspects of managing the issues.
#
class Issue < Jiral... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | lib/jiralicious/base.rb | Ruby | mit | 49 | master | 6,977 | # encoding: utf-8
require "uri"
module Jiralicious
##
# The Base class encapsulates all of the default functionality necessary in order
# to properly manage the Hashie::Trash object within the Jiralicious framework.
#
class Base < Hashie::Trash
##
# Includes functionality from FieldParser
#
in... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | lib/jiralicious/versions.rb | Ruby | mit | 49 | master | 3,966 | # encoding: utf-8
module Jiralicious
class Version < Jiralicious::Field
##
# Holds the version Key
#
property :version_key, from: :id
class << self
##
# Creates a new version
#
# [Arguments]
# :details (required) Version details to be created
#
def... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | lib/jiralicious/custom_field_option.rb | Ruby | mit | 49 | master | 1,093 | # encoding: utf-8
module Jiralicious
##
# The CustomFieldOption provides a list of available custom
# field options. This method is used in lazy loading and can
# be used to validate options prior to updating the issue.
#
class CustomFieldOption < Jiralicious::Base
##
# Initialization Method
#
... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | lib/jiralicious/basic_session.rb | Ruby | mit | 49 | master | 379 | module Jiralicious
##
# The BasicSesion class extends the default Session class by forcing
# basic_auth to be fired prior to any other action.
#
class BasicSession < Session
##
# Fires off the basic_auth with the local username and password.
#
def before_request
self.class.basic_auth(Jir... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | lib/jiralicious/field.rb | Ruby | mit | 49 | master | 1,531 | # encoding: utf-8
module Jiralicious
##
# The Field class is used in multiple classes as a support
# object. This class is designed as a Object Oriented Method
# of viewing the Jira JSON/Hash.
#
class Field < Jiralicious::Base
##
# Initialization Method
#
# Builds the dynamic Field object fr... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | lib/jiralicious/issue/fields.rb | Ruby | mit | 49 | master | 5,038 | # encoding: utf-8
module Jiralicious
class Issue
##
# The Fields class provides functionality to the Issue
# class that allows it to easily update or create issues.
# The class retains the original and the proposed
# information which could be used for cross validation
# prior to posting an u... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | lib/jiralicious/issue/watchers.rb | Ruby | mit | 49 | master | 2,170 | # encoding: utf-8
module Jiralicious
class Issue
##
# The Watchers class is used to manage the
# watchers on an issue.
#
class Watchers < Jiralicious::Base
##
# Holds the Issue Key
#
attr_accessor :jira_key
##
# Initialization Method
#
def initializ... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | lib/jiralicious/issue/transitions.rb | Ruby | mit | 49 | master | 5,385 | # encoding: utf-8
module Jiralicious
class Issue
##
# The Transitions Class provides all of the
# functionality to retrieve, and use a transition
# associated with an Issue.
#
class Transitions < Jiralicious::Base
# Contains the meta data to process a Transaction
attr_accessor :met... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | lib/jiralicious/issue/comment.rb | Ruby | mit | 49 | master | 4,328 | # encoding: utf-8
module Jiralicious
class Issue
##
# The Comment class retrieves and controls the functionality
# of Comments associated with an Issue.
#
class Comment < Jiralicious::Base
# Related Issue Key
attr_accessor :jira_key
##
# Initialization Method
#
... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | lib/jiralicious/parsers/field_parser.rb | Ruby | mit | 49 | master | 1,985 | # encoding: utf-8
module Jiralicious
##
# Parsing module contains all of the parser functionality
#
module Parsers
##
# The FieldParser module is an extention that assists in
# managing hash parsing and implementation.
#
module FieldParser
##
# Parses an Array or Hash into the cu... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | lib/jiralicious/user/avatar.rb | Ruby | mit | 49 | master | 3,683 | # encoding: utf-8
module Jiralicious
class User
##
# Avatars in the Project class.
#
class Avatar < Jiralicious::Base
##
# Initialization Method
#
# [Arguments]
# :decoded_json (optional) decoded json object
#
def initialize(decoded_json = nil)
@... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | lib/jiralicious/project/avatar.rb | Ruby | mit | 49 | master | 3,473 | # encoding: utf-8
module Jiralicious
class Project
##
# Avatars in the Project class.
#
class Avatar < Jiralicious::Base
##
# Initialization Method
#
# [Arguments]
# :decoded_json (optional) decoded json object
#
def initialize(decoded_json = nil)
... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | spec/jiralicious_spec.rb | Ruby | mit | 49 | master | 394 | # encoding: utf-8
require "spec_helper"
describe Jiralicious do
it "creates a session on load" do
expect(Jiralicious.session).to_not be_nil
end
it "creates a rest path" do
Jiralicious.configure do |config|
config.uri = "http://localhost:8080"
config.api_version = "2.0"
end
expect(Jir... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | spec/issue_spec.rb | Ruby | mit | 49 | master | 14,342 | # encoding: utf-8
require "spec_helper"
describe Jiralicious::Issue, "finding" do
before :each do
Jiralicious.configure do |config|
config.username = "jstewart"
config.password = "topsecret"
config.uri = "http://jstewart:topsecret@localhost"
config.auth_type = :basic
config.api_vers... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | spec/watchers_spec.rb | Ruby | mit | 49 | master | 1,343 | # encoding: utf-8
require "spec_helper"
describe Jiralicious, "search" do
before :each do
Jiralicious.configure do |config|
config.username = "jstewart"
config.password = "topsecret"
config.uri = "http://jstewart:topsecret@localhost"
config.auth_type = :basic
config.api_version = "l... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | spec/avatar_spec.rb | Ruby | mit | 49 | master | 1,694 | # encoding: utf-8
require "spec_helper"
describe Jiralicious, "avatar" do
before :each do
Jiralicious.configure do |config|
config.username = "jstewart"
config.password = "topsecret"
config.uri = "http://jstewart:topsecret@localhost"
config.auth_type = :basic
config.api_version = "l... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | spec/basic_session_spec.rb | Ruby | mit | 49 | master | 532 | # encoding: utf-8
require "spec_helper"
describe "performing a request" do
before :each do
Jiralicious.configure do |config|
config.uri = "http://jstewart:topsecret@localhost"
end
FakeWeb.register_uri(
:get,
Jiralicious.uri + "/ok",
status: "200"
)
end
let(:session) { Ji... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | spec/user_spec.rb | Ruby | mit | 49 | master | 2,566 | # encoding: utf-8
require "spec_helper"
describe Jiralicious::User, "finding" do
before :each do
Jiralicious.configure do |config|
config.username = "jstewart"
config.password = "topsecret"
config.uri = "http://jstewart:topsecret@localhost"
config.auth_type = :basic
config.api_versi... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | spec/field_parser_spec.rb | Ruby | mit | 49 | master | 2,582 | # encoding: utf-8
require "spec_helper"
class ParserMock
include Jiralicious::Parsers::FieldParser
def initialize(parsed)
parse!(parsed)
end
end
describe Jiralicious::Parsers::FieldParser do
context "parse!" do
before :each do
@parsed_data = {
"testfield" => { "name" => "testfield", "va... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | spec/components_spec.rb | Ruby | mit | 49 | master | 2,728 | # encoding: utf-8
require "spec_helper"
describe Jiralicious, "Project Components Class: " do
before :each do
Jiralicious.configure do |config|
config.username = "jstewart"
config.password = "topsecret"
config.uri = "http://jstewart:topsecret@localhost"
config.auth_type = :basic
con... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | spec/project_spec.rb | Ruby | mit | 49 | master | 2,928 | # encoding: utf-8
require "spec_helper"
describe Jiralicious, "Project Management Class: " do
before :each do
Jiralicious.configure do |config|
config.username = "jstewart"
config.password = "topsecret"
config.uri = "http://jstewart:topsecret@localhost"
config.auth_type = :basic
con... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | spec/comment_spec.rb | Ruby | mit | 49 | master | 2,203 | # encoding: utf-8
require "spec_helper"
describe Jiralicious, "search" do
before :each do
Jiralicious.configure do |config|
config.username = "jstewart"
config.password = "topsecret"
config.uri = "http://jstewart:topsecret@localhost"
config.auth_type = :basic
config.api_version = "l... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | spec/user_avatar_spec.rb | Ruby | mit | 49 | master | 2,275 | # encoding: utf-8
require "spec_helper"
describe Jiralicious, "Project Avatar" do
before :each do
Jiralicious.configure do |config|
config.username = "jstewart"
config.password = "topsecret"
config.uri = "http://jstewart:topsecret@localhost"
config.auth_type = :basic
config.api_vers... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | spec/base_spec.rb | Ruby | mit | 49 | master | 1,071 | # encoding: utf-8
require "spec_helper"
describe Jiralicious::Base, "issue keys" do
it "can contains all capital letters" do
expect(Jiralicious::Base.issueKey_test("ABC-1", true)).to eq true
end
it "can contain a capital letter followed by numbers and underscores" do
expect(Jiralicious::Base.issueKey_te... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | spec/search_result_spec.rb | Ruby | mit | 49 | master | 1,575 | # encoding: utf-8
require "spec_helper"
describe Jiralicious::SearchResult do
before :each do
FakeWeb.register_uri(
:get,
"#{Jiralicious.rest_path}/issue/EX-1",
status: "200",
body: issue_json
)
FakeWeb.register_uri(
:get,
"#{Jiralicious.rest_path}/issue/EX-1/comment/"... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | spec/spec_helper.rb | Ruby | mit | 49 | master | 587 | $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require "rspec"
require "fakeweb"
require "jiralicious"
FakeWeb.allow_net_connect = false
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir["#{File.... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | spec/versions_spec.rb | Ruby | mit | 49 | master | 2,861 | # encoding: utf-8
require "spec_helper"
describe Jiralicious, "Project Versions Class: " do
before :each do
Jiralicious.configure do |config|
config.username = "jstewart"
config.password = "topsecret"
config.uri = "http://jstewart:topsecret@localhost"
config.auth_type = :basic
confi... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | spec/project_avatar_spec.rb | Ruby | mit | 49 | master | 2,304 | # encoding: utf-8
require "spec_helper"
describe Jiralicious, "Project Avatar" do
before :each do
Jiralicious.configure do |config|
config.username = "jstewart"
config.password = "topsecret"
config.uri = "http://jstewart:topsecret@localhost"
config.auth_type = :basic
config.api_vers... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | spec/search_spec.rb | Ruby | mit | 49 | master | 1,138 | # encoding: utf-8
require "spec_helper"
describe Jiralicious, "search" do
before :each do
Jiralicious.configure do |config|
config.username = "jstewart"
config.password = "topsecret"
config.uri = "http://jstewart:topsecret@localhost"
config.auth_type = :basic
config.api_version = "l... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | spec/configuration_spec.rb | Ruby | mit | 49 | master | 1,366 | # encoding: utf-8
require "spec_helper"
describe Jiralicious::Configuration do
before :each do
Jiralicious.reset
end
it "sets the options to their default value" do
expect(Jiralicious.username).to be_nil
expect(Jiralicious.password).to be_nil
expect(Jiralicious.uri).to be_nil
expect(Jiralici... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | spec/support/http.rb | Ruby | mit | 49 | master | 4,164 | module LoginHelper
def register_login
response = %(
{
"session": {
"name": "JSESSIONID",
"value": "12345678901234567890"
},
"loginInfo": {
"failedLoginCount": 10,
"loginCount": 127,
"lastFailedLoginTime": "2011-07-25T06:31:07.556-0500",
"previousLogi... |
github | dorack/jiralicious | https://github.com/dorack/jiralicious | spec/support/configuration.rb | Ruby | mit | 49 | master | 289 | module ConfigurationHelper
def configure_jiralicious
Jiralicious.configure do |config|
config.username = "jstewart"
config.password = "topsecret"
config.uri = "http://localhost"
config.api_version = "latest"
config.auth_type = :cookie
end
end
end |
github | PGYER/fastlane-plugin-fir_cli | https://github.com/PGYER/fastlane-plugin-fir_cli | fastlane-plugin-fir_cli.gemspec | Ruby | mit | 49 | master | 1,277 | # coding: utf-8
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "fastlane/plugin/fir_cli/version"
Gem::Specification.new do |spec|
spec.name = "fastlane-plugin-fir_cli"
spec.version = Fastlane::FirCli::VERSION
spec.author = "atpking"
spec.email = "atp... |
github | PGYER/fastlane-plugin-fir_cli | https://github.com/PGYER/fastlane-plugin-fir_cli | lib/fastlane/plugin/fir_cli.rb | Ruby | mit | 49 | master | 461 | require 'fastlane/plugin/fir_cli/version'
module Fastlane
module FirCli
# Return all .rb files inside the "actions" and "helper" directory
def self.all_classes
Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
end
end
end
# By default we want to import all available actio... |
github | PGYER/fastlane-plugin-fir_cli | https://github.com/PGYER/fastlane-plugin-fir_cli | lib/fastlane/plugin/fir_cli/actions/fir_cli_action.rb | Ruby | mit | 49 | master | 10,253 | require "fastlane/action"
require "fir"
# require 'byebug'
require_relative "../helper/fir_cli_helper"
module Fastlane
module Actions
class FirCliAction < Action
def self.run(params)
UI.message("The fir_cli plugin is working!")
fir_args = find_app_location(params[:specify_file_path])
... |
github | PGYER/fastlane-plugin-fir_cli | https://github.com/PGYER/fastlane-plugin-fir_cli | lib/fastlane/plugin/fir_cli/helper/fir_cli_helper.rb | Ruby | mit | 49 | master | 825 | require 'fastlane_core/ui/ui'
module Fastlane
UI = FastlaneCore::UI unless Fastlane.const_defined?("UI")
module Helper
class FirCliHelper
# class methods that you define here become available in your action
# as `Helper::FirCliHelper.your_method`
#
def self.show_message
UI.mess... |
github | PGYER/fastlane-plugin-fir_cli | https://github.com/PGYER/fastlane-plugin-fir_cli | spec/fir_cli_action_spec.rb | Ruby | mit | 49 | master | 247 | describe Fastlane::Actions::FirCliAction do
describe '#run' do
it 'prints a message' do
expect(Fastlane::UI).to receive(:message).with("The fir_cli plugin is working!")
Fastlane::Actions::FirCliAction.run(nil)
end
end
end |
github | PGYER/fastlane-plugin-fir_cli | https://github.com/PGYER/fastlane-plugin-fir_cli | spec/spec_helper.rb | Ruby | mit | 49 | master | 451 | $LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
require 'simplecov'
# SimpleCov.minimum_coverage 95
SimpleCov.start
# This module is only used to check the environment is currently a testing env
module SpecHelper
end
require 'fastlane' # to import the Action super class
require 'fastlane/plugin/fir_cli'... |
github | schacon/git-lighthouse | https://github.com/schacon/git-lighthouse | git-lighthouse.gemspec | Ruby | mit | 49 | master | 764 | Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = "git-lighthouse"
s.version = "0.1.2"
s.date = "2008-05-27"
s.author = "Scott Chacon"
s.email = "schacon@gmail.com"
s.summary = "Provides command line access to a Lighthouse ticketing s... |
github | schacon/git-lighthouse | https://github.com/schacon/git-lighthouse | Rakefile | Ruby | mit | 49 | master | 928 | require 'rubygems'
Gem::manage_gems
require 'rake/gempackagetask'
require 'spec/rake/spectask'
spec = eval(File.read('git-lighthouse.gemspec'))
Rake::GemPackageTask.new(spec) do |pkg|
pkg.need_tar = true
end
desc "Run all specs in spec directory"
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_files = FileList['... |
github | schacon/git-lighthouse | https://github.com/schacon/git-lighthouse | spec/spec_helper.rb | Ruby | mit | 49 | master | 1,822 | require File.expand_path(File.dirname(__FILE__) + "/../lib/git-lighthouse")
require 'spec'
require 'fileutils'
require 'logger'
module GitLighthouseSpecHelper
def setup_new_git_repo
temp = Tempfile.new('gitrepo')
p = temp.path
temp.unlink
Dir.mkdir(p)
Dir.chdir(p) do
g = Git.init
g.c... |
github | schacon/git-lighthouse | https://github.com/schacon/git-lighthouse | spec/cli_spec.rb | Ruby | mit | 49 | master | 2,335 | require File.dirname(__FILE__) + "/spec_helper"
require 'stringio'
describe GitLighthouse::CLI do
include GitLighthouseSpecHelper
before(:all) do
@path = setup_new_git_repo
@orig_test_opts = test_opts
@gitlh = GitLighthouse.open(@path, @orig_test_opts)
end
it "should list the tickets" do
... |
github | schacon/git-lighthouse | https://github.com/schacon/git-lighthouse | lib/git-lighthouse.rb | Ruby | mit | 49 | master | 534 | $:.unshift(File.dirname(__FILE__)) unless
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
require 'rubygems'
require 'yaml'
require 'active_resource'
require 'active_support'
require 'hpricot'
require 'open-uri'
require 'pp'
require 'git'
require 'git-lighthouse/base'
re... |
github | schacon/git-lighthouse | https://github.com/schacon/git-lighthouse | lib/git-lighthouse/lighthouse.rb | Ruby | mit | 49 | master | 6,909 | ## LIGHTHOUSE API CLASS ##
# Ruby lib for working with the Lighthouse API's XML interface.
# The first thing you need to set is the account name. This is the same
# as the web address for your account.
#
# Lighthouse.account = 'activereload'
#
# Then, you should set the authentication. You can either use your l... |
github | schacon/git-lighthouse | https://github.com/schacon/git-lighthouse | lib/git-lighthouse/cli.rb | Ruby | mit | 49 | master | 7,216 | require 'git-lighthouse'
require 'optparse'
# used Cap as a model for this - thanks Jamis
module GitLighthouse
class CLI
# The array of (unparsed) command-line options
attr_reader :action, :options, :args, :tic
def self.execute
parse(ARGV).execute!
end
def self.parse(args)
cli ... |
github | schacon/git-lighthouse | https://github.com/schacon/git-lighthouse | lib/git-lighthouse/base.rb | Ruby | mit | 49 | master | 3,350 | module GitLighthouse
class Base
attr_reader :lh_url, :account, :projectId, :token, :email, :password
def initialize(working_dir, options = {})
#options = {:log => Logger.new(STDOUT)}
@git = Git.init(working_dir, options)
@account = @git.config('lighthouse.account')
@pr... |
github | postmodern/ffi-hunspell | https://github.com/postmodern/ffi-hunspell | Rakefile | Ruby | mit | 49 | main | 298 | require 'rubygems'
begin
require 'bundler/setup'
rescue LoadError => e
abort e.message
end
require 'rake'
require 'rubygems/tasks'
Gem::Tasks.new
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new
task :test => :spec
task :default => :spec
require 'yard'
YARD::Rake::YardocTask.new |
github | postmodern/ffi-hunspell | https://github.com/postmodern/ffi-hunspell | ffi-hunspell.gemspec | Ruby | mit | 49 | main | 2,096 | # encoding: utf-8
require 'yaml'
Gem::Specification.new do |gem|
gemspec = YAML.load_file('gemspec.yml')
gem.name = gemspec.fetch('name')
gem.version = gemspec.fetch('version') do
lib_dir = File.join(File.dirname(__FILE__),'lib')
$LOAD_PATH << lib_dir unless $LOAD_PATH.in... |
github | postmodern/ffi-hunspell | https://github.com/postmodern/ffi-hunspell | lib/ffi/hunspell/hunspell.rb | Ruby | mit | 49 | main | 4,025 | require 'ffi'
module FFI
module Hunspell
extend FFI::Library
ffi_lib [
'hunspell-1.7', 'libhunspell-1.7.so.0',
'hunspell-1.6', 'libhunspell-1.6.so.0',
'hunspell-1.5', 'libhunspell-1.5.so.0',
'hunspell-1.4', 'libhunspell-1.4.so.0',
'hunspell-1.3', 'libhunspell-1.3.so.0',
'... |
github | postmodern/ffi-hunspell | https://github.com/postmodern/ffi-hunspell | lib/ffi/hunspell/dictionary.rb | Ruby | mit | 49 | main | 6,802 | require 'ffi/hunspell/hunspell'
module FFI
module Hunspell
#
# Represents a dictionary for a specific language.
#
class Dictionary
# The affix file extension
AFF_EXT = 'aff'
# The dictionary file extension
DIC_EXT = 'dic'
#
# Creates a new dictionary.
#
... |
github | postmodern/ffi-hunspell | https://github.com/postmodern/ffi-hunspell | spec/hunspell_spec.rb | Ruby | mit | 49 | main | 749 | require 'spec_helper'
require 'ffi/hunspell/hunspell'
describe Hunspell do
describe ".lang" do
subject { super().lang }
it "should have a default language" do
expect(subject).to_not be_nil
expect(subject).to_not be_empty
end
end
describe ".directories" do
subject { super().directori... |
github | postmodern/ffi-hunspell | https://github.com/postmodern/ffi-hunspell | spec/spec_helper.rb | Ruby | mit | 49 | main | 203 | require 'rspec'
require 'ffi/hunspell'
include FFI
RSpec.configure do |specs|
specs.before(:suite) do
if ENV['HUNSPELL_ROOT']
Hunspell.directories << ENV['HUNSPELL_ROOT']
end
end
end |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.