hexsha stringlengths 40 40 | size int64 2 1.01M | content stringlengths 2 1.01M | avg_line_length float64 1.5 100 | max_line_length int64 2 1k | alphanum_fraction float64 0.25 1 |
|---|---|---|---|---|---|
7a5218942465b0c9f82d0188842024976719b4c3 | 885 | # frozen_string_literal: true
class HeyDoctor::CheckSidekiqHealthService
class << self
SUCCESS = {
success: true,
message: 'Sidekiq is connected'
}.freeze
ERROR = {
success: false,
message: 'Error connecting to sidekiq'
}.freeze
NO_EXECUTOR = {
success: false,
... | 20.113636 | 79 | 0.6 |
e9635cd091b88d3b1b8d21feb1151d48bc11e0ec | 1,019 | begin
require_relative "lib/net/smtp/version"
rescue LoadError # Fallback to load version file in ruby core repository
require_relative "version"
end
Gem::Specification.new do |spec|
spec.name = "net-smtp"
spec.version = Net::SMTP::VERSION
spec.authors = ["Yukihiro Matsumoto"]
spec.ema... | 36.392857 | 85 | 0.656526 |
39dc9f2066a8384251edc9a762680fd20461d00f | 1,130 | ActiveRecord::Schema.define do
create_table "companies", :force => true do |t|
t.string :name, :null => false
t.date :founded_on
end
create_table "orchards", :force => true do |t|
t.references :company
t.float :acres
t.string :name, :null => false
t.string :location
t.date :planted_... | 24.565217 | 77 | 0.652212 |
bb4b09cc6bc750ded72082ab591b49a831caeb32 | 269 | class CreateTags < ActiveRecord::Migration
def change
create_table :tags do |t|
t.string :name, null: false, default: 'latest'
t.integer :repository_id, null: false
t.timestamps null: false
end
add_index :tags, :repository_id
end
end
| 22.416667 | 52 | 0.67658 |
d5790c1df8628bcb2b94dd272e6b19b30713bc29 | 163 | require File.expand_path(File.join(File.dirname(__FILE__), 'ext', 'sunspot'))
require File.expand_path(File.join(File.dirname(__FILE__), 'ext', 'event-calendar'))
| 54.333333 | 84 | 0.760736 |
33a46c1d9286e31d7fb88126acf0609149148fcf | 2,455 | require 'spec_helper'
require 'zlib'
require 'benchmark'
describe Zopfli do
before :all do
@out_dir = File.expand_path(File.join(File.dirname(__FILE__), "../tmp/"))
Dir.mkdir(@out_dir) unless File.exists?(@out_dir)
end
after :all do
@out_dir = File.expand_path(File.join(File.dirname(__FILE__), "../tm... | 30.308642 | 101 | 0.64888 |
03c41546f163c4e904b8063f74f387ce8366a80d | 1,050 | require 'application_system_test_case'
class FoodsTest < ApplicationSystemTestCase
setup do
@food = foods(:one)
end
test 'visiting the index' do
visit foods_url
assert_selector 'h1', text: 'Foods'
end
test 'should create food' do
visit foods_url
click_on 'New food'
fill_in 'Measure... | 22.826087 | 60 | 0.692381 |
4a8f35bb6a3b2daf1f06fe2918be2b818b4bc1b4 | 34,278 | require 'rails_helper'
describe 'EPP Contact', epp: true do
before :all do
@xsd = Nokogiri::XML::Schema(File.read('lib/schemas/contact-eis-1.0.xsd'))
Fabricate(:zonefile_setting, origin: 'ee')
Fabricate(:zonefile_setting, origin: 'pri.ee')
Fabricate(:zonefile_setting, origin: 'med.ee')
Fabricate(... | 35.855649 | 108 | 0.582619 |
4aeb9443e6d8ad3ecec6e7d608fc32c709875e3f | 360 | cask 'font-iceland' do
version '1.001'
sha256 '5b5919189e5d01a6fac79251aaf9fa9565a738c39974cbe13de98ac02ec7fff5'
url 'https://googlefontdirectory.googlecode.com/hg-history/67342bc472599b4c32201ee4a002fe59a6447a42/ofl/iceland/Iceland-Regular.ttf'
homepage 'http://www.google.com/fonts/specimen/Iceland'
license... | 32.727273 | 134 | 0.811111 |
ac93c4b10e046fb44158c9e6e5b14908887e6c17 | 1,334 | # encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
# This class acts like an Array with a fixed capacity that randomly samples
# from a stream of items such that the probability of each item being included
# in t... | 25.653846 | 81 | 0.616192 |
f7324c7c2f27b16ac9dc5bbc34b7d3118641883b | 481 | require 'pancake'
require ::File.join(::File.expand_path(::File.dirname(__FILE__)), "..", "blog")
# get the application to run. The applicadtion in the Pancake.start block
# is the master application. It will have all requests directed to it through the
# pancake middleware
# This should be a very minimal file, but ... | 43.727273 | 103 | 0.744283 |
7a8e913fd767ea7a3dc294e8199fe8af8ece0050 | 5,168 | #!/usr/bin/env ruby
require 'stringio'
require 'tmpdir'
require_relative '../lib/messages'
require_relative '../lib/parsing/properties_reader'
require_relative '../lib/parsing/parser'
require_relative '../lib/domain/presentation'
require_relative '../lib/rendering/renderer_html_presentation'
require_relative '../lib/r... | 30.761905 | 91 | 0.596749 |
ff8aa687888cb7d7b52c586eeece1ac5252022e9 | 51 | class PdfboxTextExtraction
VERSION = "1.2.0"
end
| 12.75 | 26 | 0.745098 |
6a78b10b1f40896bf645aa48f4154e696ffe4248 | 1,487 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Subscriptions::Mgmt::V2019_10_01_preview
module Models
#
# REST API operation
#
class Operation
include MsRestAzure
# @return [S... | 25.637931 | 76 | 0.517149 |
21fcc1e456f41008280147ccab0fb521b2825ee0 | 738 | # frozen_string_literal: true
require 'splunk-sdk-ruby'
require 'uri'
require 'splunk/pickaxe/config'
require 'splunk/pickaxe/client'
require 'splunk/pickaxe/cookie_proxy'
module Splunk
module Pickaxe
def self.configure(environment, username, password, args)
config = Config.load(environment, args.fetch(:r... | 23.806452 | 74 | 0.668022 |
01c074944762a35d806e86a7a6a04a6837013bfd | 976 | cask 'unity-example@2017.4.9f1' do
version '2017.4.9f1,6d84dfc57ccf'
sha256 :no_check
url "https://download.unity3d.com/download_unity/6d84dfc57ccf/MacExampleProjectInstaller/Examples.pkg"
name 'Example Project'
homepage 'https://unity3d.com/unity/'
pkg 'Examples.pkg'
depends_on cask: 'unity@2017.4.9f1... | 27.111111 | 104 | 0.697746 |
618c6b03723ea3a76b33c3c7a0b3257989e9f7b1 | 43 | module FyntechFeed
VERSION = "0.1.3"
end
| 10.75 | 19 | 0.697674 |
1cd3364dc3141fd26c6e8d5557e2cf7e039abc1a | 31,403 | require 'spec_helper'
describe Pubnub::Heartbeat do
around :each do |example|
Celluloid.boot
@fired = false
@callback = ->(_envelope) do
@fired = true
end
@pubnub = Pubnub.new(
publish_key: 'pub-c-b42cec2f-f468-4784-8833-dd2b074538c4',
subscribe_key: 'sub-c-b7fb805a-1777-11e6... | 38.436965 | 154 | 0.762602 |
7a89b5bb90cdaddae5d61d5b668477774251510f | 367 | cask 'katalon-studio' do
version '7.0.4'
sha256 '697b890b70698e7222226c2f8235a65261d22c7eff851e27ab6642691764266e'
url "https://download.katalon.com/#{version}/Katalon%20Studio.dmg"
appcast 'https://github.com/katalon-studio/katalon-studio/releases.atom'
name 'Katalon Studio'
homepage 'https://www.katalon.... | 30.583333 | 75 | 0.768392 |
1c8e40ae81b6cad61826ca09370b195c65cb0812 | 139 | # frozen_string_literal: true
# rubocop:disable Lint/Void
1
def foobar
2
3; 4; 5
6
end
7
8
9
10
# rubocop:enable Lint/Void
| 5.791667 | 29 | 0.654676 |
187fbab613581a056e53a80a19d66159cfe8d305 | 258 | # frozen_string_literal: true
class ApplicationService
def self.call(*args, &block)
instance = new(*args, &block)
instance.call
end
def call
raise NotImplementedError('Services must implement call')
end
private_class_method :new
end
| 17.2 | 61 | 0.728682 |
1d78f2498383b0d05317bbb79b941420ad845f1a | 299 | Rails.application.config.generators do |g|
g.template_engine :haml
g.helper false
g.javascripts false
g.stylesheets false
g.decorator false
g.helper_specs false
g.view_specs false
g.factory_bot dir: 'spec/factories', suffix: 'factory'
end
| 24.916667 | 61 | 0.648829 |
1ce0e6aea00943e4d390b0f6743959a150568bb8 | 464 | require 'rails_helper'
RSpec.describe Identity, type: :model do
before { @identity = FactoryGirl.build :identity }
subject { @identity }
# response specs
it { should respond_to :uid }
it { should respond_to :provider }
it { should respond_to :user_id }
# validation specs
it { should validate_presenc... | 21.090909 | 52 | 0.702586 |
624a66e832220ff8442a22bee4b5098a1da05b17 | 1,449 | lib = File.expand_path("lib", __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "rulers/version"
Gem::Specification.new do |spec|
spec.name = "rulers"
spec.version = Rulers::VERSION
spec.authors = ["Toni"]
spec.email = ["toni.dezman@gmail.com"]
spec.summar... | 41.4 | 87 | 0.665286 |
18c2b02cd73483b816f01eba46b5b816402baa8a | 1,282 | require 'rails_admin/engine'
require 'rails_admin/abstract_model'
require 'rails_admin/config'
require 'rails_admin/extension'
require 'rails_admin/extensions/cancan'
require 'rails_admin/extensions/paper_trail'
require 'rails_admin/extensions/history'
require 'rails_admin/support/csv_converter'
require 'rails_admin/su... | 32.05 | 79 | 0.75507 |
1d4b9b3eb3ea47f0e2339ded753fcc25de14c633 | 6,400 | =begin
#TransferZero API
#Reference documentation for the TransferZero API V1
OpenAPI spec version: 1.0
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.0.0-beta3
=end
require 'date'
module TransferZero
class TransactionWebhook
# The ID of the webhook that was used to send out this call... | 26.122449 | 208 | 0.676094 |
3936357ef39931f3ae141143a3b38869a9bd0da7 | 706 | # frozen_string_literal: true
require "rails_helper"
RSpec.describe Aggregate::Contracts::HashMinLength do
describe "#valid?" do
it "is true if the hash is equal to min length" do
contract = Aggregate::Contracts::HashMinLength.new(2)
expect(contract.valid?(one: :one, two: :two)).to eq true
end
... | 33.619048 | 77 | 0.685552 |
b99d503ce3b4d3098f3e850cc9acb17637b44ce1 | 3,114 | #!/usr/bin/env ruby
# Encoding: utf-8
#
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
#
# License:: Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | 32.4375 | 80 | 0.677906 |
e9622b8427c58dec0e92c9c997d21b4d876faf2b | 118 | require "test_helper"
class ViewTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
| 14.75 | 40 | 0.694915 |
6a0bf11203e2f6ca09c734d818293004a95c78db | 726 | class Guest < ApplicationRecord
validates :color, format: { with: /[0-9A-Fa-f]{6}/ }, allow_nil: true
validates :name,
presence: true,
uniqueness: { case_sensitive: false },
format: { with: /\A[a-zA-Z0-9 ]+\z/ }
before_validation :add_color, on: :create
after_initialize :ad... | 25.034483 | 71 | 0.651515 |
f759b798ecb102fc971ce50138c9ca9311dc44a0 | 1,583 | require 'simple_health_check/base'
require 'simple_health_check/basic_status_check'
module SimpleHealthCheck
%w[ generic_check http_endpoint_check json_file mysql_check redis_check s3_check version_check version].each do |file|
classified_string = file.split('_').collect!{ |w| w.capitalize }.join
autoload cl... | 25.532258 | 120 | 0.6753 |
1da95db7a546e503a7e13ec1adc36a9d4b48f016 | 318 | # == Schema Information
#
# Table name: adresses
#
# id :integer not null, primary key
# value :string(255)
# user_id :integer
# created_at :datetime
# updated_at :datetime
#
# Indexes
#
# index_adresses_on_user_id (user_id)
#
class Adresse < ActiveRecord::Base
belongs_to :user
end
| 16.736842 | 53 | 0.654088 |
033b4d5ed4ad4a72fee5fbdffcbd6c1ef3e39aab | 1,173 | module HttpSender
require 'typhoeus/adapters/faraday'
# 连接
def connection(timeout = 60, open_timeout = 60)
@connection ||= Faraday.new( ssl: { verify: false } ) do |conn|
conn.request :multipart
conn.request :url_encoded
conn.request :retry, max: 0, interval: 0.05,
in... | 27.928571 | 83 | 0.616368 |
e9f0995d43736c3e6e40ca9f7e67a0dde99e229c | 246 | require 'zbozi_api_ruby/responses/base'
module ZboziApiRuby
module Response
class MarkGettingReadyForPickup < Base
attr_reader :expected_delivery_date
def initialize(json)
super(json)
end
end
end
end
| 17.571429 | 42 | 0.695122 |
bf216bc60d1d6fd043f35f0ffbd83918ff105f9b | 3,036 | package ['git', 'maven']
# In EE hopsworks is copied from the local node into the VM with the vagrantfile
if node['build']['test']['community']
# Clone Hopsworks
git node['test']['hopsworks']['base_dir'] do
repository node['test']['hopsworks']['repo']
revision node['test']['hopsworks']['branch']
user ... | 27.6 | 107 | 0.661397 |
289c8bd56e92ac7357e9572da8dd146fdf13964e | 380 | cask 'menumeters' do
version :latest
sha256 :no_check
url 'http://www.ragingmenace.com/software/download/MenuMeters.dmg'
name 'MenuMeters'
homepage 'http://www.ragingmenace.com/software/menumeters/'
license :gpl
prefpane 'MenuMeters Installer.app/Contents/Resources/MenuMeters.prefPane'
zap delete: '~... | 27.142857 | 76 | 0.773684 |
bb8796e9a2e78c2cd3b2d5eed2691a63ab82bf5f | 317 | namespace :health do
desc 'Query the healthcheck endpoint'
task check: :environment do
session = ActionDispatch::Integration::Session.new(Rails.application)
session.get(Rails.application.routes.url_helpers.health_path)
puts session.response.body
exit 1 if session.response.server_error?
end
end
| 31.7 | 73 | 0.772871 |
394ec61e0ea014db9f5a5efa22b3a9c7861f01c9 | 1,295 | # encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
require 'profiles/latest/personalizer_module_definition'
require 'profiles/latest/modules/personalizer_profile_module'
module Azure::Personalizer... | 33.205128 | 94 | 0.687259 |
ac348ec16cf15628fa6757502f1012669bac3c69 | 2,525 | require "rails_helper"
RSpec.describe "casa_admins/edit", type: :system do
let(:admin) { create :casa_admin }
before { sign_in admin }
context "with valid data" do
it "can successfully edit user email and display name" do
expected_email = "root@casa.com"
expected_display_name = "Root Admin"
... | 27.150538 | 87 | 0.704158 |
f755678cf8315b3bd32447831e789a8bc0c077af | 2,661 | require 'windows/api'
# This module includes stream I/O, low level I/O, etc.
module Windows
module MSVCRT
module IO
API.auto_namespace = 'Windows::MSVCRT::IO'
API.auto_constant = true
API.auto_method = true
API.auto_unicode = false
private
S_IFMT = 0170000 # file typ... | 35.959459 | 59 | 0.56708 |
f7b6bf526a021290c5475a82d2b27708497e2fde | 5,325 | # Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either lic... | 35.264901 | 245 | 0.674178 |
1a421a7cc1d845c25b4d424343930ff85e64b5dc | 838 | #!/usr/bin/env ruby
# encoding: utf-8
# File: monitor_qt.rb
# Created: 17/08/13
#
# (c) Michel Demazure <michel@demazure.com>
require_relative('version.rb')
require_relative('elements/monitor_help.rb')
require_relative 'elements/monitor_elements.rb'
require_relative('elements/monitor_central_widget.rb')
module Jacin... | 27.933333 | 63 | 0.801909 |
b94a34f690a52449f2e7e9446db1a3f3172cf7d1 | 694 | class CdsImporter
class EntityMapper
class GeographicalAreaDescriptionPeriodMapper < BaseMapper
self.entity_class = 'GeographicalAreaDescriptionPeriod'.freeze
self.mapping_root = 'GeographicalArea'.freeze
self.mapping_path = 'geographicalAreaDescriptionPeriod'.freeze
self.entity_mapping... | 31.545455 | 75 | 0.753602 |
33625f276ed201937045a1414eb1fde0d8c72969 | 1,620 | # Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers: a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches... | 40.5 | 85 | 0.762346 |
7a659e13818f6a448ec98becd0c18bbc85f85939 | 136 | class RemoveInstitutionsFromNodes < ActiveRecord::Migration[4.2]
def change
remove_column :nodes, :institutions, :array
end
end
| 22.666667 | 64 | 0.772059 |
289f9c5553769285077d11ec05263c73d29b7bc7 | 4,726 | #!/usr/bin/env ruby
require 'mux_ruby'
require 'solid_assert'
SolidAssert.enable_assertions
# Authentication Setup
openapi = MuxRuby.configure do |config|
config.username = ENV['MUX_TOKEN_ID']
config.password = ENV['MUX_TOKEN_SECRET']
end
# API Client Initialization
assets_api = MuxRuby::AssetsApi.new
# ======... | 39.057851 | 279 | 0.720906 |
79e639b5088a690b1533920aa02dbea907f25269 | 14,904 | # encoding: utf-8
require 'securerandom'
require 'abstract_unit'
require 'active_support/core_ext/string/inflections'
require 'active_support/json'
class TestJSONEncoding < ActiveSupport::TestCase
class Foo
def initialize(a, b)
@a, @b = a, b
end
end
class Hashlike
def to_hash
{ :foo => "... | 32.900662 | 267 | 0.595142 |
7aba78ecb0771c46ff28f8125a83df922e35e9ca | 693 | name "nghttp2"
default_version "1.12.0"
dependency "openssl"
source :url => "https://github.com/nghttp2/nghttp2/releases/download/v1.12.0/nghttp2-#{version}.tar.gz",
:md5 => "04235f1d7170a2efce535068319180a1"
relative_path "nghttp2-#{version}"
env = {
"OPENSSL_CFLAGS" => "-I#{install_dir}/embedded/include/... | 24.75 | 104 | 0.646465 |
aca099d3abbc3168e45c2023f69ee9657607d0ec | 1,061 | require_relative 'lib/ip_info/version'
Gem::Specification.new do |spec|
spec.name = "ip_info"
spec.version = IpInfo::VERSION
spec.authors = ["Andersen Fan"]
spec.email = ["as181920@gmail.com"]
spec.summary = %q{IP info}
spec.description = %q{country, city, location, po... | 36.586207 | 85 | 0.644675 |
ed74cca95c8bd3f98f9a9f53ab342f5b2a8efb86 | 872 | require "domain/customers/validations/on_create"
require "spec/domain/shared/shared_examples"
RSpec.describe Carpanta::Domain::Customers::Validations::OnCreate do
describe "#call" do
subject { described_class.new }
let(:default_params) do
{
name: "Donald",
surname: "Duck",
email... | 24.222222 | 87 | 0.629587 |
f8b8a33a9c00ad09e9434b2329f6aa1223edeb8e | 1,153 | # Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.
#
# Note: You can only move either down or right at any point in time.
#
# Example 1:
# [[1,3,1],
# [1,5,1],
# [4,2,1]]
# Given the above grid map, return 7. Because ... | 24.531915 | 151 | 0.619254 |
187e22e0583dd27b87206e6b78c140cd04ffa427 | 834 | module Bosh::Director
module CpiConfig
class Cpi
extend ValidationHelper
attr_reader :name, :type, :properties
def initialize(name, type, exec_path, properties)
@name = name
@type = type
@exec_path = exec_path
@properties = properties
end
def self.p... | 28.758621 | 109 | 0.61271 |
1c25c5daad7f27c1ed39174091bdf4b3fe8da98b | 9,851 | #
# Author:: Tyler Cloke (tyler@chef.io)
# Copyright:: Copyright 2015-2016, Chef Software, Inc
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | 35.952555 | 179 | 0.639935 |
d54a6873f47a7c15bc58dcce5c1b23fdd9a2ad2e | 2,841 | ################################################################################
# Hashes and symbols: ##########################################################
################################################################################
#1. Define a hash with the keys ’one’, ’two’, and ’three’, and the values ’un... | 37.381579 | 81 | 0.469201 |
e2a1ffdff6c2a14f175cca8cb29f615c2e84e2e0 | 2,104 | require File.expand_path('../boot', __FILE__)
# Pick the frameworks you want:
require "active_record/railtie"
# require "rails/test_unit/railtie"
Bundler.require
require "private_person"
require 'chalk_dust'
module Dummy
class Application < Rails::Application
# Settings in config/environments/* take precedence... | 41.254902 | 99 | 0.73289 |
e83fde234915ef82df58edf0d20f741bb7ade5f0 | 27,758 | require 'abstract_unit'
# FIXME: crashes Ruby 1.9
class FilterTest < Test::Unit::TestCase
class TestController < ActionController::Base
before_filter :ensure_login
after_filter :clean_up
def show
render :inline => "ran action"
end
private
def ensure_login
@ran_filter ||= []... | 31.329571 | 216 | 0.749514 |
390ba692c07e796e78188599afedf16710baaf8a | 662 | # frozen_string_literal: true
RSpec.describe Lambda::AnswerCallbackQuery, :with_lambda do
let(:event) { { 'Records' => [record] } }
let(:callback_query) { json_fixture('telegram/callback_query.json') }
let(:record) { { 'Sns' => { 'Message' => body } } }
let(:body) { callback_query.to_json }
let(:stub_url) { ... | 30.090909 | 103 | 0.697885 |
ff42f051a2292e2515b3bc69d7e88e8cdb878b8a | 767 | cask 'riot' do
version '1.6.7'
sha256 '97a2413c050df71f293de0ce392aec567de847c18bb3e7f1c11112e1a5504948'
url "https://packages.riot.im/desktop/install/macos/Riot-#{version}.dmg"
appcast 'https://github.com/vector-im/riot-desktop/releases.atom'
name 'Riot'
homepage 'https://about.riot.im/'
auto_updates t... | 31.958333 | 75 | 0.621904 |
bbb3eab773e9de375459e06b750d304ca12e1ba9 | 105 | class PlayedCard < ApplicationRecord
belongs_to :user
belongs_to :white_card
belongs_to :round
end
| 17.5 | 36 | 0.8 |
39ecadb4270dc4aebc385a56c4a2d0cffc9820fe | 215 | MRuby::Gem::Specification.new('orgf-filesystem') do |spec|
spec.license = 'Apache-2.0'
spec.author = 'Ramiro Rojo'
spec.add_dependency 'orgf-dependencies'
spec.add_dependency 'mruby-compiler'
end
| 23.888889 | 59 | 0.702326 |
62c89d644c223c31262ac827bf7d3929df69e91b | 2,373 | ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require 'test_help'
class ActiveSupport::TestCase
include Authorization::TestHelper
# Transactional fixtures accelerate your tests by wrapping each test method
# in a transaction that's rolled back on completion.... | 43.145455 | 227 | 0.73367 |
ff50386b0e8121324085631197acf4b79f5aae55 | 688 | =begin
#Datadog API V1 Collection
#Collection of all Datadog Public endpoints.
The version of the OpenAPI document: 1.0
Contact: support@datadoghq.com
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
Unless explicitly stated otherwise all files in this repository are licensed ... | 25.481481 | 107 | 0.784884 |
4abeb6c46dc790d5175773ee1291b921b0321601 | 195 | class AddMarketGroupRefToEveItem < ActiveRecord::Migration[4.2]
def change
add_reference :eve_items, :market_group, index: true
remove_column :eve_items, :cpp_market_group_id
end
end
| 27.857143 | 63 | 0.784615 |
38cbe536e88af940cdad69c1a808333fd0ea647e | 404 | # frozen_string_literal: true
$stdout.sync = true
require 'listen'
namespace :rails_hotreload do
desc 'Start watching file changes. Sample: bin/rails rails_hotreload:start app/assets/builds'
task start: :environment do
paths = (ARGV[0] || 'app/assets/builds,app/views/').to_s.split(',')
paths = paths.map { ... | 31.076923 | 95 | 0.717822 |
037fa5fbc30bceafd95e6d35deaa3b0193847bf3 | 179 | # myapp.rb
require 'sinatra'
require 'rest-client'
require 'json'
get '/' do
url = 'http://jsonplaceholder.typicode.com/users'
JSON.parse(RestClient.get(url))[0]['name']
end
| 17.9 | 51 | 0.698324 |
1d3f2bb4b295bcc30aa3d420f6f917ee2dbfc9f5 | 743 | class User < ApplicationRecord
has_one :cart
has_many :user_outfits
has_many :outfits, through: :user_outfits
validates_uniqueness_of :email
validates_presence_of :first_name, :last_name, :email, :birth_date
has_secure_password
def full_name
self.first_name + " " + self.last_name
end
def birthd... | 25.62069 | 147 | 0.71467 |
b91555a7d691ab598557ab2ae59f24450872fc39 | 52 | module AuthForum
module LineItemsHelper
end
end
| 10.4 | 24 | 0.807692 |
01e05e4623e69a678e6f514fd03a6a5a13559f7c | 7,804 | #/usr/bin/env ruby
require 'fox16'
require 'Clipboard'
require 'logger'
require_relative "ProcessadorDePendencias"
include Fox
class ProcessadorDePendenciasGUI < FXMainWindow
include ProcessadorDePendencias
def initialize(app)
Thread.abort_on_exception=true
# Invoke base class initialize first
supe... | 46.730539 | 280 | 0.736545 |
f7596dba29bff3a4f8018abbc7af35ea649f8a98 | 10,895 | # Copyright 2010-2012 Wincent Colaiuta. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and... | 30.263889 | 87 | 0.607526 |
081cda74bf936bf3b2228f3b18c29cfc0da7b4be | 6,604 | # frozen_string_literal: true
require 'spec_helper'
require_relative '../lib/cocoapods-pack/xcode_builder'
describe_with_private_methods XcodeBuilder do
let(:xcodebuild_opts) { nil }
subject do
ui = spy
XcodeBuilder.new('xcodeproject_path', xcodebuild_opts, 'xcodebuild_outdir', ui)
end
it 'breaks wh... | 57.929825 | 128 | 0.482586 |
111834bbac6c319bcb4885425a4a4e21219affdc | 110 | class HomeController < ApplicationController
def index
u = User.find(1)
sign_in(:user, u)
end
end
| 15.714286 | 44 | 0.690909 |
21f2e3f6791a88c92944fea97a81850c91275ec5 | 2,302 | # This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `rails
#... | 45.137255 | 126 | 0.735447 |
6aaf0288ff4f2ac2851789c14c25cfb8589a7449 | 4,898 | require 'manage_contacts'
def clear_contacts
path = File.expand_path('../lib/contacts.json', __dir__)
File.read(path)
empty_contacts = []
File.write(path, empty_contacts)
end
RSpec.describe ManageContacts do
before :each do
clear_contacts
@contact = ManageContacts.new
end
it 'creates a new inst... | 48.019608 | 278 | 0.678032 |
ffaf22dbb3283bb6e54e2dd7b8ef98000e0fc184 | 22,711 | # frozen_string_literal: true
RSpec.describe "bundle clean" do
def should_have_gems(*gems)
gems.each do |g|
expect(vendored_gems("gems/#{g}")).to exist
expect(vendored_gems("specifications/#{g}.gemspec")).to exist
expect(vendored_gems("cache/#{g}.gem")).to exist
end
end
def should_not_... | 24.76663 | 279 | 0.634979 |
bf42a55e3bf30d62667aee3e875a7555cd5ea4a4 | 1,809 | # frozen_string_literal: true
module Meals
# Handles meal imports.
class ImportsController < ApplicationController
before_action :authorize_import
before_action -> { nav_context(:meals, :meals) }
def show
@import = Import.find(params[:id])
prep_form_vars
return unless request.xhr?
... | 29.655738 | 104 | 0.667772 |
bf73ffd22e6f222f3b88c7a91842aa0401a6d269 | 2,343 | # This file has been automatically generated from a template file.
# Please make modifications to `templates/gRPC.podspec.template`
# instead. This file can be regenerated from the template by running
# `tools/buildgen/generate_projects.sh`.
# Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version... | 30.428571 | 74 | 0.68886 |
61b75e14fcddf55e52dca7bf0e8975d64dce4931 | 21,971 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/videointelligence/v1/video_intelligence.proto
require 'google/api/annotations_pb'
require 'google/api/client_pb'
require 'google/api/field_behavior_pb'
require 'google/longrunning/operations_pb'
require 'google/protobuf/duration_pb'
requ... | 66.377644 | 174 | 0.764144 |
6a28386461823d3bc57d3b49fcb1bb8948eab547 | 3,169 | require 'date'
require_relative '../../utility'
require_relative './server-item'
require_relative './flavor-item'
require_relative './image-item'
# Nocoah
module Nocoah
# Types
module Types
# Compute
module Compute
# Rebuild virtual machine result
class RebuildServerR... | 39.123457 | 119 | 0.517198 |
391b51f3338f4571bca218953dcc873b698ea065 | 116 | FactoryBot.define do
factory :book do
title { "My Personal Hero" }
author { "I.Ron Butterfly" }
end
end
| 16.571429 | 32 | 0.646552 |
4a75724c82f74ce3ee3e15a1842a0d6f86e2b6c1 | 13,239 | feature 'User is', js: true do
let!(:admin) { FactoryBot.create(:user, :admin) }
let!(:john) { FactoryBot.create(:user, :john) }
let!(:blocked_admin) { FactoryBot.create(:user, :blocked_admin) }
scenario 'created without validation errors' do
signin(admin.email, admin.password)
click_... | 46.12892 | 113 | 0.590377 |
f76e7d99eee7666292d8b9b2c9aa1eabac3ffffd | 3,357 | require 'spec_helper'
describe Cointrader::Client, vcr: true do
def limit_buy
subject.limit_buy(total_quantity: 1, price: 10)
end
def limit_sell
subject.limit_sell(total_quantity: 1, price: 10)
end
def market_buy
subject.market_buy(total_amount: 1)
end
def market_sell
subject.market_s... | 23.640845 | 115 | 0.617516 |
87d300a3e9c45842bae5615befe1390028e6430a | 733 | module TD::Types
# Describes a user profile photo.
#
# @attr id [Integer] Photo identifier; 0 for an empty photo.
# Can be used to find a photo in a list of user profile photos.
# @attr small [TD::Types::File] A small (160x160) user profile photo.
# The file can be downloaded only before the photo is ch... | 40.722222 | 74 | 0.697135 |
e9fb6e21ea3ed27f455d55ab7556cd18343ff756 | 1,271 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'rails_log_deinterleaver/version'
Gem::Specification.new do |spec|
spec.name = "rails_log_deinterleaver"
spec.version = RailsLogDeinterleaver::VERSION
spec.authors = ["M... | 42.366667 | 118 | 0.674272 |
62b4801f712504d57e37bb3f964de25e86bbd6ef | 426 | require 'rubygems/test_case'
require 'rubygems/name_tuple'
class TestGemNameTuple < Gem::TestCase
def test_platform_normalization
n = Gem::NameTuple.new "a", Gem::Version.new(0), "ruby"
assert_equal "ruby", n.platform
n = Gem::NameTuple.new "a", Gem::Version.new(0), nil
assert_equal "ruby", n.platfo... | 26.625 | 59 | 0.685446 |
18c4ce575da362d68adf97539c12cb3f832be1c3 | 978 | # coding: utf-8
Gem::Specification.new do |spec|
spec.name = "capybara-timeout_reporter"
spec.version = "0.2.2"
spec.authors = ["Vitalii Grygoruk"]
spec.email = ["vitaliy[dot]grigoruk[at]gmail[dot]com"]
spec.summary = %q{Detecting and reporting capybara sync timeouts}
spe... | 40.75 | 128 | 0.656442 |
01fcac943fa520985555e4e01264a3ab2d7f1b83 | 5,068 | module Fog
module Parsers
module AWS
module RDS
class DbParser < Fog::Parsers::Base
def reset
@db_instance = fresh_instance
end
def fresh_instance
{'PendingModifiedValues' => [], 'DBSecurityGroups' => [], 'ReadReplicaDBInstanceIdentifiers' => []... | 36.992701 | 129 | 0.549132 |
21b6bdf957665fb0756201b813c027f035e9c7b2 | 462 | # frozen_string_literal: true
module Scaffoldable
module BatchableHelper
def batchable_element_viewable?(element_model_instance, options = {})
result = (element_model_instance.selected.nil? || element_model_instance.selected)
result = options[:confirming] ? result && options[:confirming] : true unless... | 30.8 | 108 | 0.761905 |
081663095bd13016e3e373f6b4d6f28ee1085026 | 2,067 |
require 'sightstone/modules/sightstone_base_module'
require 'sightstone/summoner'
require 'sightstone/player_stats_summary'
require 'sightstone/ranked_stats'
module Sightstone
# Module to receive stats
class StatsModule < SightstoneBaseModule
def initialize(sightstone)
@sightstone = sightstone
end
# get a s... | 27.197368 | 91 | 0.670537 |
87573b91e80f8119ded79b9b2cb0156a4666e2f3 | 815 | # encoding: utf-8
require 'spec_helper'
require 'nokogiri'
feature 'Analytics' do
before(:all) do
@stat_new_courses = File.new('spec/fixtures/splunk_new_courses.xml').read
@stat_new_records = File.new('spec/fixtures/splunk_new_records.xml').read
@stat_view = File.new('spec/fixtures/splunk_view.xml').rea... | 32.6 | 78 | 0.671166 |
0166f436dd6a291322668d4df767f63ca2468842 | 232 | class RenameRegions < ActiveRecord::Migration
def change
Region.all.each do |region|
region.name = region.name.sub ' район', ''
region.name = region.name.sub 'поселение ', ''
region.save!
end
end
end
| 19.333333 | 52 | 0.637931 |
6aa4d21d35f10dbf78d25d61fbe45a5f7e952a6d | 1,386 | class Members::RegistrationsController < Devise::RegistrationsController
# before_filter :configure_sign_up_params, only: [:create]
# before_filter :configure_account_update_params, only: [:update]
# GET /resource/sign_up
# def new
# super
# end
# POST /resource
# def create
# super
# end
# GET... | 22.721311 | 72 | 0.69697 |
01b666c648ea9a600e180a05af4a0d405d10af07 | 1,299 | require 'rdf'
# TODO: disable until solve memory exhaust
# require 'rdf/raptor'
require 'rdf/turtle'
require 'zlib'
module DbSNP::RDF
module Writer
class Turtle
class << self
def open(path, compress: true)
f = if compress
Zlib::GzipWriter.open(path)
else
... | 22.396552 | 92 | 0.525019 |
b97801f3453fe18de301a6b122016d989bc0a7bb | 1,276 | require_relative '../../../search_test'
require_relative '../../../generator/group_metadata'
module USCoreTestKit
module USCoreV311
class EncounterIdentifierSearchTest < Inferno::Test
include USCoreTestKit::SearchTest
title 'Server returns valid results for Encounter search by identifier'
desc... | 27.73913 | 114 | 0.691223 |
260dfedee0454b0b3e6ef9c1045cdcdf76edf852 | 552 | module VolleyMotion
class PostRequest < Com::Android::Volley::Request
def parseNetworkResponse(response)
# p response
result = response.data
# p response.toString
# s = Java::Lang::String.new(response.data)
# p s
# p response.result.toString
return Com::Android::Volley::... | 25.090909 | 138 | 0.686594 |
d5004941707e5f2fe7b1ce39a105d9bd04587117 | 2,184 | Окончательный три согласны бакалавра Сэм Вуд является идеальным парнем - но кто он будет выбирать?
Тайна?
Лана Джевонс-ребята, Сара Маккей и Снежана Маркоски может невольно показал, кто выигрывает холостяк.
Женщина, которая с Сэм Вуд заканчивается холостяка были обмотаны в полной секретности.
И три девушки, осталось ко... | 91 | 219 | 0.804487 |
e80adcc82dbc96c652a3e0ca30cd080f014f0c0f | 759 | class UserNameChangeRequest < ApplicationRecord
belongs_to :user
belongs_to :approver, class_name: "User", optional: true
validate :not_limited, on: :create
validates :desired_name, user_name: true, confirmation: true, on: :create
validates_presence_of :original_name, :desired_name
after_create :update_na... | 24.483871 | 100 | 0.711462 |
0177bc8173c430a684d58bbf63d16620dfb228a3 | 603 | require 'spec_helper'
module Spree
describe 'Countries', type: :feature do
stub_authorization!
it 'deletes a state', js: true do
visit spree.admin_countries_path
click_link 'New Country'
fill_in 'Name', with: 'Brazil'
fill_in 'Iso Name', with: 'BRL'
fill_in 'Iso', with: 'BR'
... | 23.192308 | 71 | 0.646766 |
bbf5a78fb0ba3f6d7b89886525de6274f5738cb9 | 47,208 | # -*- coding: binary -*-
require 'rex/ui/text/output/buffer/stdout'
module Msf
module Ui
module Console
module CommandDispatcher
#
# {CommandDispatcher} for commands related to background jobs in Metasploit Framework.
#
class Modules
include Msf::Ui::Console::Co... | 36.425926 | 158 | 0.510019 |
610aa5dc5501a94b351b0181814a9e2d4e4c30bd | 4,831 | require_relative "../spec_helper"
begin
require 'tilt/erb'
rescue LoadError
warn "tilt not installed, skipping render_locals plugin test"
else
describe "render_locals plugin with :merge option" do
before do
app(:bare) do
plugin :render_locals, :render=>{:a=>1, :b=>2, :c=>3, :d=>4, :e=>5}, :layout=>{:... | 42.008696 | 180 | 0.546678 |
877977de268ed24f3d6c93362242f05f66ba78d1 | 1,002 | class Ott < Formula
desc "Tool for writing definitions of programming languages and calculi"
homepage "https://www.cl.cam.ac.uk/~pes20/ott/"
url "https://github.com/ott-lang/ott/archive/0.29.tar.gz"
sha256 "42208e47a9dab3ca89da79c4b1063a728532343a4bf5709393bb3d673a9eaeed"
head "https://github.com/ott-lang/ott... | 34.551724 | 93 | 0.742515 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.