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
savonrb/wasabi
https://github.com/savonrb/wasabi
spec/wasabi/document/no_namespace_spec.rb
Ruby
mit
88
main
1,540
# frozen_string_literal: true require "spec_helper" describe Wasabi::Document do context "with: no_namespace.wsdl" do subject { Wasabi::Document.new fixture(:no_namespace).read } describe '#namespace' do subject { super().namespace } it { should == "urn:ActionWebService" } end describ...
github
savonrb/wasabi
https://github.com/savonrb/wasabi
spec/wasabi/document/savon295_spec.rb
Ruby
mit
88
main
526
# frozen_string_literal: true require "spec_helper" describe Wasabi::Document do context "with: savon295.wsdl" do subject { Wasabi::Document.new fixture(:savon295).read } describe '#operations' do subject { super().operations } it do should include( { sendsms: { ...
github
savonrb/wasabi
https://github.com/savonrb/wasabi
spec/wasabi/document/escaped_endpoint_spec.rb
Ruby
mit
88
main
352
require "spec_helper" describe Wasabi::Document do context "with: escaped_endpoint.wsdl" do subject(:document) { Wasabi::Document.new fixture(:escaped_endpoint).read } describe '#endpoint' do it "supports spaces in URIs" do expect(document.endpoint).to eq URI("http://localhost/soap%20service"...
github
savonrb/wasabi
https://github.com/savonrb/wasabi
spec/wasabi/parser/no_target_namespace_spec.rb
Ruby
mit
88
main
1,060
# frozen_string_literal: true require "spec_helper" describe Wasabi::Parser do context "with a WSDL defining xs:schema without targetNamespace" do subject do parser = Wasabi::Parser.new Nokogiri::XML(xml) parser.parse parser end let(:xml) do %Q{ <definitions xmlns='http...
github
savonrb/wasabi
https://github.com/savonrb/wasabi
spec/wasabi/parser/no_message_parts_spec.rb
Ruby
mit
88
main
1,129
# frozen_string_literal: true require 'spec_helper' describe Wasabi::Parser do context 'with: no_message_parts.wsdl' do subject do parser = Wasabi::Parser.new Nokogiri::XML(xml) parser.parse parser end let(:xml) { fixture(:no_message_parts).read } it 'falls back to using the mes...
github
savonrb/wasabi
https://github.com/savonrb/wasabi
spec/wasabi/parser/workday_spec.rb
Ruby
mit
88
main
422
# frozen_string_literal: true require "spec_helper" describe Wasabi::Parser do context "with: workday.wsdl" do subject do parser = Wasabi::Parser.new Nokogiri::XML(xml) parser.parse parser end let(:xml) { fixture(:workday).read } it "parses the operations" do expect(subject...
github
savonrb/wasabi
https://github.com/savonrb/wasabi
spec/wasabi/parser/types_with_same_name_in_separate_namespaces_spec.rb
Ruby
mit
88
main
1,142
require 'spec_helper' describe Wasabi::Parser do context 'with: types_with_same_name_in_separate_namespaces.wsdl' do subject do parser = Wasabi::Parser.new Nokogiri::XML(xml) parser.parse parser end let(:xml) { fixture(:types_with_same_name_in_separate_namespaces).read } it 'parse...
github
savonrb/wasabi
https://github.com/savonrb/wasabi
spec/wasabi/parser/no_namespace_spec.rb
Ruby
mit
88
main
668
# frozen_string_literal: true require "spec_helper" describe Wasabi::Parser do context "with: no_namespace.wsdl" do subject do parser = Wasabi::Parser.new Nokogiri::XML(xml) parser.parse parser end let(:xml) { fixture(:no_namespace).read } it "lists the types" do expect(su...
github
savonrb/wasabi
https://github.com/savonrb/wasabi
spec/wasabi/parser/multiple_parts_in_message_spec.rb
Ruby
mit
88
main
813
# frozen_string_literal: true require "spec_helper" describe Wasabi::Parser do context 'with: multiple_parts_in_message.wsdl' do subject do parser = Wasabi::Parser.new Nokogiri::XML(xml) parser.parse parser end let(:xml) { fixture(:multiple_parts_in_message).read } context "with...
github
savonrb/wasabi
https://github.com/savonrb/wasabi
spec/wasabi/parser/symbolic_endpoint_spec.rb
Ruby
mit
88
main
639
# frozen_string_literal: true require "spec_helper" describe Wasabi::Parser do context "with: symbolic_endpoint.wsdl" do subject(:parser) { described_class.new Nokogiri::XML(xml) } let(:xml) { fixture(:symbolic_endpoint).read } before { parser.parse } it "allows symbolic endpoints" do expec...
github
savonrb/wasabi
https://github.com/savonrb/wasabi
spec/wasabi/parser/juniper_spec.rb
Ruby
mit
88
main
617
# frozen_string_literal: true require "spec_helper" describe Wasabi::Parser do context 'with: juniper.wsdl' do subject do parser = Wasabi::Parser.new Nokogiri::XML(xml) parser.parse parser end let(:xml) { fixture(:juniper).read } it 'does not blow up when an extension base eleme...
github
savonrb/wasabi
https://github.com/savonrb/wasabi
spec/wasabi/parser/marketo_spec.rb
Ruby
mit
88
main
393
# frozen_string_literal: true require 'spec_helper' describe Wasabi::Parser do context 'with: marketo.wsdl' do subject do parser = Wasabi::Parser.new Nokogiri::XML(xml) parser.parse parser end let(:xml) { fixture(:marketo).read } it 'parses the operations' do expect(subject...
github
savonrb/wasabi
https://github.com/savonrb/wasabi
spec/wasabi/parser/multiple_namespaces_spec.rb
Ruby
mit
88
main
1,627
# frozen_string_literal: true require "spec_helper" describe Wasabi::Parser do context "with: multiple_namespaces.wsdl" do subject do parser = Wasabi::Parser.new Nokogiri::XML(xml) parser.parse parser end let(:xml) { fixture(:multiple_namespaces).read } it "lists the namespaces"...
github
savonrb/wasabi
https://github.com/savonrb/wasabi
spec/wasabi/parser/get_servicename_spec.rb
Ruby
mit
88
main
397
# frozen_string_literal: true require "spec_helper" describe Wasabi::Parser do context "with: geotrust.wsdl" do subject do parser = Wasabi::Parser.new Nokogiri::XML(xml) parser.parse parser end let(:xml) { fixture(:geotrust).read } it "returns the #service_name attribute" do ...
github
savonrb/wasabi
https://github.com/savonrb/wasabi
spec/wasabi/parser/tradetracker_spec.rb
Ruby
mit
88
main
399
# frozen_string_literal: true require 'spec_helper' describe Wasabi::Parser do context 'with: tradetracker.wsdl' do subject do parser = Wasabi::Parser.new Nokogiri::XML(xml) parser.parse parser end let(:xml) { fixture(:tradetracker).read } it 'parses the operations' do expe...
github
savonrb/wasabi
https://github.com/savonrb/wasabi
spec/wasabi/parser/import_port_types_spec.rb
Ruby
mit
88
main
531
# frozen_string_literal: true require "spec_helper" describe Wasabi::Parser do context "with: import_port_types.wsdl" do subject do parser = Wasabi::Parser.new Nokogiri::XML(xml) parser.parse parser end let(:xml) { fixture(:import_port_types).read } it "does blow up when portTyp...
github
savonrb/wasabi
https://github.com/savonrb/wasabi
spec/wasabi/core_ext/string_spec.rb
Ruby
mit
88
main
1,309
# frozen_string_literal: true require "spec_helper" describe Wasabi::CoreExt::String do describe ".snakecase" do it "lowercases one word CamelCase" do expect(Wasabi::CoreExt::String.snakecase("Merb")).to eq("merb") end it "makes one underscore snakecase two word CamelCase" do expect(Wasabi...
github
savonrb/wasabi
https://github.com/savonrb/wasabi
spec/support/fixture.rb
Ruby
mit
88
main
613
# frozen_string_literal: true module SpecSupport class Fixture def self.[](name) fixtures[name] end def self.[]=(name, value) fixtures[name] = value end def self.fixtures @fixtures ||= {} end def initialize(file, ext = :wsdl) self.file = file self.ext = e...
github
savonrb/wasabi
https://github.com/savonrb/wasabi
spec/support/profiling.rb
Ruby
mit
88
main
317
# frozen_string_literal: true module SpecSupport def benchmark(&block) require 'benchmark' puts "Benchmark:" puts Benchmark.measure(&block) end def profile_methods require 'method_profiler' profiler = MethodProfiler.observe(Wasabi::Parser) yield puts profiler.report end end
github
savonrb/wasabi
https://github.com/savonrb/wasabi
lib/wasabi.rb
Ruby
mit
88
main
261
# frozen_string_literal: true require "wasabi/version" require "wasabi/document" require "wasabi/resolver" module Wasabi # Expects a WSDL document and returns a <tt>Wasabi::Document</tt>. def self.document(document) Document.new(document) end end
github
savonrb/wasabi
https://github.com/savonrb/wasabi
lib/wasabi/parser.rb
Ruby
mit
88
main
12,358
# frozen_string_literal: true require 'uri' require 'addressable/uri' require 'wasabi/core_ext/string' module Wasabi # = Wasabi::Parser # # Parses WSDL documents and remembers their important parts. class Parser XSD = 'http://www.w3.org/2001/XMLSchema' WSDL = 'http://schemas.xmlsoap.org/wsd...
github
savonrb/wasabi
https://github.com/savonrb/wasabi
lib/wasabi/resolver.rb
Ruby
mit
88
main
1,601
# frozen_string_literal: true require "faraday" module Wasabi # = Wasabi::Resolver # # Resolves local and remote WSDL documents. class Resolver class HTTPError < StandardError def initialize(message, response=nil) super(message) @response = response end attr_reader :res...
github
savonrb/wasabi
https://github.com/savonrb/wasabi
lib/wasabi/document.rb
Ruby
mit
88
main
4,445
# frozen_string_literal: true require "nokogiri" require "wasabi/resolver" require "wasabi/parser" module Wasabi # = Wasabi::Document # # Represents a WSDL document. class Document ELEMENT_FORM_DEFAULTS = [:unqualified, :qualified] # Validates if a given +value+ is a valid elementFormDefault value....
github
savonrb/wasabi
https://github.com/savonrb/wasabi
lib/wasabi/core_ext/string.rb
Ruby
mit
88
main
375
# frozen_string_literal: true module Wasabi module CoreExt module String def self.snakecase(str) str = str.dup str.gsub!(/::/, '/') str.gsub!(/([A-Z]+)([A-Z][a-z])/, '\1_\2') str.gsub!(/([a-z\d])([A-Z])/, '\1_\2') str.tr!(".", "_") str.tr!("-", "_") ...
github
dlindahl/omniauth-cas
https://github.com/dlindahl/omniauth-cas
Rakefile
Ruby
mit
88
master
283
#!/usr/bin/env rake # frozen_string_literal: true require 'bundler/gem_tasks' require 'rspec/core/rake_task' desc 'Default: run specs.' task default: :spec desc 'Run specs' RSpec::Core::RakeTask.new(:spec) do |t| t.rspec_opts = '--require spec_helper --color --order rand' end
github
dlindahl/omniauth-cas
https://github.com/dlindahl/omniauth-cas
Gemfile
Ruby
mit
88
master
322
# frozen_string_literal: true source 'https://rubygems.org' gem 'awesome_print' gem 'rack-test' gem 'rake' gem 'rspec' gem 'simplecov' gem 'webmock' gem 'rubocop' gem 'rubocop-packaging' gem 'rubocop-performance' gem 'rubocop-rake' gem 'rubocop-rspec' # Specify your gem's dependencies in omniauth-cas.gemspec gemspe...
github
dlindahl/omniauth-cas
https://github.com/dlindahl/omniauth-cas
omniauth-cas.gemspec
Ruby
mit
88
master
1,260
# frozen_string_literal: true require File.expand_path('lib/omniauth/cas/version', __dir__) Gem::Specification.new do |gem| gem.authors = ['Derek Lindahl'] gem.email = ['dlindahl@customink.com'] gem.summary = 'CAS Strategy for OmniAuth' gem.description = gem.summary gem.homepage =...
github
dlindahl/omniauth-cas
https://github.com/dlindahl/omniauth-cas
lib/omniauth/strategies/cas.rb
Ruby
mit
88
master
7,762
# frozen_string_literal: true require 'omniauth' require 'addressable/uri' module OmniAuth module Strategies class CAS include OmniAuth::Strategy # Custom Exceptions class MissingCASTicket < StandardError; end class InvalidCASTicket < StandardError; end autoload :ServiceTicketVal...
github
dlindahl/omniauth-cas
https://github.com/dlindahl/omniauth-cas
lib/omniauth/strategies/cas/logout_request.rb
Ruby
mit
88
master
1,922
# frozen_string_literal: true module OmniAuth module Strategies class CAS class LogoutRequest def initialize(strategy, request) @strategy = strategy @request = request end def call(options = {}) @options = options begin result = ...
github
dlindahl/omniauth-cas
https://github.com/dlindahl/omniauth-cas
lib/omniauth/strategies/cas/service_ticket_validator.rb
Ruby
mit
88
master
4,138
# frozen_string_literal: true require 'net/http' require 'nokogiri' module OmniAuth module Strategies class CAS class ServiceTicketValidator VALIDATION_REQUEST_HEADERS = { 'Accept' => '*/*' }.freeze attr_reader :success_body # Build a validator from a +configuration+, a #...
github
dlindahl/omniauth-cas
https://github.com/dlindahl/omniauth-cas
spec/spec_helper.rb
Ruby
mit
88
master
4,889
# frozen_string_literal: true if ENV['CI'] || ENV['COVERAGE'] require 'simplecov' SimpleCov.start do add_filter '/spec/' end end require 'omniauth-cas' require 'rack/test' require 'webmock/rspec' OmniAuth.config.logger = Logger.new(File::NULL) OmniAuth.config.request_validation_phase = nil # This file wa...
github
dlindahl/omniauth-cas
https://github.com/dlindahl/omniauth-cas
spec/omniauth/strategies/cas_spec.rb
Ruby
mit
88
master
9,141
# frozen_string_literal: true require 'spec_helper' RSpec.describe OmniAuth::Strategies::CAS, type: :strategy do include Rack::Test::Methods let(:my_cas_provider) { Class.new(described_class) } let(:app) do Rack::Builder.new do use OmniAuth::Test::PhonySession use MyCasProvider, name:...
github
dlindahl/omniauth-cas
https://github.com/dlindahl/omniauth-cas
spec/omniauth/strategies/cas/service_ticket_validator_spec.rb
Ruby
mit
88
master
2,023
# frozen_string_literal: true require 'spec_helper' RSpec.describe OmniAuth::Strategies::CAS::ServiceTicketValidator do let(:strategy) do instance_double(OmniAuth::Strategies::CAS, service_validate_url: 'https://example.org/serviceValidate') end let(:provider_options) do OmniAuth::Strategy::Options.new(...
github
dlindahl/omniauth-cas
https://github.com/dlindahl/omniauth-cas
spec/omniauth/strategies/cas/logout_request_spec.rb
Ruby
mit
88
master
2,939
# frozen_string_literal: true require 'spec_helper' RSpec.describe OmniAuth::Strategies::CAS::LogoutRequest do subject(:call) { described_class.new(strategy, request).call(options) } let(:strategy) { instance_double(OmniAuth::Strategies::CAS) } let(:env) do { 'rack.input' => StringIO.new('', 'r') } end ...
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
Rakefile
Ruby
apache-2.0
88
master
257
require 'bundler/gem_tasks' require 'rspec/core/rake_task' RSpec::Core::RakeTask.new task :default => :spec task :test => :spec unless defined?(JRUBY_VERSION) require 'yard' YARD::Rake::YardocTask.new do |t| t.files = ['lib/**/*.rb'] end end
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
google_maps_service.gemspec
Ruby
apache-2.0
88
master
945
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'google_maps_service/version' Gem::Specification.new do |spec| spec.name = 'google_maps_service' spec.version = GoogleMapsService::VERSION spec.authors = ['Edward Samuel...
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
Gemfile
Ruby
apache-2.0
88
master
465
source 'https://rubygems.org' # Specify your gem's dependencies in google_maps_service.gemspec gemspec group :development do gem 'bundler', '~> 1.6' gem 'rake', '~> 10.0' gem 'rspec', '~> 3.3' gem 'simplecov', '~> 0.10' gem 'coveralls', '~> 0.8.2' gem 'webmock', '~> 1.21' end platforms :ruby do group :...
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
spec/spec_helper.rb
Ruby
apache-2.0
88
master
870
SPEC_DIR = File.expand_path(File.dirname(__FILE__)) ROOT_DIR = File.expand_path(File.join(SPEC_DIR, '..')) LIB_DIR = File.expand_path(File.join(ROOT_DIR, 'lib')) FIXTURES_DIR = File.expand_path(File.join(SPEC_DIR, 'fixtures')) $LOAD_PATH.unshift(SPEC_DIR) $LOAD_PATH.unshift(LIB_DIR) $LOAD_PATH.uniq! if defined?(JRUBY...
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
spec/google_maps_service_spec.rb
Ruby
apache-2.0
88
master
242
require 'spec_helper' describe GoogleMapsService do it 'has a version number' do expect(GoogleMapsService::VERSION).not_to be nil end it 'can detect os version' do expect(GoogleMapsService::OS_VERSION).not_to be nil end end
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
spec/google_maps_service/validator_spec.rb
Ruby
apache-2.0
88
master
1,342
require 'spec_helper' require 'date' describe GoogleMapsService::Validator do describe '.travel_mode' do context 'with valid travel mode' do it 'should return travel mode' do [:driving, :walking, :bicycling, :transit].each do |mode| expect(GoogleMapsService::Validator.travel_mode(mode)).t...
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
spec/google_maps_service/client_spec.rb
Ruby
apache-2.0
88
master
6,906
require 'spec_helper' describe GoogleMapsService::Client do include_context 'HTTP client' # This test assumes that the time to run a mocked query is # relatively small, eg a few milliseconds. We define a rate of # 3 queries per second, and run double that, which should take at # least 1 second but no more t...
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
spec/google_maps_service/url_spec.rb
Ruby
apache-2.0
88
master
834
require 'spec_helper' describe GoogleMapsService::Url do context '.urlencode' do it 'should only encode non-reserved characters' do encoded_params = GoogleMapsService::Url.urlencode_params([["address", "=Sydney ~"]]) expect(encoded_params).to eq("address=%3DSydney+~") end end context '.sign_...
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
spec/google_maps_service/convert_spec.rb
Ruby
apache-2.0
88
master
5,991
require 'spec_helper' require 'date' describe GoogleMapsService::Convert do describe '.latlng' do context 'with a lat/lng pair' do it 'should return comma-separated string' do expect(GoogleMapsService::Convert.latlng({lat: 1, lng: 2})).to eq("1.000000,2.000000") expect(GoogleMapsService::Co...
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
spec/google_maps_service/polyline_spec.rb
Ruby
apache-2.0
88
master
3,166
require 'spec_helper' require 'date' describe GoogleMapsService::Polyline do context '.decode' do context 'with Sydney to Melbourne polyline' do let (:decoded_points) do syd_mel_route = ("rvumEis{y[`NsfA~tAbF`bEj^h{@{KlfA~eA~`AbmEghAt~D|e@j" \ "lRpO~yH_\\v}LjbBh~FdvCxu@`nCp...
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
spec/google_maps_service/apis/time_zone_spec.rb
Ruby
apache-2.0
88
master
1,129
require 'spec_helper' describe GoogleMapsService::Apis::TimeZone do include_context 'HTTP client' before(:example) do stub_request(:get, /https:\/\/maps.googleapis.com\/maps\/api\/timezone\/.*/) .to_return(:status => 200, headers: { 'Content-Type' => 'application/json' }, body: '{"status":"OK","results"...
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
spec/google_maps_service/apis/distance_matrix_spec.rb
Ruby
apache-2.0
88
master
4,636
require 'spec_helper' describe GoogleMapsService::Apis::DistanceMatrix do include_context 'HTTP client' before(:example) do stub_request(:get, /https:\/\/maps.googleapis.com\/maps\/api\/distancematrix\/.*/) .to_return(:status => 200, headers: { 'Content-Type' => 'application/json' }, body: '{"status":"O...
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
spec/google_maps_service/apis/elevation_spec.rb
Ruby
apache-2.0
88
master
2,677
require 'spec_helper' describe GoogleMapsService::Apis::Elevation do include_context 'HTTP client' before(:example) do stub_request(:get, /https:\/\/maps.googleapis.com\/maps\/api\/elevation\/.*/) .to_return(:status => 200, headers: { 'Content-Type' => 'application/json' }, body: '{"status":"OK","result...
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
spec/google_maps_service/apis/directions_spec.rb
Ruby
apache-2.0
88
master
7,182
require 'spec_helper' describe GoogleMapsService::Apis::Directions do include_context 'HTTP client' before(:example) do stub_request(:get, /https:\/\/maps.googleapis.com\/maps\/api\/directions\/.*/) .to_return(:status => 200, headers: { 'Content-Type' => 'application/json' }, body: '{"status":"OK","resu...
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
spec/google_maps_service/apis/roads_spec.rb
Ruby
apache-2.0
88
master
8,510
require 'spec_helper' describe GoogleMapsService::Apis::Roads do include_context 'HTTP client' context '#snap_to_roads' do before(:example) do stub_request(:get, /https:\/\/roads.googleapis.com\/v1\/snapToRoads/) .to_return(:status => 200, headers: { 'Content-Type' => 'application/json' }, body:...
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
spec/google_maps_service/apis/geocoding_spec.rb
Ruby
apache-2.0
88
master
5,761
require 'spec_helper' describe GoogleMapsService::Apis::Geocoding do include_context 'HTTP client' before(:example) do stub_request(:get, /https:\/\/maps.googleapis.com\/maps\/api\/geocode\/.*/) .to_return(:status => 200, headers: { 'Content-Type' => 'application/json' }, body: '{"status":"OK","results"...
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
lib/google_maps_service.rb
Ruby
apache-2.0
88
master
1,287
# Google Maps Web Service API. module GoogleMapsService class << self # Global key. # @see Client#key # @return [String] attr_accessor :key # Global client_id. # @see Client#client_id # @return [String] attr_accessor :client_id # Global client_secret. # @see Client#client_se...
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
lib/google_maps_service/polyline.rb
Ruby
apache-2.0
88
master
2,535
require 'google_maps_service/convert' module GoogleMapsService # Encoder/decoder for [Google Encoded Polyline](https://developers.google.com/maps/documentation/utilities/polylinealgorithm). module Polyline module_function # Decodes a Polyline string into a list of lat/lng hash. # # See the develo...
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
lib/google_maps_service/version.rb
Ruby
apache-2.0
88
master
623
module GoogleMapsService # GoogleMapsService gem version VERSION = '0.4.2' # Current operating system # @private OS_VERSION = begin if RUBY_PLATFORM =~ /mswin|win32|mingw|bccwin|cygwin/ `ver`.sub(/\s*\[Version\s*/, '/').sub(']', '').strip elsif RUBY_PLATFORM =~ /darwin/i "Mac OS X/#{`sw_v...
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
lib/google_maps_service/convert.rb
Ruby
apache-2.0
88
master
5,193
module GoogleMapsService # Converts Ruby types to string representations suitable for Maps API server. module Convert module_function # Converts a lat/lon pair to a comma-separated string. # # @example # >> GoogleMapsService::Convert.latlng({"lat": -33.8674869, "lng": 151.2069902}) # =...
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
lib/google_maps_service/client.rb
Ruby
apache-2.0
88
master
10,914
require 'hurley' require 'multi_json' require 'retriable' require 'thread' require 'google_maps_service/errors' require 'google_maps_service/convert' require 'google_maps_service/url' require 'google_maps_service/apis/directions' require 'google_maps_service/apis/distance_matrix' require 'google_maps_service/apis/elev...
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
lib/google_maps_service/url.rb
Ruby
apache-2.0
88
master
1,819
require 'base64' require 'uri' module GoogleMapsService # Helper for handling URL. module Url module_function # Returns a base64-encoded HMAC-SHA1 signature of a given string. # # @param [String] secret The key used for the signature, base64 encoded. # @param [String] payload The payload to s...
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
lib/google_maps_service/errors.rb
Ruby
apache-2.0
88
master
1,336
module GoogleMapsService # Specific Google Maps Service error module Error # Base error, capable of wrapping another class BaseError < StandardError # HTTP response object # @return [Hurley::Response] attr_reader :response # Initialize error # # @param [Hurley::Response]...
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
lib/google_maps_service/validator.rb
Ruby
apache-2.0
88
master
1,244
require_relative './convert' module GoogleMapsService # Validate value that is accepted by Google Maps. module Validator module_function # Validate travel mode. The valid value of travel mode are `driving`, `walking`, `bicycling` or `transit`. # # @param [String, Symbol] mode Travel mode to be va...
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
lib/google_maps_service/apis/geocoding.rb
Ruby
apache-2.0
88
master
3,824
require 'google_maps_service/convert' module GoogleMapsService::Apis # Performs requests to the Google Maps Geocoding API. module Geocoding # Geocoding is the process of converting addresses # (like `"1600 Amphitheatre Parkway, Mountain View, CA"`) into geographic # coordinates (like latitude 37.4230...
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
lib/google_maps_service/apis/time_zone.rb
Ruby
apache-2.0
88
master
1,443
require 'date' module GoogleMapsService::Apis # Performs requests to the Google Maps TimeZone API.""" module TimeZone # Get time zone for a location on the earth, as well as that location's # time offset from UTC. # # @example Current time zone # timezone = client.timezone([39.603481, -119....
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
lib/google_maps_service/apis/elevation.rb
Ruby
apache-2.0
88
master
1,957
module GoogleMapsService::Apis # Performs requests to the Google Maps Elevation API. module Elevation # Provides elevation data for locations provided on the surface of the # earth, including depth locations on the ocean floor (which return negative # values). # # @example Single point elevati...
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
lib/google_maps_service/apis/distance_matrix.rb
Ruby
apache-2.0
88
master
4,482
require_relative '../validator' module GoogleMapsService::Apis # Performs requests to the Google Maps Distance Matrix API. module DistanceMatrix # Gets travel distance and time for a matrix of origins and destinations. # # @example Simple distance matrix # origins = ["Perth, Australia", "Sydney...
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
lib/google_maps_service/apis/directions.rb
Ruby
apache-2.0
88
master
4,875
require_relative '../validator' module GoogleMapsService::Apis # Performs requests to the Google Maps Directions API. module Directions # Get directions between an origin point and a destination point. # # @example Simple directions # routes = client.directions('Sydney', 'Melbourne') # ...
github
edwardsamuel/google-maps-services-ruby
https://github.com/edwardsamuel/google-maps-services-ruby
lib/google_maps_service/apis/roads.rb
Ruby
apache-2.0
88
master
6,697
require 'multi_json' module GoogleMapsService::Apis # Performs requests to the Google Maps Roads API. module Roads # Base URL of Google Maps Roads API ROADS_BASE_URL = "https://roads.googleapis.com" # Snaps a path to the most likely roads travelled. # # Takes up to 100 GPS points collected a...
github
ankane/str_enum
https://github.com/ankane/str_enum
str_enum.gemspec
Ruby
mit
88
master
545
require_relative "lib/str_enum/version" Gem::Specification.new do |spec| spec.name = "str_enum" spec.version = StrEnum::VERSION spec.summary = "String enums for Rails" spec.homepage = "https://github.com/ankane/str_enum" spec.license = "MIT" spec.author = "Andrew Kan...
github
ankane/str_enum
https://github.com/ankane/str_enum
test/test_helper.rb
Ruby
mit
88
master
648
require "bundler/setup" Bundler.require(:default) require "minitest/autorun" require "active_record" ActiveRecord::Base.logger = Logger.new(ENV["VERBOSE"] ? STDOUT : nil) ActiveRecord::Migration.verbose = ENV["VERBOSE"] # migrations ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:" Act...
github
ankane/str_enum
https://github.com/ankane/str_enum
test/str_enum_test.rb
Ruby
mit
88
master
1,922
require_relative "test_helper" class StrEnumTest < Minitest::Test def setup User.delete_all end def test_default user = User.new assert_equal "active", user.status end def test_scopes User.create! assert_equal 1, User.active.count assert_equal 0, User.archived.count end def tes...
github
ankane/str_enum
https://github.com/ankane/str_enum
lib/str_enum/model.rb
Ruby
mit
88
master
1,768
require "active_support/concern" module StrEnum module Model extend ActiveSupport::Concern class_methods do def str_enum(column, values, validate: true, scopes: true, accessor_methods: true, update_methods: true, prefix: false, suffix: false, default: true, allow_nil: false) values = values.ma...
github
alexrothenberg/motion-addressbook
https://github.com/alexrothenberg/motion-addressbook
motion-addressbook.gemspec
Ruby
mit
88
master
891
# -*- encoding: utf-8 -*- require File.expand_path('../lib/motion-addressbook/version', __FILE__) Gem::Specification.new do |gem| gem.name = "motion-addressbook" gem.version = Motion::Addressbook::VERSION gem.license = 'MIT' gem.authors = ["Alex Rothenberg", "Jason May"] gem.email...
github
alexrothenberg/motion-addressbook
https://github.com/alexrothenberg/motion-addressbook
Rakefile
Ruby
mit
88
master
1,753
require "bundler/gem_tasks" $:.unshift("/Library/RubyMotion/lib") if ENV['osx'] require 'motion/project/template/osx' else require 'motion/project/template/ios' end Bundler.setup Bundler.require Motion::Project::App.setup do |app| # Use `rake config' to see complete project settings. app.name = 'AddressBook'...
github
alexrothenberg/motion-addressbook
https://github.com/alexrothenberg/motion-addressbook
app/app_delegate.rb
Ruby
mit
88
master
894
class AppDelegate def application(application, didFinishLaunchingWithOptions:launchOptions) @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds) @window.rootViewController = UIViewController.alloc.init @window.makeKeyAndVisible command_line true end def command_line if com...
github
alexrothenberg/motion-addressbook
https://github.com/alexrothenberg/motion-addressbook
spec/osx/helpers/person_helpers.rb
Ruby
mit
88
master
303
def unique_email(email='alex_testy@example.com') name, domain = email.split('@') "#{name}_#{Time.now.to_i}_#{rand(1000)}@#{domain}" end def new_alex(emailaddr = unique_email) { :first_name => 'Alex', :last_name => 'Testy', :emails => [{:label => 'home', :value => emailaddr}] } end
github
alexrothenberg/motion-addressbook
https://github.com/alexrothenberg/motion-addressbook
spec/osx/helpers/hacks.rb
Ruby
mit
88
master
395
# The value of these constants is undefined until one of the following functions has been called: # ABAddressBookCreate, ABPersonCreate, ABGroupCreate. # see https://developer.apple.com/library/ios/#documentation/AddressBook/Reference/ABPersonRef_iPhoneOS/Reference/reference.html # and search for "Discussion" # WTF...
github
alexrothenberg/motion-addressbook
https://github.com/alexrothenberg/motion-addressbook
spec/osx/address_book/person_spec.rb
Ruby
mit
88
master
5,834
describe AddressBook::Person do before do @alex_data = { :prefix => 'Mr.', :first_name=>'Alex', :middle_name=>'Q.', :last_name=>'Testy', :suffix => 'III', :nickname => 'Geekster', :job_title => 'Developer', :department => 'Development', :organization => 'The C...
github
alexrothenberg/motion-addressbook
https://github.com/alexrothenberg/motion-addressbook
spec/ios/helpers/authentication_helper.rb
Ruby
mit
88
master
648
if defined?(UIATarget) # Refer to https://gist.github.com/Voxar/946de66777fc821a63cf5c1d6169504d # Automatically tap the default button on iOS system dialogs for authentication of access to Contacts target = UIATarget.localTarget target.setValue(true, forKey:"handlesAlerts") class UIATarget def _handleAl...
github
alexrothenberg/motion-addressbook
https://github.com/alexrothenberg/motion-addressbook
spec/ios/helpers/spec_helper.rb
Ruby
mit
88
master
509
module Bacon class << self @@old_run = instance_method(:run) @@already_started = false def ab_connect AddressBook::AddrBook.new do |ab| if ab cb = proc do Bacon.run end Dispatch::Queue.main.async &cb else warn "ACCESS DENIED - ABOR...
github
alexrothenberg/motion-addressbook
https://github.com/alexrothenberg/motion-addressbook
spec/ios/address_book/multi_valued_spec.rb
Ruby
mit
88
master
4,796
describe AddressBook::MultiValued do describe 'a new multi-value' do it 'should convert to localized labels' do AddressBook::MultiValued::LabelMap.size.should.equal 11 AddressBook::MultiValued::LabelMap.each do |label, localized| mv = AddressBook::MultiValued.new(:attributes => [{:label => lab...
github
alexrothenberg/motion-addressbook
https://github.com/alexrothenberg/motion-addressbook
spec/ios/address_book/creator_spec.rb
Ruby
mit
88
master
912
describe AddressBook::Creator do before do @ab = AddressBook::AddrBook.new @person = @ab.create_person(first_name: 'Colin') @ab_person = @person.ab_person end after do @person.delete! end describe 'IOS UI for creating an entry' do before do @created_person = :not_set @picker ...
github
alexrothenberg/motion-addressbook
https://github.com/alexrothenberg/motion-addressbook
spec/ios/address_book/person_spec.rb
Ruby
mit
88
master
20,080
describe AddressBook::Person do before do @ab = AddressBook::AddrBook.new end it "should be authorized" do @ab.authorized?.should.be.true end describe 'ways of creating and finding people' do describe 'new' do before do @data = new_alex @alex = @ab.new_person(@data) e...
github
alexrothenberg/motion-addressbook
https://github.com/alexrothenberg/motion-addressbook
spec/ios/address_book/group_spec.rb
Ruby
mit
88
master
2,652
describe AddressBook::Group do before do @ab = AddressBook::AddrBook.new end describe 'an empty group' do before do @group = @ab.new_group(:name => 'Test Group') end after do @group.delete! end it "should have a name" do @group.name.should.equal 'Test Group' end ...
github
alexrothenberg/motion-addressbook
https://github.com/alexrothenberg/motion-addressbook
spec/ios/address_book/picker_spec.rb
Ruby
mit
88
master
1,752
describe AddressBook::Picker do describe 'IOS UI for finding people' do before do @ab = AddressBook::AddrBook.new @colin = @ab.create_person(first_name: 'Colin') @ab_person = @colin.ab_person @selected_person = nil @picker = @ab.picker(animated: false) do |person| @selected_p...
github
alexrothenberg/motion-addressbook
https://github.com/alexrothenberg/motion-addressbook
lib/motion-addressbook.rb
Ruby
mit
88
master
967
require "motion-addressbook/version" # RubyMotion bug RM-81 was fixed for 2.8; motion-addressbook if Gem::Version.new(Motion::Version) < Gem::Version.new("2.8") raise <<EOT motion-addressbook requires at least RubyMotion version 2.8. If you cannot upgrade RubyMotion please use an older version of this gem. Add the ...
github
alexrothenberg/motion-addressbook
https://github.com/alexrothenberg/motion-addressbook
motion/address_book.rb
Ruby
mit
88
master
2,129
module AddressBook module_function def address_book if Kernel.const_defined?(:NSApplication) ABAddressBook.addressBook else # iOS version = UIDevice.currentDevice.systemVersion.to_f if version < 6.0 ios5_create else ios6_create end end end def instance...
github
alexrothenberg/motion-addressbook
https://github.com/alexrothenberg/motion-addressbook
motion/address_book/ios/source.rb
Ruby
mit
88
master
276
module AddressBook class Source attr_reader :ab_source def initialize(ab_source) @ab_source = ab_source end def type ABRecordCopyValue(ab_source, KABSourceTypeProperty) end def local? type == KABSourceTypeLocal end end end
github
alexrothenberg/motion-addressbook
https://github.com/alexrothenberg/motion-addressbook
motion/address_book/ios/group.rb
Ruby
mit
88
master
2,685
# Wrapper for iOS ABGroup # # * groups are saved to the database immediately upon new() # * members are added with << # module AddressBook class Group attr_reader :attributes, :error, :address_book def initialize(opts) @address_book = opts.fetch(:address_book) { AddressBook.address_book } @ab_gro...
github
alexrothenberg/motion-addressbook
https://github.com/alexrothenberg/motion-addressbook
motion/address_book/ios/multi_valued.rb
Ruby
mit
88
master
5,378
module AddressBook class MultiValued include Enumerable attr_reader :mv_type def initialize(opts) unless opts.one? raise ArgumentError, "MultiValued requires :attributes *or* :ab_multi_value argument" end if opts[:ab_multi_value] @ab_multi_value = ABMultiValueCreateMut...
github
alexrothenberg/motion-addressbook
https://github.com/alexrothenberg/motion-addressbook
motion/address_book/ios/addr_book.rb
Ruby
mit
88
master
4,191
module AddressBook class AddrBook attr_reader :ab def initialize(&block) @ab = NullAddrBook if authorized? activate! if block_given? yield self end elsif block # asynchronous auth AddressBook.request_authorization do |granted| if g...
github
alexrothenberg/motion-addressbook
https://github.com/alexrothenberg/motion-addressbook
motion/address_book/ios/picker.rb
Ruby
mit
88
master
1,893
module AddressBook class Picker class << self attr_accessor :showing end def self.show(options={}, &after) raise "Cannot show two Pickers" if showing? @picker = self.new(options[:ab] || AddressBook::AddrBook.instance, &after) @picker.show options @picker end def self...
github
alexrothenberg/motion-addressbook
https://github.com/alexrothenberg/motion-addressbook
motion/address_book/ios/creator.rb
Ruby
mit
88
master
1,232
module AddressBook class Creator class << self attr_accessor :showing end def self.show(options={}, &after) raise "Cannot show two Pickers" if showing? @creator = self.new(options[:ab], &after) @creator.show options @creator end def self.showing? !!showing ...
github
alexrothenberg/motion-addressbook
https://github.com/alexrothenberg/motion-addressbook
motion/address_book/ios/person.rb
Ruby
mit
88
master
11,854
module AddressBook class Person attr_reader :error attr_reader :address_book def initialize(attributes = nil, existing_ab_person = nil, opts = {}) @address_book = opts.fetch(:address_book) { AddressBook.address_book } @attributes = attributes @ab_person = existing_ab_person end ...
github
alexrothenberg/motion-addressbook
https://github.com/alexrothenberg/motion-addressbook
motion/address_book/osx/group.rb
Ruby
mit
88
master
2,917
# Wrapper for OSX ABGroup # # * groups are saved to the database immediately upon new() # * members are added with << # module AddressBook class Group attr_reader :attributes, :error attr_reader :address_book def initialize(opts) @address_book = opts.fetch(:address_book) { AddressBook.address_book ...
github
alexrothenberg/motion-addressbook
https://github.com/alexrothenberg/motion-addressbook
motion/address_book/osx/person.rb
Ruby
mit
88
master
8,639
module AddressBook class Person attr_reader :error attr_reader :address_book def initialize(target, opts = {}) @address_book = opts.fetch(:address_book) { AddressBook.address_book } if target.respond_to?(:fetch) # data for a new Person, to be saved to the Address Book @ab_pers...
github
alexrothenberg/motion-addressbook
https://github.com/alexrothenberg/motion-addressbook
motion/address_book/osx/addr_book.rb
Ruby
mit
88
master
1,935
module AddressBook class AddrBook attr_reader :ab def initialize @ab = ABAddressBook.addressBook yield self if block_given? end def people(opts = {}) if opts[:local] people.select {|p| p.local?} else ab.people.map do |ab_person| AddressBook::Person.ne...
github
alexrothenberg/motion-addressbook
https://github.com/alexrothenberg/motion-addressbook
motion/address_book/osx/multi_valued.rb
Ruby
mit
88
master
5,514
module AddressBook class MultiValued include Enumerable attr_reader :mv_type def initialize(opts) unless opts.one? raise ArgumentError, "MultiValued requires :attributes *or* :ab_multi_value argument" end if opts[:ab_multi_value] @ab_multi_value = opts[:ab_multi_value]...
github
ahawkins/chassis
https://github.com/ahawkins/chassis
chassis.gemspec
Ruby
mit
88
master
1,495
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'chassis/version' Gem::Specification.new do |spec| spec.name = "chassis" spec.version = Chassis::VERSION spec.authors = ["ahawkins"] spec.email = ["adam@hawkin...
github
ahawkins/chassis
https://github.com/ahawkins/chassis
Rakefile
Ruby
mit
88
master
519
require "bundler/gem_tasks" require 'rake/testtask' require 'stringio' def capture_stdout out = StringIO.new $stdout = out yield return out ensure $stdout = STDOUT end desc 'Run examples' task :examples do root = File.dirname __FILE__ Dir["#{root}/examples/*.rb"].each do |example| capture_stdout do...
github
ahawkins/chassis
https://github.com/ahawkins/chassis
lib/chassis.rb
Ruby
mit
88
master
1,639
require "chassis/version" require 'interchange' require 'tnt' require 'lift' require 'logger-better' require 'sinatra' require 'manifold' require 'rack/contrib/bounce_favicon' require 'rack/contrib/post_body_content_type_parser' require 'harness' require 'harness/rack' require 'virtus' require 'virtus/dirty_attrib...
github
ahawkins/chassis
https://github.com/ahawkins/chassis
lib/chassis/dirty_session.rb
Ruby
mit
88
master
2,229
require 'set' module Chassis class DirtySession < Proxy def initialize(*args) super @original_values = { } @new_values = { } end def clean? new_values.empty? end def dirty? !clean? end def original_values @original_values end def new_values...
github
ahawkins/chassis
https://github.com/ahawkins/chassis
lib/chassis/repo.rb
Ruby
mit
88
master
1,647
module Chassis RecordNotFoundError = Chassis.error do |klass, id| "Could not locate #{klass} with id #{id}" end QueryNotImplementedError = Chassis.error do |selector| "Adapter does not support #{selector.class}!" end GraphQueryNotImplementedError = Chassis.error do |selector| "Adapter does not k...
github
ahawkins/chassis
https://github.com/ahawkins/chassis
lib/chassis/logger.rb
Ruby
mit
88
master
215
module Chassis class Logger < ::Logger def initialize(logdev = Chassis.stream, shift_age = 0, shift_size = 1048576) super self.level = ENV['LOG_LEVEL'].to_sym if ENV['LOG_LEVEL'] end end end