conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add tests of line number calculations for simple diff\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/../test_helper'\n\nclass GitDiffParserTest < Test::Unit::TestCase\n\n TestDiffs = ['simple.diff']\n\n def setup\n @done_diffs = Hash.new\...
ruby
chosen
[ { "from": "system", "value": "Add IAM Profile support to EC2 instances; fix hashing format for newer Ruby version\n" }, { "from": "human", "value": "require_relative '../resource'\n\nmodule Convection\n module Model\n class Template\n class Resource\n ##\n # AWS::RDS::DBSe...
ruby
chosen
[ { "from": "system", "value": "Raise LoadError unless grpc or nxapi gem missing\n" }, { "from": "human", "value": "# Copyright (c) 2015 Cisco and/or its affiliates.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the L...
ruby
chosen
[ { "from": "system", "value": "Choose the right database on the server\n" }, { "from": "human", "value": "set :application, \"optemo_site\"\nset :repository, \"git@jaguar:site.git\"\nset :domain, \"jaguar\"\n\n# If you aren't deploying to /u/apps/#{application} on the target\n# servers (which is...
ruby
chosen
[ { "from": "system", "value": "Call the setup! method from within Server.start, not Server.run!\n" }, { "from": "human", "value": "# lib/frecon/server.rb\n#\n# Copyright (C) 2014 Christopher Cooper, Sam Craig, Tiger Huang, Vincent Mai, Sam Mercier, and Kristofer Rye\n#\n# This file is part of FRe...
ruby
chosen
[ { "from": "system", "value": "Add notebooks as a new resource\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n root \"home#index\"\n\n devise_for :users\nend\n" }, { "from": "gpt", "value": "Rails.application.routes.draw do\n root \"home#index\"\n\n devise_fo...
ruby
chosen
[ { "from": "system", "value": "Allow links to the list of scans of a dictionary\n" }, { "from": "human", "value": "Sanskrit::Application.routes.draw do\n\t# The priority is based upon order of creation: first created -> highest priority.\n\t# See how all your routes lay out with \"rake routes\".\...
ruby
chosen
[ { "from": "system", "value": "Use north reference in south method\n\nThis is a hack until we get the other controller\n" }, { "from": "human", "value": "require 'rdmx'\n\nmodule Helios\n class Lights\n TOTAL_LIGHTS = 50\n SOUTH_SIDE_MAX = 25\n\n class <<self\n def [](idx)\n ...
ruby
chosen
[ { "from": "system", "value": "Use variable for total records\n" }, { "from": "human", "value": "######\n#\n# Retrieves all object records from the V&A API and stores\n# them as documents in a MongoDB instance.\n#\n######\n\nrequire \"open-uri\"\nrequire \"mongo\"\nrequire \"parallel\"\nrequire \...
ruby
chosen
[ { "from": "system", "value": "Change a TAB to 2 SPACES\n\nBecause that is just how I roll." }, { "from": "human", "value": "framework 'Foundation'\n\nclass URL\n def initialize(url_string)\n @url = NSURL.URLWithString url_string\n end\n\n def to_s\n\t@url.absoluteString\n end\nend\n\nmodu...
ruby
chosen
[ { "from": "system", "value": "Update redis config to remove client commands\n\nhttps://github.com/mperham/sidekiq/wiki/Using-Redis#disabled-client-command\n" }, { "from": "human", "value": "module PaasResolver\n module_function\n\n def get_redis_config\n url = begin\n # TODO: !Importan...
ruby
chosen
[ { "from": "system", "value": "Update to support cvar removal\n" }, { "from": "human", "value": "require_relative 'assets'\nrequire_relative 'config'\nrequire_relative 'middleware'\nrequire_relative 'version'\n\nrequire_relative 'preprocessors/css-preprocessor'\nrequire_relative 'preprocessors/im...
ruby
chosen
[ { "from": "human", "value": "Add feature tests for successful and unsuccessful user registration\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\ndescribe \"the sign up process\", :type => :feature do\n scenario 'signing up with valid credentials' do\n \tvisit '/users/new'\n \twithi...
ruby
chosen
[ { "from": "system", "value": "Fix test by creating link associations\n\nThe test was failing with\n```\nFailures:\n\n 1) LinkApiResponsePresenter#present link is present returns combined details for the local authority and local interaction\n Failure/Error: \"lgsl_code\" => @link.service.lgsl_code,\n\n...
ruby
chosen
[ { "from": "system", "value": "JariBakken: Update file detector Ruby example.\n\ngit-svn-id: aa1aa1384423cb28c2b1e29129bb3a91de1d9196@14082 07704840-8298-11de-bf8c-fd130f914ac9\n" }, { "from": "human", "value": "module Selenium\n module WebDriver\n\n #\n # @api private\n #\n\n module...
ruby
chosen
[ { "from": "system", "value": "Fix race condition in tests\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'Locale redirects routing', type: :request do\n %w[ru en de es].each do |locale|\n it \"to #index locale: #{locale}\" do\n get(\"/#{locale}\")\n expect(res...
ruby
chosen
[ { "from": "system", "value": "Add a rake task, oh yeah!\n" }, { "from": "human", "value": "namespace :check do \n desc \"Check many gems are created locally in Australia\"\n\n \nend\n" }, { "from": "gpt", "value": "require 'origin_detector'\n\nnamespace :bruce do \n desc \"Check m...
ruby
chosen
[ { "from": "system", "value": "Remove unused methods in PollItem\n" }, { "from": "human", "value": "module ZMQ\n class PollItem < FFI::Struct\n layout :socket, :pointer,\n :fd, :int,\n :events, :short,\n :revents, :short\n\n def socket\n self[:sock...
ruby
chosen
[ { "from": "system", "value": "Add associations to migration for progress notes\n" }, { "from": "human", "value": "class MigrateProgressNotesToEventNotes < ActiveRecord::Migration\n\n class DeprecatedProgressNotesClass < ActiveRecord::Base\n self.table_name = :progress_notes\n end\n\n def c...
ruby
chosen
[ { "from": "system", "value": "Move value3 to another column in the same CF." }, { "from": "human", "value": "create 'test', 'cf'\nput 'test', 'row1', 'cf:col1', 'value1'\nput 'test', 'row2', 'cf:col1', 'value2'\nput 'test', 'row3', 'cf:col1', 'value3'\n" }, { "from": "gpt", "value": ...
ruby
chosen
[ { "from": "system", "value": "Increase how long job_timeout will block on a receive in case a full GC happens in the middle of this integ\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'torquebox-messaging'\n\n\ndescribe \"job timeout\" do\n deploy <<-END.gsub(/^ {4}/,'')\n ...
ruby
chosen
[ { "from": "system", "value": "Add an explicit .to_s for rare instances where the resource type could be nil.\n\n(transferred from ManageIQ/manageiq@ee9e35470d8285b8dc8ff69e241721ee45393a81)\n" }, { "from": "human", "value": "module ManageIQ::Providers::Azure::CloudManager::EventParser\n extend ...
ruby
chosen
[ { "from": "system", "value": "upgrade: Fix the \"Next step\" hint after removing database step\n\nDatabase step was removed completely, next step after admin upgrade\nis repository check for nodes.\n" }, { "from": "human", "value": "#\n# Copyright 2016, SUSE Linux GmbH\n#\n# Licensed under the A...
ruby
chosen
[ { "from": "system", "value": "Fix wait_timeout and generated url" }, { "from": "human", "value": "require 'flex'\n\nmodule Elasticsnap\n class VerifyEsClusterStatus\n class Error < StandardError; end\n class StatusRed < Error; end\n class NoQuorum < Error; end\n\n attr_accessor :url...
ruby
chosen
[ { "from": "system", "value": "Reimplement method because there's no primary key for ActiveRecord\n" }, { "from": "human", "value": "class PolicyMemberDistance < ActiveRecord::Base\n self.table_name = \"pw_cache_dreamreal_distance\"\n\n belongs_to :policy, foreign_key: :dream_id\n belongs_to :...
ruby
chosen
[ { "from": "system", "value": "Fix Tags helper spec pending message\n" }, { "from": "human", "value": "require 'spec_helper'\n\n# Specs in this file have access to a helper object that includes\n# the TagsHelper. For example:\n#\n# describe TagsHelper do\n# describe \"string concat\" do\n# ...
ruby
chosen
[ { "from": "human", "value": "Add spec for Fastly middleware.\n" }, { "from": "gpt", "value": "require 'hdo/rack/fastly'\nrequire 'i18n'\n\nmodule Hdo\n module Rack\n describe Fastly do\n let(:response) { [200, {}, [\"\"]] }\n let(:app) { mock(:app, call: response) }\n let(:fas...
ruby
chosen
[ { "from": "system", "value": "Correct test for average number of words read per hours. PA-2182\n" }, { "from": "human", "value": "require \"read_time_estimator\"\nrequire 'rspec'\n\ndescribe \"ReadTimeEstimator\" do\n describe \"minutes_to_read\" do\n it \"should output an amount of time giv...
ruby
chosen
[ { "from": "system", "value": "Fix repo url in gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"apipie/version\"\n\nGem::Specification.new do |s|\n s.name = \"apipie-rails\"\n s.version = Apipie::VERSION\n...
ruby
chosen
[ { "from": "system", "value": "Fix typo in migration to destroy declaration tasks. This has been run manually in staging, so no need to re-run migrations." }, { "from": "human", "value": "class DestroyDeclarationAndDependencies < ActiveRecord::Migration\n def up\n drop_table :declaration_sur...
ruby
chosen
[ { "from": "human", "value": "Add test for creation of question\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\ndescribe QuestionsController do\n describe \"POST create\" do\n it \"creates a new Question\" do\n expect {\n post :create, question: {:questions => { :title ...
ruby
chosen
[ { "from": "system", "value": "Fix some bad references in session_end_notification\n" }, { "from": "human", "value": "class Dataservice::PeriodicBundleLoggersMetalController < ActionController::Metal\n\n def session_end_notification\n if pbl = Dataservice::PeriodicBundleLogger.find(params[:id...
ruby
chosen
[ { "from": "system", "value": "Add missing constants in File class.\n\n`FIle::ALT_SEPARATOR` and `File::PATH_SEPARATOR`" }, { "from": "human", "value": "class File < IO\n Separator = SEPARATOR = '/'\n\n class << self\n def expand_path(path, basedir = nil)\n path = [basedir, path].compac...
ruby
chosen
[ { "from": "system", "value": "FIX: Add user parameter to feedback test\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass FeedbackTest < ActiveSupport::TestCase\n include Rack::Test::Methods\n include TestHelpers::AuthHelper\n include TestHelpers::JsonHelper\n\n def app\n R...
ruby
chosen
[ { "from": "system", "value": "Change database deploy strategy default to continuous\n" }, { "from": "human", "value": "# See http://doc.gitlab.com/ce/development/migration_style_guide.html\n# for more information on how to write migrations for GitLab.\n\nclass AddDeployStrategyToProjectAutoDevop...
ruby
chosen
[ { "from": "system", "value": "Add qso and point totals for score table\n" }, { "from": "human", "value": "class HomeController < ApplicationController\n def index\n @lastid = params[:lastid] || 0\n \n @qsos = Qso.where('id > ?', @lastid).limit(10)\n \n @lastid = @qsos.last.id unl...
ruby
chosen
[ { "from": "system", "value": "Fix admin app initialization instructions" }, { "from": "human", "value": "class MainController < ApplicationController\n layout false\n before_filter :authenticate_user!\n \n def index\n admin_app = Rails.root.join('public', 'index.html')\n if File.exists...
ruby
chosen
[ { "from": "system", "value": "Add fonticon to Tenant class\n" }, { "from": "human", "value": "class TenantDecorator < MiqDecorator\n def fonticon\n tenant? ? 'pficon pficon-tenant' : 'pficon pficon-project'\n end\nend\n" }, { "from": "gpt", "value": "class TenantDecorator < MiqD...
ruby
chosen
[ { "from": "system", "value": "Update file references to new filenames\n" }, { "from": "human", "value": "class GridOne < Grid\n\n attr_reader :program_1\n\n def initialize(window, user)\n super(window, user,\n 'media/grid_one.txt',\n 'media/grid_one_tileset.png',\n {'...
ruby
chosen
[ { "from": "system", "value": "Fix for frozen strings and follow existing style\n" }, { "from": "human", "value": "module PgHero\n module HomeHelper\n def pghero_pretty_ident(table, schema: nil)\n ident = table\n if schema && schema != \"public\"\n ident = \"#{schema}.#{table...
ruby
chosen
[ { "from": "system", "value": "Fix bug that was throwing off behavior import\n\n+ The code was failing to import all but the first discipline incident for each school year\n+ This was because of a misunderstanding of how first_or_initialize works\n+ Instead of finding the first incident with the supplied att...
ruby
chosen
[ { "from": "system", "value": "Make it so scour just purges week old (bad) ones" }, { "from": "human", "value": "class ScourJob < JuliaJob\n queue_as :default\n\n def perform(*args)\n FileUtils.rm_rf \"tmp/scour\"\n\n system \"#{@sys_run} scour:packages\"\n end\nend\n" }, { "from...
ruby
chosen
[ { "from": "human", "value": "Disable LLDP packet eater on XL710 NICs\n\nThis will look at all NIC devices on your server and disable the ability to eat LLDP packets." }, { "from": "gpt", "value": "# Reference Links for this fix\n# https://communities.intel.com/thread/87759\n# http://serverfault....
ruby
chosen
[ { "from": "human", "value": "Clean up MedicalSafetyAlert publication history\n\nA small number of medical safety alerts were published on GOV.UK after\nthe bulk publish work had been done because the MHRA editors lacked\naccess to the publishing tool. This migration sets the bulk published\nflag for those d...
ruby
chosen
[ { "from": "system", "value": "Fix regex to find values\n" }, { "from": "human", "value": "require \"color/cop/version\"\n\nmodule Color\n module Cop\n # Your code goes here...\n class CLI\n def execute!\n puts \"SCSS files within current path that have hex codes:\"\n fi...
ruby
chosen
[ { "from": "system", "value": "Make middleware manager connect more generic\n" }, { "from": "human", "value": "module ManageIQ::Providers\n class Hawkular::MiddlewareManager < ManageIQ::Providers::MiddlewareManager\n require_nested :RefreshParser\n require_nested :Refresher\n\n include ...
ruby
chosen
[ { "from": "system", "value": "Add tests for reaumur conversion\n\nFollow up work from #46\n" }, { "from": "human", "value": "require 'test_helper'\n\ndescribe Unitwise::Functional do\n subject { Unitwise::Functional }\n %w{cel degf hpX hpC tan100 ph ld ln lg 2lg}.each do |function|\n descri...
ruby
chosen
[ { "from": "system", "value": "Add a Link Checker API mock service\n\nThis will be used to run Pact tests against the Link Checker API.\n" }, { "from": "human", "value": "PUBLISHING_API_PORT = 3001\nORGANISATION_API_PORT = 3002\nBANK_HOLIDAYS_API_PORT = 3003\nACCOUNT_API_PORT = 3004\n\ndef publis...
ruby
chosen
[ { "from": "system", "value": "Make sure hostname isn't being carried over from build machine\n" }, { "from": "human", "value": "require 'spec_helper'\n\n# Ensure hostname is not carried over from live-cd build\ndescribe command('hostname') do\n its(:stdout) { should_not eq 'debian-7' }\nend\n\n...
ruby
chosen
[ { "from": "system", "value": "Support rails 5.1 in tests\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe DateTime do\n let(:date_time) { DateTime.parse(\"2010-01-01\") }\n\n it \"should allow advancing by calendar days\" do\n expect(date_time.advance_considering_calenda...
ruby
chosen
[ { "from": "system", "value": "INF-941: Add check if remore is cloned\n" }, { "from": "human", "value": "require 'securerandom'\nrequire 'erb'\n\nmodule Skyed\n # This module encapsulates all the Git features.\n module Git\n class << self\n def clone_stack_remote(stack, options)\n ...
ruby
chosen
[ { "from": "system", "value": "Add more validation task to find meta\n" }, { "from": "human", "value": "require 'find'\nrequire 'json'\nrequire 'rainbow'\n\nnamespace :meta do\n desc \"validate meta\"\n task :validate do\n errors = []\n Find.find('openapi-meta') do |path|\n if FileTe...
ruby
chosen
[ { "from": "system", "value": "Move details of e2e tests to the bottom\n\nThe code should be written like a newspaper, wherein the top we\nhave more high level information, and as we go down we have more\ndetails.\n\nSo I'm moving the implementation details to the bottom to make the\ntest easier to read.\n" ...
ruby
chosen
[ { "from": "system", "value": "Correct reference to missing attribute for cookie secret\n" }, { "from": "human", "value": "require 'securerandom'\n\naction :run do\n\n #Create cookie secret\n if (!node[:google_auth][:cookie_secret][new_resource.name])\n node.set[:google_auth][:cookie_secret]...
ruby
chosen
[ { "from": "system", "value": "Use speficiation from config for integration testing\n\nIntegrate config reading from config folder as well.\n" }, { "from": "human", "value": "require File.expand_path('../../rails_helper', __FILE__)\n\nRSpec.describe GroupMembershipsController, type: :controller d...
ruby
chosen
[ { "from": "human", "value": "Fix extra \"s\" after \"trade\"\n" }, { "from": "gpt", "value": "category = MainstreamCategory.where(title: \"Trades union administration and membership\").first\n\nif category\n title = \"Trade union administration and membership\"\n category.title = title\n cate...
ruby
chosen
[ { "from": "system", "value": "Remove helper of a guide having at least one part\n\nThis enforcement, needs to be done on a model level, not within a view helper.\n" }, { "from": "human", "value": "module Admin::EditionsHelper\n def format_content_diff( body )\n ContentDiffFormatter.new(body)...
ruby
chosen
[ { "from": "system", "value": "Remove visible comments result assignment\n\nResults of query do not need to be assigned to anything and can be\nreturned as-is.\n" }, { "from": "human", "value": "class Idea < ActiveRecord::Base\n\n belongs_to :owner, :class_name => 'User'\n belongs_to :current\n...
ruby
chosen
[ { "from": "human", "value": "Add rack response config.ru for measuring.\n" }, { "from": "gpt", "value": "require \"../lib/cuba\"\nrequire \"cuba/contrib\"\n\nCuba.plugin Cuba::Mote\n\nITEMS = (\"A\"..\"Z\").to_a\n\nCuba.send :remove_const, :Response\nCuba::Response = Rack::Response\n\nCuba.defin...
ruby
chosen
[ { "from": "system", "value": "Change `list` to `single` in the single address tests.\n\nCopy / paste error :-/" }, { "from": "human", "value": "require 'test_helper'\n\nclass SingleAddressTest < ActiveSupport::TestCase\n\n context \"single attribute\" do\n should \"handle single values\" do\...
ruby
chosen
[ { "from": "system", "value": "Add relationships to User model\n" }, { "from": "human", "value": "class User < ActiveRecord::Base\nend\n" }, { "from": "gpt", "value": "class User < ActiveRecord::Base\n\thas_many :comments, foreign_key: :commenter_id\n\thas_many :likes, foreign_key: :l...
ruby
chosen
[ { "from": "system", "value": "Clean up formatting of devise declaration in User\n" }, { "from": "human", "value": "class User < ActiveRecord::Base\n # Include default devise modules. Others available are:\n # :confirmable, :lockable, :timeoutable and :omniauthable\n devise :database_authentic...
ruby
chosen
[ { "from": "system", "value": "Add timezone to device serializer.\n" }, { "from": "human", "value": "class DeviceSerializer < ActiveModel::Serializer\n attributes :id, :name, :webcam_url\nend\n" }, { "from": "gpt", "value": "class DeviceSerializer < ActiveModel::Serializer\n attribu...
ruby
chosen
[ { "from": "system", "value": "Update tests to allow disabled docker\n" }, { "from": "human", "value": "require 'spec_helper'\n\nservices = [\n # System Services\n 'vboxadd-service',\n 'cron',\n 'ntp',\n 'docker',\n # App services\n 'postgresql',\n 'mysql',\n 'rabbitmq-server',\n 'redis...
ruby
chosen
[ { "from": "system", "value": "Add a note about the weirdness\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\njson.version(@api.version)\njson.run_date(@start_time.utc)\njson.user(@api.user.id) if @api.user\n\nunless @api.errors.any?(&:fatal)\n if @api.query\n json.query(@...
ruby
chosen
[ { "from": "system", "value": "Change find by find_by_id (cause exception if id in cookie is not found in database)\n" }, { "from": "human", "value": "module Socializer\n class ApplicationController < ActionController::Base\n # Prevent CSRF attacks by raising an exception.\n # For APIs, yo...
ruby
chosen
[ { "from": "system", "value": "Add more Flow testing helper methods\n" }, { "from": "human", "value": "# encoding: UTF-8\n\nmodule FlowTestHelper\n def setup_for_testing_flow(flow_slug)\n @flow_registry ||= SmartAnswer::FlowRegistry.new(:show_drafts => true)\n @flow = @flow_registry.find(f...
ruby
chosen
[ { "from": "system", "value": "Add optional parameter to authentication method\n\nFixes #353\n" }, { "from": "human", "value": "module SocialStream\n module Oauth2Server\n module Controllers\n # Common methods added to ApplicationController\n module Helpers\n extend ActiveSup...
ruby
chosen
[ { "from": "system", "value": "Fix id for promo_campaign lookup\n" }, { "from": "human", "value": "class BrowserUserSignUpService < BaseService\n def initialize\n end\n\n def perform\n uphold_user = BrowserUser.create(role: Publisher::BROWSER_USER)\n PromoClient.peer_to_peer_registration...
ruby
chosen
[ { "from": "system", "value": "Add default scope to the Song model\n" }, { "from": "human", "value": "class Song < ApplicationRecord\n belongs_to :live\n validates :live_id, presence: true\n validates :name, presence: true\nend\n" }, { "from": "gpt", "value": "class Song < Applicat...
ruby
chosen
[ { "from": "system", "value": "Use a different method to clean up the short name.\n" }, { "from": "human", "value": "class Stop < ActiveRecord::Base\n # Callbacks\n before_save :convert_short_name \n\n # Relations\n has_and_belongs_to_many :routes\n \n # Validations\n validates :name, :pre...
ruby
chosen
[ { "from": "system", "value": "Improve `issue create …` slash command with user input keys to create a newline in chat clients." }, { "from": "human", "value": "module Gitlab\n module ChatCommands\n class IssueCreate < IssueCommand\n def self.match(text)\n # we can not match \\n w...
ruby
chosen
[ { "from": "system", "value": "Use KNAPSACK_PRO_RECORDING_ENABLED flag to enable recording for test\nfile execution and pushing data to API\n" }, { "from": "human", "value": "module KnapsackPro\n module Runners\n class RSpecRunner\n def self.run(args)\n allocator_builder = Knapsac...
ruby
chosen
[ { "from": "system", "value": "Upgrade to database version sr26\n" }, { "from": "human", "value": "namespace :usda do\n desc 'Import the latest USDA nutrition data'\n task import: :environment do\n UsdaNutrientDatabase::Importer.new('tmp/usda', 'sr25').import\n end\n\n [\n 'Weights', 'F...
ruby
chosen
[ { "from": "system", "value": "Switch to calling download function in Pleiades/Geonames bin script\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n#\nEncoding.default_external = Encoding::UTF_8\nEncoding.default_internal = Encoding::UTF_8\n\nrequire 'geocollider'\n\npleiades = Geocollider...
ruby
chosen
[ { "from": "system", "value": "Switch to Ruby's native JSON parser\n\nRuby's JSON parser is ~20x faster, because it's written in C.\n\nCalculating -------------------------------------\n ruby 204 i/100ms\n rack 6 i/100ms\n-------------------------------------------...
ruby
chosen
[ { "from": "system", "value": "Add some comments/rdoc to the new hash methods\n" }, { "from": "human", "value": "class Hash\n def select_keys *keys\n select{|k, _| keys.include? k}\n end\n\n alias_method :retain_keys, :select_keys\n\n def reject_keys *keys\n reject{|k, _| keys.include? ...
ruby
chosen
[ { "from": "system", "value": "Remove version of redis dependency.\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"nest\"\n s.version = \"1.1.0\"\n s.summary = \"Object-oriented keys for Redis.\"\n s.description = \"It is a ...
ruby
chosen
[ { "from": "human", "value": "Add a test file for BMFF::Box::SyncSample.\n" }, { "from": "gpt", "value": "# coding: utf-8\n# vim: set expandtab tabstop=2 shiftwidth=2 softtabstop=2 autoindent:\n\nrequire_relative '../../minitest_helper'\nrequire 'bmff/box'\nrequire 'stringio'\n\nclass TestBMFFBox...
ruby
chosen
[ { "from": "system", "value": "Update stable release to Cuttlefish\n\nSigned-off-by: Alexandre Marangone <b22b3721ddccab8b244ba54f4bce96411b0dcebd@inktank.com>\n" }, { "from": "human", "value": "default['ceph']['branch'] = \"stable\" # Can be stable, testing or dev.\n# Major release version to in...
ruby
chosen
[ { "from": "system", "value": "Use chef-solo to run unit tests faster\n" }, { "from": "human", "value": "# encoding: UTF-8\n#\n# Author:: Xabier de Zuazo (<xabier@zuazo.org>)\n# Copyright:: Copyright (c) 2015 Xabier de Zuazo\n# License:: Apache License, Version 2.0\n#\n# Licensed under the Apache...
ruby
chosen
[ { "from": "human", "value": "Add data migration to update document URLs\n\nRequested here: https://govuk.zendesk.com/agent/tickets/3590864\n" }, { "from": "gpt", "value": "puts \"Reslugging documents...\"\n\ndocuments = [\n {\n slug: \"letter-to-providers-on-health-and-safety\",\n new_slu...
ruby
chosen
[ { "from": "system", "value": "Fix an error in the gemspec\n" }, { "from": "human", "value": "# encoding: utf-8\nGem::Specification.new do |gem|\n gem.required_ruby_version = \">= 1.9.0\"\n\n gem.version = \"0.7.1\"\n\n gem.author = \"Janko Marohnić\"\n gem.email = \"jan...
ruby
chosen
[ { "from": "system", "value": "Fix is_quick_edit_page_enabled to check for both pipeline_config_single_page_app_key and quick_edit_page_toggle_key toggles\n* Change the conditional check from 'and' to '&&'\n" }, { "from": "human", "value": "########################################################...
ruby
chosen
[ { "from": "human", "value": "Change tasks index on [task_num,company_id] to index on [type, task_num, company_id]. It mean one index for tasks and another one for templates.\n" }, { "from": "gpt", "value": "class AddIndexTasksOnTypeAndTaskNumAndCompanyId < ActiveRecord::Migration\n def self.up\...
ruby
chosen
[ { "from": "system", "value": "Update session cookie expiration to 30 days\n" }, { "from": "human", "value": "# frozen_string_literal: true\n# Be sure to restart your server when you modify this file.\n\nAnnict::Application.config.session_store :active_record_store,\n expire_after: 10.days,\n d...
ruby
chosen
[ { "from": "human", "value": "MishMesh: Add podspec file to enable projects include this library as cocoapod\n" }, { "from": "gpt", "value": "Pod::Spec.new do |s|\n\n# Root specification\n\ns.name = \"mishmesh\"\ns.version = \"1.0.0\"\ns.summary = \"iO...
ruby
chosen
[ { "from": "human", "value": "Disable assets logging on development, will still show errors if any\n" }, { "from": "gpt", "value": "# https://github.com/rails/rails/issues/2639#issuecomment-6591735\n\nclass DisableAssetsLogger\n def initialize(app)\n @app = app\n Rails.application.assets.l...
ruby
chosen
[ { "from": "system", "value": "Use the ghetto LWRP and not the sudoers provider that has been deprecated\n" }, { "from": "human", "value": "#\n# Cookbook Name:: rundeck\n# Recipe:i: default\n#\n# Copyright 2011, Peter Crossley\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\")...
ruby
chosen
[ { "from": "system", "value": "Use the recommended media_type, instead of mime_type\n" }, { "from": "human", "value": "require 'sinatra/base'\nrequire 'yaks'\n\nmodule Sinatra\n module Yaks\n class << self\n attr_accessor :yaks_config\n end\n\n def configure_yaks(&block)\n Yak...
ruby
chosen
[ { "from": "system", "value": "Disable db munging for now.\n" }, { "from": "human", "value": "module HandlePolicyNotification\n # Create or update the 'main' policy in glue to bring the data\n # into line with the changes we are about to transmit.\n class CreatePolicyOrUpdateContinuation\n ...
ruby
chosen
[ { "from": "system", "value": "Move the Samba log depot validation code from LogFile.verify_log_depot_settings into FileDepotSmb.validate.\n\nhttps://bugzilla.redhat.com/show_bug.cgi?id=1151173\n" }, { "from": "human", "value": "class FileDepotSmb < FileDepot\n def self.uri_prefix\n \"smb\"\n...
ruby
chosen
[ { "from": "system", "value": "Update Rummager with converted Unknown NewsArticleType content\n" }, { "from": "human", "value": "begin\n # Update NewsArticles in Whitehall\n unknown_news_articles = NewsArticle.by_subtype(NewsArticleType::Unknown)\n document_ids = unknown_news_articles.map { |n...
ruby
chosen
[ { "from": "system", "value": "Add default_url_options to user_mailer spec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Spree::UserMailer do \n\n before do \n user = create(:user)\n Spree::UserMailer.reset_password_instructions(user).deliver\n @message = ActionMa...
ruby
chosen
[ { "from": "system", "value": "Whitelist Webdrivers update URLs in WebMock\n\nResolves #2557:\n\n $ docker-compose run --rm osem bundle exec rspec --tag js\n …\n WebMock::NetConnectNotAllowedError\n\nSee titusfortner/webdrivers#109 for details.\n" }, { "from": "human", "value": "# frozen...
ruby
chosen
[ { "from": "system", "value": "Update podspec version to 2.1.0\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"GestureRecognizerClosures\"\n s.version = \"2.0.0\"\n s.license = \"MIT\"\n s.summary = \"Closure support for handling gesture recognizers...
ruby
chosen
[ { "from": "system", "value": "Add .pre for next release\n" }, { "from": "human", "value": "module EY\n VERSION = '2.0.8'\n ENGINEYARD_SERVERSIDE_VERSION = ENV['ENGINEYARD_SERVERSIDE_VERSION'] || '2.0.3'\nend\n" }, { "from": "gpt", "value": "module EY\n VERSION = '2.0.9.pre'\n ENG...
ruby
chosen
[ { "from": "system", "value": "Use IO.sysread instead of File.read\n" }, { "from": "human", "value": "require 'forwardable'\nrequire 'mkfifo'\n\nclass Fifo\n include Forwardable\n \n class Pipe < ::File\n alias :orig_write :write\n def write(*args)\n orig_write(*args)\n flush\n...
ruby
chosen
[ { "from": "system", "value": "Update to work properly inside another eventmachine process\n\nwait_for_emails was returning immediately when run inside of cucumber\ntesting a rails app\n" }, { "from": "human", "value": "Thread.abort_on_exception = true\n\nclass Mailtruck::Receiver\n\n def self.w...
ruby
chosen
[ { "from": "system", "value": "Remove previous bug-fix for splatting.\n\nThis is currently causing to emit `Opal.to_a(Opal.to_a(..))` for splats,\nsince the issue was then fixed downstream in the splat node handler.\n" }, { "from": "human", "value": "require 'opal/nodes/base'\n\nmodule Opal\n mo...
ruby
chosen