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 |
|---|---|---|---|---|---|
bfb086a0d0f319522933d91c01daf7f4e181fb40 | 2,379 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web serv... | 34.985294 | 87 | 0.761665 |
5d32127227f992e457999dfb093bfee8a1dfb867 | 1,883 | require 'test_helper'
class UserTest < ActiveSupport::TestCase
def setup
@user = User.new(name:"Example User", email:"user@example.com",
password:"foobar",password_confirmation: "foobar")
end
test "should be valid" do
assert @user.valid?
end
test "name should be present" do
@user.... | 27.691176 | 78 | 0.668083 |
03046945162b06833d7a354cc0fe5a4ceb6be9bb | 10,917 | #
# Author:: Bryan McLellan <btm@loftninjas.org>
# Copyright:: Copyright 2014-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... | 38.440141 | 172 | 0.654942 |
62996e29494ce567b4b6f24cbf59abb8b824435f | 224 | class ApplicationMailer < ActionMailer::Base
MILIEU_EMAIL_ADDRESS = 'info@milieu.io'.freeze
NOTIFICATION_EMAIL_ADDRESS = 'notifications@milieu.io'.freeze
default from: NOTIFICATION_EMAIL_ADDRESS
layout 'mailer'
end
| 28 | 63 | 0.808036 |
fffede2acd198f8d16b3b24d36924ec87cf9a084 | 115 | # frozen_string_literal: true
require 'support/coverage'
require 'env_mock'
require 'pry-byebug'
require 'rspec'
| 14.375 | 29 | 0.782609 |
1866be705cb79d2779b28a8c63327904d38debf3 | 203 | class CreateEvents < ActiveRecord::Migration[5.2]
def change
create_table :events do |t|
t.string :name
t.integer :distance
t.string :stroke
t.timestamps
end
end
end
| 16.916667 | 49 | 0.640394 |
01b7c5e0948da1c975a6fe5f85422d310b5b4f0a | 690 | # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = 'fb_rails'
s.version = '1.2.0'
s.summary = 'Facebook on Rails'
s.description = 'A Rails 3 gem for the latest facebook API'
s.required_ruby_version = '>= 1.9.2'
s.required_rubygems_version = '>= 1.3.5'
s.author = 'Matthew H... | 31.363636 | 76 | 0.634783 |
8727e4dda14756e975774b36069f2d47c021ddfb | 533 | platform_is :windows do
require 'win32ole'
describe 'WIN32OLE_METHOD#invkind' do
before :each do
ole_type = WIN32OLE_TYPE.new("Microsoft Scripting Runtime", "File")
@m_file_name = WIN32OLE_METHOD.new(ole_type, "name")
end
it 'raises ArgumentError if argument is given' do
lambda... | 26.65 | 73 | 0.679174 |
f710262eab160b54d2fe9f3fa167b8a9656d8c78 | 5,606 | ##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# web site for more information on licensing and terms of use.
# http://metasploit.com/
##
require 'rex/proto/http'
require 'msf/core'
class Metasploit3 < Msf::Auxiliary
... | 29.046632 | 145 | 0.61345 |
ff74f4a60a087da3c2321c5d5daf50ba28e07510 | 288 | Rails.application.routes.draw do
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
resources :actors, only: [:index]
# Defines the root path route ("/")
root "actors#index"
require 'sidekiq/web'
mount Sidekiq::Web => '/sidekiq'
end
| 26.181818 | 93 | 0.715278 |
f8458ade71cc471d25aafd158dc60bf584f7eb8e | 1,877 | class SubjectsController < ApplicationController
before_action :set_subject, only: [:show, :edit, :update, :destroy]
# GET /subjects
# GET /subjects.json
def index
@subjects = Subject.all
end
# GET /subjects/1
# GET /subjects/1.json
def show
end
# GET /subjects/new
def new
@subject = Su... | 24.697368 | 93 | 0.665424 |
261e4e1a51f16e1452feb8b4481278cbd3469aee | 139 | require File.expand_path('../../../spec_helper', __FILE__)
describe "Date#cweek" do
it "needs to be reviewed for spec completeness"
end
| 23.166667 | 58 | 0.726619 |
03d4eb2a171f5c5d0911e0a910ab26eb85a08fc5 | 2,381 | AppRoot::Application.routes.draw do
root to: 'application#index'
controller :sorcery do
get :test_login
get :test_logout
get :some_action
post :test_return_to
get :test_auto_login
post :test_login_with_remember_in_login
get :test_login_from_cookie
get :test_login_from
get :test_... | 33.069444 | 62 | 0.797984 |
38413c5742e081ec35db3f3239a1067fd1544fe6 | 1,188 | require_relative '../ports/identity_port'
module Existence
module Adapters
class AdapterBase
include Dry::Monads::Either::Mixin
SUCCESS_STATUS = :ok
attr_reader :port
def initialize(port: Ports::IdentityPort, config: Configuration, **) #oauth_token_value: Domain::OauthTokenValue
... | 20.135593 | 118 | 0.635522 |
ab04e0da6f95e8b80922441fbfac7f0c1bb8dc8b | 1,592 | # Puzzle: http://adventofcode.com/2017/day/3
# --- Day 3: Spiral Memory ---
#
# You come across an experimental new kind of memory stored on an infinite
# two-dimensional grid.
#
# Each square on the grid is allocated in a spiral pattern starting at a
# location marked 1 and then counting up while spiraling ... | 37.023256 | 80 | 0.675251 |
f712644835e14291a1817f4581280c23cab67294 | 969 | require 'ethereum-contract-abi/encoders/decimal_encoder'
require 'ethereum-contract-abi/util'
include EthereumContractABI::Encoders
describe EthereumContractABI::Encoders::DecimalEncoder do
describe "encode" do
it "encodes basic decimal number with 2 digits of precision" do
expected = "0000000000000000000... | 40.375 | 83 | 0.767802 |
6283a22db3cfa18cc6f2e83246701ef8d1bd0de2 | 912 | require 'opal/nodes'
class Opal::Nodes::CallNode
# Rubyspec uses this call to load in language specific features at runtime.
# We can't do this at runtime, so handle it during compilation
add_special :language_version do
if scope.top?
lang_type = arglist[2][1]
target = "corelib/language/versions/... | 20.266667 | 77 | 0.685307 |
5d789c5d5bb0731e6c308361d3f3fbf2256bd570 | 847 | # OpenStack Compute (Nova) Example
require 'fog'
require 'fog/openstack'
auth_url = "https://example.net/v2.0/tokens"
username = 'admin@example.net'
password = 'secret'
tenant = 'My Compute Tenant' # String
compute_client ||= ::Fog::Compute.new(
:provider => :openstack,
:openstack_api_key => passwor... | 25.666667 | 58 | 0.57379 |
9112d904823048b8ed6e34841faca5d688e3932a | 135 | module PerformEvery
class Railtie < ::Rails::Railtie
rake_tasks do
load "tasks/perform_every_tasks.rake"
end
end
end
| 16.875 | 43 | 0.703704 |
039254b5968d94aa6582d5ab88636c97db4ba703 | 243 | require 'rails_helper'
RSpec.describe "family_members/show", type: :view do
# before(:each) do
# @family_member = assign(:family_member, FamilyMember.create!())
# end
#
# it "renders attributes in <p>" do
# render
# end
end
| 20.25 | 69 | 0.662551 |
b9b81ec9ecda4b12c844d0f716415746c168dec6 | 199 | require 'rails'
module Proxied
class Railtie < Rails::Railtie
rake_tasks do
Dir[File.join(File.dirname(__FILE__), '../tasks/*.rake')].each { |ext| load ext }
end
end
end
| 16.583333 | 87 | 0.61809 |
62688333c338756b63f4e0277e617ebd70bb94bf | 320 | # Sample code from Programing Ruby, page 15
inst_section = {
'cello' => 'string',
'clarinet' => 'woodwind',
'drum' => 'percussion',
'oboe' => 'woodwind',
'trumpet' => 'brass',
'violin' => 'string'
}
inst_section['oboe']
inst_section['cello']
inst_section['bassoon']
| 24.615385 | 43 | 0.546875 |
bba4fe33e9dd3bb6cd68bc6d3494f2d79b73268f | 442 | require 'test_helper'
class TeamProjectsHelperTest < ActionView::TestCase
setup do
@c_id = classrooms(:one).id
@t_id = team_projects(:one).id
end
test "helpers" do
begin
classroom_path_team_project_prefix
rescue Errno::ECONNREFUSED
end
assert true
end
private
def params
... | 16.37037 | 51 | 0.678733 |
ab2064470da290f2f3f1dd2ac7da28c3de938e64 | 594 | 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 GoalApp
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails v... | 31.263158 | 82 | 0.765993 |
386833711079f2eee3dcfd98ab5ec13e57d7c6db | 46,664 | # frozen_string_literal: true
# WARNING ABOUT GENERATED CODE
#
# This file is generated. See the contributing guide for more information:
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
module Aws::Honeycode
# @api private
module ClientApi
include Seahors... | 70.489426 | 172 | 0.763094 |
e98803e854a0b0bcd9a7635f667caa67a0634f21 | 694 | class Api::V1::UsersController < ApplicationController
def index
@users = User.all
render json: @users
end
def show
@user = User.find(params[:id])
render json: @user
end
def create
@user = User.create(user_params)
end
def destroy
User.find(... | 18.263158 | 74 | 0.560519 |
7998b22619bab9a6b6f6508d95a6025a1326b153 | 3,280 | Gem::Specification.new do |s|
s.specification_version = 2 if s.respond_to? :specification_version=
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
## Leave these as is they will be modified for you by the rake gemspec task.
## If your rubyforge_project na... | 43.733333 | 253 | 0.700305 |
4a32c1816cb0ada40cdd485d0907a4f24cb7975d | 1,976 | # vFabric Administration Server Ruby API
# Copyright (c) 2012 VMware, Inc. 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... | 38.745098 | 125 | 0.710526 |
bbc2c82805b07864344e16c2c875a7d2bd260e55 | 1,281 | #
# Cookbook: kubernetes-cluster
# License: Apache 2.0
#
# Copyright 2015-2016, Bloomberg Finance L.P.
#
service 'kube-apiserver' do
action :enable
end
node.default['kubernetes']['master']['fqdn'] = node['fqdn']
template '/etc/kubernetes/etcd.client.conf' do
mode '0644'
source 'kube-apiserver-etcd.erb'
varia... | 30.5 | 72 | 0.693989 |
1a5d0fd6489b50d839626a9a009ac89d0f856aa3 | 3,871 | # frozen_string_literal: true
module EPub
module Unmarshaller
class Content
private_class_method :new
# Class Methods
def self.from_rootfile_full_path(rootfile, full_path)
return null_object unless rootfile&.instance_of?(Rootfile) && full_path&.instance_of?(String) && full_path.presen... | 29.549618 | 124 | 0.592353 |
8759d339b20c71380f084af34fffe7c1dd37430a | 1,494 | cask 'unison' do
if MacOS.version <= :mountain_lion
version '2.40.69'
sha256 '2bcc460511f2b43fa1613cc5f9ba4dd59bb12d40b5b9fb2e9f21adaf854bcf3b'
# unison-binaries.inria.fr was verified as official when first introduced to the cask
url "https://unison-binaries.inria.fr/files/Unison-#{version}_x64.dmg"
... | 41.5 | 112 | 0.754351 |
bbdd9762d829d7478e93d98767f81074846a57a7 | 1,549 | Pod::Spec.new do |s|
s.name = "RainbowNavigationOC"
s.version = "1.0.0"
s.summary = "它允许你在各种情况下动画改变UINavigationBar的backgroundColor。"
s.homepage = "https://github.com/timRabbit/RainbowNavigationOC"
s.social_media_url = "https://github.com/timRabbit... | 45.558824 | 232 | 0.610717 |
e9802998170065d5956e20cf98cbc4c1e49ef0a0 | 1,362 | # Copyright (c) 2009-2011 Cyril Rohr, INRIA Rennes - Bretagne Atlantique
#
# 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 b... | 33.219512 | 74 | 0.697504 |
7a42d297317238246bc8e996ed40fa15be479e27 | 26 | require_relative 'client'
| 13 | 25 | 0.846154 |
e9664661777194335e4bea8102bf3dea7ec5848b | 1,097 |
#
# testing ruote
#
# Thu Dec 24 18:05:39 JST 2009
#
require File.join(File.dirname(__FILE__), 'base')
class FtAddServiceTest < Test::Unit::TestCase
include FunctionalBase
class MyService
attr_reader :context, :options
def initialize(context, options={})
@context = context
@options = opt... | 19.245614 | 73 | 0.698268 |
03076003f239d4216b4b1cacc9851fc38bd3bb5d | 4,375 | require 'spec_helper'
describe Neo4j::Shared::Property do
let(:clazz) { Class.new { include Neo4j::Shared::Property } }
describe ':property class method' do
it 'raises an error when passing illegal properties' do
Neo4j::Shared::DeclaredProperty::ILLEGAL_PROPS.push 'foo'
expect { clazz.property :fo... | 28.225806 | 133 | 0.633829 |
91f7153a979f08587cb84dd5dbbe1a84c55c540d | 7,297 | module Cocoon
module ViewHelpers
# this will show a link to remove the current association. This should be placed inside the partial.
# either you give
# - *name* : the text of the link
# - *f* : the form this link should be placed in
# - *html_options*: html options to be passed to link_to (se... | 45.60625 | 197 | 0.66959 |
331bd0f34608514738228a7573031bba68c2611c | 378 | # frozen_string_literal: true
require "omni_attributes"
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_patching!
config.e... | 23.625 | 66 | 0.759259 |
b928d827ec547164422b773c20da2e6ffb74f170 | 597 | class User < ApplicationRecord
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
has_many :articles
has_many :comments
include Permi... | 28.428571 | 63 | 0.726968 |
03a20014b0357a95318b8d6759228419278f53a8 | 2,669 | # mundi_api
#
# This file was automatically generated by APIMATIC v2.0 (
# https://apimatic.io ).
module MundiApi
# UpdateSellerRequest Model.
class UpdateSellerRequest < BaseModel
# Seller name
# @return [String]
attr_accessor :name
# Seller code
# @return [String]
attr_acce... | 26.69 | 67 | 0.520045 |
b947bfd125f6a3b5195bba5cb64a1dd5a68143ae | 271 | describe 'common/element/window' do
def before_first
screen.must_equal catalog
end
t 'before_first' do
before_first
end
t 'window_size' do
size = window_size
size.width.class.must_equal Fixnum
size.height.class.must_equal Fixnum
end
end
| 16.9375 | 39 | 0.723247 |
ac4f6b268a1b24970fcbeb54cb2fbcf4f895d6c1 | 945 | Veewee::Session.declare({
:cpu_count => '1', :memory_size=> '384',
:disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', :ioapic => 'on', :pae => 'on',
:os_type_id => 'RedHat_64',
:iso_file => "CentOS-5.9-x86_64-bin-DVD-1of2.iso",
:iso_src => "http://mirrors.kernel.org/centos/5.9/isos/x86_64/Ce... | 55.588235 | 101 | 0.64127 |
2160d520aba2ee130a05d6a72f94f29565a1903f | 1,326 | Gem::Specification.new do |s|
s.name = "google-protobuf"
s.version = "3.12.3"
git_tag = "v#{s.version.to_s.sub('.rc.', '-rc')}" # Converts X.Y.Z.rc.N to vX.Y.Z-rcN, used for the git tag
s.licenses = ["BSD-3-Clause"]
s.summary = "Protocol Buffers"
s.description = "Protocol Buffers are... | 44.2 | 115 | 0.616139 |
5d9555e06381792453519e7ea1a11b3a3d1b9023 | 950 | require 'minitest/autorun'
require_relative 'hamming'
# Common test data version: 2.2.0 4c453c8
class HammingTest < Minitest::Test
def test_empty_strands
#skip
assert_equal 0, Hamming.compute('', '')
end
def test_single_letter_identical_strands
#skip
assert_equal 0, Hamming.compute('A', 'A')
e... | 21.111111 | 69 | 0.716842 |
d548c00ce10e1375d5af868ed63751eb8e4d4f58 | 243 | class ConfirmExistingUsers < SeedMigration::Migration
def up
User.where(confirmed_at: nil).find_each do |user|
user.skip_confirmation!
user.skip_confirmation_notification!
user.save
end
end
def down
end
end
| 17.357143 | 53 | 0.711934 |
6a09a6a1410a204830b1c532c5eb6e59259b5047 | 456 | $simport.r 'iek/rgss3_ext/plane', '1.0.0', 'Extends Plane Class'
class Plane
# Planes don't have an update method, this usually causes a few 'gotchas!'
def update
end
##
# @return [Void]
def dispose_bitmap
self.bitmap.dispose
end
##
# @return [Void]
def dispose_bitmap_safe
dispose_bitmap ... | 16.888889 | 76 | 0.66886 |
87f1738e3b9cc4d5720a676c694d39f3d123849a | 2,134 | #
# Author:: Christopher Walters (<cw@opscode.com>)
# Author:: Mark Anderson (<mark@opscode.com>)
# Copyright:: Copyright (c) 2010-2011 Opscode, 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 Lice... | 34.419355 | 100 | 0.754452 |
1c8f7987a43a9cfdfc41559f46b08cce11ae6eea | 952 | # frozen_string_literal: true
module Vnstat
module Traffic
##
# A class representing a collection of tracked tops.
class Tops < Base
##
# Iterates over all results in the collection.
#
# @overload each
# @return [Enumerator]
#
# @overload each(&block)
# ... | 22.666667 | 72 | 0.561975 |
d5c8210d2dde0cbe6260b7640af3d5df74086588 | 277 | class AddResetPasswordFields < ActiveRecord::Migration[6.0]
def change
add_column :users, :reset_password_token, :string, default: nil
add_column :users, :reset_password_token_expires_at, :datetime, default: nil
add_index :users, :reset_password_token
end
end
| 34.625 | 80 | 0.772563 |
61f26062bdd6a00bb458594776fe7fbe55f785b9 | 465 | class CreateIntegrations < ActiveRecord::Migration
def self.up
create_table :integrations do |t|
t.belongs_to :conference
t.integer :integration_type
t.string :key
t.string :url
t.string :integration_config_key
t.timestamps
end
add_foreign_key :integrations, :conferenc... | 22.142857 | 78 | 0.705376 |
38e087939f71adf88aba69ec42b9686851929c51 | 2,148 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
package = JSON.parse(File.read(File.expand_path('../../package.json', __dir__)))
version = package['version']
source = { :git => ENV['INSTALL... | 37.034483 | 226 | 0.698324 |
ff17839b97b8dc97e65fcdd870d2668416f006c4 | 430 | Gem::Specification.new do |s|
s.name = 'hebruby'
s.version = '2.1.0'
s.date = '2016-05-20'
s.summary = "Convert Hebrew dates to/from Julian dates"
s.description = "Convert Hebrew dates to/from Julian dates"
s.authors = ["Ron Evans"]
s.email = 'nick@quaran.to'
s.files ... | 30.714286 | 61 | 0.57907 |
338df6d4dc185d5ee437003238eb8fdde8d69cf3 | 1,682 | class Admin::DocsController < Admin::BaseController
before_action :verify_editor
respond_to :html, only: ['new','edit','create']
respond_to :js, only: ['destroy']
def new
@doc = Doc.new
@doc.category_id = params[:category_id]
@doc.body = Post.where(id: params[:post_id]).first.body if params[:post_... | 20.02381 | 79 | 0.593341 |
61c2a380a3f1dbdadeb6b59cb901422dd097680f | 7,591 | require 'active_support/concern'
require 'radmin/fields/types'
module Radmin
module Utils
module HasFields
def fields
_fields
end
def find_field(name)
_fields[name.to_s]
end
def field(name, type = nil, &block)
name = name.to_s
mdl_name = abstract_mo... | 35.306977 | 126 | 0.583981 |
62a22a5c67bbd60ee0431461df46ef55488ee726 | 982 | # frozen_string_literal: true
module Lightning
module IO
class Broadcast < Concurrent::Actor::RestartingContext
include Algebrick
def initialize
@receivers = {}
end
def on_message(message)
match message, (on Array.(:subscribe, ~any) do |type|
if envelope.sender... | 28.882353 | 81 | 0.57332 |
6141531108b43fe7301fbebd11506987a9205f07 | 339 | FileUploadError = Struct.new(:message, :suggestion, :link_options) do
def suggestion_with_link
if link_options
url = link_options[:url]
placeholder = link_options[:placeholder]
suggestion.sub(
/\[#{placeholder}\]/, "<a href=\"#{url}\">#{placeholder}</a>"
)
else
suggestion... | 24.214286 | 69 | 0.622419 |
5df583c9ba4ee44dd2b6345fbbd5dfb034444674 | 11,605 | # Copyright 2014 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 34.53869 | 80 | 0.564584 |
186b0cf2844f6e63e8bebf1a4f60f97951d997e1 | 518 | require 'rails_helper'
RSpec.describe StoresController, type: :controller do
describe "GET #search" do
it "returns http success" do
get :search
expect(response).to have_http_status(:success)
end
end
describe "GET #index" do
it "returns http success" do
get :index
expect(resp... | 19.185185 | 53 | 0.667954 |
bfe0dd0c16070d97d82e017a194992f485d5139b | 69 | class Service < ApplicationRecord
has_many :service_offerings
end
| 13.8 | 33 | 0.826087 |
0154d143586c710508474d233e1e35322712bc92 | 16,645 | # frozen_string_literal: true
begin
gem "redis", ">= 4.0.1"
require "redis"
require "redis/distributed"
rescue LoadError
warn "The Redis cache store requires the redis gem, version 4.0.1 or later. Please add it to your Gemfile: `gem \"redis\", \"~> 4.0\"`"
raise
end
# Prefer the hiredis driver but don't req... | 33.626263 | 181 | 0.587504 |
6acdec1595444cfa3e1d61d401e54f4a04807569 | 1,167 | class MoviesController < ApplicationController
before_action :set_movie, only: [:show, :edit, :update, :destroy]
# GET /movies
def index
@movies = Movie.all
end
# GET /movies/1
def show
end
# GET /movies/new
def new
@movie = Movie.new
end
# GET /movies/1/edit
def edit
end
# POST... | 19.779661 | 81 | 0.659811 |
9111b146846ceb8c6a571aa73b11129b08fb4c24 | 4,406 | class Auditbeat < Formula
desc "Lightweight Shipper for Audit Data"
homepage "https://www.elastic.co/products/beats/auditbeat"
url "https://github.com/elastic/beats.git",
:tag => "v6.8.3",
:revision => "9be0dc0ce65850ca0efb7310a87affa193a513a2"
head "https://github.com/elastic/beats.git"
bot... | 33.633588 | 141 | 0.670676 |
39c36b8246347126f483e8fcbf979397bac29bf2 | 1,103 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'rapid_api/version'
Gem::Specification.new do |spec|
spec.name = 'rapidapi_connect'
spec.version = RapidAPI::VERSION
spec.authors = ['Unathi Chonco']
spec.email ... | 38.034483 | 94 | 0.653672 |
b97541d38a5abe779823812a7354e538a26cab3f | 20,817 | require 'rails_helper'
require 'digest/md5'
describe User, type: :model do
before do
allow_any_instance_of(User).to receive(:update_index).and_return(true)
end
let(:topic) { create :topic }
let(:user) { create :user }
let(:user2) { create :user }
let(:reply) { create :reply }
let(:user_for_delete1) ... | 29.402542 | 124 | 0.624057 |
5d4f0de3f9284944c94b3dcb62bd28288f45d800 | 702 | Pod::Spec.new do |s|
s.name = 'HokoConnectKit'
s.version = '3.1.6'
s.license = 'MIT'
s.summary = 'Hoko Connect Kit'
s.description = 'Hoko Connect Kit iOS SDK. Changing the way apps connect.'
s.homepage = 'http://hoko.io'
s.social_media_url = 'http://twitter.com/hoko_io'
s.authors = {
'Hokolinks S.A'... | 30.521739 | 87 | 0.660969 |
1a97aafe8090ade2619b61ed3120091f155db132 | 3,161 | module Sources
module Alternates
class Pixiv < Base
MONIKER = %r!(?:[a-zA-Z0-9_-]+)!
PROFILE = %r!\Ahttps?://www\.pixiv\.net/member\.php\?id=[0-9]+\z!
DATE = %r!(?<date>\d{4}/\d{2}/\d{2}/\d{2}/\d{2}/\d{2})!i
EXT = %r!(?:jpg|jpeg|png|gif)!i
def force_https?
true
end
... | 42.716216 | 122 | 0.591901 |
bbfca6a3398c171eb01665521b0cfd787078a02d | 1,529 | require './test/test_helper'
class MicropostsInterfaceTest < ActionDispatch::IntegrationTest
def setup
@user = users(:michael)
end
test "micropost interface" do
log_in_as(@user)
get root_path
assert_select 'div.pagination'
assert_select 'input[type="file"]'
# 無効な送信
assert_no_differe... | 29.403846 | 71 | 0.70569 |
1d0496df89e0de8c898406e8fd097b19af352ced | 450 | class Numeric
# The purpose of this is to provide a number to be used as the maximum
# on a chart. Basically rounding up to different scales depending
# on how big the number is.
def chart_round
max = self * 1.1
return 10 unless max > 0; # only happens in testing so far
l = Math.log10(max).to_i # FYI could ... | 23.684211 | 71 | 0.668889 |
b985224774ba613180d3fca9b0643c9ed1154fad | 1,630 | # frozen_string_literal: true
require ::File.expand_path("../test_helper", __dir__)
module EwStripe
class DisputeTest < Test::Unit::TestCase
should "be listable" do
disputes = EwStripe::Dispute.list
assert_requested :get, "#{EwStripe.api_base}/v1/disputes"
assert disputes.data.is_a?(Array)
... | 31.346154 | 79 | 0.652147 |
185ec242ce370e90e5ce6dd86d0b01ab1043b778 | 2,087 | #TODO: Move API keys to env variables instead of hard-coded strings
class ApplicationController < ActionController::Base
def get_real_ip
if request.remote_ip === '127.0.0.1'
return '189.6.22.151'
else
return request.remote_ip
end
end
def get_location_info_for_ip
user_ip_addr = get_real_ip
# TODO: M... | 33.126984 | 187 | 0.736943 |
1c0deb202ad2025deb4c8bd6565a7781da0e1f79 | 633 | require File.expand_path('../../../spec_helper', __FILE__)
require 'strscan'
describe "StringScanner#post_match" do
before :each do
@s = StringScanner.new("This is a test")
end
it "returns the post-match (in the regular expression sense) of the last scan" do
@s.post_match.should == nil
@s.scan(/\w+\... | 24.346154 | 83 | 0.631912 |
b9b6f1e908a31eda198156589f83920b1f1a8851 | 715 | # == Schema Information
#
# Table name: partners
#
# id :integer not null, primary key
# name :string
# email :string
# created_at :datetime not null
# updated_at :datetime not null
# organization_id :integer
# send_reminders :boolean ... | 26.481481 | 70 | 0.583217 |
bbb7f3232fd395f615c63c7a82c065c174a8423e | 126 | node.set['platform'] = 'ubuntu'
# @see https://github.com/opscode-cookbooks/jenkins
include_recipe 'jenkins::_master_package' | 31.5 | 51 | 0.769841 |
61f8ba67e9cc5137788004b7826d280f198fd3cd | 1,883 | # -*- encoding: utf-8 -*-
$LOAD_PATH.push File.expand_path('../lib', __FILE__)
require_relative 'lib/MrMurano/version.rb'
Gem::Specification.new do |s|
s.name = 'MuranoCLI'
s.version = MrMurano::VERSION
s.authors = ['Michael Conrad Tadpol Tilstra']
s.email = ['miketilstra@exosite.com']
s... | 36.921569 | 84 | 0.662241 |
797b304799a56e7a78c66a6f6d5d9357a1f27d26 | 1,061 | #
# Cookbook:: chrony
# Spec:: default
#
# Copyright:: 2018-2019, The Authors, All Rights Reserved.
require 'spec_helper'
describe 'chrony::default' do
context 'When all attributes are default, on Ubuntu 16.04' do
let(:chef_run) do
# for a complete list of available platforms and versions see:
# htt... | 29.472222 | 82 | 0.696513 |
08120d6727d2c32371a8f07df0cf1581b47468fb | 32 | module DefaultStreamsHelper
end
| 10.666667 | 27 | 0.90625 |
ab1ca5d349a2f23de89339e12d18a981740d970b | 10,374 | # Copyright (c) 2007-2012 Vassilis Rizopoulos. All rights reserved.
# Copyright (c) 2021 Markus Prasser. All rights reserved.
require 'observer'
module Batir
#CommandSequence describes a set of commands to be executed in sequence.
#
#Each instance of CommandSequence contains a set of Batir::Command instances, w... | 36.146341 | 203 | 0.667727 |
08aadceb20b4640da5c231df0bb99a32168609ad | 1,239 | require 'spec_helper'
RSpec.describe 'default browser context' do
# https://github.com/microsoft/playwright/blob/master/tests/defaultbrowsercontext-2.spec.ts
it 'should accept userDataDir' do
Dir.mktmpdir do |tmpdir|
browser_type.launch_persistent_context(tmpdir) do |context|
expect(Dir.glob(File... | 32.605263 | 93 | 0.673123 |
ed3d4c403d813b24e5ba804a57ce23ea0bbaa282 | 628 | # Copyright 2016 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 33.052632 | 74 | 0.757962 |
3829ec16c3dd64871c28e7ff543d443bfed827c7 | 269 | class CreateRestaurants < ActiveRecord::Migration[4.2]
def change
create_table :restaurants do |t|
t.string :name
t.string :image_url
t.string :categories
t.integer :rating
t.string :address
t.string :yelp_id
end
end
end
| 20.692308 | 54 | 0.650558 |
d5a425314e29ff1cbeb5c5db0f195fdf188e21c3 | 1,368 | require 'rubygems'
require 'zookeeper'
def wait_until(timeout=10, &block)
time_to_stop = Time.now + timeout
until yield do
break if Time.now > time_to_stop
sleep 0.1
end
end
puts 'Initializing Zookeeper'
zk = Zookeeper.new('localhost:2181')
if zk.state != Zookeeper::ZOO_CONNECTED_STATE
puts 'Unable ... | 24 | 88 | 0.698099 |
116d5e0335c47efc3bb41055201fae72cef4a930 | 29,758 | module Plivo
module Resources
include Plivo::Utils
class Call < Base::Resource
def initialize(client, options = nil)
@_name = 'Call'
@_identifier_string = 'call_uuid'
super
end
def update(options)
valid_param?(:options, options, Hash, true)
params = ... | 53.329749 | 751 | 0.625815 |
18c93642b19bb8e5e894487f9e2876a34b59e226 | 11,118 | # frozen_string_literal: true
require "rails_helper"
# rubocop:disable RSpec/ExampleLength, Layout/LineLength, Style/WordArray
module Renalware
module UKRDC
describe TreatmentTimeline::HD::Generator do
include PatientsSpecHelper
subject(:generator) { described_class.new(modality) }
let(:user)... | 38.337931 | 125 | 0.555226 |
e838ca510e817f27794d21531fddbd18c955fc20 | 1,611 | # encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::SecurityInsights::Mgmt::V2019_01_01_preview
module Models
#
# Describes an threat intelligence ARM STIX Sort By
#
class Thre... | 27.305085 | 77 | 0.556797 |
f75bd96f37ff40b430d9c7354a7109961503bd06 | 27 | module ChampionsHelper
end
| 9 | 22 | 0.888889 |
61601586537d4d8127df195b18ee0ead767a564d | 21,034 | # frozen_string_literal: true
require 'test_helper'
if defined?(::Rails::Railtie) && defined?(::ActionView)
class ActionViewExtensionTest < ActionView::TestCase
setup do
self.output_buffer = ::ActionView::OutputBuffer.new
I18n.available_locales = [:en, :de, :fr]
I18n.locale = :en
end
te... | 35.530405 | 162 | 0.574451 |
332ab37c7b826be854125f2f860d91713aa09e56 | 120 | class AddCarNumberToScans < ActiveRecord::Migration
def change
add_column :scans, :car_number, :integer
end
end
| 20 | 51 | 0.766667 |
e80722857ec86dc059bcda6ebdb646ac4dfd2be2 | 3,386 | shared_examples 'GET #show lists all variables' do
it 'renders the variables as json' do
subject
expect(response).to match_response_schema('variables')
end
it 'has only one variable' do
subject
expect(json_response['variables'].count).to eq(1)
end
end
shared_examples 'PATCH #update updates v... | 24.897059 | 80 | 0.670112 |
6294c6f3561449e1a5b573ca942aa69bc51d7e68 | 2,321 | require 'memoizable'
require 'twitter/entity/hashtag'
require 'twitter/entity/symbol'
require 'twitter/entity/uri'
require 'twitter/entity/user_mention'
require 'twitter/media_factory'
module Twitter
module Entities
include Memoizable
# @return [Boolean]
def entities?
!@attrs[:entities].nil? && @a... | 23.927835 | 83 | 0.651874 |
b995568da43f0a0ce7ef271aaf7579b7a8515461 | 283 | # Encoding: utf-8
require_relative 'spec_helper'
describe 'logstash::default' do
before { logstash_stubs }
describe 'ubuntu' do
let(:chef_run) { ChefSpec::Runner.new.converge(described_recipe) }
it 'writes some chefspec code' do
pending 'todo'
end
end
end
| 18.866667 | 70 | 0.699647 |
08d8b67504772a4e0b4397994afa3d8d163ce850 | 449 | class Myaccount::OrdersController < Myaccount::BaseController
# GET /myaccount/orders
# GET /myaccount/orders.xml
def index
@orders = current_user.completed_orders.find_myaccount_details
end
# GET /myaccount/orders/1
# GET /myaccount/orders/1.xml
def show
@order = current_user.completed_orders.in... | 23.631579 | 92 | 0.737194 |
ffa68a66cbdcb7aa81416cb794e9fb08882104a9 | 537 | class User < ActiveRecord::Base
#define roles for authorization
enum role: [:user, :admin]
after_initialize :set_default_role, :if => :new_record?
def set_default_role
self.role ||= :user
end
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
... | 28.263158 | 76 | 0.743017 |
26a97e1a923125667339a91fbf93d8f91c6d50fb | 176 | class AddSocialLinksToRecruitDocuments < ActiveRecord::Migration[6.0]
def change
add_column :recruit_documents, :social_links, :jsonb, null: false, default: []
end
end
| 29.333333 | 82 | 0.767045 |
871e0ae0c9beaa047b09f77d2428e4309de44c20 | 136 | class AddCommentsCountToProposals < ActiveRecord::Migration
def change
add_column :proposals, :comments_count, :integer
end
end
| 22.666667 | 59 | 0.794118 |
336f4d459ad4fe53823022f3cead997d4780bdd7 | 20,167 | require File.expand_path('../../../spec_helper', __FILE__)
module Bosh::Director
describe Jobs::VmState do
def stub_agent_get_state_to_return_state_with_vitals
expect(agent).to receive(:get_state).with('full').and_return(
'vm_cid' => 'fake-vm-cid',
'networks' => { 'test' => { 'ip' => '1.1.1... | 37.139963 | 123 | 0.545297 |
d5f17bd26516ac311ea3d88f15c874cfd9b09e65 | 6,267 | # == Schema Information
#
# Table name: pqs
#
# id :integer not null, primary key
# house_id :integer
# raising_member_id :integer
# tabled_date :datetime
# respons... | 41.503311 | 93 | 0.494016 |
1a8cb0b1ea3f1ac5039c7d804c3034bd16110d56 | 619 | Pod::Spec.new do |s|
s.name = "OpenClien"
s.version = "0.1.1"
s.summary = "Clien.net 비공식 iOS 라이브러리"
s.homepage = "https://github.com/kewlbear/OpenClien"
s.license = 'Apache 2.0'
s.author = { "Changbeom Ahn" => "kewlbear@gmail.com" }
s.source ... | 36.411765 | 102 | 0.588045 |
011817fbc7d8713af3fa36dfa17c9298b7692d44 | 1,598 | require 'spec_helper'
describe 'granules searches compliance with CEOS Best Practices version 1.2' do
include Rack::Test::Methods
def app
Rails.application
end
it 'unsupported query parameters are dropped from the request per CEOS-BP-009B' do
VCR.use_cassette 'views/granule/ceos_bp_009b', :decode_com... | 57.071429 | 169 | 0.694618 |
03945d9bd2ca5d184545e3bcb55ffd9b0f56af2a | 5,670 | $:.unshift File.dirname(__FILE__)
require 'helper'
describe Gaga do
@types = {
"String" => ["lady", "gaga"],
"Object" => [{:lady => :gaga}, {:gaga => :ohai}]
}
before do
@store = Gaga.new(:repo => tmp_dir, :branch => :lady)
@master = Gaga.new(:repo => tmp_dir)
end
after do
remove_tmpd... | 29.226804 | 123 | 0.592593 |
b944832acd6eeb76ef2bd2bcd26ebca38eaa9cec | 1,473 | module RETerm
module Components
# CDK Histogram Widget
class Histogram < Component
include CDKComponent
attr_accessor :value
# Override setter
def value=(v)
component.set(:PERCENT, # view type
CDK::CENTER, # stats pos
Ncu... | 26.303571 | 61 | 0.467753 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.