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
misshie/bioruby-ucsc-api
https://github.com/misshie/bioruby-ucsc-api
devtools/spec_generator_ci2.rb
Ruby
mit
19
master
1,180
#!/usr/bin/env ruby # sea squirt ci2 spec generator SPEC_FILE = "../spec/ci2_spec.rb" KLASS = "Bio::Ucsc::Ci2" TABLES = %w( all_est all_mrna author cds cell chromInfo description development ensGene ensGtp ensPep estOrientInfo gap gbCdnaInfo gbDelete_tmp gbExtFile gbLoaded gbMiscDiff gbSeq gbStatus gbWarn gc5Base gen...
github
misshie/bioruby-ucsc-api
https://github.com/misshie/bioruby-ucsc-api
devtools/spec_generator_gasacu1.rb
Ruby
mit
19
master
1,727
#!/usr/bin/env ruby # stickleback GasAcu1 spec generator SPEC_FILE = "../spec/gasacu1_spec.rb" KLASS = "Bio::Ucsc::GasAcu1" TABLES = %w( all_est all_mrna author blastHg18KG cds cell chainAnoCar1 chainAnoCar1Link chainDanRer7 chainDanRer7Link chainFr2 chainFr2Link chainGalGal3 chainGalGal3Link chainHg19 chainHg19Link ...
github
misshie/bioruby-ucsc-api
https://github.com/misshie/bioruby-ucsc-api
devtools/spec_generator_petmar1.rb
Ruby
mit
19
master
1,595
#!/usr/bin/env ruby # lamprey PetMar1 spec generator SPEC_FILE = "../spec/petmar1_spec.rb" KLASS = "Bio::Ucsc::PetMar1" TABLES = %w( all_est all_mrna author blastHg18KG cds cell chainBraFlo1 chainBraFlo1Link chainGalGal3 chainGalGal3Link chainHg19 chainHg19Link chainMm9 chainMm9Link chainOryLat2 chainOryLat2Link chro...
github
misshie/bioruby-ucsc-api
https://github.com/misshie/bioruby-ucsc-api
devtools/spec_generator_anocar2.rb
Ruby
mit
19
master
1,494
#!/usr/bin/env ruby # lizard AnoCar2 spec generator SPEC_FILE = "../spec/anocar2_spec.rb" KLASS = "Bio::Ucsc::AnoCar2" TABLES = %w( all_est all_mrna author blastHg18KG cds cell chainGalGal3 chainGalGal3Link chainGasAcu1 chainGasAcu1Link chainHg19 chainHg19Link chainMm9 chainMm9Link chainOrnAna1 chainOrnAna1Link chain...
github
misshie/bioruby-ucsc-api
https://github.com/misshie/bioruby-ucsc-api
devtools/spec_generator_danrer7.rb
Ruby
mit
19
master
1,542
#!/usr/bin/env ruby # zebrafish DanRer7 spec generator SPEC_FILE = "../spec/danrer7_spec.rb" KLASS = "Bio::Ucsc::DanRer7" TABLES = %w( all_est all_mrna author blastHg18KG cds cell chainFr2 chainFr2Link chainGasAcu1 chainGasAcu1Link chainHg19 chainHg19Link chainMm9 chainMm9Link chainOryLat2 chainOryLat2Link chainPanTr...
github
misshie/bioruby-ucsc-api
https://github.com/misshie/bioruby-ucsc-api
devtools/spec_generator_go.rb
Ruby
mit
19
master
900
#!/usr/bin/env ruby # GO spec generator SPEC_FILE = "../spec/go_spec.rb" KLASS = "Bio::Ucsc::Go" TABLES = %w( association association_qualifier db dbxref evidence evidence_dbxref gene_product gene_product_count gene_product_synonym goaPart graph_path instance_data source_audit species term term2term term_dbxref term_...
github
misshie/bioruby-ucsc-api
https://github.com/misshie/bioruby-ucsc-api
devtools/spec_generator_droere1.rb
Ruby
mit
19
master
1,187
#!/usr/bin/env ruby # D. erecta DroEre1 spec generator SPEC_FILE = "../spec/droere1_spec.rb" KLASS = "Bio::Ucsc::DroEre1" TABLES = %w( all_mrna author blastDm2FB cds cell chainDm3 chainDm3Link chromInfo description development gap gbCdnaInfo gbDelete_tmp gbExtFile gbLoaded gbMiscDiff gbSeq gbStatus gbWarn gc5Base gen...
github
misshie/bioruby-ucsc-api
https://github.com/misshie/bioruby-ucsc-api
devtools/spec_generator_ornana1.rb
Ruby
mit
19
master
1,843
#!/usr/bin/env ruby # platypus OrnAna1 spec generator SPEC_FILE = "../spec/ornana1_spec.rb" KLASS = "Bio::Ucsc::OrnAna1" TABLES = %w( all_est all_mrna author blastHg18KG cds cell chainAnoCar1 chainAnoCar1Link chainBosTau4 chainBosTau4Link chainCalJac1 chainCalJac1Link chainEquCab2 chainEquCab2Link chainGalGal3 chainG...
github
misshie/bioruby-ucsc-api
https://github.com/misshie/bioruby-ucsc-api
devtools/spec_generator_loxafr3.rb
Ruby
mit
19
master
1,220
#!/usr/bin/env ruby # elephant LoxAfr3 spec generator SPEC_FILE = "../spec/loxafr3_spec.rb" KLASS = "Bio::Ucsc::LoxAfr3" TABLES = %w( all_mrna author blastHg18KG cds cell chainHg19 chainHg19Link chainMm9 chainMm9Link chromInfo description development ensGene ensGtp ensPep gap gbCdnaInfo gbExtFile gbLoaded gbMiscDiff ...
github
misshie/bioruby-ucsc-api
https://github.com/misshie/bioruby-ucsc-api
devtools/spec_generator_strpur2.rb
Ruby
mit
19
master
1,277
#!/usr/bin/env ruby # sea urchin StrPur2 spec generator SPEC_FILE = "../spec/strpur2_spec.rb" KLASS = "Bio::Ucsc::StrPur2" TABLES = %w( all_est all_mrna author blastHg18KG cds cell chainCi2 chainCi2Link chainHg18 chainHg18Link chromInfo description development estOrientInfo gap gbCdnaInfo gbExtFile gbLoaded gbMiscDif...
github
misshie/bioruby-ucsc-api
https://github.com/misshie/bioruby-ucsc-api
samples/hg19-sample.rb
Ruby
mit
19
master
2,165
#!/usr/local/bin/ruby-1.9 # # hg19-sample.rb: chunks of codes handling hg19 tables # # Copyright:: # Copyright (C) 2011 MISHIMA, Hiroyuki # <missy at be.to / hmishima at nagasaki-u.ac.jp> # License:: The Ruby licence (Ryby's / GPLv2 dual) # require File.dirname(__FILE__) + '/../lib/bio-ucsc'...
github
misshie/bioruby-ucsc-api
https://github.com/misshie/bioruby-ucsc-api
samples/symbol2summary.rb
Ruby
mit
19
master
1,113
#!/usr/local/bin/ruby-1.9 # # Usage:: symbol2summary.rb <Gene_Symbol> (default is "TP53") # # Copyright:: # Copyright (C) 2011 MISHIMA, Hiroyuki # <missy at be.to / hmishima at ngit agasaki-u.ac.jp> # License:: The Ruby licence (Ryby's / GPLv2 dual) # #require File.dirname(__FILE__) + '/../l...
github
misshie/bioruby-ucsc-api
https://github.com/misshie/bioruby-ucsc-api
samples/bed2refseq.rb
Ruby
mit
19
master
508
#!/usr/bin/env ruby #require 'bio-ucsc' require '../lib/bio-ucsc' DB = Bio::Ucsc::Hg19 DB.connect genes = Array.new ARGF.each_line do |row| row.chomp! next if row.empty? chr, chr_start, chr_end = row.split("\t") gi = GenomicInterval.zero_based(chr, Integer(chr_start), ...
github
misshie/bioruby-ucsc-api
https://github.com/misshie/bioruby-ucsc-api
samples/snp2genes.rb
Ruby
mit
19
master
3,104
#!/usr/local/bin/ruby-1.9 # # Usage:: snp2genes.rb rs_id (default is "rs100") # # This example is an answer of a question at BioStar # http://biostar.stackexchange.com/questions/9737/mapping-snps-to-genes-and-pathways-go-etc # # Copyright:: # Copyright (C) 2011 MISHIMA, Hiroyuki # <missy at be.to...
github
misshie/bioruby-ucsc-api
https://github.com/misshie/bioruby-ucsc-api
samples/num-gene-exon.rb
Ruby
mit
19
master
712
#!/usr/local/bin/ruby-1.9 # usage: # ./num-gene-exon <genomic-interval> # example: # ./num-gene-exon chr1:12345-45678 # # Based on hg18-RefSeq genes table, print a list of included genes, # number of genes, and maximum number of exons. # require 'bio-ucsc' interval = Bio::GenomicInterval.parse(ARGV[0]) DB = Bio::Uc...
github
misshie/bioruby-ucsc-api
https://github.com/misshie/bioruby-ucsc-api
samples/hg19-2bit-retrieve.rb
Ruby
mit
19
master
811
#!/usr/local/bin/ruby-1.9 # # Usage:: hg19-2bit-retrieve.rb <genomic interval> # (default is "chr1:9,500-10,499") # # Copyright:: # Copyright (C) 2011 MISHIMA, Hiroyuki # <missy at be.to / hmishima at ngit agasaki-u.ac.jp> # License:: The Ruby licence (Ryby's / GPLv2 dual) # require ...
github
misshie/bioruby-ucsc-api
https://github.com/misshie/bioruby-ucsc-api
samples/get-gene-ontology.rb
Ruby
mit
19
master
1,260
require 'bio-ucsc' class GetGeneOntology GO = Bio::Ucsc::Go HG19 = Bio::Ucsc::Hg19 IdAspName = Struct.new(:goId, :aspect, :name) ASPECTS = { "F" => "Molecular Function", "P" => "Biological Process", "C" => "Cellular Component", } def sp_display_ids(genesym) spdid = HG19::KgXref...
github
sebastyuiop/spree_pages
https://github.com/sebastyuiop/spree_pages
spree_pages.gemspec
Ruby
bsd-3-clause
19
master
677
Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.name = 'spree_pages' s.version = '0.70.0' s.summary = 'Adds a basic CMS to Spree' s.description = 'Simple page based CMS for Spree' s.required_ruby_version = '>= 1.8.7' s.author = 'sebastyuiop' # s.email ...
github
sebastyuiop/spree_pages
https://github.com/sebastyuiop/spree_pages
Rakefile
Ruby
bsd-3-clause
19
master
1,806
require 'rubygems' require 'rake' require 'rake/testtask' require 'rake/packagetask' require 'rake/gempackagetask' gemfile = File.expand_path('../spec/test_app/Gemfile', __FILE__) if File.exists?(gemfile) && (%w(spec cucumber).include?(ARGV.first.to_s) || ARGV.size == 0) require 'bundler' ENV['BUNDLE_GEMFILE'] = g...
github
sebastyuiop/spree_pages
https://github.com/sebastyuiop/spree_pages
app/controllers/spree/pages_controller.rb
Ruby
bsd-3-clause
19
master
496
module Spree class PagesController < BaseController include Spree::Core::ControllerHelpers::Order layout 'spree/layouts/spree_application' before_filter { render_404 if params[:id] =~ /(\.|\\)/ } respond_to :html # GET /pages/about-us def show @page = Page.published.find_by_permalink...
github
sebastyuiop/spree_pages
https://github.com/sebastyuiop/spree_pages
app/controllers/spree/admin/pages_controller.rb
Ruby
bsd-3-clause
19
master
1,498
module Spree class Admin::PagesController < Admin::ResourceController def index @pages = Page.page(params[:page]) end def new @page = Page.new end def create @page = Page.new(pages_params) if @page.save flash[:notice] = "Successfully created page." ...
github
sebastyuiop/spree_pages
https://github.com/sebastyuiop/spree_pages
app/models/spree/page.rb
Ruby
bsd-3-clause
19
master
216
module Spree class Page < ActiveRecord::Base validates :title, :presence => true validates :permalink, :uniqueness => true scope :published, where(:published => true) paginates_per 50 end end
github
sebastyuiop/spree_pages
https://github.com/sebastyuiop/spree_pages
db/migrate/20110614102624_create_pages.rb
Ruby
bsd-3-clause
19
master
265
class CreatePages < ActiveRecord::Migration def self.up create_table :pages do |t| t.string :title t.text :body t.string :permalink t.boolean :published t.timestamps end end def self.down drop_table :pages end end
github
sebastyuiop/spree_pages
https://github.com/sebastyuiop/spree_pages
db/migrate/20110620220441_add_meta_keywords_and_meta_description_to_pages.rb
Ruby
bsd-3-clause
19
master
302
class AddMetaKeywordsAndMetaDescriptionToPages < ActiveRecord::Migration def self.up add_column :pages, :meta_keywords, :string add_column :pages, :meta_description, :string end def self.down remove_column :pages, :meta_description remove_column :pages, :meta_keywords end end
github
sebastyuiop/spree_pages
https://github.com/sebastyuiop/spree_pages
lib/spree_pages/engine.rb
Ruby
bsd-3-clause
19
master
637
module SpreePages class Engine < Rails::Engine engine_name "spree_pages" config.autoload_paths += %W(#{config.root}/lib) def self.activate Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c| Rails.application.config.cache_classes ? require(c) : load(c) end...
github
sebastyuiop/spree_pages
https://github.com/sebastyuiop/spree_pages
lib/generators/spree_pages/install/install_generator.rb
Ruby
bsd-3-clause
19
master
510
module SpreePages module Generators class InstallGenerator < Rails::Generators::Base def add_migrations run 'bundle exec rake railties:install:migrations FROM=spree_pages' end def run_migrations res = ask "Would you like to run the migrations now? [Y/n]" if res == "" ...
github
dougbarth/jsonlint
https://github.com/dougbarth/jsonlint
jsonlint.gemspec
Ruby
mit
19
master
1,010
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'jsonlint/version' Gem::Specification.new do |spec| spec.name = "jsonlint" spec.version = JsonLint::VERSION spec.authors = ['Doug Barth'] spec.email = ['dougba...
github
dougbarth/jsonlint
https://github.com/dougbarth/jsonlint
spec/cli_spec.rb
Ruby
mit
19
master
2,430
require 'spec_helper' describe 'jsonlint' do it 'should print usage if run with no args' do jsonlint expect(last_command_started).to_not be_successfully_executed expect(last_command_started).to have_output(/Error: need at least one JSON file to check./) end it '-h should print usage' do jsonlint...
github
dougbarth/jsonlint
https://github.com/dougbarth/jsonlint
spec/linter_spec.rb
Ruby
mit
19
master
1,656
require 'spec_helper' require 'jsonlint/linter' describe 'JsonLint::Linter' do let(:linter) { JsonLint::Linter.new } it 'should throw an exception if given a bogus path' do expect { linter.check('/does/not/exist') }.to raise_error(JsonLint::FileNotFoundError) end it 'should be happy with a valid JSON fil...
github
dougbarth/jsonlint
https://github.com/dougbarth/jsonlint
spec/spec_helper.rb
Ruby
mit
19
master
600
require 'rspec' require 'aruba' require 'aruba/rspec' require 'jsonlint' module SpecHelpers def spec_data(data_path) File.expand_path(File.join('spec/data', data_path)) end end module CliSpecHelpers def jsonlint(args = nil) run_command_and_stop("#{jsonlint_bin} #{args}", fail_on_error: false) end ...
github
dougbarth/jsonlint
https://github.com/dougbarth/jsonlint
lib/jsonlint/rake_task.rb
Ruby
mit
19
master
1,326
require 'rake' require 'rake/tasklib' require 'jsonlint' module JsonLint class RakeTask < Rake::TaskLib attr_accessor :name attr_accessor :paths attr_accessor :exclude_paths attr_accessor :fail_on_error attr_accessor :log_level def initialize(name = :jsonlint) @name = name @excl...
github
dougbarth/jsonlint
https://github.com/dougbarth/jsonlint
lib/jsonlint/cli.rb
Ruby
mit
19
master
1,091
require 'optimist' module JsonLint class CLI def initialize(argv, stdin = STDIN, stdout = STDOUT, stderr = STDERR, kernel = Kernel) @argv, @stdin, @stdout, @stderr, @kernel = argv, stdin, stdout, stderr, kernel end def execute! parse_options files_to_check = @argv Optimist::die...
github
dougbarth/jsonlint
https://github.com/dougbarth/jsonlint
lib/jsonlint/linter.rb
Ruby
mit
19
master
4,556
require 'oj' require 'set' require 'jsonlint/errors' module JsonLint class Linter attr_reader :errors def initialize @errors = {} end def check_all(*files_to_check) files_to_check.flatten.each { |f| check(f) } end def check(path) fail FileNotFoundError, "#{path}: no such...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
aws-s3.gemspec
Ruby
mit
19
master
1,633
Gem::Specification.new do |s| s.name = 'aws-s3' s.version = "0.4.1" s.summary = "Client library for Amazon's Simple Storage Service's REST API" s.description = s.summary s.email = 'marcel@vernix.org' s.author = 'Marcel Molina Jr.' s.has_rdoc ...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
Rakefile
Ruby
mit
19
master
9,652
require 'rubygems' require 'rake' require 'rake/testtask' require 'rake/rdoctask' require 'rake/packagetask' require 'rake/gempackagetask' require File.dirname(__FILE__) + '/lib/aws/s3' def library_root File.dirname(__FILE__) end task :default => :test Rake::TestTask.new do |test| test.pattern = 'test/*_test.rb...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
test/base_test.rb
Ruby
mit
19
master
4,620
require File.dirname(__FILE__) + '/test_helper' class BaseTest < Test::Unit::TestCase def test_connection_established assert_raises(NoConnectionEstablished) do Base.connection end Base.establish_connection!(:access_key_id => '123', :secret_access_key => 'abc') assert_kind_of Connection, ...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
test/connection_test.rb
Ruby
mit
19
master
6,026
require File.dirname(__FILE__) + '/test_helper' class ConnectionTest < Test::Unit::TestCase def setup @keys = {:access_key_id => '123', :secret_access_key => 'abc'} end def test_creating_a_connection connection = Connection.new(@keys) assert_kind_of Net::HTTP, connection.http end def test_u...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
test/extensions_test.rb
Ruby
mit
19
master
7,847
require File.dirname(__FILE__) + '/test_helper' class HashExtensionsTest < Test::Unit::TestCase def test_to_query_string # Because hashes aren't ordered, I'm mostly testing against hashes with just one key symbol_keys = {:one => 1} string_keys = {'one' => 1} expected = '?one=1' [symbol_keys, s...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
test/response_test.rb
Ruby
mit
19
master
2,500
require File.dirname(__FILE__) + '/test_helper' class BaseResponseTest < Test::Unit::TestCase def setup @headers = {'content-type' => 'text/plain', 'date' => Time.now} @response = FakeResponse.new() @base_response = Base::Response.new(@response) end def test_status_predicates respon...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
test/logging_test.rb
Ruby
mit
19
master
2,870
require File.dirname(__FILE__) + '/test_helper' class LoggingStatusReadingTest < Test::Unit::TestCase def setup @disabled = logging_status(:logging_disabled) @enabled = logging_status(:logging_enabled) @new_status = Logging::Status.new('target_bucket' => 'foo', 'target_prefix' => 'access-log-') ...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
test/authentication_test.rb
Ruby
mit
19
master
4,768
require File.dirname(__FILE__) + '/test_helper' class HeaderAuthenticationTest < Test::Unit::TestCase def test_encoded_canonical signature = Authentication::Signature.new(request, key_id, secret, current_host) assert_equal AmazonDocExampleData::Example1.canonical_string, signature.send(:canonical_string) ...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
test/error_test.rb
Ruby
mit
19
master
2,367
require File.dirname(__FILE__) + '/test_helper' class ErrorTest < Test::Unit::TestCase def setup @container = AWS::S3 @error = Error.new(Parsing::XmlParser.new(Fixtures::Errors.access_denied)) end def teardown @container.send(:remove_const, :NotImplemented) if @container.const_defined?(:NotImpleme...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
test/object_test.rb
Ruby
mit
19
master
6,731
require File.dirname(__FILE__) + '/test_helper' class ObjectTest < Test::Unit::TestCase def setup bucket = Bucket.new(Parsing::XmlParser.new(Fixtures::Buckets.bucket_with_one_key)) @object = bucket.objects.first end def test_header_settings_reader_and_writer S3Object.in_test_mode do headers...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
test/service_test.rb
Ruby
mit
19
master
990
require File.dirname(__FILE__) + '/test_helper' class ServiceTest < Test::Unit::TestCase def test_bucket_list_with_empty_bucket_list Service.request_always_returns :body => Fixtures::Buckets.empty_bucket_list, :code => 200 do list = Service.buckets(:reload) assert_equal [], list end end de...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
test/test_helper.rb
Ruby
mit
19
master
2,325
require 'test/unit' $:.unshift File.dirname(__FILE__) + '/../lib' require 'aws/s3' require File.dirname(__FILE__) + '/mocks/base' require File.dirname(__FILE__) + '/fixtures' require_library_or_gem 'breakpoint' # Data copied from http://docs.amazonwebservices.com/AmazonS3/2006-03-01/RESTAuthentication.html module Amaz...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
test/bucket_test.rb
Ruby
mit
19
master
1,777
require File.dirname(__FILE__) + '/test_helper' class BucketTest < Test::Unit::TestCase def test_bucket_name_validation valid_names = %w(123 joe step-one step_two step3 step_4 step-5 step.six) invalid_names = ['12', 'jo', 'kevin spacey', 'larry@wall', '', 'a' * 256] validate_name = Proc.new {|name| B...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
test/mocks/base.rb
Ruby
mit
19
master
2,190
require_library_or_gem 'flexmock' module AWS module S3 class FakeResponse < String attr_reader :code, :body, :headers def initialize(options = {}) @code = options.delete(:code) || 200 @body = options.delete(:body) || '' @headers = {'content-type' => 'application/xml'}...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
test/remote/acl_test.rb
Ruby
mit
19
master
3,293
require File.dirname(__FILE__) + '/test_helper' class RemoteACLTest < Test::Unit::TestCase def setup establish_real_connection end def teardown disconnect! end def test_acl Bucket.create(TEST_BUCKET) # Wipe out the existing bucket's ACL bucket_policy = Bucket.acl(TEST_BUCKET) ...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
test/remote/test_helper.rb
Ruby
mit
19
master
667
require 'test/unit' require 'uri' $:.unshift File.dirname(__FILE__) + '/../../lib' require 'aws/s3' require_library_or_gem 'breakpoint' TEST_BUCKET = 'aws-s3-tests' TEST_FILE = File.dirname(__FILE__) + '/test_file.data' class Test::Unit::TestCase include AWS::S3 def establish_real_connection Base.establish_...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
test/remote/object_test.rb
Ruby
mit
19
master
9,954
require File.dirname(__FILE__) + '/test_helper' class RemoteS3ObjectTest < Test::Unit::TestCase def setup establish_real_connection end def teardown disconnect! end def test_object key = 'testing_s3objects' value = 'testing' content_type = 'text/...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
lib/aws/s3.rb
Ruby
mit
19
master
1,747
require 'base64' require 'cgi' require 'uri' require 'openssl' require 'digest/sha1' require 'net/https' require 'time' require 'date' require 'open-uri' $:.unshift(File.dirname(__FILE__)) require 's3/extensions' require_library_or_gem 'builder' unless defined? Builder require_library_or_gem 'mime/types' unless define...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
lib/aws/s3/logging.rb
Ruby
mit
19
master
12,275
module AWS module S3 # A bucket can be set to log the requests made on it. By default logging is turned off. You can check if a bucket has logging enabled: # # Bucket.logging_enabled_for? 'jukebox' # # => false # # Enabling it is easy: # # Bucket.enable_logging_for('jukebox') ...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
lib/aws/s3/response.rb
Ruby
mit
19
master
4,715
#:stopdoc: module AWS module S3 class Base class Response < String attr_reader :response, :body, :parsed def initialize(response) @response = response @body = response.body.to_s super(body) end def headers headers = {} ...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
lib/aws/s3/extensions.rb
Ruby
mit
19
master
8,288
#:stopdoc: class Hash def to_query_string(include_question_mark = true) query_string = '' unless empty? query_string << '?' if include_question_mark query_string << inject([]) do |params, (key, value)| params << "#{key}=#{value}" end.join('&') end query_string end d...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
lib/aws/s3/authentication.rb
Ruby
mit
19
master
9,281
module AWS module S3 # All authentication is taken care of for you by the AWS::S3 library. None the less, some details of the two types # of authentication and when they are used may be of interest to some. # # === Header based authentication # # Header based authentication is achieved by ...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
lib/aws/s3/connection.rb
Ruby
mit
19
master
12,792
module AWS module S3 class Connection #:nodoc: class << self def connect(options = {}) new(options) end def prepare_path(path) path = path.remove_extended unless path.utf8? URI.escape(path) end end attr_reader :access_...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
lib/aws/s3/base.rb
Ruby
mit
19
master
10,391
module AWS #:nodoc: # AWS::S3 is a Ruby library for Amazon's Simple Storage Service's REST API (http://aws.amazon.com/s3). # Full documentation of the currently supported API can be found at http://docs.amazonwebservices.com/AmazonS3/2006-03-01. # # == Getting started # # To get started you need to requir...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
lib/aws/s3/owner.rb
Ruby
mit
19
master
1,225
module AWS module S3 # Entities in S3 have an associated owner (the person who created them). The owner is a canonical representation of an # entity in the S3 system. It has an <tt>id</tt> and a <tt>display_name</tt>. # # These attributes can be used when specifying a ACL::Grantee for an ACL::Grant...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
lib/aws/s3/version.rb
Ruby
mit
19
master
271
module AWS module S3 module VERSION #:nodoc: MAJOR = '0' MINOR = '4' TINY = '0' BETA = nil # Time.now.to_i.to_s end Version = [VERSION::MAJOR, VERSION::MINOR, VERSION::TINY, VERSION::BETA].compact * '.' end end
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
lib/aws/s3/object.rb
Ruby
mit
19
master
24,785
module AWS module S3 # S3Objects represent the data you store on S3. They have a key (their name) and a value (their data). All objects belong to a # bucket. # # You can store an object on S3 by specifying a key, its data and the name of the bucket you want to put it in: # # S3Object.store('...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
lib/aws/s3/acl.rb
Ruby
mit
19
master
24,385
module AWS module S3 # By default buckets are private. This means that only the owner has access rights to the bucket and its objects. # Objects in that bucket inherit the permission of the bucket unless otherwise specified. When an object is private, the owner can # generate a signed url that exposes t...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
lib/aws/s3/service.rb
Ruby
mit
19
master
1,764
module AWS module S3 # The service lets you find out general information about your account, like what buckets you have. # # Service.buckets # # => [] class Service < Base @@response = nil #:nodoc: class << self # List all your buckets. # # Servic...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
lib/aws/s3/exceptions.rb
Ruby
mit
19
master
4,991
module AWS module S3 # Abstract super class of all AWS::S3 exceptions class S3Exception < StandardError end # All responses with a code between 300 and 599 that contain an <Error></Error> body are wrapped in an # ErrorResponse which contains an Error object. This Error class generates a ...
github
isaacfeliu/aws-s3
https://github.com/isaacfeliu/aws-s3
lib/aws/s3/bucket.rb
Ruby
mit
19
master
13,147
module AWS module S3 # Buckets are containers for objects (the files you store on S3). To create a new bucket you just specify its name. # # # Pick a unique name, or else you'll get an error # # if the name is already taken. # Bucket.create('jukebox') # # Bucket names must be uniq...
github
pat/render_api
https://github.com/pat/render_api
render_api.gemspec
Ruby
mit
19
main
837
# frozen_string_literal: true Gem::Specification.new do |spec| spec.name = "render_api" spec.version = "0.2.0" spec.authors = ["Pat Allan"] spec.email = ["pat@freelancing-gods.com"] spec.summary = "Ruby interface for the render.com API." spec.homepage = "https://github.com/pat/render_api" spec.license =...
github
pat/render_api
https://github.com/pat/render_api
spec/spec_helper.rb
Ruby
mit
19
main
212
# frozen_string_literal: true require "render_api" require_relative "support/webmock" RSpec.configure do |config| config.disable_monkey_patching! config.expect_with(:rspec) { |c| c.syntax = :expect } end
github
pat/render_api
https://github.com/pat/render_api
spec/support/webmock.rb
Ruby
mit
19
main
846
# frozen_string_literal: true require "delegate" require "webmock/rspec" module WebmockJSONHelpers def stub_request(method, uri) RequestStub.new(super) end def a_request(method, uri) RequestPattern.new(super) end class RequestStub < SimpleDelegator def to_return_json(*response_hashes, &block) ...
github
pat/render_api
https://github.com/pat/render_api
spec/features/services_spec.rb
Ruby
mit
19
main
14,716
# frozen_string_literal: true RSpec.describe "Services" do let(:client) { RenderAPI.client "test-api-key" } subject { client.services } describe "create" do before :each do stub_request( :post, "https://api.render.com/v1/services" ).to_return_json( body: { "service" =>...
github
pat/render_api
https://github.com/pat/render_api
spec/features/jobs_spec.rb
Ruby
mit
19
main
3,432
# frozen_string_literal: true RSpec.describe "Jobs" do let(:client) { RenderAPI.client "test-api-key" } let(:service_id) { "random-string" } subject { client.jobs } describe "create" do before :each do stub_request( :post, "https://api.render.com/v1/services/#{service_id}/jobs" ).to_r...
github
pat/render_api
https://github.com/pat/render_api
spec/features/owners_spec.rb
Ruby
mit
19
main
1,126
# frozen_string_literal: true RSpec.describe "Owners" do let(:client) { RenderAPI.client "test-api-key" } subject { client.owners } describe "find" do let(:id) { "my-id" } before :each do stub_request( :get, "https://api.render.com/v1/owners/#{id}" ).to_return_json( body: {...
github
pat/render_api
https://github.com/pat/render_api
spec/features/domains_spec.rb
Ruby
mit
19
main
4,537
# frozen_string_literal: true RSpec.describe "Domains" do let(:client) { RenderAPI.client "test-api-key" } let(:service_id) { "random-string" } subject { client.domains } describe "create" do before :each do stub_request( :post, "https://api.render.com/v1/services/#{service_id}/custom-domai...
github
pat/render_api
https://github.com/pat/render_api
spec/features/deploys_spec.rb
Ruby
mit
19
main
3,443
# frozen_string_literal: true RSpec.describe "Deploys" do let(:client) { RenderAPI.client "test-api-key" } let(:service_id) { "random-string" } subject { client.deploys } describe "create" do before :each do stub_request( :post, "https://api.render.com/v1/services/#{service_id}/deploys" ...
github
pat/render_api
https://github.com/pat/render_api
lib/render_api.rb
Ruby
mit
19
main
228
# frozen_string_literal: true require_relative "render_api/client" module RenderAPI Error = Class.new(StandardError) RequestError = Class.new(Error) def self.client(api_key) RenderAPI::Client.new(api_key) end end
github
pat/render_api
https://github.com/pat/render_api
lib/render_api/client.rb
Ruby
mit
19
main
806
# frozen_string_literal: true require_relative "clients/deploys" require_relative "clients/domains" require_relative "clients/jobs" require_relative "clients/owners" require_relative "clients/services" require_relative "endpoint" module RenderAPI class Client def initialize(api_key) @api_key = api_key ...
github
pat/render_api
https://github.com/pat/render_api
lib/render_api/camelise.rb
Ruby
mit
19
main
691
# frozen_string_literal: true module RenderAPI # Borrowed from awrence: # https://github.com/technicalpanda/awrence/blob/main/lib/awrence/methods.rb class Camelise def self.call(...) new.call(...) end def call(string, first_upper: false) if first_upper string = gsubbed(string, /(...
github
pat/render_api
https://github.com/pat/render_api
lib/render_api/endpoint.rb
Ruby
mit
19
main
1,651
# frozen_string_literal: true require "http" require_relative "camelise" require_relative "response" module RenderAPI class Endpoint HOST = "https://api.render.com" VERSION = "/v1" def initialize(api_key) @api_key = api_key end def get(path, params: nil) request(:get, path, params...
github
pat/render_api
https://github.com/pat/render_api
lib/render_api/data_object.rb
Ruby
mit
19
main
1,058
# frozen_string_literal: true require_relative "camelise" module RenderAPI class DataObject TIME_PATTERN = /\A\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d.\d+Z\z/.freeze attr_reader :cursor def initialize(data) if data["cursor"] @cursor = data.delete("cursor") @data = data.values.first ...
github
pat/render_api
https://github.com/pat/render_api
lib/render_api/response.rb
Ruby
mit
19
main
1,325
# frozen_string_literal: true require_relative "data_object" module RenderAPI class Response include Enumerable def initialize(http_response) @http_response = http_response end def data @data ||= http_response.parse(:json) end def each(&block) data_objects.each(&block) ...
github
pat/render_api
https://github.com/pat/render_api
lib/render_api/clients/owners.rb
Ruby
mit
19
main
304
# frozen_string_literal: true require_relative "base" module RenderAPI module Clients class Owners < Base def find(owner_id) endpoint.get("/owners/#{owner_id}") end def list(...) endpoint.get("/owners", params: list_parameters(...)) end end end end
github
pat/render_api
https://github.com/pat/render_api
lib/render_api/clients/deploys.rb
Ruby
mit
19
main
654
# frozen_string_literal: true require_relative "base" module RenderAPI module Clients class Deploys < Base def create(service_id, clear_cache: nil) body = nil body = { clear_cache: clear_cache } unless clear_cache.nil? endpoint.post( "/services/#{service_id}/deploys", bo...
github
pat/render_api
https://github.com/pat/render_api
lib/render_api/clients/domains.rb
Ruby
mit
19
main
891
# frozen_string_literal: true require_relative "base" module RenderAPI module Clients class Domains < Base def create(service_id, name:) endpoint.post( "/services/#{service_id}/custom-domains", body: { name: name } ) end def delete(service_id, domain_id) endp...
github
pat/render_api
https://github.com/pat/render_api
lib/render_api/clients/jobs.rb
Ruby
mit
19
main
661
# frozen_string_literal: true require_relative "base" module RenderAPI module Clients class Jobs < Base def create(service_id, start_command:, plan_id: nil) body = { startCommand: start_command } body[:plan_id] = plan_id unless plan_id.nil? endpoint.post( "/services/#{se...
github
pat/render_api
https://github.com/pat/render_api
lib/render_api/clients/base.rb
Ruby
mit
19
main
722
# frozen_string_literal: true module RenderAPI module Clients class Base def initialize(endpoint) @endpoint = endpoint end private attr_reader :endpoint def filter_parameter(value) case value when Array value.join(",") else valu...
github
pat/render_api
https://github.com/pat/render_api
lib/render_api/clients/services.rb
Ruby
mit
19
main
1,687
# frozen_string_literal: true require_relative "base" module RenderAPI module Clients class Services < Base def create(**payload) endpoint.post("/services", body: payload) end def delete(service_id) endpoint.delete("/services/#{service_id}") end def find(service_i...
github
v-kolesnikov/uuid_v6
https://github.com/v-kolesnikov/uuid_v6
uuid_v6.gemspec
Ruby
mit
19
master
680
# frozen_string_literal: true require File.expand_path("../lib/uuid_v6/version", __FILE__) Gem::Specification.new do |spec| spec.name = "uuid_v6" spec.version = UUIDv6::VERSION spec.authors = ["Vasily Kolesnikov"] spec.email = ["re.vkolesnikov@gmail.com"] spec.summary = '...
github
v-kolesnikov/uuid_v6
https://github.com/v-kolesnikov/uuid_v6
lib/uuid_v6.rb
Ruby
mit
19
master
228
# frozen_string_literal: true require 'uuid_v6/sequence' require 'uuid_v6/version' # Usage: # # UUIDv6.uuid # => "13bfc94b-6e81-6070-51da-2683e7d73645" module UUIDv6 extend self def uuid Sequence.new.() end end
github
v-kolesnikov/uuid_v6
https://github.com/v-kolesnikov/uuid_v6
lib/uuid_v6/sequence.rb
Ruby
mit
19
master
748
# frozen_string_literal: true require 'uuid' module UUIDv6 # Usage: # seq = UUIDv6::Sequence.new # uid = seq.call # => "137ab4b3-3748-6090-80e3-0c859007c113" class Sequence attr_reader :uuid_v1 def initialize @uuid_v1 = ::UUID.new end # @param uuid [String] UUID version 1 (http...
github
v-kolesnikov/uuid_v6
https://github.com/v-kolesnikov/uuid_v6
spec/spec_helper.rb
Ruby
mit
19
master
394
# frozen_string_literal: true require "bundler/setup" require "uuid_v6" RSpec.configure do |config| # Enable flags like --only-failures and --next-failure config.example_status_persistence_file_path = ".rspec_status" # Disable RSpec exposing methods globally on `Module` and `main` config.disable_monkey_patch...
github
v-kolesnikov/uuid_v6
https://github.com/v-kolesnikov/uuid_v6
spec/uuid_v6/sequence_spec.rb
Ruby
mit
19
master
702
# frozen_string_literal: true require 'uuid_v6/sequence' RSpec.describe UUIDv6::Sequence do subject(:seq) { described_class.new } describe '#call' do subject { seq.() } specify { expect(subject).to be_a(String) } specify { expect(subject.size).to eq 36 } specify 'idempotent behaviour' do ...
github
Amey-Thakur/RUBY
https://github.com/Amey-Thakur/RUBY
web/build.rb
Ruby
mit
19
main
2,035
require 'erb' require 'json' require 'fileutils' require_relative 'data' # The Build Script: Translating Art into Interaction def build_website pages = { 'web/templates/index.html.erb' => 'web/index.html', 'web/templates/404.html.erb' => 'web/404.html' } puts "🚀 Initializing Ruby Build System..." ...
github
Amey-Thakur/RUBY
https://github.com/Amey-Thakur/RUBY
web/data.rb
Ruby
mit
19
main
3,357
# The Source of Truth for the Ruby Programming Challenge CURRICULUM_DATA = [ { day: 1, topic: "Installation, Variables & User Input", category: "basics", file: "Source Code/Day 1/Name.rb" }, { day: 2, topic: "Methods and Conditional if-else", category: "basics", file: "Source Code/Day 2/If_Else_Statement.rb" }, {...
github
Amey-Thakur/RUBY
https://github.com/Amey-Thakur/RUBY
web/source/Day 7/Next_&_Redo_Statement.rb
Ruby
mit
19
main
241
# Next & Redo Statement # Next statement for i in 0..5 if i < 2 next end puts "The value of local variable i = #{i}" end # Redo statement for i in 0..5 if i < 2 puts "The value of local variable i = #{i}" redo end end
github
Amey-Thakur/RUBY
https://github.com/Amey-Thakur/RUBY
web/source/Day 7/Break_Statement.rb
Ruby
mit
19
main
366
# Break Statement =begin Pattern 1: 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 Pattern 2 by modifying Pattern 1 & using break: 1 2 1 2 1 2 1 2 1 2 =end # Pattern 1 for r in 1..5 for c in 1..5 print "#{c}" end print"\n" end # Pattern 2 for r in 1..5 for c in 1..5 print ...
github
Amey-Thakur/RUBY
https://github.com/Amey-Thakur/RUBY
web/source/Day 21/TicTacToe/Gemfile
Ruby
mit
19
main
213
# frozen_string_literal: true source 'https://rubygems.org' git_source(:github) { |Amey-Thakur/TIC-TAC-TOE-IN-RUBY| "https://github.com/#{repo_name}" } # gem "rails" gem 'reek', '6.0.1' gem 'rubocop', '0.82.0'
github
Amey-Thakur/RUBY
https://github.com/Amey-Thakur/RUBY
web/source/Day 21/TicTacToe/lib/game.rb
Ruby
mit
19
main
1,906
# frozen_string_literal: true require_relative 'display.rb' # Contains the logic to play the game class Game include Display attr_reader :first_player, :second_player, :board, :current_player def initialize @board = Board.new @first_player = nil @second_player = nil @current_player = nil end ...
github
Amey-Thakur/RUBY
https://github.com/Amey-Thakur/RUBY
web/source/Day 21/TicTacToe/lib/display.rb
Ruby
mit
19
main
882
# frozen_string_literal: true # rubocop:disable Layout/LineLength # Text needed to Tic-Tac-Toe module Display def display_intro "Let's play a simple Tic-Tac-Toe game in the console! \n\n" end def display_name_prompt(number) "What is the name of player ##{number}?" end def display_symbol_prompt ...
github
Amey-Thakur/RUBY
https://github.com/Amey-Thakur/RUBY
web/source/Day 21/TicTacToe/lib/board.rb
Ruby
mit
19
main
920
# frozen_string_literal: true # Tic-Tac-Toe Board class Board attr_reader :cells WINNING_COMBOS = [ [0, 1, 2], [3, 4, 5], [6, 7, 8], [0, 3, 6], [1, 4, 7], [2, 5, 8], [0, 4, 8], [2, 4, 6] ].freeze def initialize @cells = [1, 2, 3, 4, 5, 6, 7, 8, 9] end # rubocop:disable Metrics/AbcSize def ...
github
Amey-Thakur/RUBY
https://github.com/Amey-Thakur/RUBY
web/source/Day 21/TicTacToe/lib/main.rb
Ruby
mit
19
main
437
# frozen_string_literal: true require_relative 'board.rb' require_relative 'player.rb' require_relative 'game.rb' require_relative 'display.rb' def play_game game = Game.new game.play repeat_game end def repeat_game puts "Would you like to play a new game? Press 'y' for yes or 'n' for no." repeat_input = g...
github
Amey-Thakur/RUBY
https://github.com/Amey-Thakur/RUBY
web/source/Day 21/TicTacToe/spec/board_spec.rb
Ruby
mit
19
main
3,651
# frozen_string_literal: true # rubocop:disable Layout/LineLength, Metrics/BlockLength require_relative '../lib/board' describe Board do subject(:board) { described_class.new } describe '#update_board' do context 'when board is new' do it 'updates cells[index]' do player_input = 0 play...
github
Amey-Thakur/RUBY
https://github.com/Amey-Thakur/RUBY
web/source/Day 21/TicTacToe/spec/spec_helper.rb
Ruby
mit
19
main
4,996
# This file was generated by the `rspec --init` command. Conventionally, all # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. # The generated `.rspec` file contains `--require spec_helper` which will cause # this file to always be loaded, without a need to explicitly require it in any # file...