conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add license details to gemspec.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nrequire File.expand_path('../lib/ffi-proj4/version', __FILE__)\n\nGem::Specification.new do |s|\n s.name = \"ffi-proj4\"\n s.version = Proj4::VERSION\n\n s.required_ru...
ruby
chosen
[ { "from": "system", "value": "Fix BerksfileCheck spec to stub in_path?\n\nThis spec would pass locally but fail on Travis because it didn't stub\nthe `in_path?` call. Fix it.\n\nChange-Id: I359f69518eae2f108761c6e48f2273a9b8cc146e\nReviewed-on: http://gerrit.causes.com/37940\nTested-by: jenkins <d95b56ce41a...
ruby
chosen
[ { "from": "human", "value": "Convert a string to its permutation using only neighbor swaps\n" }, { "from": "gpt", "value": "# Convert string to permutations using only adjacent swaps\n#\n# Example: CAT TAC\n#\n# CAT CTA TCA TAC\n#\n\nclass String\n def perms(target)\n result = []\n ...
ruby
chosen
[ { "from": "system", "value": "Add link to prefixes page\n" }, { "from": "human", "value": "ActiveAdmin.register Endpoint do\n\n# See permitted parameters documentation:\n# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters\n#\n# p...
ruby
chosen
[ { "from": "system", "value": "Add tests for email validator\n" }, { "from": "human", "value": "require 'test_helper'\n\n#\n# == MailingSettingTest Model\n#\nclass MailingSettingTest < ActiveSupport::TestCase\n # test \"the truth\" do\n # assert true\n # end\nend\n" }, { "from": "gpt...
ruby
chosen
[ { "from": "system", "value": "Switch back to having AFNetworking as a dependency instead of just the subspec AFNetworking/NSURLSession\n\nThere are bugs in AFNetworking/NSURLSession which requires it to use\nother files not included in the subspec.\n" }, { "from": "human", "value": "Pod::Spec.ne...
ruby
chosen
[ { "from": "human", "value": "JariBakken: Add missing file from last commit.\n\ngit-svn-id: aa1aa1384423cb28c2b1e29129bb3a91de1d9196@12313 07704840-8298-11de-bf8c-fd130f914ac9\n" }, { "from": "gpt", "value": "module Selenium\n module WebDriver\n module Firefox\n\n describe Driver do\n ...
ruby
chosen
[ { "from": "system", "value": "Remove unused variable from test\n" }, { "from": "human", "value": "# frozen_string_literal: true\nrequire 'test_helper'\n\nclass UsersControllerTest < ActionController::TestCase\n include Devise::Test::ControllerHelpers\n\n setup do\n @ad = create(:ad)\n @u...
ruby
chosen
[ { "from": "system", "value": "Change CauseOfDeath CodingStandard to EDTA_COD\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nxml = builder\n\n# temp hack until XSD updated to include missing code 34\ncause_code = cause.code\ncause_code = 99 if cause_code == 34\n\nxml.CauseOfD...
ruby
chosen
[ { "from": "system", "value": "Add missing null: false on user addresses\n" }, { "from": "human", "value": "class AddSpreeUserAddresses < ActiveRecord::Migration\n def change\n create_table :spree_user_addresses do |t|\n t.integer :user_id, null: false\n t.integer :address_id, null:...
ruby
chosen
[ { "from": "system", "value": "Fix indentation. Workshops to Workshop.\n" }, { "from": "human", "value": "class ChangePhaseToInt < ActiveRecord::Migration\n def change\n Workshops.find_each do |workshop|\n phase = workshop.phase\n new_phase = 0\n if phase == 'Phase 1'\n ne...
ruby
chosen
[ { "from": "system", "value": "Fix to get current_tenant working\n" }, { "from": "human", "value": "module ActsAsTenant\n module ControllerExtensions\n \n # this method allows setting the current_account by reading the subdomain and looking\n # it up in the tenant-model passed to the meth...
ruby
chosen
[ { "from": "system", "value": "Enable native scaling for svgbob\n" }, { "from": "human", "value": "require_relative '../diagram_converter'\nrequire_relative '../util/cli_generator'\nrequire_relative '../util/platform'\n\nmodule Asciidoctor\n module Diagram\n # @private\n class SvgbobConver...
ruby
chosen
[ { "from": "system", "value": "Refactor default locale assignment on argument parser\n" }, { "from": "human", "value": "require_relative '../../resume_generator'\nrequire_relative 'colours'\nrequire 'optparse'\nrequire 'forwardable'\n\nmodule ResumeGenerator\n module CLI\n class ArgumentParse...
ruby
chosen
[ { "from": "system", "value": "Make code compatible with Ruby 2.1\n" }, { "from": "human", "value": "require 'digest'\n\nmodule TheCommunityFarm\n class OrganicBoxes\n class Box\n def initialize(noko:)\n @noko = noko\n end\n\n def id\n Digest::MD5.new.tap do |id|\...
ruby
chosen
[ { "from": "system", "value": "Create Core Cells for new Field Types\n" }, { "from": "human", "value": "module Cortex\n module FieldTypes\n module Core\n module Tag\n class TagCell < FieldCell\n\n def tag_picker\n render\n end\n\n end\n end...
ruby
chosen
[ { "from": "human", "value": "Test ApplicationController methods with dedicated spec.\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\nRSpec.describe ApplicationController, type: :controller do\n\n controller do\n before_action :login_required, only: [:fake_action]\n before_actio...
ruby
chosen
[ { "from": "system", "value": "Make spec ruby 1.8 compatible" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'ActionMailer::Base.register_interceptor' do\n it 'should register interceptor PremailerRails::Hook' do\n ActionMailer::Base\n .expects(:register_interceptor)\n...
ruby
chosen
[ { "from": "system", "value": "Update display adapters spec to match AST output" }, { "from": "human", "value": "RSpec.describe \"Display adapters\" do\n subject(:form) {\n Class.new(Formalist::Form) do\n field :temperature_unit, type: \"string\", display: \"select\", option_values: [%w[...
ruby
chosen
[ { "from": "system", "value": "Change topic params to tag params.\n" }, { "from": "human", "value": "class ResourcesController < ApplicationController\n before_action :set_resource, only: [:show, :edit, :update, :destroy]\n\n def index\n end\n\n def new\n @user = current_user\n @resourc...
ruby
chosen
[ { "from": "system", "value": "Use `self.class.connection` instead of `ActiveRecord::Base.connection`\n" }, { "from": "human", "value": "# use this module to defer actions to the after-commit hook. this is useful if you want\n# to trigger actions in after_create, after_destroy and after_update ca...
ruby
chosen
[ { "from": "human", "value": "Add integration test for generating new sharable link\n" }, { "from": "gpt", "value": "require \"test_helper\"\nrequire \"capybara/rails\"\n\nclass ShareablePreviewGenerateNewLinkIntegrationTest < ActionDispatch::IntegrationTest\n extend Minitest::Spec::DSL\n inclu...
ruby
chosen
[ { "from": "system", "value": "Use an external URL for Signon\n" }, { "from": "human", "value": "GDS::SSO.config do |config|\n config.user_model = 'User'\n config.oauth_id = ENV['OAUTH_ID']\n config.oauth_secret = ENV['OAUTH_SECRET']\n config.oauth_root_url = Plek.current.find(\"signon\...
ruby
chosen
[ { "from": "system", "value": "Add counter for number of feed refreshes\n" }, { "from": "human", "value": "require 'sidekiq/api'\nrequire_relative '../../lib/batch_jobs'\n\nclass FeedRefresherScheduler\n include Sidekiq::Worker\n include BatchJobs\n sidekiq_options queue: :critical\n\n STRATE...
ruby
chosen
[ { "from": "human", "value": "Create button a class for container timeline buttons\n" }, { "from": "gpt", "value": "class ApplicationHelper::Button::ContainerTimeline < ApplicationHelper::Button::Container\n needs :@record\n\n def disabled?\n @error_message = _('No Timeline data has been col...
ruby
chosen
[ { "from": "system", "value": "Fix nodes order after performing a network analysis\n" }, { "from": "human", "value": "json.visualization @dataset.visualization.as_json\njson.visualization do\n json.dataset_id @dataset.id\n json.node_custom_fields @dataset.node_custom_fields\n json.relation_cus...
ruby
chosen
[ { "from": "system", "value": "Add currently empty tests to test the responses to different intents\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe AlexaInterfaceController, :type => :controller do\n describe '#recommend' do\n xit 'accepts returns a json object to ...
ruby
chosen
[ { "from": "system", "value": "Fix custom button set tooltip spec\n\nThis spec uses a shared example assuming that it behaves like all other\ntree nodes, however:\n\n* this attribute is based on the description of the object, not the name\n as it is in others\n* it just so happens that the name will equal t...
ruby
chosen
[ { "from": "system", "value": "Remove executables from gemspec and cleanup test files\n\nWe only have specs in this repo and knife plugins never have binaries so this whole thing was unnecessary.\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", ...
ruby
chosen
[ { "from": "system", "value": "Fix pass hash to last argument as keyword\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'active_record/connection_adapters/abstract_mysql_adapter'\n\nmodule Ridgepole\n module Ext\n module AbstractMysqlAdapter\n module UseAlter...
ruby
chosen
[ { "from": "system", "value": "Update development dependency on rake\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nGem::Specification.new do |s|\n s.name = 'gir_ffi-pretty_printer'\n s.version = '0.0.3'\n\n s.summary = 'Pretty-printer for modules generated by GirFFI'\n s.des...
ruby
chosen
[ { "from": "system", "value": "Bump pod version to 1.0.0\n" }, { "from": "human", "value": "Pod::Spec.new do |spec|\n spec.name = \"DelaunaySwift\"\n spec.version = \"0.1.2\"\n spec.summary = \"A utility for doing Delaunay triangulations on a set of vertices...
ruby
chosen
[ { "from": "system", "value": "Add proper heading_id and chapter_id to commodity jsonapi presenter\n" }, { "from": "human", "value": "module Api\n module V2\n module Commodities\n class CommodityPresenter < SimpleDelegator\n\n attr_reader :commodity, :footnotes, :import_measures, ...
ruby
chosen
[ { "from": "system", "value": "Update datasets columns attribute in meta to include data types\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule GobiertoData\n class DatasetMetaSerializer < DatasetSerializer\n has_many :queries\n has_many :visualizations\n\n att...
ruby
chosen
[ { "from": "system", "value": "Fix homepage to use SSL in BitTorrent Sync Cask\n\nThe HTTP URL is already getting redirected to HTTPS. Using the HTTPS URL directly\nmakes it more secure and saves a HTTP round-trip.\n" }, { "from": "human", "value": "cask :v1 => 'bittorrent-sync' do\n version :la...
ruby
chosen
[ { "from": "system", "value": "Revert earlier change to assets precompile list\n" }, { "from": "human", "value": "require_relative \"middleware/url_redirect\"\n\nmodule Koi\n class Engine < ::Rails::Engine\n\n isolate_namespace Koi\n\n initializer \"static assets\" do |app|\n app.midd...
ruby
chosen
[ { "from": "system", "value": "Fix save action on admin VM view\n" }, { "from": "human", "value": "class Atmosphere::Admin::VirtualMachinesController < Atmosphere::Admin::ApplicationController\n load_and_authorize_resource :virtual_machine,\n class: 'Atmosphere::VirtualMachine'\n\n def index...
ruby
chosen
[ { "from": "human", "value": "Add test for history using default json dstu2\n" }, { "from": "gpt", "value": "require_relative '../../test_helper'\n\nclass ClientInterfaceHistoryTest < Test::Unit::TestCase\n def client\n @client ||= FHIR::Client.new('history-test')\n end\n\n def test_history...
ruby
chosen
[ { "from": "system", "value": "Remove exception for protect_from_forgery for API\n" }, { "from": "human", "value": "class Api::V1::InputsController < ApplicationController\n protect_from_forgery :except => [:create]\n\n def index\n @inputs = current_user.inputs\n end\n\n def new\n @inpu...
ruby
chosen
[ { "from": "system", "value": "Allow user name on confirmation controller\n" }, { "from": "human", "value": "class ConfirmationsController < Devise::ConfirmationsController\n def show\n confirmation_token = Devise.token_generator.\n digest(self, :confirmation_token, token_param)\n sel...
ruby
chosen
[ { "from": "system", "value": "FIX : update restaurateur restaurant check\n" }, { "from": "human", "value": "class RestaurateursController < ApplicationResourcesController\n before_action :set_restaurateur, only: [:show, :edit, :update, :destroy]\n\n def create\n @restaurateur = Restaurateur...
ruby
chosen
[ { "from": "system", "value": "Add fields to patient Document\n" }, { "from": "human", "value": "require \"document/embedded\"\nrequire \"document/enum\"\n\nmodule Renalware\n class PatientDocument < Document::Embedded\n attribute :interpreter_notes, String\n attribute :admin_notes, String...
ruby
chosen
[ { "from": "system", "value": "Improve offline mode of PublisherDomainNormalizer\n" }, { "from": "human", "value": "# Normalize a domain by calling the relevant ledger endpoint\nclass PublisherDomainNormalizer < BaseApiClient\n attr_reader :domain\n\n def initialize(domain:)\n # normalize do...
ruby
chosen
[ { "from": "system", "value": "Fix json render syntax with ActiveModelSerializer\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule GobiertoAdmin\n module GobiertoCommon\n module Api\n class VocabulariesController < ::GobiertoAdmin::Api::BaseController\n\n ...
ruby
chosen
[ { "from": "system", "value": "Revert \"prettify html in dev\"\n\nThis reverts commit ed6a1f30053e182091fa65d1d665dc96f1cc1dde.\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\n# Prettify html source for development only\n# Slim::Engine.set_options...
ruby
chosen
[ { "from": "system", "value": "Make sure that migration 103 does not destroy tag association.\n" }, { "from": "human", "value": "class ReallyUpdateExistingArticlesWithNilOrEmptyPostType < ActiveRecord::Migration\n class Content < ActiveRecord::Base\n inheritance_column = :ignore_inheritance_c...
ruby
chosen
[ { "from": "system", "value": "Fix spoiler guard when visitors do not sign in\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Api\n module Internal\n class TrackedResourcesController < Api::Internal::ApplicationController\n before_action :authenticate_user!\n\n...
ruby
chosen
[ { "from": "system", "value": "Update Charles.app to version 3.11b1\n" }, { "from": "human", "value": "cask :v1 => 'charles-beta' do\n version '3.10b9'\n sha256 '35955b18774e9b278d0db7c9cd996dee9beb3990c391ae1556f3ff5ad8aa8dbc'\n\n url \"http://www.charlesproxy.com/assets/release/#{version.gsu...
ruby
chosen
[ { "from": "system", "value": "Update Smart Scroll.prefPane to v4.0.8\n" }, { "from": "human", "value": "cask 'smart-scroll' do\n version '4.0.7'\n sha256 '825517a2078bda2477be58cf36a6293d157b8e1057a4f615bcc6ce8d08aafcd4'\n\n url 'http://www.marcmoini.com/SmartScroll.zip'\n name 'Smart Scroll...
ruby
chosen
[ { "from": "system", "value": "Add rspec as development dependency\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'isms/ruby/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Implement a alias method for \"all\"." }, { "from": "human", "value": "require 'active_force/query'\nrequire 'forwardable'\n\nmodule ActiveForce\n class ActiveQuery < Query\n extend Forwardable\n\n attr_reader :sobject\n\n def_delegators :sobject, :sfdc_cl...
ruby
chosen
[ { "from": "system", "value": "Boost coverage to current level\n" }, { "from": "human", "value": "unless ENV['COVERAGE'] == 'off'\n COVERAGE_THRESHOLD = 95\n require 'simplecov'\n require 'simplecov-rcov'\n require 'coveralls'\n Coveralls.wear!\n\n SimpleCov.formatters = [\n SimpleCov::F...
ruby
chosen
[ { "from": "system", "value": "Fix rename to use ordered hash to run on non-1.9 Rubies\n" }, { "from": "human", "value": "module Faststep\n class Collection\n def index_information\n info = {}\n db[\"system.indexes\"].find({:ns => ns}).each do |index|\n info[index['name']] = ...
ruby
chosen
[ { "from": "system", "value": "Update Firefox ESR version and download over https" }, { "from": "human", "value": "default['firefox']['tarball']['version'] = '31.6.0esr'\ndefault['firefox']['tarball']['download_url'] = \"http://releases.mozilla.org/pub/firefox/releases/#{node...
ruby
chosen
[ { "from": "system", "value": "Update migration to calc annotation offsets relative to date created\n" }, { "from": "human", "value": "class AddGlobalOffsetsToAnnotations < ActiveRecord::Migration[5.2]\n ANNOTATABLES = [Case, TextBlock]\n\n def up\n add_column :content_annotations, :global_s...
ruby
chosen
[ { "from": "human", "value": "Add controller spec for Profiles::NotificationsController\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Profiles::NotificationsController do\n describe 'GET show' do\n it 'renders' do\n user = create_user\n sign_in(user)\n\n ge...
ruby
chosen
[ { "from": "system", "value": "Fix to last commit, split in the wrong place\n" }, { "from": "human", "value": "\nmodule Eshealth\n class ClusterConfig < Checkfactory\n \n attr_accessor :url, :configbody, :type, :lastmsg\n attr_reader :requestfactory\n\n def initialize(options={})\n ...
ruby
chosen
[ { "from": "system", "value": "Change pagination parameter for performance\n" }, { "from": "human", "value": "require 'active_support/time'\nrequire 'octokit'\n\nmodule Github\n module Nippou\n class UserEvents\n def initialize(client, user, since_date)\n @client = client\n ...
ruby
chosen
[ { "from": "system", "value": "Add another MacRuby extension to the URL class" }, { "from": "human", "value": "framework 'Foundation'\n\n# work around curb not building for MacRuby (ticket #941)\nHandsoap.http_driver = :net_http\n\nclass URL\n def initialize(url_string)\n @url = NSURL.URLWith...
ruby
chosen
[ { "from": "system", "value": "Refactor as class, add setup, and remove cruft\n" }, { "from": "human", "value": "module BenchTool\n # A structureless datastore; loads and persists to a YML file in a configured location\n module AppConfig\n\n CONFIG_DIR = File.expand_path('./config')\n CON...
ruby
chosen
[ { "from": "system", "value": "Format date-time into ISO 8601\n" }, { "from": "human", "value": "module Quickbooks\n module Service\n class CDC < BaseService\n\n \tdef url_for_cdc(models, start_time)\n\t entities = models.map {|model| model::XML_NODE}.join(',')\n\t changedSin...
ruby
chosen
[ { "from": "human", "value": "Add rake task to republish all related links\n\nSince https://github.com/alphagov/panopticon/pull/396 we're sending the\nrelated artefacts in the links hash to the publishing-api. This commit\nadds a rake task that republishes all the related links, so that the\npublishing-api i...
ruby
chosen
[ { "from": "system", "value": "Refactor asset tags builder to remove duplicate mess\n" }, { "from": "human", "value": "module Yarrow\n module HTML\n module AssetTags \n include Yarrow::Configurable\n\n # TODO: make sprockets manifest optional/pluggable\n def manifest\n ...
ruby
chosen
[ { "from": "system", "value": "Raise when a pod can't be found by name.\n" }, { "from": "human", "value": "module Pod\n class Resolver\n def initialize(specification)\n @specification = specification\n end\n\n def resolve\n @sets = []\n find_dependency_sets(@specification...
ruby
chosen
[ { "from": "system", "value": "Remove isolate_namespace to fix unresolved split_stylesheet_link_tag\n" }, { "from": "human", "value": "module CssSplitter\n class Engine < ::Rails::Engine\n isolate_namespace CssSplitter\n\n initializer 'css_splitter.sprockets_engine', after: 'sprockets.envi...
ruby
chosen
[ { "from": "system", "value": "Fix build - pass test files via ENV to avoid cached report path\n" }, { "from": "human", "value": "require 'knapsack'\nrequire 'rake/testtask'\n\nnamespace :knapsack do\n Rake::TestTask.new(:minitest_run) do |t|\n t.libs << 'test'\n t.test_files = Knapsack::A...
ruby
chosen
[ { "from": "system", "value": "Move handling the error into separate method.\n" }, { "from": "human", "value": "require 'thread'\nrequire 'hubble'\nrequire 'active_support/core_ext/class/attribute'\n\nmodule Travis\n class Hub\n class ErrorReporter\n class_attribute :queue\n attr_ac...
ruby
chosen
[ { "from": "system", "value": "Fix issues with dependency definitions\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'soulless/version'\n\nGem::Specification.new do |spec|\n spec.nam...
ruby
chosen
[ { "from": "system", "value": "Add dependency to active record\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'delayed/plugins/mutex/version'\n\nGem::Specification.new do |g...
ruby
chosen
[ { "from": "system", "value": "Refactor Lengthable length_min and length_max\n" }, { "from": "human", "value": "module Lengthable\n def length\n rand length_min..length_max\n end\n\n def length_min\n if min_no_max?\n min\n elsif max_no_min?\n if max < default_min\n lo...
ruby
chosen
[ { "from": "system", "value": "Fix test case declaration - Rails upgrade\n" }, { "from": "human", "value": "ENV[\"RAILS_ENV\"] = \"test\"\nrequire File.expand_path(File.dirname(__FILE__) + \"/../config/environment\")\nrequire 'test_help'\n\nclass Test::Unit::TestCase\n # Transactional fixtures a...
ruby
chosen
[ { "from": "system", "value": "Add minitest/pride because PRETTY COLOURS\n" }, { "from": "human", "value": "gem \"minitest\"\nrequire \"minitest/autorun\"\nrequire \"minitest/mock\"\nrequire \"minitest/stub_any_instance\"\nrequire 'coveralls'\nCoveralls.wear!\n\nrequire_relative \"../lib/udp2sqs_...
ruby
chosen
[ { "from": "system", "value": "Add a homepage to the gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\r\n\r\nGem::Specification.new do |s|\r\n s.name = \"digest-cksum\"\r\n s.summary = \"Unix cksum implementation\"\r\n s.author = \"Mal Clrambault\"\r\n s.email = \"mael@cle...
ruby
chosen
[ { "from": "system", "value": "Implement figfile object in rake\n" }, { "from": "human", "value": "require 'erb'\nrequire 'pathname'\ndesc 'Install Fig'\ntask :install do |task, args|\n base_dir = Pathname.new('.')\n puts \"Figsifying #{base_dir}/ ...\"\n locations = args.extras || \"applicati...
ruby
chosen
[ { "from": "system", "value": "Load Mongoid when being an Engine.\n" }, { "from": "human", "value": "require \"govuk_content_models/version\"\n\nmodule GovukContentModels\n class Engine < Rails::Engine\n end\nend\n" }, { "from": "gpt", "value": "require \"govuk_content_models/versio...
ruby
chosen
[ { "from": "system", "value": "Allow Test::Response access to the context.\n" }, { "from": "human", "value": "module Harbor\n module Test\n class Response < Harbor::Response\n\n attr_accessor :request\n\n ##\n # We redefine Harbor::Response.initialize(request) with an empty arg...
ruby
chosen
[ { "from": "human", "value": "Remove unused legacy columns from pages table\n" }, { "from": "gpt", "value": "# removes intermediary columns left over from moving data\nclass RemoveLegacyColumnsFromPage < ActiveRecord::Migration[5.2]\n def change\n remove_column :pageflow_pages, :legacy_templa...
ruby
chosen
[ { "from": "system", "value": "Update source location for Berkshelf 3.0\n" }, { "from": "human", "value": "require 'digest/sha1'\nrequire 'fileutils'\nrequire 'knife-solo/cookbook_manager'\nrequire 'knife-solo/tools'\n\nmodule KnifeSolo\n class Berkshelf\n include CookbookManager\n\n def s...
ruby
chosen
[ { "from": "system", "value": "Fix escaping of quotations in comment" }, { "from": "human", "value": "require \"interrogate/version\"\n\n# String?(\\\"Hello\\\")\n# Interrogate attempts to bring Scheme-like class predication to Ruby.\n# It provides an alternate syntax using Module#===\nmodule Int...
ruby
chosen
[ { "from": "human", "value": "Add unique index common_id on subscription / subscription_payments\n" }, { "from": "gpt", "value": "class AddUniqueIndexOnCommonIdAtSubscriptionsAndSubPayments < ActiveRecord::Migration\n def up\n execute %Q{\n create unique index uniq_common_id_at_subscriptio...
ruby
chosen
[ { "from": "system", "value": "Tidy up the require statements\n" }, { "from": "human", "value": "require_relative 'london_bike_hire_cli/application'\nrequire_relative 'london_bike_hire_cli/basic_renderer'\nrequire_relative 'london_bike_hire_cli/controller'\nrequire_relative 'london_bike_hire_cli/...
ruby
chosen
[ { "from": "system", "value": "Change from always executing `which wkhtmltopdf` to only executing it if the binary file's location is not explicitly stated in config.\n" }, { "from": "human", "value": "class PDFKit\n class Configuration\n attr_accessor :meta_tag_prefix, :wkhtmltopdf, :default...
ruby
chosen
[ { "from": "human", "value": "Use public_name on project index\n" }, { "from": "gpt", "value": "class AdjustFullTextIndexOnProjects < ActiveRecord::Migration\n def change\n execute %Q{\nCREATE OR REPLACE FUNCTION public.generate_project_full_text_index(project projects)\n RETURNS tsvector\n L...
ruby
chosen
[ { "from": "human", "value": "Add migration to confirm already confirmed email addresses\n" }, { "from": "gpt", "value": "class CopyConfirmedAtFromEnterprisesToSpreeUsers < ActiveRecord::Migration\n def up\n execute \"UPDATE spree_users SET confirmed_at = enterprises.confirmed_at FROM enterpr...
ruby
chosen
[ { "from": "system", "value": "Use methods instead of ivars.\n" }, { "from": "human", "value": "module Nmap\n #\n # Wraps a `uptime` XML element.\n #\n class Uptime < Struct.new(:seconds, :lastboot)\n\n #\n # Converts the uptime object to a String.\n #\n # @return [String]\n # ...
ruby
chosen
[ { "from": "system", "value": "Fix nginx default vhost spec\n" }, { "from": "human", "value": "require_relative '../../../../spec_helper'\n\ndescribe 'nginx::config::vhost::default', :type => :define do\n let(:title) { 'donkey' }\n let(:facts) do\n { :govuk_platform => 'production' }\n end\...
ruby
chosen
[ { "from": "system", "value": "Allow nils passed as an option to do nothing\n" }, { "from": "human", "value": "module ExpressTemplates\n module Macro\n\n def self.included(base)\n base.class_eval do\n extend ClassMethods\n include InstanceMethods\n end\n ...
ruby
chosen
[ { "from": "human", "value": "Support for properties in DSL\n" }, { "from": "gpt", "value": "module RCoLi\n \n module Properties\n \n def setter(name)\n define_method(name) do |value|\n ivar = \"@#{name}\"\n instance_variable_set(ivar, value)\n end\n end\n ...
ruby
chosen
[ { "from": "human", "value": "Add spec for dashboards controller\n" }, { "from": "gpt", "value": "describe DashboardsController do\n render_views\n \n describe \"Student dashboard\" do\n let(:course2) { FactoryGirl.create(:given_course)}\n \n before :all do\n @student = FactoryGi...
ruby
chosen
[ { "from": "system", "value": "Add homepage and summary information" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"dress_up/version\"\n\nGem::Specification.new do |s|\n s.name = \"dress_up\"\n s.version = DressUp:...
ruby
chosen
[ { "from": "system", "value": "Use subscription instead of user for counts\n" }, { "from": "human", "value": "class HomeController < ApplicationController\n def index\n @subscriber_count = User.count\n @story_count = Story.count\n @letter_count = Letter.count\n end\nend\n" }, { ...
ruby
chosen
[ { "from": "system", "value": "Fix for homepage and permissions when there are no images at all.\n" }, { "from": "human", "value": "# encoding: utf-8\n#\n# rshot (http://rshot.net) - a social digital photo gallery.\n# (c) 2011-2012 Raphael Kallensee\n#\n# This program is free software: you can re...
ruby
chosen
[ { "from": "system", "value": "Fix colour of environment label/favicon on staging\n" }, { "from": "human", "value": "GovukAdminTemplate.environment_style = ENV['RAILS_ENV']\n\nGovukAdminTemplate.configure do |c|\n c.app_title = 'Appointment Planner'\n c.show_flash = true\n c.show_signout = tru...
ruby
chosen
[ { "from": "system", "value": "Use help@obra.org for posts missing from email\n" }, { "from": "human", "value": "class FixEmailFrom < ActiveRecord::Migration\n def change\n Post.transaction do\n %w{ obra obrarace }.each do |list_name|\n if File.exists?(\"tmp/#{list_name}.txt\")\n ...
ruby
chosen
[ { "from": "human", "value": "Change questionnaire flags to explicit defaults\n" }, { "from": "gpt", "value": "class QuestionnaireFlagDefaults < ActiveRecord::Migration\n def self.up\n no_preview = Questionnaire.all(:conditions => { :allow_preview => false }).each\n\n change_column :questi...
ruby
chosen
[ { "from": "human", "value": "Add index to database_host (for metrics)\n" }, { "from": "gpt", "value": "Sequel.migration do\n no_transaction # indexes need to be created outside of the transaction\n\n up do\n Rails::Sequel.connection.run %{\n CREATE INDEX CONCURRENTLY \"users_database_h...
ruby
chosen
[ { "from": "system", "value": "Create helper for checking JSON responses\n" }, { "from": "human", "value": "module RequestsHelper\n # Format a HTTP header output.\n #\n # This method captializes the first letter of each word and after each hyphen.\n #\n # Example:\n #\n # cache-control ...
ruby
chosen
[ { "from": "system", "value": "Add timeslot mailer methods for cancellations\n\nAdd methods to timeslot mailer to issue emails to the affected student\nand tutor when a session is canceled by either of them.\n" }, { "from": "human", "value": "class TimeslotMailer < ApplicationMailer\n\n def tuto...
ruby
chosen
[ { "from": "system", "value": "Add filtering by tag logic to stories import\n" }, { "from": "human", "value": "class ImportStories\n require 'rss'\n require 'open-uri'\n\n def call(reset = false)\n cleanup if reset\n\n import_stories\n end\n\n private\n\n def cleanup\n Story.delete...
ruby
chosen
[ { "from": "human", "value": "Add SEGGER Embedded Studio for RISC-V V3.52a\n" }, { "from": "gpt", "value": "cask 'segger-embedded-studio-for-risc-v' do\n version '3.52a'\n sha256 '04b17efd94dec6505f4906007f2408b750903e497de36f91809dac162968595e'\n\n url \"https://www.segger.com/downloads/embed...
ruby
chosen