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 |
|---|---|---|---|---|---|
b96c30ee91f284acf238e6eac175a273255445be | 1,741 | class Xmrig < Formula
desc "Monero (XMR) CPU miner"
homepage "https://github.com/xmrig/xmrig"
url "https://github.com/xmrig/xmrig/archive/v6.7.1.tar.gz"
sha256 "72202ba211a7554b9a45bb1f633dcf132656fcdb83a778f1754d08d6988ec672"
license "GPL-3.0-or-later"
head "https://github.com/xmrig/xmrig.git"
livecheck... | 31.089286 | 95 | 0.688685 |
bf70bff4fd20a8fec00ce67c781a1a47ca6ea3e3 | 10,233 | #
# Copyright 2012-2014 Chef Software, Inc.
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 30.915408 | 116 | 0.62963 |
6142969f6486d7a238ed81762f46277a320bd512 | 799 | require 'simplecov'
SimpleCov.start 'rails'
# Configure Rails Environment
ENV["RAILS_ENV"] = "test"
require File.expand_path("../dummy/config/environment.rb", __FILE__)
require "rails/test_help"
Rails.backtrace_cleaner.remove_silencers!
# Load support files
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |... | 24.96875 | 83 | 0.772215 |
e945f939d5ff55fa90b9fea58cef68f61578700e | 2,457 | # frozen_string_literal: true
module Doorkeeper
module OAuth
module Authorization
class Token
attr_accessor :pre_auth, :resource_owner, :token
class << self
def build_context(pre_auth_or_oauth_client, grant_type, scopes)
oauth_client = if pre_auth_or_oauth_client.resp... | 28.241379 | 81 | 0.543346 |
b955ad8f9e228445547530a0b057e00d60e2ee81 | 710 | # frozen_string_literal: true
module Checkers
module AI
module Engine
class Base
attr_reader :tree_depth
def initialize(tree_depth = 3)
@tree_depth = tree_depth
end
def next_board(board)
if board.jumped
Board.generate_boards(board, :ai).firs... | 18.684211 | 67 | 0.53662 |
0374ecc5460d9713e3557b02f271a4367a3c99b4 | 11,102 | # frozen_string_literal: true
RSpec.describe FactoryTrace::Processors::FindUnused do
subject(:checker) { described_class.call(FactoryTrace::Preprocessors::ExtractDefined.call, FactoryTrace::Preprocessors::ExtractUsed.call(data)) }
describe "check!" do
context "when all factories are not used" do
let(:da... | 42.212928 | 241 | 0.562241 |
d58dcd13ee62f051a109595909291b98560f6d47 | 4,190 | # Copyright (c) 2016, 2020, 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... | 62.537313 | 245 | 0.765632 |
d5fd683368d7515d3adbce0dde3a8b53582e8831 | 1,437 | require 'test_helper'
class FamilyYearsControllerTest < ActionController::TestCase
setup do
@family_year = family_years(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:family_years)
end
test "should get new" do
get :new
assert_respons... | 28.74 | 225 | 0.742519 |
e27c73e34086805c2a77edd48f55b2c4b1784dfa | 1,501 | require File.dirname(__FILE__) + '/test_helper'
class RoutingWithOptionalFormatsTest < Test::Unit::TestCase
def setup
self.class.send :include, ActionController::UrlWriter
ActionController::Base.prune_routes = true
end
def test_should_not_define_formatted_routes_when_explicitly_disabled
assert... | 38.487179 | 90 | 0.697535 |
089326cfd4545696254701b24bcb6eb5f8a050b4 | 227 | module PostUsernameHelper
def each_post_username(post)
render 'each', post: post if user_signed_in?
end
def editing(post)
render 'editing', post: post if current_user && current_user.id == post.user_id
end
end
| 22.7 | 83 | 0.731278 |
8729f95c6f2607a23637d18294d78b8b69379973 | 1,721 | require 'test_helper'
class UsersControllerTest < ActionDispatch::IntegrationTest
def setup
@user = users(:taro)
@other_user = users(:jiro)
end
test "newページの表示" do
get signup_path
assert_response :success
end
test "他のユーザのeditへ" do
log_in_as(@other_user)
get edit_user_path(@user)
... | 25.308824 | 101 | 0.649041 |
871fed05593cc1c2619ee9d346fb75b34a323b4d | 1,368 | # frozen_string_literal: true
##
# This file is part of WhatWeb and may be subject to
# redistribution and commercial restrictions. Please see the WhatWeb
# web site for more information on licensing and terms of use.
# http://www.morningstarsecurity.com/research/whatweb
##
WhatWeb::Plugin.define "Saman-Portal" do
@... | 29.106383 | 155 | 0.665205 |
08afd2c0d83f55411c773fdb6fe9f360287ba048 | 1,177 | require 'rails_helper'
describe Cosmoslike::ValidatorDelegationsDecorator do
let(:instance) { described_class.new(chain, validator) }
let(:chain) { build(:cosmos_chain) }
let(:validator) { double(id: 1, owner: 'cosmosowner123', info_field: 1000000) }
let(:syncer) { double }
let(:delegation) { { 'delegator_ad... | 40.586207 | 115 | 0.684792 |
f8fc3986072923e9718719e8564d8775e54cc3e4 | 151 | class AddEventWillSyncToGpArticleDocs < ActiveRecord::Migration[4.2]
def change
add_column :gp_article_docs, :event_will_sync, :string
end
end
| 25.166667 | 68 | 0.794702 |
11552fb9e778a265d9ecf1afe4dc2a06be0e3eb8 | 2,645 |
module ShopifyCli
##
# `TransformDataStructure` helps to standardize data structure access. It
# traverses nested data structures and can convert
#
# * all strings used as keys to symbols,
# * all strings used as keys from `CamelCase` to `snake_case` and
# * associative array containers, e.g. from Hash t... | 30.402299 | 97 | 0.622684 |
bf43f902c76a341f52eeda1063fe281087093fb0 | 343 | class CreateProducts < ActiveRecord::Migration[5.2]
def change
create_table :products do |t|
t.string :name
t.boolean :sold_out, default: false
t.string :category
t.boolean :under_sale, null: false
t.integer :price
t.integer :sale_price
t.string :sale_text
t.timest... | 21.4375 | 51 | 0.64723 |
1ac9b6ad5c3dfd71135ed80637696bb2fef79d3a | 596 | require_relative 'boot'
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module AwsDemos
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails ... | 31.368421 | 82 | 0.765101 |
bfff7edb40e6bfc0f59d4e22f62d624646f969c9 | 623 | # frozen_string_literal: true
module RelatonIso
# Hit.
class Hit < RelatonBib::Hit
# @return [RelatonIsoBib::IsoBibliographicItem]
attr_writer :fetch
# Parse page.
# @param lang [String, NilClass]
# @return [RelatonIso::IsoBibliographicItem]
def fetch(lang = nil)
@fetch ||= Scrapper.... | 22.25 | 60 | 0.630819 |
e804a32b90ebb07de79ba2c6a92ab7723bca6b32 | 721 | positive = []
for i in [1, 3, 4, 5, 1, 2].sort do
if i > 0
positive.push(i)
end
end
lowest = 1
if positive.size > 0
i = 0
loop do
if (i < positive.size)
if i+1 >= positive.size
lowest = lowest + 1
break
else
diff = ... | 22.53125 | 60 | 0.359223 |
010dc6895abd0d331e06d15eba3f803dd8b93881 | 3,753 | # frozen_string_literal: true
module RuboCop
module Cop
module Style
# This cop checks for redundant uses of `self`.
#
# `self` is only needed when:
#
# * Sending a message to same object with zero arguments in
# presence of a method name clash with an argument or a local
... | 25.882759 | 77 | 0.551825 |
edae98153d990a771ca526a53e9e7b6334a70a8a | 8,026 | # frozen_string_literal: true
require "excon"
require "nokogiri"
require "dependabot/errors"
require "dependabot/nuget/update_checker"
require "dependabot/shared_helpers"
module Dependabot
module Nuget
class UpdateChecker
class RepositoryFinder
DEFAULT_REPOSITORY_URL = "https://api.nuget.org/v3/in... | 33.58159 | 78 | 0.566658 |
f7373b71f4061e18d802e83b2ca0ed8927996b8c | 5,539 | # 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
# fil... | 42.607692 | 92 | 0.737317 |
871d29e474585348c869204e380d456911bddb5a | 373 | Sequel.migration do
up do
# Drop logging for multi_labels table.
drop_trigger(:multi_labels, :audit_trigger_row)
drop_trigger(:multi_labels, :audit_trigger_stm)
end
down do
# Log changes to multi_labels table. Exclude changes to the updated_at column.
run "SELECT audit.audit_table('multi_labe... | 28.692308 | 87 | 0.729223 |
e84dee2d100519c6d0681a633d2194231930a605 | 1,228 | $:.push File.expand_path("lib", __dir__)
# Maintain your gem's version:
require "stardust/rspec/version"
# Describe your gem and declare its dependencies:
Gem::Specification.new do |spec|
spec.name = "stardust-rspec"
spec.version = Stardust::Rspec::VERSION
spec.authors = ["Vic Amuso"]
spec.emai... | 38.375 | 96 | 0.70114 |
03032f213494fac608604ccd6b7b08543fc35bb3 | 1,055 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'rails3_enum/version'
Gem::Specification.new do |spec|
spec.name = "rails3_enum"
spec.version = Rails3Enum::VERSION
spec.authors = ["Tomohisa Kuranari"]
spec.email ... | 37.678571 | 74 | 0.665403 |
1d34063b43cb3e4f40b50005aace3f170deb058c | 515 | require 'spec_helper'
describe YmCore::ImageHelper do
describe "width_height_from_geo_string" do
it "returns [100, 110] if given '100x110'" do
width_height_from_geo_string("100x110").should == [100,110]
end
it "returns [100, 110] if given '100x110#'" do
width_height_from_geo_stri... | 24.52381 | 72 | 0.63301 |
6a01b257b23917316fdbafccd15930f74ab790bb | 1,176 | # frozen_string_literal: true
require "spec_helper"
RSpec.describe Rubytoolbox::Api::ResponseWrapper do
sub = Class.new(Rubytoolbox::Api::ResponseWrapper) do
field :key
end
sample = Class.new(described_class) do
field :foo
field :bar, &:reverse
field :sub do |input|
sub.new input
end... | 21 | 79 | 0.568027 |
f82dbeb39dee3dfebe50e7c61114b32364ff8d35 | 1,997 | namespace :collshift do
desc 'Pull call numbers from range'
task :call_nums, [:start_num, :end_num] => [:environment] do |task, args|
l = LibraryCloud.new
library_code = args[:library_code] || 'MUS'
collection_code = args[:library_code] || 'GEN'
start_num = args[:start_num] || 'M... | 48.707317 | 123 | 0.647972 |
399ba2d01a8aaa7c375d91a4d770d530a127ef0e | 1,342 | lib = File.expand_path("lib", __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "shortcode/version"
Gem::Specification.new do |spec|
spec.name = "shortcode"
spec.version = Shortcode::VERSION
spec.authors = ["Jamie Dyer"]
spec.email = ["jamie@kernowsoul.com"]
... | 41.9375 | 84 | 0.684054 |
260609b6d58f9290df0bffa5a5d2ee301bacc359 | 1,724 | require "spec_helper"
module CC::Analyzer
describe StatsdContainerListener do
describe "#started" do
it "increments a metric in statsd" do
statsd = stub(increment: nil)
statsd.expects(:increment).with("engines.started")
listener = StatsdContainerListener.new("engine", statsd)
... | 33.803922 | 76 | 0.657773 |
62af9b849fbe44dc56232be8dbe26b540569010f | 1,122 | def endpoints_count
YAML.load_file('app/data/endpoints.yml').count
end
def valid_jti
'd8cfec8b-9b00-471e-996d-6a1d93086e1c' # watchdoge JTI
end
def sorted_fake_calls(size: 10, oldest_timestamp: 8.days)
endpoint_factory = EndpointFactory.new
endpoints = endpoint_factory.endpoints.select { |e| e.api_name == 'ap... | 29.526316 | 104 | 0.702317 |
b987a24a919058201bc8f4a20bd7a6d631cd409e | 1,407 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'integration/activejob/version'
Gem::Specification.new do |spec|
spec.name = "integration-activejob"
spec.version = Integration::Activejob::VERSION
spec.authors = ["John... | 41.382353 | 104 | 0.672353 |
7a04206c2c75aa86fc62394b6c5e6c91e4d55286 | 515 | module Student
class ProblemsController < BaseController
# before_action :set_problem, only: [:show]
# GET /student/problems
# GET /student/problems.json
def index
@problems = Problem.all
end
# GET /student/problems/1
# GET /student/problems/1.json
def show
@problem = Pro... | 23.409091 | 63 | 0.603883 |
f8a3bf64b7aa831125607bfa1836a1de8f904ddb | 663 | $:.push File.expand_path("../lib", __FILE__)
# Maintain your gem's version:
require "timequery/version"
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "timequery"
s.version = Timequery::VERSION
s.authors = ["mars"]
s.email = ["578595193@qq.com"]
... | 28.826087 | 83 | 0.647059 |
bffc4e4e5dcaef7404fd4654eba06eaa54209aab | 2,303 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 39.706897 | 98 | 0.686062 |
ff78ae744057d12e348802d918b63acc1be94e9f | 887 | # Copyright 2011-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fil... | 24.638889 | 78 | 0.711387 |
281f1589bd2035658a349f377a5f3c1595b87b04 | 466 | # 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.
require File.expand_path(File.join(File.dirname(__FILE__),'..','..','test_helper'))
require 'new_relic/rack/browser_monitoring'
require 'new_relic/rack/developer... | 31.066667 | 83 | 0.759657 |
91b43753cb62f322a90fa38f5bc43b626db542cc | 17,750 | require 'rails_helper'
module Stats
describe R102SarAppealsPerformanceReport do
before(:all) do
create_report_type(abbr: :r102)
Team.all.map(&:destroy)
Timecop.freeze Time.new(2017, 6, 30, 12, 0, 0) do
@bizgrp_ab = create :business_group, name: 'BGAB'
@dir_a = create :direc... | 62.5 | 227 | 0.637634 |
e2ff23da32a3ed0af38448138725a2e810ef3bf3 | 1,081 | require_relative 'boot'
require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
require "active_storage/engine"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
require "action_cable/eng... | 31.794118 | 82 | 0.778908 |
28156965abeb5417785305ef474e847412624b9c | 195 | module MondoApi
class Response
attr_reader :body
def initialize(success:, body:)
@success = success
@body = body
end
def success?
@success
end
end
end
| 13 | 35 | 0.6 |
8727122f8323811380cfa1c39268668bd1a6200e | 192 | class CreateTweets < ActiveRecord::Migration[6.0]
def change
create_table :tweets do |t|
t.string :content
t.integer :user_id
t.timestamps null: false
end
end
end | 21.333333 | 49 | 0.666667 |
4a653d7029332c5aca7faca5d00dfb1ddcedbf9b | 1,418 | # -*- encoding: utf-8 -*-
require './lib/recursive_open_struct/version'
Gem::Specification.new do |s|
s.name = "recursive-open-struct"
s.version = RecursiveOpenStruct::VERSION
s.authors = ["William (B.J.) Snow Orvis"]
s.email = "aetherknight@gmail.com"
s.date = Time.now.utc.strftime("%Y-%m-%d")
s.homepage... | 31.511111 | 95 | 0.649506 |
ff34f7e7b2e0bb5a91e50b3ad2c7b42ba7cb3437 | 3,480 | module Cannie
# Module for defining and checking permissions
module Permissions
def self.included(base)
base.extend ClassMethods
end
# Class methods available in the class scope for defining permissions
module ClassMethods
# Defines a namespace for permissions and defines the permission... | 31.636364 | 97 | 0.637069 |
087cf327788916bb1b51cf0ff3d90679797cd7ba | 112 | json.extract! @favourite_store, :id, :name, :address, :latitude, :longitude, :user_id, :created_at, :updated_at
| 56 | 111 | 0.741071 |
180d7fe656c300004ee683ec943435f1a6d96f1e | 2,415 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Compute::Mgmt::V2019_12_01
module Models
#
# Api request input for LogAnalytics getThrottledRequests Api.
#
class ThrottledRequestsInput < Log... | 29.096386 | 70 | 0.474534 |
1def651fc931caace6b171b82fdd989cffe6e2f1 | 536 | class CreateTangSubscriptions < ActiveRecord::Migration
def change
create_table :tang_subscriptions do |t|
t.string :stripe_id
t.integer :customer_id, index: true
t.integer :plan_id, index: true, foreign_key: true
t.decimal :application_fee_percent
t.integer :quantity
t.decima... | 24.363636 | 58 | 0.679104 |
abc2f67a1e0c7e9b9c2c4c60d4e51388a645383a | 188 | # Capistrano recipes for an Apache Passenger app server
namespace :passenger do
desc "Restart the rails app"
task :restart do
run "touch #{current_path}/tmp/restart.txt"
end
end
| 23.5 | 55 | 0.744681 |
032e122d4890b6940b8eb3344acdf33506a643c8 | 1,809 | describe 'apache::mod::itk', :type => :class do
let :pre_condition do
'class { "apache": mpm_module => false, }'
end
context "on a Debian OS" do
let :facts do
{
:osfamily => 'Debian',
:operatingsystemrelease => '6',
:concat_basedir => '/dne',
}
... | 30.661017 | 94 | 0.579878 |
e9b17371d176f3f49547276c57940db4343bb153 | 6,286 | require File.expand_path("../../spec_helper", __FILE__)
describe CouchRest do
before(:each) do
@cr = CouchRest.new(COUCHHOST)
begin
@db = @cr.database(TESTDB)
@db.delete! rescue nil
end
end
after(:each) do
begin
@db.delete! rescue nil
end
end
describe "getting i... | 30.965517 | 76 | 0.616927 |
618b6d9ad904ad2f9c509de3a330b2a569637630 | 3,159 | require 'spec_helper'
RSpec.describe Rip::Parser do
let(:fixtures) { Rip::Parser.root + 'spec' + 'fixtures' }
describe '.load' do
end
describe '.load_file' do
let(:parse_tree) { Rip::Parser.load_file(fixtures + 'syntax_sample.rip') }
subject { parse_tree }
def find_rhs(name)
parse_tree.exp... | 29.523364 | 102 | 0.568534 |
ed97aa808e9b0ce6d72dd980eeea316595cdbd01 | 2,885 | # This file is copied to spec/ when you run 'rails generate rspec:install'
require 'spec_helper'
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../config/environment', __dir__)
# Prevent database truncation if the environment is production
abort('The Rails environment is running in production mode!') if Rails.en... | 44.384615 | 86 | 0.751127 |
2106b344abc48c33074a0cf0efe0316203586329 | 13,170 | require 'tmpdir'
require 'tty/platform'
require_relative 'validation'
module VideoConverter
# Class for video conversion
# require 'video_converter/converter'
# VideoConverter::Converter.new(
# verbose: false,
# foreground: false,
# clean: true,
# input_folder: '~/Downloads',
... | 31.966019 | 130 | 0.633333 |
b9a89c088b36dd5138e7485c518ef4bbcc0852e0 | 759 | require 'spec_helper'
describe Lyft::Client::Api::Rides, '#cancel' do
let(:request_path) { "/#{Lyft::Client::Api::VERSION}/rides/#{ride_id}/cancel" }
let(:inputs) do
{
confirmation_token: 'abc123'
}
end
let(:config) do
Lyft::Client::Configuration.new client_id: 'id', client_secret: 'secret'
... | 25.3 | 100 | 0.675889 |
ac88edf03104fe7685896e562d46b04509a7e3ae | 1,053 | # Encoding: utf-8
require_relative 'spec_helper'
describe 'openstack-network::server' do
describe 'redhat' do
let(:runner) { ChefSpec::SoloRunner.new(REDHAT_OPTS) }
let(:node) { runner.node }
let(:chef_run) do
node.override['openstack']['compute']['network']['service_type'] = 'neutron'
runner... | 32.90625 | 99 | 0.694207 |
03a4992114fa39471543530fb2c5a990f30bab81 | 93 | module Mogli
class Music < Model
define_properties :name, :category, :id
end
end | 15.5 | 43 | 0.677419 |
2150cbd2acfc767d115a13b3d6c53bb682a2fbfa | 2,298 | require File.expand_path('../../spec_helper', __FILE__)
module Pod
describe Pod::AggregateTarget do
describe 'In general' do
before do
@target_definition = fixture_target_definition
@lib = AggregateTarget.new(config.sandbox, false, {}, [], Platform.ios, @target_definition, config.sandbox.ro... | 37.064516 | 142 | 0.672759 |
623ddbe9eb5c9aeda32bc1c327d823092034c168 | 1,669 | require 'logger'
module AnalyzeMySQL
module Structure
class Schema
attr_reader :tables
def initialize(conn, conf, name)
@name = name
@conn = conn
@conf = conf
@tables = {}
@log = ::Logger.new(STDOUT)
refresh_cache
end
def refresh_cache
... | 29.803571 | 107 | 0.56441 |
623fe955084f93d38aa1501dd69ff158fb44bc19 | 2,648 | class Redis < Formula
desc "Persistent key-value database, with built-in net interface"
homepage "https://redis.io/"
url "https://download.redis.io/releases/redis-6.0.10.tar.gz"
sha256 "79bbb894f9dceb33ca699ee3ca4a4e1228be7fb5547aeb2f99d921e86c1285bd"
license "BSD-3-Clause"
head "https://github.com/redis/re... | 33.948718 | 108 | 0.616314 |
0894359ac2837d5924c66682d657ab8d6836ae6f | 1,039 | cask :v1 => 'deeper' do
version :latest
sha256 :no_check
if MacOS.version == :tiger
url 'http://www.titanium.free.fr/download/104/Deeper.dmg'
elsif MacOS.version == :leopard
url 'http://www.titanium.free.fr/download/105/Deeper.dmg'
elsif MacOS.version == :snow_leopard
url 'http://www.titanium.fre... | 30.558824 | 76 | 0.683349 |
b9be5e0a5114204fa48a701ec8025250a1644c25 | 330 | require "ruby-spacy"
require "terminal-table"
nlp = Spacy::Language.new("en_core_web_sm")
doc = nlp.read("Where are you?")
puts "Morph features of the third word: " + doc[2].morph.to_s
puts "POS of the third word: " + doc[2].pos
# Morph features of the third word: Case=Nom|Person=2|PronType=Prs
# POS of the third w... | 25.384615 | 66 | 0.712121 |
18caab3590d237b8814137abc3b0db9ea470c221 | 253 | require 'rails_helper'
RSpec.describe "parent/special_events/show", type: :view do
before(:each) do
@parent_special_event = assign(:parent_special_event, SpecialRegistree.create!())
end
it "renders attributes in <p>" do
render
end
end
| 21.083333 | 85 | 0.731225 |
e91b342786777a9656c1ddea8b4e60fc2c46d923 | 2,172 | require 'thinp_xml/listener'
require 'thinp_xml/era/metadata'
require 'rexml/document'
require 'rexml/streamlistener'
#----------------------------------------------------------------
module EraXML
module EraParseDetail
class Listener
include ThinpXML::Base::ListenerUtils
include REXML::StreamListe... | 23.868132 | 78 | 0.524862 |
ed4a3e05d6e523d78899f0b6a70758efa8495c4b | 3,817 | # frozen_string_literal: true
# Copyright The OpenTelemetry Authors
#
# SPDX-License-Identifier: Apache-2.0
require 'test_helper'
describe OpenTelemetry::SDK::Resources::Resource do
Resource = OpenTelemetry::SDK::Resources::Resource
describe '.new' do
it 'is private' do
_(proc { Resource.new('k1' => '... | 34.080357 | 95 | 0.614095 |
21816f9d25e0a0af53569581764e5243968a0cc8 | 2,297 | module Snapshot
class SimulatorLauncherConfiguration
# both
attr_accessor :languages
attr_accessor :devices
attr_accessor :add_photos
attr_accessor :add_videos
attr_accessor :clean
attr_accessor :erase_simulator
attr_accessor :headless
attr_accessor :localize_simulator
attr_acc... | 36.460317 | 76 | 0.741837 |
5dacd07dd347f86c98a619e5ddce9a309c67aa84 | 360 | # frozen_string_literal: true
class Amazon::Workers::Images < Amazon::Workers::Base
FEED_TYPE = '_POST_PRODUCT_IMAGE_DATA_'
ENVELOPE_CLASS = 'Images'
private
def log_msg
"Images feed: Shop(#{shop_id})/Marketplace(#{marketplace})"
end
def completed
update_states :completed
core_ap... | 20 | 65 | 0.7 |
62b7ca4b034ec121f04ac4bd8117ad35e577226f | 1,313 | class Graphite2 < Formula
desc "Smart font renderer for non-Roman scripts"
homepage "https://graphite.sil.org/"
url "https://github.com/silnrsi/graphite/releases/download/1.3.14/graphite2-1.3.14.tgz"
sha256 "f99d1c13aa5fa296898a181dff9b82fb25f6cc0933dbaa7a475d8109bd54209d"
license "LGPL-2.1"
head "https://g... | 32.825 | 94 | 0.753998 |
f8f06068000803a5d081ceb944527a9c82004936 | 579 | class UsersController < ApplicationController
def index
@users = User.all
end
def show
@user = User.find(params[:id])
end
def edit
@user = User.find(params[:id])
end
def update
@user = User.find(params[:id])
@user.update(user_params)
redirect_to @user
end
def new
@user ... | 14.121951 | 45 | 0.618307 |
6aa78b951716bc8cb36ca9a21606f13f723ed01a | 3,969 | class PagesController < ApplicationController
before_action :define_as_page_pro, only: [:landing_page_pro, :faq_pro]
def landing_page_pro
@users_count = Rails.cache.fetch(:users_count, expires_in: 30.seconds) { Counter.total_users }
@confirmed_matched_users_count = Rails.cache.fetch(:confirmed_matched_user... | 26.46 | 140 | 0.610229 |
1857b7334b4e6eddf1c475d61e200457a5e050fa | 33,935 | # Copyright 2015 Google Inc.
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 38.00112 | 100 | 0.609813 |
f7e64ca9853b36dfe0a519e5e50d98e0dded4634 | 1,820 | Puppet::Functions.create_function(:'consul::validate_checks') do
local_types do
type 'HashOrArray = Variant[Hash,Array]'
end
dispatch :validate_checks do
param 'HashOrArray', :obj
end
def validate_checks(obj)
case obj
when Array
obj.each do |c|
validate_checks(c)
... | 40.444444 | 130 | 0.543407 |
287b35daa01fe88e14e0d43ae0996888861a6f29 | 13,259 | require File.join(File.dirname(__FILE__), '../test_helper.rb')
class GatewayTest < Test::Unit::TestCase
include TestHelper
def setup
@gateway = XeroGateway::Gateway.new(CONSUMER_KEY, CONSUMER_SECRET)
end
context "GET methods" do
should :get_invoices do
XeroGateway::OAuth.any_instance.stubs(:get... | 44.049834 | 159 | 0.710008 |
f8f659658a5442750b2753d0454b8364c39a6618 | 15,825 | require "spec_helper"
describe Mongoid::Relations::Accessors do
describe "\#{getter}?" do
let(:person) do
Person.create
end
context "when the relation is a has one" do
context "when the relation exists" do
let!(:game) do
person.build_game
end
it "return... | 20.93254 | 69 | 0.533902 |
26c1395f54d0eeff089a4e9de2ab90fba80a4077 | 423 | cask 'gisto' do
version '1.10.17'
sha256 '8c95961fab98b6c7f70e70971597b6ad461884beeea17ea44d03896e797cac2a'
# github.com/Gisto/Gisto was verified as official when first introduced to the cask
url "https://github.com/Gisto/Gisto/releases/download/v#{version}/Gisto-#{version}.dmg"
appcast 'https://github.com/G... | 32.538462 | 89 | 0.756501 |
bb48bbec19a11f6ed6083b6ac7f6cdb8c3aa884a | 1,606 | class UndeleteFlag < Flag
attr_accessible :problem
validates_inclusion_of :problem, :in => %w( un_delete ), :on => :create, :message => " problem %s is not recognized"
def submithelper
client.flag_venue(venueId, :problem => problem, :comment => comment_text)
end
def resolved?
return true if status ... | 26.327869 | 118 | 0.640722 |
2189b9d83ac64b3a8fa29fa96b5bf2f0854ecbbf | 4,620 | class ImagemagickAT6 < Formula
desc "Tools and libraries to manipulate images in many formats"
homepage "https://www.imagemagick.org/"
# Please always keep the Homebrew mirror as the primary URL as the
# ImageMagick site removes tarballs regularly which means we get issues
# unnecessarily and older versions o... | 35.813953 | 107 | 0.686797 |
d5f9fe14b7d1be5d1e9fa8d5acd22650765a37c3 | 908 | #
# Cookbook: clouderamanager
# Role: clouderamanager-ha-filer.rb
#
# Copyright (c) 2011 Dell Inc.
#
# 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
#
# http://www.apache.org/lice... | 32.428571 | 75 | 0.742291 |
6163b0392c4015177379280f293694b5b24480ad | 4,413 | # encoding: UTF-8
class Money
class FormattingRules
def initialize(currency, *raw_rules)
@currency = currency
# support for old format parameters
@rules = normalize_formatting_rules(raw_rules)
@rules = default_formatting_rules.merge(@rules) unless @rules[:ignore_defaults]
@rules =... | 30.86014 | 244 | 0.637435 |
7a2c6dab4dd4d0734832b64b979337ddf5dc7252 | 16,716 | require 'spec_helper'
describe "inquiry_answers", type: :feature, dbscope: :example do
let(:site) { cms_site }
let(:faq_node) { create :faq_node_page, cur_site: site }
let(:node) { create :inquiry_node_form, cur_site: site, faq: faq_node }
let(:index_path) { inquiry_answers_path(site, node) }
let(:remote_ad... | 43.644909 | 121 | 0.659787 |
4a80e2e5c6182f8a813b73f456c30dbbbe13e25d | 654 | module Api
module V1
class ToursController < Api::V1::ApiController
skip_before_action :check_json_request, :authenticate_user!
def create
user = User.find_by_id params[:user_id]
if user.present?
ActiveRecord::Base.transaction do
tour = user.tours.create(tour_pa... | 23.357143 | 84 | 0.61315 |
ab7d6368016aa845f52c4a3231c882b622e4b83d | 146 | Rails.application.config.middleware.use OmniAuth::Builder do
provider :google_oauth2, ENV["GOOGLE_CLIENT_ID"], ENV["GOOGLE_CLIENT_SECRET"]
end | 48.666667 | 81 | 0.808219 |
1d9f7237e13e68b622774f4f06aa84eeb8c26bdc | 5,851 | # 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... | 37.031646 | 245 | 0.680567 |
79158f9e85afe9293f80d2a457edd53e3e765653 | 42 | module RubberDuck
VERSION = "0.1.0"
end
| 10.5 | 19 | 0.690476 |
03ead68b82a46c7e1e884aa7fb58a48202af5f58 | 1,123 | require_relative '../../../spec_helper'
require_relative 'shared/constants'
describe "Digest::MD5#hexdigest" do
it "returns a hexdigest" do
cur_digest = Digest::MD5.new
cur_digest.hexdigest.should == MD5Constants::BlankHexdigest
# add something to check that the state is reset later
cur_digest << "... | 34.030303 | 83 | 0.747106 |
1d2a8df01be76aa535caaf13d4849eb8563f5ee9 | 92 | class NOVAHawk::Providers::Azure::NetworkManager::LoadBalancerPool < ::LoadBalancerPool
end
| 30.666667 | 87 | 0.826087 |
08f678d907c27b922be63b0902d0c9d0c8167652 | 283 | class CreateUsers < ActiveRecord::Migration[5.2]
def change
create_table :users do |t|
t.text :first_name, null: false
t.text :last_name, null: false
t.text :email, null: false
t.timestamps
end
add_index :users, :email, unique: true
end
end
| 20.214286 | 48 | 0.646643 |
7ae089704a101a614eed341064bba5fa5aad7ae0 | 431 | require_relative '../../spec_helper'
require_relative 'shared/terminate'
require 'strscan'
describe "StringScanner#clear" do
it_behaves_like :strscan_terminate, :clear
it "warns in verbose mode that the method is obsolete" do
s = StringScanner.new("abc")
-> {
s.clear
}.should complain(/clear.*ob... | 22.684211 | 66 | 0.689095 |
5dca182e97bd8b8e6b619debd70cdbe31a058b76 | 456 | # frozen_string_literal: true
require "action_view"
module ActionView
module ConsistentFallback
module TemplateRendering
def render_template(template, layout_name = nil, locals = nil)
if template.variants == [nil] && !@lookup_context.variants.empty?
@lookup_context.variants = []
... | 22.8 | 87 | 0.708333 |
039fa0d6df2653c51f2381550ae5228ccb7acf4f | 1,179 | class Bedops < Formula
desc "Set and statistical operations on genomic data of arbitrary scale"
homepage "https://github.com/bedops/bedops"
url "https://github.com/bedops/bedops/archive/v2.4.39.tar.gz"
sha256 "f8bae10c6e1ccfb873be13446c67fc3a54658515fb5071663883f788fc0e4912"
license "GPL-2.0"
bottle do
... | 35.727273 | 95 | 0.759118 |
797ff0ff681c793fff046fb7058a9f2053612443 | 5,896 | # frozen_string_literal: true
# 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 expl... | 50.393162 | 106 | 0.674695 |
4a5719f7503149ea690100370235ea760969cdda | 205 | # Cookbook Name:: im
# Recipe:: gather_evidence
#
# Copyright IBM Corp. 2016, 2018
#
# <> Gather evidence recipe (gather_evidence.rb)
# <> It will create log file mentioning installed application version.
| 25.625 | 70 | 0.741463 |
5da5d024ae6bda5dd11d92ff51b121d2ab72587e | 222 | # Read about factories at https://github.com/thoughtbot/factory_girl
FactoryBot.define do
factory :lms_instance do
lms_type_id { 1 }
organization_id { 1 }
url { "https://canvas.instructure.com" }
end
end | 20.181818 | 68 | 0.707207 |
08aa685db1e2fdd35cb195510bfd3ca4a3f88b67 | 1,660 | class Cksfv < Formula
desc "File verification utility"
homepage "https://zakalwe.fi/~shd/foss/cksfv/"
url "https://zakalwe.fi/~shd/foss/cksfv/files/cksfv-1.3.15.tar.bz2"
sha256 "a173be5b6519e19169b6bb0b8a8530f04303fe3b17706927b9bd58461256064c"
license "GPL-2.0-or-later"
livecheck do
url "https://zakalw... | 46.111111 | 123 | 0.770482 |
1a63561a5bebe87dc1ac8db9527671161a16cef1 | 45 | module Plivo
VERSION = "4.26.0".freeze
end
| 11.25 | 27 | 0.688889 |
28dd68fd411bc9a8c2f7f974b6eabc7b139d601e | 581 | class ChallengeMailer < ActionMailer::Base
default from: 'challenges@hackingchinese.com'
def starts_soon(challenge, user)
@challenge = challenge
@user = user
return if !MailPreference.allowed?(@user, :challenge_starts_soon)
mail to: user.email,
subject: "[Hackingchinese] #{challenge.title} st... | 29.05 | 69 | 0.70568 |
f751842c864f11140c8c3f232d687548ec19cc6e | 6,521 | #
# May 2018
#
# Copyright (c) 2017-2018 Cisco and/or its affiliates.
#
# Puppet resource provider for fvbd
# For documentation for the Managed Object corresponding to this Puppet Type
# please refer to the following URL
# https://pubhub.devnetcloud.com/media/apic-mim-ref-311/docs/MO-fvBD.html
#
# Licensed under the A... | 30.471963 | 83 | 0.593467 |
6148639e0e3e665de538ebd16fe7b397adddb917 | 2,814 | # frozen_string_literal: true
=begin
require 'spec_helper'
require 'aca_entities/operations/transform_examples/to_mitc_contract/eligibility_response'
RSpec.describe ::AcaEntities::Operations::TransformExamples::ToMitcContract::EligibilityResponse do
describe 'When a valid json file passed' do
let(:source_file) ... | 43.292308 | 144 | 0.67022 |
ab50a20793e56d7b735627f25a7b2cee47f90f95 | 138 | require File.expand_path('../../../spec_helper', __FILE__)
describe "Time#eql?" do
it "needs to be reviewed for spec completeness"
end
| 23 | 58 | 0.717391 |
1836117f47b7cd45c091fd2fd1311627652c29df | 1,376 | # encoding: UTF-8
# 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.
#
# Note that this schema.rb definition is the authoritative sou... | 34.4 | 86 | 0.742006 |
e914d474dadf37b9457561d7604e6490bc0067e2 | 225 | class Admin::BugReportsController < Admin::ApplicationController
layout "admin"
def index
@bug_reports = BugReport.all.order(created_at: :asc)
end
def show
@bug_report = BugReport.find(params[:id])
end
end
| 18.75 | 64 | 0.724444 |
ed8b95881faeba24358b7a952c4d0aa2124d5c3e | 2,410 | require 'rails_helper'
RSpec.describe User, type: :model do
describe User do
before do
@user = FactoryBot.build(:user)
end
describe 'ユーザー新規登録' do
context '新規登録がうまくいくとき' do
it 'nicknameとemail、passwordとpassword_confirmation、birthday、genderが存在すれば登録できること' do
expect(@user).to be_... | 33.472222 | 90 | 0.613693 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.