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 |
|---|---|---|---|---|---|
21817b21b2382b6ef68998bffade61de01f746d6 | 2,925 | # frozen_string_literal: true
class Fisk
module Instructions
# Instruction MOVUPD: Move Unaligned Packed Double-Precision Floating-Point Values
MOVUPD = Instruction.new("MOVUPD", [
# movupd: xmm, xmm
Form.new([
OPERAND_TYPES[26],
OPERAND_TYPES[24],
].freeze, [
Class.ne... | 29.25 | 86 | 0.482393 |
873003b2d04c4c1fd689ea9d101f3e9440a34ab4 | 170 | server 'staging.kevinmcphillips.ca', user: 'kevin', roles: %w{web app}, primary: true
set :rails_env, 'staging'
set :deploy_to, "/home/kevin/staging.kevinmcphillips.ca"
| 34 | 85 | 0.741176 |
1df55ad6ad8f8868c45e39fd14680f580c7c59e4 | 180 | class User < ActiveRecord::Base
devise :remote_user_authenticatable, :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
end
| 36 | 80 | 0.777778 |
1d4b39ad921e712dfce704b36e819bbb17559f23 | 149 | # frozen_string_literal: true
RSpec.describe RgGen::VHDL do
it 'has a version number' do
expect(RgGen::VHDL::VERSION).not_to be nil
end
end
| 18.625 | 46 | 0.731544 |
e945e50d1d27c6f2ac2bc0288e8c13606442971d | 781 | cask 'postman' do
version '6.0.9'
sha256 '0922608591e78aa4f0750a4906dd62311e93cd733825ee8cd5b92ed165954976'
# dl.pstmn.io/download/version/ was verified as official when first introduced to the cask
url "https://dl.pstmn.io/download/version/#{version}/osx64"
name 'Postman'
homepage 'https://www.getpostman.... | 33.956522 | 92 | 0.659411 |
9166351ad1901823945dc2e2494ba42bb72f89b3 | 84,596 | # Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 46.506872 | 133 | 0.644168 |
4a99e6f744a13ac9f3caab8b564c261139643619 | 1,025 | Rails.application.routes.draw do
mount ApiTaster::Engine => "/api_taster"
get 'home' => 'application#home', :as => :home
match 'custom' => 'application#home', :via => [:get, :delete]
resources :users, :except => [:new, :edit] do
resources :comments, :only => [:new, :edit]
end
end
ApiTaster.routes do
... | 18.981481 | 63 | 0.458537 |
5d463822c8437394e91fcf8bb8d7f6a17db83f8b | 649 | require 'net/http'
require 'logger'
require_relative 'config'
module AdminUI
class AdminUILogger < Logger
alias_method :parent_debug, :debug
alias_method :parent_info, :info
def initialize(file_name, level)
super(file_name, level)
end
def debug_user(user_name, op, msg)
parent_debug(... | 20.935484 | 65 | 0.559322 |
f835130636e4ff0404d4b0ec8b2976967e1781a0 | 1,810 | #--
#
# $HeadURL$
#
# $LastChangedRevision$
# $LastChangedDate$
#
# $LastChangedBy$
#
# Copyright (c) 2008-2014 California Institute of Technology.
# All rights reserved.
#
#++
name 'every subproperty domain/range consistent with superproperty'
query %q{
<%= @namespace_defs %>
select distinct ... | 24.133333 | 124 | 0.632597 |
3900189599c9903679d753935f238cd38a8c8800 | 968 | class Admin::MissionsController < Admin::BaseController
def index
@missions = Mission.order(:name)
end
def new
@mission = Mission.new
render 'form'
end
def create
@mission = Mission.new(strong_params)
if @mission.save
redirect_to admin_missions_path
else
set_flash_now_er... | 18.615385 | 94 | 0.669421 |
1d291736cef234a2d80a3d86f6ac9a29823ee89d | 879 | # Copyright 2013 Petr Chalupa <git+algebrick@pitr.ch>
#
# 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 ... | 33.807692 | 75 | 0.765643 |
6ac8dea6f77bf157c867162f95b6cd6883d4d736 | 1,223 | require 'spec_helper'
RSpec.describe NgrokAPI::Models::AgentIngress do
before(:each) do
@client = class_double("AgentIngresssClient")
@agent_ingress = NgrokAPI::Models::AgentIngress.new(client: @client, attrs: agent_ingress_result)
end
describe "#==" do
it "is equal if the results are the same" do
... | 28.44186 | 101 | 0.692559 |
39c1592cdb64e1afc59be04b951ed5881d3f6e29 | 273 | module GraphDecorator
class JobNode < BaseNode
def children
return [] unless record.accessible_by?(context)
children = record.input_files.map do |file|
build_child(file)
end
children.push(build_child(record.app))
end
end
end
| 17.0625 | 53 | 0.666667 |
030a49d60155121c8d640942dc35be0b7eb4a457 | 365 | require 'dragonfly/job/step'
module Dragonfly
class Job
class Fetch < Step
class NotFound < RuntimeError; end
def uid
args.first
end
def apply
content, meta = app.datastore.read(uid)
raise NotFound, "uid #{uid} not found" if content.nil?
job.content.updat... | 18.25 | 62 | 0.608219 |
28f0e84dfd5a775f57d9b7edc7347ec2d0dc98aa | 212 | #! /usr/local/bin/ruby -w
require 'RMagick'
# Demonstrate the Image#ordered_dither method
img = Magick::Image.read('images/Flower_Hat.jpg').first
img = img.ordered_dither
img.write('ordered_dither.jpg')
exit
| 17.666667 | 55 | 0.754717 |
e894f3668f6416b0ab28de4fb389d4edc9773265 | 293 | require 'spec_helper'
describe "teams/index" do
before(:each) do
assign(:teams, [
stub_model(Team),
stub_model(Team)
])
end
it "renders a list of teams" do
render
# Run the generator again with the --webrat flag if you want to use webrat matchers
end
end
| 18.3125 | 87 | 0.65529 |
2128225a5d732df54618cfc0254eafe9f1c992db | 1,264 | require 'spec_helper'
describe Gitlab::Git do
let(:committer_email) { 'user@example.org' }
let(:committer_name) { 'John Doe' }
describe 'committer_hash' do
it "returns a hash containing the given email and name" do
committer_hash = described_class.committer_hash(email: committer_email, name: committer... | 30.095238 | 99 | 0.683544 |
871a27c25b74ae4e06cb94fa17242580d5e951d4 | 358 | require './config/environment'
if ActiveRecord::Base.connection.migration_context.needs_migration?
raise 'Migrations are pending. Run `rake db:migrate` to resolve the issue.'
end
# a Rack module for handling browser-unsupported HTTP verbs in web applications
use Rack::MethodOverride
use UsersController
use Wines... | 22.375 | 79 | 0.815642 |
b9ea46c97442c9371b3224f9691a03968ffb80f3 | 1,737 | #!/opt/puppetlabs/puppet/bin/ruby
require 'spec_helper_acceptance_local'
require 'bolt_spec/run'
config_data = {
'modulepath' => "#{__dir__}/../fixtures/modules",
}
inventory_data = YAML.load_file("#{__dir__}/../fixtures/inventory.yaml")
include BoltSpec::Run
describe 'powerstore_host' do
it 'performs host_col... | 36.957447 | 142 | 0.713299 |
03d6ca3c91e085788c0b67bd6324013f5975e487 | 1,484 |
module Sprout
# The MXMLCCruise helper wraps up the fdb and mxmlc unit test tasks by
# using either a Singleton or provided ProjectModel instance.
#
# The simple case that uses a Singleton ProjectModel:
# ci :cruise
#
# Using a specific ProjectModel instance:
# project_model :model
#
# ci... | 23.1875 | 99 | 0.638814 |
4aa4c20d91076ffb650af6476f45604e6050fa6f | 805 | # Be sure to restart your server when you modify this file.
# Your secret key for verifying cookie session data integrity.
# If you change this key, all old sessions will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
Act... | 50.3125 | 148 | 0.790062 |
4a2dbe45194ad8064811db7396f9389f7b8d7be1 | 72 | # frozen_string_literal: true
class Candidate < ApplicationRecord; end
| 18 | 40 | 0.819444 |
7a7bc37d7f1a37f983e47a746d1b1d080963e12e | 130 | def fizzbuzz(int)
if int % 3 == 0 && int % 5 == 0
"FizzBuzz"
elsif int % 3 == 0
"Fizz"
elsif int % 5 == 0
"Buzz"
end
end
| 13 | 31 | 0.523077 |
7ad8cc6241f3ab4928b850f7dcb853b451830bb5 | 722 | require 'spec_helper'
describe 'puppetdb::create_subsetting_resource_hash' do
it { is_expected.not_to eq(nil) }
it { is_expected.to run.with_params.and_raise_error(ArgumentError) }
it { is_expected.to run.with_params('test' => 1).and_raise_error(ArgumentError) }
it { is_expected.to run.with_params('foo', 'bar'... | 51.571429 | 161 | 0.620499 |
5dfca87115341824c124de63aaf884edabada285 | 609 | module ActiveRecord
module PGCrypto
# Subscribes to the logger and obfuscates the sensitive queries.
module LogSubscriber
# rubocop:disable Lint/MixedRegexpCaptureTypes
REGEXP = \
/(\(*)(?<operation>pgp_sym_(decrypt|encrypt)_bytea)(\(+.*\)+)/im.freeze
# rubocop:enable Lint/MixedRegex... | 27.681818 | 79 | 0.648604 |
0311dda19c8cc655765e89698c8dc97d8d9f6d09 | 9,628 | require 'autoproj'
require 'bundler'
require 'digest/md5'
require 'json'
require 'open3'
require 'apaka/packaging/packager'
module Apaka
module Packaging
class GemDependencies
@@known_gems = {}
@@gemfile_to_specs = {}
@@gemfile_md5 = {}
# Path to autoproj d... | 40.79661 | 128 | 0.475904 |
ed3c64ebb9a37682037ee20ea799b2c5b6251c2c | 290 | require 'simplecov'
require 'coveralls'
Coveralls.wear!('rails')
SimpleCov.start 'rails'
ENV['RAILS_ENV'] ||= 'test'
require 'webmock/rspec'
RSpec.configure do |config|
config.order = :random
WebMock.disable_net_connect!(allow: [/localhost/, /127\.0\.0\.1/, /codeclimate.com/])
end
| 19.333333 | 87 | 0.710345 |
acc86d38f858faac82d5e28d1b8b04ec92dc2b8d | 785 | Pod::Spec.new do |s|
s.name = 'PKHUD'
s.module_name = 'PKHUD'
s.version = '4.2.0'
s.summary = 'A Swift 3 based reimplementation of the Apple HUD (Volume, Ringer, Rotation,…) for iOS 8 and up'
s.homepage = 'https://github.c... | 49.0625 | 129 | 0.467516 |
f88109dd8758332f39d5d3b973526bc89c746808 | 119 | Rails.application.routes.draw do
resources :promotions, only: [:show]
post 'callback', to: 'message#callback'
end
| 19.833333 | 41 | 0.731092 |
f73f20e13ba768f2d54db40ecc4c73d72662cd96 | 2,371 | module Fog
module Compute
class AWS
class Real
require 'fog/aws/parsers/compute/describe_internet_gateways'
# Describe all or specified internet_gateways
#
# ==== Parameters
# * filters<~Hash> - List of filters to limit results with
#
# === Returns
... | 38.868852 | 197 | 0.583298 |
6a4154c62ed1205c87116aca77a1a7f7b922f34a | 854 | module Helpers
AWS_S3_BUCKET_IMAGES = ENV["AWS_S3_BUCKET_IMAGES"] || ENV["AWS_S3_BUCKET"]
def preset
OpenStruct.new(IMAGE_PRESETS[@preset_name.to_sym])
end
def send_to_feedbin(original_url:, storage_url:)
Sidekiq::Client.push(
"args" => [@public_id, {
"original_url" => original_url,
... | 25.117647 | 83 | 0.61007 |
8789e6ed996462722f994b57f4ab414b5e6abe8a | 2,770 | require 'spec_helper'
describe Net::NTLM::Client::Session do
let(:t2_challenge) { Net::NTLM::Message.decode64 "TlRMTVNTUAACAAAADAAMADgAAAA1goriAAyk1DmJUnUAAAAAAAAAAFAAUABEAAAABgLwIwAAAA9TAEUAUgBWAEUAUgACAAwAUwBFAFIAVgBFAFIAAQAMAFMARQBSAFYARQBSAAQADABzAGUAcgB2AGUAcgADAAwAcwBlAHIAdgBlAHIABwAIADd7mrNaB9ABAAAAAA==" }
... | 40.144928 | 255 | 0.73574 |
bb66e71907fec788de0a23ed26676ffd7de671c2 | 1,923 | #--
# Copyright 2013 Red Hat, 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 writ... | 27.869565 | 78 | 0.725949 |
1a6e1503fd82015ed878bde45f9069617b97d2fa | 1,741 | # frozen_string_literal: true
require 'test_helper'
class RefuteRespondToTest < Minitest::Test
def setup
@cop = RuboCop::Cop::Minitest::RefuteRespondTo.new
end
def test_registers_offense_when_using_refute_calling_respond_to_method
assert_offense(<<~RUBY, @cop)
class FooTest < Minitest::Test
... | 30.017241 | 199 | 0.643308 |
082c144952998074eb19c959feb5aa597502cb29 | 570 | # frozen_string_literal: true
module I18n::Tasks
module HtmlKeys
HTML_KEY_PATTERN = /[.\-_]html\z/
MAYBE_PLURAL_HTML_KEY_PATTERN = /[.\-_]html\.[^.]+\z/
def html_key?(full_key, locale)
# rubocop:disable Style/DoubleNegation
!!(full_key =~ HTML_KEY_PATTERN ||
full_key =~ MAYBE_PLURA... | 27.142857 | 85 | 0.649123 |
f8213c1ee2ebfff1f35f33da722e5e6500c4e398 | 5,287 | ##
# $Id$
# $Revision: $
##
require "rexml/document"
#-------------------------------------------------------------------------------
#Options and Option Parsing
opts = Rex::Parser::Arguments.new(
"-h" => [ false, "Help menu." ],
"-c" => [ false, "Return credentials." ]
)
get_credentials=false
opts.parse(args) { ... | 30.039773 | 107 | 0.626442 |
338a91a43116f9350dad75e0e2662b461789ecd7 | 205 | class Relationship < ApplicationRecord
belongs_to :follower, class_name: "User"
belongs_to :folloed, class_name: "User"
validates :follower_id, presence: true
validates :folloed_id, presence: true
end
| 29.285714 | 41 | 0.795122 |
1c7788da9cf5efa3611d915cd903bee4e64217a2 | 2,217 | # frozen_string_literal: true
module RuboCop
module Cop
module Layout
# This cops checks the indentation of comments.
class CommentIndentation < Cop
include AutocorrectAlignment
MSG = 'Incorrect indentation detected (column %d instead of %d).'.freeze
def investigate(processe... | 29.959459 | 80 | 0.579161 |
0341c6a904f5a66768ace07e800ff4cb969822a8 | 255 | #!/usr/bin/env ruby
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'zwaveascii'
zwave = ZWave::ASCII.new ARGV[0], 115200
zwave.debug = true
while(true) do
events = zwave.fetch_events
p events if events
sleep 0.25
end
| 17 | 66 | 0.701961 |
62f0a0da7d0e493c7d49b7ab3befaeb05d11cee7 | 3,245 | require 'rails_helper'
RSpec.describe Ticket, type: :model do
let(:project) { FactoryBot.create(:project)}
describe "association" do
describe "belongs_to" do
it { is_expected.to belong_to(:project) }
it { is_expected.to belong_to(:assignee).class_name("User") }
it { is_expected.to belong_to(:... | 37.732558 | 131 | 0.652696 |
0359b8b17fdc87da778d02a9ca5014370c594304 | 892 | require 'spec_helper'
require 'vigilem/support/system'
require 'vigilem/core/system'
describe Vigilem::Core::System do
describe '::check' do
describe ':os' do
it 'checks to see if the os is the same as the argument' do
expect(described_class.check[:os].call(/#{described_class.os}/i)).to be_tr... | 29.733333 | 99 | 0.661435 |
f7556ddc7f76b2af75ad51b307c18aa786fc853f | 3,638 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web serve... | 40.422222 | 102 | 0.762232 |
918cd478db2f16da3cda38286a72c429244abf86 | 2,788 | # frozen_string_literal: true
# Copyright 2015 Australian National Botanic Gardens
#
# This file is part of the NSL Editor.
#
# 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
#
# ht... | 45.704918 | 76 | 0.565638 |
7a93a45e36760526c0f99282488e9f6330aa5e9e | 1,081 | # Author:: AJ Christensen (<aj@junglist.gen.nz>)
# Copyright:: Copyright (c) 2012 AJ Christensen
# 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
#
# ... | 36.033333 | 131 | 0.706753 |
e810ccf4a9c6de54af5614558a68b384c135a06e | 1,931 | class Logcli < Formula
desc "Run LogQL queries against a Loki server"
homepage "https://grafana.com/loki"
url "https://github.com/grafana/loki/archive/v2.4.0.tar.gz"
sha256 "38e8403e59218cfa81b38af48852e77f6b6be5390190b99bdc0dc157a7e0400b"
license "AGPL-3.0-only"
head "https://github.com/grafana/loki.git", ... | 38.62 | 129 | 0.75971 |
2815b60d2addf21d5ca6ecd95f2c982e5d3aa896 | 3,033 | class FacultyConnectSessionReminderJob < ApplicationJob
queue_as :default
def perform(connect_request_id)
@connect_request_id = connect_request_id
return unless job_is_relevant?
remind_founders_on_slack
remind_faculty_on_slack
remind_ops_team_on_slack if Rails.env.production?
end
def rem... | 31.268041 | 174 | 0.791296 |
183f05b6994f2616ba63f526bc7aa01993612a18 | 784 |
Pod::Spec.new do |s|
s.name = "KCLoginKit"
s.version = "0.2.23"
s.summary = "A short description of KCLoginKit."
s.license = 'MIT'
s.author = { "Emil Wojtaszek" => "emil@appunite.com" }
s.source = { :git => "git@git.appunite.com:newmedia/kingschat-... | 31.36 | 114 | 0.585459 |
d5dae6e3078e638a07a235757c7b82c089c77925 | 13,803 | # frozen_string_literal: true
require 'game_manager'
require 'lib/color'
require 'lib/connection'
require 'lib/params'
require 'lib/settings'
require_tree './game'
module View
class GamePage < Snabberb::Component
include GameManager
include Lib::Color
include Lib::Settings
needs :selected_company, ... | 31.585812 | 118 | 0.567268 |
6ac1e591010b77d95c8632d38399c5e78339479a | 12,976 | ##
# This code was generated by
# \ / _ _ _| _ _
# | (_)\/(_)(_|\/| |(/_ v1.0.0
# / /
module Twilio
module REST
class Chat < Domain
class V2 < Version
class ServiceContext < InstanceContext
class BindingList < ListResource
##
# Initialize the B... | 37.180516 | 120 | 0.521578 |
183a05f251d3f3085de701371f220a63e2d5858d | 1,105 | # -*- encoding: utf-8 -*-
# stub: jekyll-theme-modernist 0.0.4 ruby lib
Gem::Specification.new do |s|
s.name = "jekyll-theme-modernist".freeze
s.version = "0.0.4"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s... | 34.53125 | 112 | 0.676923 |
01ccfe7b9f108856364d31f29f60a9bcff40b89a | 3,450 | module Gifts::Grit
class CommitStats
attr_reader :id, :files, :additions, :deletions, :total
# Instantiate a new CommitStats
# +id+ is the id of the commit
# +files+ is an array of :
# [ [filename, adds, deletes, total],
# [filename, adds, deletes, total],
# [filenam... | 26.744186 | 93 | 0.57942 |
1afaaab24f9254cf9b3b237b87efef5770e33705 | 414 | class AddQcColumnsToWell < ActiveRecord::Migration
def self.up
add_column :wells, :measured_volume, :decimal, :precision => 5, :scale => 2
add_column :wells, :sequenom_count, :integer
add_column :wells, :gender_markers, :string, :limit => 8
end
def self.down
remove_column :wells, :gender_markers
... | 31.846154 | 79 | 0.724638 |
6aa1da38e91501ec3063656ab9fd585928809039 | 175 | FactoryGirl.define do
factory :peer_review do
association :result, factory: :result, marking_state: 'incomplete'
association :reviewer, factory: :grouping
end
end
| 25 | 70 | 0.754286 |
f8796e3f9ff8791ff3aecdf47607100f3b982e3f | 17,753 | module CustomLandingPage
# rubocop:disable Metrics/ModuleLength
module StaticData
# TODO Document the expected JSON structure here
DATA_STR = <<JSON
{
"settings": {
"marketplace_id": 9999,
"locale": "en",
"sitename": "qa6.test.com"
},
"page": {
"twitter_handle": {"type": "marketplac... | 47.595174 | 357 | 0.596294 |
bbde3aa368ae9a49332ea375b88c4fbfb11a49a2 | 8,162 | module Shoulda
module Matchers
module ActionController
# The `set_the_flash` matcher is used to make assertions about the
# `flash` hash.
#
# class PostsController < ApplicationController
# def index
# flash[:foo] = 'A candy bar'
# end
#
... | 27.389262 | 79 | 0.495712 |
bf8d9c4107ca66fbd67e7bbebbbb1e35c0816873 | 168 | class AuditSerializer < ActiveModel::Serializer
attributes :id, :created_at, :event, :whodunnit
def whodunnit
object.user&.email || object.whodunnit
end
end
| 21 | 49 | 0.744048 |
39e6c688fecaa461ac0b61914c953deea5ab3e1c | 59 | module AnnotatorStore
module AnnotationsHelper
end
end
| 11.8 | 26 | 0.830508 |
6adad7c8a3d4c31942ebaabb994db20c6f6b05db | 2,160 | require 'fileutils'
MSSTL = ARGV[0] || '../STL'
INC = File.join(MSSTL, 'stl', 'inc')
OUT = 'include/msstl/converted'
FileUtils.mkdir_p OUT
raise "#{MSSTL} is not recognized as clone of https://github.com/microsoft/STL" if !File.directory?(INC)
def comment_line(line)
'//~ ' + line
end
def convert_line(line)
ret ... | 27.692308 | 133 | 0.6375 |
abb52db318d668a2e90e4ec987e8ad3de4ac9c39 | 651 | targets = []
ARGV.each do |input|
if File.file?(input) && File.extname(input).downcase == '.wav'
targets << input
elsif File.directory?(input)
waves = Dir.glob("#{input}/*.wav")
waves.each {|file| targets << file}
flacs = Dir.glob("#{input}/*.flac")
flacs.each {|file| targets << file}
else
... | 32.55 | 123 | 0.654378 |
7a3b477d59c09bd1239219e6e2b0d16494f8d28b | 183 | # frozen_string_literal: true
require './helpers/utility'
class GlobalController < ApplicationController
def index
give_response('00', 'SERVICE RAILS VERSION 1.0.0')
end
end
| 20.333333 | 54 | 0.759563 |
087bfa2f370bf40106f16ce4c742a3ffe13784c6 | 430 | cask 'not-pacman' do
version '1004'
sha256 '4a2c4d84ad713f505a89a14eea5184e76ea5378eb08698da41afc6c4021ead13'
url "http://stabyourself.net/dl.php?file=notpacman-#{version}/notpacman-osx.zip"
appcast 'http://stabyourself.net/notpacman',
checkpoint: '6f262fd3ae2a99d3f2cc0565fa94946d5d3b591903e5106368f3... | 33.076923 | 88 | 0.776744 |
18847ed09feec07b6dec41f481c8834a13ac2f70 | 616 | require_relative 'test_helper'
class TestFakerFunnyName < Test::Unit::TestCase
def setup
@tester = Faker::FunnyName
end
def test_name
res = @tester.name
assert res.is_a?(String) && !res.empty?
end
def test_two_word_name
res = @tester.two_word_name
assert res.count(' ') == 1
end
def... | 18.666667 | 47 | 0.670455 |
e884fd0668f4f93bb0f97cac1d96ef7644844f5d | 1,158 | require "test_helper"
class MensajesControllerTest < ActionDispatch::IntegrationTest
setup do
@mensaje = mensajes(:one)
end
test "should get index" do
get mensajes_url
assert_response :success
end
test "should get new" do
get new_mensaje_url
assert_response :success
end
test "shoul... | 23.632653 | 128 | 0.725389 |
7ab0553ab3bd5dc295b4b706fd1a2a004320694c | 550 | RDL.nowrap :'ActionController::MimeResponds'
RDL.type :'ActionController::MimeResponds', :respond_to,
'(*(String or Symbol)) { (ActionController::MimeResponds::Collector) -> %any } -> Array<String> or String'
module ActionController
module MimeResponds
class Collector
Mime::EXTENSION_LOOKUP.each { |mime... | 34.375 | 121 | 0.692727 |
3901bf06f37f41c593e6c2aa25cafc10d5abb189 | 8,383 | class Snapcraft < Formula
include Language::Python::Virtualenv
desc "Package any app for every Linux desktop, server, cloud or device"
homepage "https://snapcraft.io/"
url "https://files.pythonhosted.org/packages/eb/46/c2cc809e56786719169240e7517e4775f4ddae4d40cacaddc2797aa1788d/snapcraft-2.43.1.tar.gz"
sha2... | 46.572222 | 149 | 0.822856 |
1d44b78b12bc4e867196f6d5928fe0e495c81ee9 | 1,232 | #!/usr/bin/env ruby
$t = {
'n' => {'sw' => 'nw', 's' => 0, 'se' => 'ne'},
'ne' => {'nw' => 'n', 'sw' => 0, 's' => 'se'},
'se' => {'n' => 'ne', 'nw' => 0, 'sw' => 's' },
's' => {'ne' => 'se', 'n' => 0, 'nw' => 'sw'},
'sw' => {'se' => 's', 'ne' => 0, 'n' => 'nw'},
'nw' => {'ne' => 'n', ... | 25.142857 | 81 | 0.367695 |
381608b6af1fb0ae9f38297877d4950eacfbc344 | 1,506 | require "rails_helper"
RSpec.describe CacheKeys::Custom::Showcases do
context "index" do
let(:collection) { instance_double(Collection, showcases: "showcases") }
it "uses CacheKeys::ActiveRecord" do
expect_any_instance_of(CacheKeys::ActiveRecord).to receive(:generate)
subject.index(collection: c... | 32.73913 | 124 | 0.724436 |
e22a3f8c3086ba6a59e92ce917e305e1aef39574 | 28 | 5000000.times { 42.quo(3) }
| 14 | 27 | 0.642857 |
e272f8511e4d85094adcdb227a3cd86a758108f8 | 361 | require "bundler/setup"
require "sjpeg"
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.expect_with :rspec... | 24.066667 | 66 | 0.750693 |
286e3a0055766b14ca4bb6d5324af15d09f1adcc | 884 | require File.expand_path("#{File.dirname(__FILE__)}/test_helper")
class TestApps < MiniTest::Unit::TestCase
def test_post_snapshots
tmp_hash = {
:account_id => "test@megam.io",
:asm_id => "ASM535576423764486230",
:org_id => "ORG7879663326321337888",
:name =>... | 26.787879 | 65 | 0.597285 |
262e45cffca25655882b0fe350a09720b55b9eb5 | 5,242 | require 'abstract_unit'
require 'controller/fake_models'
require 'active_support/core_ext/hash/conversions'
class RespondToController < ActionController::Base
layout :set_layout
def html_xml_or_rss
respond_to do |type|
type.html { render :text => "HTML" }
type.xml { render :text => "XML" }... | 24.156682 | 91 | 0.646509 |
f7ba145a23a5597f0e134fe79fa008e261cd1240 | 373 | class UserSubscriptionMailer < ActionMailer::Base
default from: ENV['email_suscription']
def confirmation_email(user_subscription)
@bill = user_subscription.bill
@user = User.find_by_id(user_subscription.user)
@user_subscription = user_subscription
@url = ENV['url_suscription']
mail(to: @user.e... | 31.083333 | 62 | 0.753351 |
3945b7bcc122be5d0cc72bad58fbe9bd1030091b | 455 | require 'spec_helper'
describe Tutorial do
subject(:tutorial) { Fabricate.build(:tutorial) }
it { should respond_to(:title) }
it { should respond_to(:description) }
it { should respond_to(:url) }
it { should respond_to(:sessions)}
context "validations" do
it "#title" do
tutorial = Fabricate.bui... | 22.75 | 55 | 0.681319 |
2608b477a8a85c81144cb96f635a25abbd55da1f | 1,252 | =begin
#Selling Partner API for Direct Fulfillment Shipping
#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data.
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.4.26
... | 29.809524 | 133 | 0.782748 |
e24e4cbf5e75ea218344d56fa704a07bede56fe3 | 7,853 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe SendFileUpload do
let(:uploader_class) do
Class.new(GitlabUploader) do
include ObjectStorage::Concern
storage_options Gitlab.config.uploads
private
# user/:id
def dynamic_segment
File.join(model.class.und... | 30.917323 | 185 | 0.631733 |
01dcbe262d24d83980fc417cc7b5408dd74ee59a | 642 | require 'spec_helper'
describe Example::App do
def app
@app ||= Example::App
end
describe "GET '/'" do
it 'requesting a url that requires authentication redirects to redirect uri' do
response = get '/'
uri = Addressable::URI.parse(response.headers['Location'])
uri.scheme.should eql('... | 25.68 | 83 | 0.652648 |
ffb4e2c5cf5c24e3f0a167bea281555ca3884a92 | 5,256 | require "cases/helper"
# a suite of tests to ensure the ConnectionAdapters#MysqlAdapter can handle tables with
# reserved word names (ie: group, order, values, etc...)
class Mysql2ReservedWordTest < ActiveRecord::Mysql2TestCase
class Group < ActiveRecord::Base
Group.table_name = 'group'
belongs_to :select
... | 34.352941 | 128 | 0.734209 |
18e63210b033917e64adf1cce1790df063fe2c0a | 6,284 | require "rails_helper"
RSpec.describe "insured/consumer_roles/edit.html.erb" do
let(:person) { FactoryGirl.create(:person) }
let(:consumer_role) { FactoryGirl.create(:consumer_role) }
let(:current_user) {FactoryGirl.create(:user)}
let(:individual_market_is_enabled) { true }
before :each do
assign(:person... | 48.338462 | 116 | 0.771961 |
ed82ce8e28cdddd1ea2248a103c9d307d7caebbe | 2,056 | 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.nam... | 26.025316 | 85 | 0.657588 |
abf5b801f5cac242f24b488352612bc30538e032 | 369 | require "bundler/setup"
require "cli_project_1"
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.expect_wit... | 24.6 | 66 | 0.756098 |
0801086870313d04b377918870d6aab458ea03e0 | 134 | module MoRecord
module Configuration
attr_accessor :version_count
def version_count
@version || 5
end
end
end
| 13.4 | 32 | 0.686567 |
e9186a2582f6316285a242dce3609b99948a21f1 | 1,424 | cask 'puppet-bolt' do
case MacOS.version
when '10.11'
os_ver = '10.11'
version '2.0.0'
sha256 'a5956c7d075a6219f04cda8890732bb8e31b4e10ad0096e18046531b43cfdd7d'
when '10.12'
os_ver = '10.12'
version '2.0.0'
sha256 '9d14f5106bb1c882971658ca00537fd1f1e176685f31588637eab8b95feba0d7'
when '1... | 32.363636 | 112 | 0.726124 |
08e7a38726f8acc72cfa6bd776723a9362a0fc30 | 184 | class UserProfileSerializer < ActiveModel::Serializer
attributes :first_name, :last_name, :home_phone, :cell_phone, :job_title, :company, :website, :blog
belongs_to :user
end
| 30.666667 | 103 | 0.76087 |
2142c33f7e3f229149872d2638108b5b130e2c0c | 7,124 | =begin
#Xero Payroll UK
#This is the Xero Payroll API for orgs in the UK region.
Contact: api@xero.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.3.1
=end
require 'time'
require 'date'
module XeroRuby::PayrollUk
require 'bigdecimal'
class PayRunCalendarObject
attr_accessor ... | 30.059072 | 219 | 0.625772 |
e88372bfe4b6eadd9b7e3432ce60dc42596cad03 | 1,209 | installers = {
"Angular": :angular,
"Elm": :elm,
"React": :react,
"Vue": :vue,
"Erb": :erb,
"Coffee": :coffee,
"Typescript": :typescript,
"Svelte": :svelte,
"Stimulus": :stimulus
}.freeze
dependencies = {
"Angular": [:typescript]
}
bin_path = ENV["BUNDLE_BIN"] || Rails.root.join("bin")
namespace ... | 26.866667 | 88 | 0.603805 |
6a9e7d4814ea206761c78afa9ddc82b3fede02b4 | 728 | cask 'toggldesktop-beta' do
version '7.4.52'
sha256 'e1f3d35a47d0b150f46aba5457833873932e735a232a1b8eeb5995222fa0bed9'
# github.com/toggl/toggldesktop was verified as official when first introduced to the cask
url "https://github.com/toggl/toggldesktop/releases/download/v#{version}/TogglDesktop-#{version.dots_... | 38.315789 | 123 | 0.707418 |
e8cfe5a8ea626ef0d8ed42d4c824c2d833e1f596 | 398 | module TD::Types
# A token for Apple Push Notification service.
#
# @attr device_token [String, nil] Device token; may be empty to de-register a device.
# @attr is_app_sandbox [Boolean] True, if App Sandbox is enabled.
class DeviceToken::ApplePush < DeviceToken
attribute :device_token, TD::Types::String.o... | 36.181818 | 88 | 0.736181 |
1a73d6700254bba2418dd1c527b7a6cd50c6a1ed | 1,126 | class DoctorsController < ApplicationController
before_action :authenticate_doctor_with_token!, only: [:update, :destroy]
def show
respond_with Doctor.find(params[:id])
end
def create
doctor = Doctor.create(doctor_params)
logger.debug 'Params: ' + doctor_params.inspect
logger.debug 'Doctor Obj... | 20.851852 | 85 | 0.689165 |
035e6bea55c85f2511241fb8403029aeaa838203 | 283 | module Ruby2JS
class Converter
# (break
# (int 1))
handle :break do |n=nil|
raise NotImplementedError, "break argument #{ n.inspect }" if n
raise NotImplementedError, "break outside of loop" if @next_token == :return
put 'break'
end
end
end
| 20.214286 | 82 | 0.628975 |
abf5b681a8b9bba5d86a924311fd4967d390a8df | 382 | module Api
module V1
class InactiveFriendsController < ::Api::V1::Base
private
def summary_uids(limit: 3)
uids = @twitter_user.inactive_friendships.limit(limit).pluck(:friend_uid)
size = @twitter_user.inactive_friendships.size
[uids, size]
end
def list_users
... | 21.222222 | 81 | 0.651832 |
26e7688b3fab284e1a296b3121124b307dbf0e77 | 169 | module EtAtosFileTransfer
module V1
class TestController < ::EtAtosFileTransfer::ApplicationController
def show
head :ok
end
end
end
end
| 16.9 | 70 | 0.680473 |
f8c61ceef2b16fee31817631ca58511eddd5eb66 | 139 | require 'test_helper'
class LayoutsControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
| 17.375 | 61 | 0.741007 |
621f92b1ae2b8110955ad78be9a517c46a40d1fd | 2,214 | # frozen_string_literal: true
require "alicloud_backend"
class AliCloudVpc < AliCloudResourceBase
name "alicloud_vpc"
desc "Verifies properties for an individual AliCloud Virtual Private Network"
example "
describe alicloud_vpc('vpc-1234567890') do
it { should exist }
end
"
attr_reader :vpc_id, :vpc... | 30.75 | 130 | 0.63776 |
6a29e062b10203b767f8d0d94bef39aad5a7a034 | 424 | require 'rails'
module Poly
class Engine < ::Rails::Engine
engine_name 'poly'
#initializer 'poly.assets.precompile' do |app|
# app.config.assets.precompile += %w(poly.js.coffee poly.css.sass)
#end
#config.generators do |g|
# g.test_framework :rspec, fixture: false
# g.fixture_replace... | 23.555556 | 71 | 0.658019 |
ffacd9d05b7b21aba44b890359e4af42e47621b8 | 342 | class CreateSpreePermissions < ActiveRecord::Migration
def change
create_table :spree_permissions do |t|
t.string :title, null: false, unique: true
t.integer :priority, default: 0
t.boolean :visible, :boolean, default: true
t.timestamps null: false
end
add_index :spree_permission... | 24.428571 | 54 | 0.69883 |
62046bebc061bd62e10e896a8c7e41b6cd85cb5c | 1,508 | class Instead < Formula
desc "Interpreter of simple text adventures"
homepage "https://instead.syscall.ru/"
url "https://github.com/instead-hub/instead/archive/3.2.1.tar.gz"
sha256 "2f5ee94393cf9f314bd9a8617a7f16d6500376223b920bf1821ba0e8a76c3696"
bottle do
rebuild 1
sha256 "e34be5357b1fc1991909eb42b... | 35.069767 | 93 | 0.709549 |
6ae831af52b755786f174a0a7ec971377291cebe | 708 | class UsersController < ApplicationController
def index
@users = User.all
end
def update
User.find(params[:id]).update! user_params
ActionCable.server.broadcast 'users', user_params: {
nickname: user_params[:nickname],
id: params[:id]
}
respond_to do |format|
format.json { h... | 22.125 | 58 | 0.64548 |
1abfc7c83d3598a738a8d0e758564eb23362191f | 3,551 | class Mypy < Formula
desc "Experimental optional static type checker for Python"
homepage "http://www.mypy-lang.org/"
url "https://github.com/python/mypy.git",
:tag => "v0.720",
:revision => "36aecdae92d050f626ea9029ad08f0c8382c47e7"
head "https://github.com/python/mypy.git"
bottle do
ce... | 40.816092 | 147 | 0.744861 |
61309d77c0e13c4803120754b2b5221a377a4777 | 1,754 | Pod::Spec.new do |s|
s.name = 'AWSAuthUI'
s.version = '2.12.2'
s.summary = 'Amazon Web Services SDK for iOS.'
s.description = 'The AWS SDK for iOS provides a library, code samples, and documentation for developers to build connected mobile applications using AWS.'
s.homepage = ... | 79.727273 | 398 | 0.733751 |
79a025bb2b543a800706ce8f27c7d861ea2c3b2a | 206 | class CreateItemToItemTags < ActiveRecord::Migration[5.1]
def change
create_table :item_to_item_tags do |t|
t.integer :item_id
t.integer :item_tag_id
t.timestamps
end
end
end
| 18.727273 | 57 | 0.694175 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.