conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Load up the Exlibris::Aleph::TablesManager when the application starts to save time\n" }, { "from": "gpt", "value": "# Load all the sub libraries when the application starts\nExlibris::Aleph::TablesManager.instance.sub_libraries.all\n# Load all the item circulation p...
ruby
chosen
[ { "from": "system", "value": "Use dataset for Update command\n" }, { "from": "human", "value": "require 'rom/sql/commands'\n\nmodule ROM\n module SQL\n module Commands\n class Update < ROM::Commands::Update\n option :original, type: Hash, reader: true\n\n alias_method :to,...
ruby
chosen
[ { "from": "system", "value": "Increase expiration to 30 minutes\n" }, { "from": "human", "value": "require 'nifty-report/model'\n\nmodule Nifty\n class Report\n def initialize(sql, name, connection_string = nil)\n @sql = sql\n @name = name\n @connection_string = connection_str...
ruby
chosen
[ { "from": "system", "value": "Fix a bug in the CopyCards class\n" }, { "from": "human", "value": "module SlackTrello; class CopyCards\n\n attr_reader :source_board, :source_list, :destination_board, :destination_list\n\n def initialize(source_board, source_list, destination_board, destination_...
ruby
chosen
[ { "from": "system", "value": "Change email validation regex to reject backticks\n\n* regex now will no accept backticks in any part of the email string\n" }, { "from": "human", "value": "class EmailFormatValidator < ActiveModel::EachValidator\n def validate_each(object, attribute, value)\n u...
ruby
chosen
[ { "from": "system", "value": "Remove extraneous bundler require statement\n" }, { "from": "human", "value": "require 'bundler'\nBundler.setup\n\nrequire 'something_like_that/match_phrase'\nrequire 'something_like_that/match_phrase/query'\nrequire 'something_like_that/scorer'\nrequire 'something_...
ruby
chosen
[ { "from": "system", "value": "Use arel predicates to quote tree expand query\n" }, { "from": "human", "value": "module Puffer\n class TreeBase < Puffer::Base\n\n helper 'puffer/helpers/puffer_tree'\n\n define_fieldset :tree, :fallbacks => :index\n\n def index\n return super if puf...
ruby
chosen
[ { "from": "human", "value": "Add born at postgresql constraint\n" }, { "from": "gpt", "value": "class AddNotNullContraintIfCompanyEntity < ActiveRecord::Migration\n def change\n execute \"ALTER TABLE entities ADD CONSTRAINT company_born_at_not_null CHECK (( of_company = TRUE AND born_at IS N...
ruby
chosen
[ { "from": "system", "value": "Use hash to argument type\n" }, { "from": "human", "value": "module Syoboemon\n\tmodule Connector\n\t\tURL\t\t\t= \"http://cal.syoboi.jp\"\n\t\tRSS2_PATH\t= \"/rss2.php\"\n\t\tDB_PATH\t\t= \"/db.php\"\n\t\tJSON_PATH\t= \"/json.php\"\n\n\t\tclass << self\n\t\t\tdef r...
ruby
chosen
[ { "from": "system", "value": "Add a rake task to sync announcements\n\nAdd a rake task to sync the announcements in the database with the ones\nin the yaml file.\n\nUsage: rake coronavirus:sync_announcements\n" }, { "from": "human", "value": "# Temporary rake task whilst MVP publishing tool is u...
ruby
chosen
[ { "from": "human", "value": "Add temporary Rake task to republish all editions with attachments for accessible format pilot\n" }, { "from": "gpt", "value": "desc \"Republish all documents with attachments for organisations in accessible format request pilot\"\ntask repubish_docs_with_attachments...
ruby
chosen
[ { "from": "system", "value": "Use HTTPS in all connections\n\nNow `dmm-crawler` using HTTP so it should use HTTPS connection.\n" }, { "from": "human", "value": "require 'mechanize'\n\nmodule DMMCrawler\n BASE_URL = 'http://www.dmm.co.jp'.freeze\nend\n\nrequire 'dmm-crawler/agent'\nrequire 'dmm-...
ruby
chosen
[ { "from": "system", "value": "Handle blank values when processing remote TSV data\n\nWe have not null DB constraints on several fields in the TagMapping\nmodel. An import TSV may have blank values in any of its fields. We\nshould handle these cases and not attempt to persist null values in the\ntag_mappings...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.0.2.2 to 0.0.2.3\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'set_attributes'\n s.version = '0.0.2.2'\n s.summary = \"Set an object's attributes from an object or hash ...
ruby
chosen
[ { "from": "system", "value": "Update gemspec with rubygems url\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'liquid-validations/version'\n\nGem::Specification.new do |gem...
ruby
chosen
[ { "from": "system", "value": "Remove a funky case statement\n" }, { "from": "human", "value": "include_recipe 'bluepill'\n\n# Boring\npackage 'nc' do\n package_name case node['platform_family']\n when 'debian'\n 'netcat'\n else\n 'nc'\...
ruby
chosen
[ { "from": "human", "value": "Add basic disk config unit tests\n" }, { "from": "gpt", "value": "require File.expand_path(\"../../../../base\", __FILE__)\n\nrequire Vagrant.source_root.join(\"plugins/kernel_v2/config/disk\")\n\ndescribe VagrantPlugins::Kernel_V2::VagrantConfigDisk do\n include_co...
ruby
chosen
[ { "from": "system", "value": "Add block argument to GroupNode.new\n" }, { "from": "human", "value": "# Copyright (C) 2016 Colin Fulton\n# All rights reserved.\n#\n# This software may be modified and distributed under the\n# terms of the three-clause BSD license. See LICENSE.txt\n# (located in ro...
ruby
chosen
[ { "from": "system", "value": "Add explanatory comment to bundler require file.\n" }, { "from": "human", "value": "require 'rspec/given'\n" }, { "from": "gpt", "value": "# This file file is to make bundler happy when auto-requiring files\n# based on gem name. If you are manually requ...
ruby
chosen
[ { "from": "system", "value": "Restructure won to be slightly more sequence-oriented\n" }, { "from": "human", "value": "require \"tic_tac_toe/version\"\n\nmodule TicTacToe\n\n class Game\n\n def initialize display\n end\n\n def start\n end\n\n end\n\n class Board\n @@win_places ...
ruby
chosen
[ { "from": "system", "value": "Update aruba timeout to use config block\n" }, { "from": "human", "value": "require 'aruba/cucumber'\n\nBefore do\n # Force ids to be printed unquoted for consistency\n set_environment_variable('SHELL', '/usr/bin/bash')\n\n if RUBY_PLATFORM =~ /java/ || defined?(...
ruby
chosen
[ { "from": "system", "value": "Set a build_dir option, remove working files\n" }, { "from": "human", "value": "require 'optparse'\nrequire 'paur/submission'\n\nmodule Paur\n class Main\n class << self\n attr_reader :category, :verbose\n\n def run(argv)\n @category = 'system'\...
ruby
chosen
[ { "from": "system", "value": "Move shims up in file hierarchy.\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/../../../../helpers/test_case'\n\n# Declare the ROOT_DIR constant before adding galena/lib to the Ruby path.\n\nmodule Galena\n # The Galena example root director...
ruby
chosen
[ { "from": "system", "value": "Add rake to development dependency for Travis-CI\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/lps/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Junegunn Choi\"]\n gem.email ...
ruby
chosen
[ { "from": "system", "value": "Fix callback type -> after_update\n" }, { "from": "human", "value": "class Plugin < ActiveRecord::Base\n belongs_to :district\n\n serialize :plugin_attributes\n\n before_validation :default_attributes\n before_validation :name, uniqueness: {scope: :district_id}\...
ruby
chosen
[ { "from": "system", "value": "Fix for missing file on first converge\n" }, { "from": "human", "value": "name\t\t \"rackspacecloud\"\nmaintainer \"Ryan Walker\"\nmaintainer_email \"ryan.walker@rackspace.com\"\nlicense \"Apache 2.0\"\ndescription \"Provides LWRP's for managing ...
ruby
chosen
[ { "from": "system", "value": "Use SPDX standard license string\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "name 'reprepro'\nmaintainer 'Tim Smith'\nmaintainer_email 'tsmith@chef.io'\nlicense 'Apache 2.0'\ndescription 'Installs...
ruby
chosen
[ { "from": "system", "value": "Convert base_shipping_method factory into an alias\n\nBase_shipping_method was invalid because it doesn't have a calculator.\n\nbase_shipping_method isn't used anywhere within core, but it could be\nused other applications.\n\nFor both of these reasons, base_shipping_method is ...
ruby
chosen
[ { "from": "system", "value": "Add httparty and active support gems" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nrequire File.expand_path('../lib/mol/version', __FILE__)\n\nGem::Specification.new do |spec|\n spec.name = \"mol\"\n spec.version = MOL::VERSION\n sp...
ruby
chosen
[ { "from": "human", "value": "Add migration to redirect atom feed\n\nThe atom feed was not redirected when the department was renamed\n" }, { "from": "gpt", "value": "base_path = \"/government/organisations/department-of-health\"\ndestination = \"/government/organisations/department-of-health-and...
ruby
chosen
[ { "from": "system", "value": "Allow reference file assets to be bigger than allowed.\n" }, { "from": "human", "value": "class FileAsset < ActiveRecord::Base\n include Referencable\n include Expirable\n include Owned\n \n has_attached_file :resource\n \n delegate :path, to: :resource\n \n...
ruby
chosen
[ { "from": "system", "value": "Sort import logs by descending finished_at\n" }, { "from": "human", "value": "# Common behaviour for import loggers\nrequire 'active_support/concern'\n\nmodule ImportLog\n\n extend ActiveSupport::Concern\n\n included do\n\n belongs_to :user\n\n attr_accessib...
ruby
chosen
[ { "from": "system", "value": "Change gemspec back to rdoc - readme.md is in examples not root dir\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"rally_api/version\"\n\nGem::Specification.new do |s|\n s.name = \"rall...
ruby
chosen
[ { "from": "human", "value": "Add migration for field length restriction\n" }, { "from": "gpt", "value": "Sequel.migration do\n up do\n execute <<-EOF\nALTER TABLE bytea_things ADD CONSTRAINT valid_bytea_size\n CHECK (data IS NULL OR octet_length(data) = 176)\nEOF\n end\nend\n" } ]
ruby
chosen
[ { "from": "system", "value": "Remove rooms along with their owners\n\nFixes #440\n" }, { "from": "human", "value": "module SocialStream\n module Events\n module Models\n module Actor\n extend ActiveSupport::Concern\n\n included do\n has_many :rooms\n end\n\...
ruby
chosen
[ { "from": "system", "value": "Fix warnings while building gem\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'bulk_updater/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Update IntelliJ IDEA CE to 14.1.4\n" }, { "from": "human", "value": "cask :v1 => 'intellij-idea-ce' do\n version '14.1.3'\n sha256 'e0e21b9ee9ac881c10b62507eaae4c2dc651bee631fbb9a0fbac9a289d405616'\n\n url \"http://download.jetbrains.com/idea/ideaIC-#{version}.dm...
ruby
chosen
[ { "from": "system", "value": "Update podspec to be compatible with iOS 6\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'CSNotificationView'\n s.version = '0.4'\n s.summary = \"iOS-7-style, semi-translucent notification view with blur.\"\n s.homepage ...
ruby
chosen
[ { "from": "system", "value": "Fix xor method to be able to take large strings as input\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\ndef treatAsHex s\n [s].pack('H*').unpack('B*').last.to_i 2\nend\n\npublic\ndef xor(str1, str2)\n h1 = treatAsHex str1\n h2 = treatAsHex str2\n (h1 ...
ruby
chosen
[ { "from": "human", "value": "Add code wars (6) - format words into a sentence\n" }, { "from": "gpt", "value": "# http://www.codewars.com/kata/51689e27fe9a00b126000004/\n# --- iteration 1 ---\ndef format_words(words)\n return \"\" if words.nil?\n words.reject!(&:empty?)\n return \"\" if words....
ruby
chosen
[ { "from": "system", "value": "Change sql statement to use rails helpers.\n\nThis cause migration to fail on sqlite, due to syntax\ndifferences between RDBMSs.\n" }, { "from": "human", "value": "#\n# Copyright 2011 Red Hat, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"Lice...
ruby
chosen
[ { "from": "system", "value": "Check to see if we are in Rails 3 or not and use the correct content_tag call.\n" }, { "from": "human", "value": "module CountryCodeSelect\n\tmodule InstanceTag\n\t\tinclude Countries\n\n\t\tdef to_country_code_select_tag(priority_countries, options = {})\n\t\t\tcou...
ruby
chosen
[ { "from": "system", "value": "[google][compute] Add rhel-cloud to project search list\n" }, { "from": "human", "value": "require 'fog/core/collection'\nrequire 'fog/google/models/compute/image'\n\nmodule Fog\n module Compute\n class Google\n\n class Images < Fog::Collection\n\n m...
ruby
chosen
[ { "from": "system", "value": "Copy all layouts under the layouts folder.\n" }, { "from": "human", "value": "module Typus\n\n module Generators\n\n class ViewsGenerator < Rails::Generators::Base\n\n source_root File.expand_path(\"../../../../app/views\", __FILE__)\n\n desc <<-MSG\nD...
ruby
chosen
[ { "from": "system", "value": "Update error flash class by official documentation" }, { "from": "human", "value": "module BootstrapFlashHelper\n ALERT_TYPES = [:error, :info, :success, :warning]\n\n def bootstrap_flash\n output = ''\n flash.each do |type, message|\n next if message.b...
ruby
chosen
[ { "from": "system", "value": "Use syck for yaml, fixes an issuew with new delayed job.\n" }, { "from": "human", "value": "require 'rubygems'\n# Set up gems listed in the Gemfile.\nif File.exist?(File.expand_path('../../Gemfile', __FILE__))\n require 'bundler'\n Bundler.setup\nend\n" }, { ...
ruby
chosen
[ { "from": "system", "value": "Add description to HaveApplied matcher for doc format\n" }, { "from": "human", "value": "module RailsEventStore\n module RSpec\n class HaveApplied\n def initialize(mandatory_expected, *optional_expected, differ:)\n @expected = [mandatory_expected, *o...
ruby
chosen
[ { "from": "system", "value": "Fix a minor typo in a comment: srvious => various" }, { "from": "human", "value": "# Configure the Rakefile's tasks.\n\n###\n# Company and SSL Details\n# Used with the ssl_cert task.\n###\n\n# The company name - used for SSL certificates, and in srvious other places...
ruby
chosen
[ { "from": "system", "value": "Refactor for consistency with other Results.\n" }, { "from": "human", "value": "require 'geocoder/results/base'\n\nmodule Geocoder::Result\n class Bing < Base\n\n def address(format = :full)\n data_address['formattedAddress']\n end\n\n def city\n ...
ruby
chosen
[ { "from": "system", "value": "Add development mode, and symlink the app files into the gem in development mode only\n" }, { "from": "human", "value": "class Mangos::Mangos\n def initialize(root_path)\n raise \"root_path must be an instance of Pathname\" unless root_path.is_a?(Pathname)\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add some hash route methods." }, { "from": "human", "value": "module Pacer\n module Core\n module HashRoute\n def lengths\n map(element_type: :integer) { |s| s.length }\n end\n end\n end\nend\n\n" }, { "from": "gpt", "value": "mo...
ruby
chosen
[ { "from": "system", "value": "Tweak configure task, set it to run after deploy:setup\n" }, { "from": "human", "value": "require 'highline/import'\n\nCapistrano::Configuration.instance(true).load do\n set :database_name, nil\n set :database_user, Proc.new { ask(\"What is your database username?...
ruby
chosen
[ { "from": "system", "value": "Implement happy path for get_current.\n" }, { "from": "human", "value": "require \"ubuntu_unused_kernels/version\"\nrequire \"open3\"\n\nmodule UbuntuUnusedKernels\n PACKAGE_PREFIXES = %w{linux-image linux-headers}\n KERNEL_VERSION = %r{\\d+\\.\\d+\\.\\d+-\\d+}\n\...
ruby
chosen
[ { "from": "system", "value": "Fix Yao::Keypair.list would not return instances themselves\n" }, { "from": "human", "value": "module Yao::Resources\n class Keypair < Base\n friendly_attributes :name, :public_key, :fingerprint\n\n self.service = \"compute\"\n self.resource_name =...
ruby
chosen
[ { "from": "system", "value": "Make the output a diff\n" }, { "from": "human", "value": "RSpec::Matchers.define :be_the_same_proxy_pac_file do |expected|\n define_method :loader do\n ProxyPacRb::ProxyPacLoader.new\n end\n\n match do |actual|\n @file_a = ProxyPacRb::ProxyPacFile.new(sourc...
ruby
chosen
[ { "from": "system", "value": "Change boolean conditions to use && and not \"and\"\n" }, { "from": "human", "value": "# encoding: utf-8\n\nnamespace :metrics do\n allowed_versions = %w(mri-1.9.3 mri-2.0.0 rbx-1.9.3)\n\n begin\n require 'mutant'\n rescue LoadError\n end\n\n mutant_present ...
ruby
chosen
[ { "from": "system", "value": "Fix `url` stanza comment for duckieTV.\n" }, { "from": "human", "value": "cask 'duckietv' do\n version '1.1.3'\n sha256 '4c4ee965cf39db6333dad65fe2b56ebf412af490a1b091487ef5d1fe8989b359'\n\n # schizoduckie.github.io/DuckieTV was verified as official homepage when...
ruby
chosen
[ { "from": "system", "value": "Update Stackato CLI to v3.2.1\n" }, { "from": "human", "value": "cask :v1 => 'stackato' do\n version '3.2.0'\n sha256 'ba54288e3770c3ad8928c0ad3b5904b552dbe32e2748ed724a38fcb2efc4fb8c'\n\n url \"http://downloads.activestate.com/stackato/client/v#{version}/stackat...
ruby
chosen
[ { "from": "system", "value": "Add Github class with basic auth and some simple GET methods.\n" }, { "from": "human", "value": "require \"issues/version\"\n\nmodule Issues\n # Your code goes here...\nend\n" }, { "from": "gpt", "value": "$LOAD_PATH.unshift(File.dirname(__FILE__))\n\nr...
ruby
chosen
[ { "from": "system", "value": "Add use_cases to manifest file\n" }, { "from": "human", "value": "require \"quotes/version\"\n\n# require all support files\nDir.glob('./lib/quotes/support/*.rb') { |f| require f }\n\nrequire \"quotes/entities\"\nrequire \"quotes/services\"\n\nmodule Quotes\nend\n"...
ruby
chosen
[ { "from": "system", "value": "Revert \"Removed `EasyNotificationBadge` from podspec dependency.\"\n\nThis reverts commit 5897b8f8a3d2c82a2038987fd36b31197818ded4.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"AZTabBar\"\n s.version = \"1.4.2\"\n s.summary ...
ruby
chosen
[ { "from": "system", "value": "Use pry-nav instead of pry-debugger\n" }, { "from": "human", "value": "# coding: utf-8\n$:.push File.expand_path(\"../lib\", __FILE__)\n\nrequire \"detour/version\"\n\nGem::Specification.new do |spec|\n spec.name = \"detour\"\n spec.version = Detour...
ruby
chosen
[ { "from": "system", "value": "Make sure we test the right thing\n" }, { "from": "human", "value": "require 'spec_helper_acceptance'\n\ndescribe \"Service tests:\" do\n\n case fact('osfamily')\n when 'RedHat'\n defaults_file = '/etc/sysconfig/elasticsearch'\n when 'Debian'\n defa...
ruby
chosen
[ { "from": "human", "value": "Add feature tests for users\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\nfeature \"User visits the website\" do\n scenario \"when user signs up\" do\n user = FactoryGirl.create(:user)\n visit \"/users/new\"\n fill_in \"user[first_name]\", with...
ruby
chosen
[ { "from": "system", "value": "Simplify invitation email even more" }, { "from": "human", "value": "class Task::Notifications::InvitationEmail < Mutations::Command\n required do\n model :task\n model :current_user, class: User\n string :type\n end\n\n def execute\n invitees = volun...
ruby
chosen
[ { "from": "system", "value": "Use require_relative instead of messing with $LOAD_PATH\n" }, { "from": "human", "value": "# This is based on Florian Weber's TDDMate\n\nENV['TM_PROJECT_DIRECTORY'] ||= File.dirname(ENV['TM_FILEPATH'])\n\n$LOAD_PATH.unshift(File.dirname(__FILE__) + '/..')\n\nrequire...
ruby
chosen
[ { "from": "system", "value": "Fix exception handler helper method" }, { "from": "human", "value": "class Object\n def catching_standard_errors(&block)\n begin\n yield\n rescue StandardError => e\n Adhearsion::Events.trigger ['exception'], e\n end\n end\nend\n" }, { "...
ruby
chosen
[ { "from": "system", "value": "Bring back React as a dependency of the cocoapod\n\nThe pod is unable to reference RN's headers when compiled as a framework without RN as a dependency.\n\nFixes errors like:\n\n```\nRNMixpanel.h:9:9: 'RCTBridgeModule.h' file not found\n```\n" }, { "from": "human", ...
ruby
chosen
[ { "from": "system", "value": "Allow the bearer to be set on the instance in addition to the class\n" }, { "from": "human", "value": "module NfgRestClient\n class BaseTransaction < Base\n before_request :add_authentication_details\n\n def initialize(attrs={})\n super\n self.campa...
ruby
chosen
[ { "from": "system", "value": "Set TW version for PowerPC\n\nSigned-off-by: Dinar Valeev <5117617bf147dfe0d669bc60877f607cdec8696e@suse.com>\n" }, { "from": "human", "value": "module ObsFactory\n\n # PowerPC to Factory Diff\n class DistributionStrategyFactoryPPC < DistributionStrategyFactory\n\...
ruby
chosen
[ { "from": "system", "value": "Update the version to 0.3.1 in podspec.\n" }, { "from": "human", "value": "#\n# Be sure to run `pod lib lint HUDHelper.podspec' to ensure this is a\n# valid spec before submitting.\n#\n# Any lines starting with a # are optional, but their use is encouraged\n# To lea...
ruby
chosen
[ { "from": "system", "value": "Add search namespace override to JournalEntry\n\nThe namespace for JournalEntry is tranGeneral, but it's search falls under the Transaction schema with the namespace tranSales. Add a search_class_namespace override to make this work properly.\n" }, { "from": "human", ...
ruby
chosen
[ { "from": "system", "value": "Add dev dependency on chefstyle\n" }, { "from": "human", "value": "$:.unshift File.expand_path(\"../lib\", __FILE__)\nrequire \"mixlib/log/version\"\n\nGem::Specification.new do |gem|\n gem.name = \"mixlib-log\"\n gem.version = Mixlib::Log::VERSION\n gem.platform...
ruby
chosen
[ { "from": "system", "value": "Drop -rails from the name.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"slickbone/version\"\n\nGem::Specification.new do |s|\n s.name = \"slickbone-rails\"\n s.version = Slickbon...
ruby
chosen
[ { "from": "system", "value": "Add the result to the log\n" }, { "from": "human", "value": "class CacheBrowserChannelsJsonJob < ApplicationJob\n queue_as :heavy\n\n def perform\n channels_json = JsonBuilders::ChannelsJsonBuilder.new.build\n Rails.cache.write('browser_channels_json', chann...
ruby
chosen
[ { "from": "system", "value": "Support for redmine_contacts has been added\n" }, { "from": "human", "value": "module RedmineLightbox2\n module Hooks\n class ViewLayoutsBaseHtmlHeadHook < Redmine::Hook::ViewListener\n def view_layouts_base_html_head(context={})\n if context[:contro...
ruby
chosen
[ { "from": "human", "value": "Add twemproxy to graphite plugin.\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\n#\n# Push twemproxy stats into graphite\n# ===\n#\n# DESCRIPTION:\n# This plugin gets the stats data provided by twemproxy\n# and sends it to graphite.\n#\n#\n# DEPENDENCIES:\...
ruby
chosen
[ { "from": "human", "value": "Add code wars (6) - which are in\n" }, { "from": "gpt", "value": "# http://www.codewars.com/kata/550554fd08b86f84fe000a58/\n# --- iteration 1 ---\ndef in_array(a1, a2)\n return [] if a1.empty?\n a1.select! do |a1_str|\n a2.any? { |a2_str| a2_str.include?(a1_str)...
ruby
chosen
[ { "from": "system", "value": "Add description to task factory.\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :task do\n title \"MyString\"\n milestone_id 1\n assigned_user_id 1\n state \"new\"\n project_id 1\n end\nend\n" }, { "from": "gpt", "val...
ruby
chosen
[ { "from": "system", "value": "Fix a critical bug on Array ex class.\n" }, { "from": "human", "value": "#\n# Array クラス拡張メソッド\n#\nclass Array\n\n def to_v\n if size == 0\n Vec::new 0.0, 0.0, 0.0\n else\n x = 0.0, y = 0.0, z = 0.0\n if size > 0 then x = self[0].to_f end\n ...
ruby
chosen
[ { "from": "system", "value": "Fix style of FizzBuzz problem example\n" }, { "from": "human", "value": "subject \"FizzBuzz (1 ~ 15)\"\nexpected <<EOS\n1\n2\nFizz\n4\nBuzz\nFizz\n7\n8\nFizz\nBuzz\n11\nFizz\n13\n14\nFizzBuzz\nEOS\n" }, { "from": "gpt", "value": "subject \"FizzBuzz (1 ~ ...
ruby
chosen
[ { "from": "system", "value": "Remove driver code section and numbering" }, { "from": "human", "value": "# Introduction to Inheritance\n\n# I worked on this challenge [by myself, with: ].\n\n\n# 1. Pseudocode\n\n\n\n\n# 2. Initial Solution\n\nclass GlobalCohort\n #your code here\n\nend\n\nclass ...
ruby
chosen
[ { "from": "system", "value": "203: Add throttling test for noauth/submission\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'throttling for xml requests' do\n\n let(:limit) { configatron.direct_auth_request_limit }\n\n before(:each) do\n Rack::Attack.cache.store = Acti...
ruby
chosen
[ { "from": "system", "value": "Fix test to deal with access control issue in older Ruby versions\n" }, { "from": "human", "value": "module ThousandIsland\n describe StyleSheet do\n let(:subject) do\n dummy = Class.new\n dummy.include(described_class)\n dummy.new\n end\n l...
ruby
chosen
[ { "from": "system", "value": "Remove new issues list from migration\n" }, { "from": "human", "value": "class CreateBacklogs < ActiveRecord::Migration\n def up\n create_table :backlogs do |t|\n t.string :name\n t.boolean :locked\n t.string :locked_session_id\n\n t.timestam...
ruby
chosen
[ { "from": "system", "value": "[DMG-406] Install Gitweb as part of Gerrit installation\n" }, { "from": "human", "value": "# Encoding: utf-8\n#\n# Cookbook Name:: cicd_infrastructure\n# Recipe:: default\n#\n# Copyright (c) 2014 Grid Dynamics International, Inc. All Rights Reserved\n# Classificatio...
ruby
chosen
[ { "from": "system", "value": "Fix deprecation warning in test\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe ApplicationController do\n controller do\n def index\n render text: 'ok'\n end\n end\n\n describe 'debug_params' do\n it 'filters passwords' ...
ruby
chosen
[ { "from": "system", "value": "Disable in production with DISABLE_DO_BY" }, { "from": "human", "value": "require \"do_by/version\"\n\nmodule DoBy\n class LateTask < RuntimeError\n end\n\n class Note\n def initialize(description, date = nil)\n message = description + \" is overdue\"\n ...
ruby
chosen
[ { "from": "system", "value": "Enable page caching for all templates.\n\nThis will enable apache/nginx to serve all but the first request for\neach one, which will improve performance somewhat, and save having to\nkeep workers running for static.\n" }, { "from": "human", "value": "class RootContr...
ruby
chosen
[ { "from": "system", "value": "Add changelog, remove extraneous files from built gem\n" }, { "from": "human", "value": "require_relative 'lib/binding_of_caller/version'\n\nGem::Specification.new do |spec|\n spec.name = \"binding_of_caller\"\n spec.version = BindingOfCaller::VERSI...
ruby
chosen
[ { "from": "system", "value": "Use aruba helpers instead of nested steps.\n\nFixes some pending step issues for steps that should not have been\npending.\n" }, { "from": "human", "value": "Then /^the output should say the file \"([^\"]*)\" was created$/ do |file|\n step %{Then \"the output shoul...
ruby
chosen
[ { "from": "system", "value": "Add some packages to run heroku-buildpack-ruby\n" }, { "from": "human", "value": "#\n# Cookbook Name:: buildpack\n# Recipe:: default\n#\n# Copyright (C) 2015 Yamashita, Yuu\n#\n# Apache 2.0\n#\n\npackage \"bash\"\npackage \"git\"\n" }, { "from": "gpt", "...
ruby
chosen
[ { "from": "system", "value": "Reset IIS using net stop to reload registry\n" }, { "from": "human", "value": "#\n# Cookbook Name:: asp_core\n# Recipe:: default\n#\n# Copyright (c) 2016 The Authors, All Rights Reserved.\n\ninclude_recipe 'iis::default'\n\nservice 'W3SVC' do\n action :nothing\nend...
ruby
chosen
[ { "from": "system", "value": "Fix missing execution block for apt > 2.4.0, where it was changed to apt-get-update." }, { "from": "human", "value": "include_recipe \"apt\"\n\napt_repository \"brightbox-ruby-ng-#{node['lsb']['codename']}\" do\n uri \"http://ppa.launchpad.net/brightbox/ru...
ruby
chosen
[ { "from": "human", "value": "[COOK-3675] Add a recipe for CGI feature\n\nSigned-off-by: Seth Vargo <81550dbf04dfd8537ff7b3c014c6fbf86e0889dc@gmail.com>\n" }, { "from": "gpt", "value": "#\n# Author:: Richard Downer (<richard.downer@cloudsoftcorp.com>)\n# Cookbook Name:: iis\n# Recipe:: mod_cgi\n#...
ruby
chosen
[ { "from": "system", "value": "Rename `check` command to `scan`" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'thor'\n\n\nmodule Audiothority\n class Cli < Thor\n desc 'check PATHS', 'Check given paths for inconsistencies'\n method_option :paths_only, type: :boolean, defaul...
ruby
chosen
[ { "from": "system", "value": "Use `Time.zone.at` instead of `Time.at`\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass Integer\n def to_time\n Time.at(self / 1000)\n end\nend\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nclass Integer...
ruby
chosen
[ { "from": "system", "value": "Fix broken user registration test\n" }, { "from": "human", "value": "require 'test_helper'\nrequire 'mocha'\n\nclass EulasControllerTest < ActionController::TestCase\n setup do\n @request.env['SERVER_PROTOCOL']='HTTP/1.1'\n end\n \n test \"should respond to po...
ruby
chosen
[ { "from": "system", "value": "Remove transaction from version cleanup to preserve liveliness\n" }, { "from": "human", "value": "def versions_query\n VestalVersions::Version\n .where(versioned_type: %w[\n DiscountCode\n Event\n MultidayEvent\n Page\...
ruby
chosen
[ { "from": "system", "value": "Add a test to make sure the UI is reloaded between tests\n" }, { "from": "human", "value": "require \"spec_helper\"\n\nfeature \"Linking\" do\n background do\n visit \"/foo.html\"\n end\n\n scenario \"UI is loaded before interacting with a page\" do\n expec...
ruby
chosen