conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add now handles patterns as a special case.\nAdd_matching is now private.\n\n\ngit-svn-id: 6a2c20c72ceedae27ecedb68e90cd4f115192a7a@59 5af023f1-ac1a-0410-98d6-829a145c37ef\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\nmodule Rake\n class FileList < Arra...
ruby
chosen
[ { "from": "system", "value": "Handle Range with excluded end\n" }, { "from": "human", "value": "module ActiveRecord\n class PredicateBuilder\n\n def initialize(engine)\n @engine = engine\n end\n\n def build_from_hash(attributes, default_table)\n predicates = attributes.map do...
ruby
chosen
[ { "from": "system", "value": "Comment shows right number of products\n" }, { "from": "human", "value": "class HomeController < ApplicationController\n \n around_filter :shopify_session, :except => 'welcome'\n \n def welcome\n current_host = \"#{request.host}#{':' + request.port.to_s if re...
ruby
chosen
[ { "from": "human", "value": "Add spec tests for OpenConnect\n\nWe have logic in a template. So I'd be a lot happier if we had\npositive/negative tests for the desired behaviour.\n" }, { "from": "gpt", "value": "require_relative '../../../../spec_helper'\n\ndescribe 'openconnect', :type => :class...
ruby
chosen
[ { "from": "system", "value": "Fix passing of symbol to liquid template\n" }, { "from": "human", "value": "module RailsCoreExtensions\n module ActiveRecordLiquidExtensions\n def self.included(base)\n base.extend ClassMethods\n end\n end\n\n module ClassMethods\n def validates_liq...
ruby
chosen
[ { "from": "system", "value": "Remove ENV variable that is no longer used\n" }, { "from": "human", "value": "require 'extend/ENV'\nrequire 'formula'\n\nmodule Homebrew extend self\n def sh\n ENV.activate_extensions!\n\n if superenv?\n ENV.x11 = MacOS::X11.installed?\n ENV.deps = ...
ruby
chosen
[ { "from": "human", "value": "Add step definition to add files to Git\n" }, { "from": "gpt", "value": "World(Aruba::Api)\n\nGiven(/^an empty, committed file named \"(.*?)\"$/) do |file_name|\n write_file(file_name, \"\")\n in_current_dir do\n `git add \"#{file_name}\"`\n end\nend\n" } ]
ruby
chosen
[ { "from": "system", "value": "Correct format in footer actions\n" }, { "from": "human", "value": "def click_author_link_on_footer(author_name)\n link = current_page.footer.author_by_name(author_name)\n !link.nil? ? link.click : raise(\"Unable to find an author by name #{author_name}\")\nend\n\...
ruby
chosen
[ { "from": "system", "value": "Refactor: Add contracts to BuildReps stage\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Nanoc\n module Int\n class Compiler\n module Stages\n class BuildReps < Nanoc::Core::CompilationStage\n def initialize(site...
ruby
chosen
[ { "from": "system", "value": "Add route to toggle published status.\n" }, { "from": "human", "value": "Ecm::Downloads::Backend::Engine.routes.draw do\n backend_resources :download_categories\n backend_resources :downloads do\n member { get :download }\n end\n\n root to: 'home#index'\nend\...
ruby
chosen
[ { "from": "system", "value": "Use the plural for path helpers\n" }, { "from": "human", "value": "require \"sidekiq/web\"\n\nSidekiq::Web.use Rack::Auth::Basic do |_, password|\n ActiveSupport::SecurityUtils.secure_compare(\n ::Digest::SHA256.hexdigest(password),\n ::Digest::SHA256.hexdige...
ruby
chosen
[ { "from": "system", "value": "Add test 'can specialize owned key names'\n" }, { "from": "human", "value": "require 'test_helper'\n\ndescribe 'Redis::Breadcrumb' do\n before do\n redis = MockRedis.new\n\n Redis::Breadcrumb.redis = redis\n end\n\n it 'can specialize tracked_in key name' d...
ruby
chosen
[ { "from": "system", "value": "Add missing tests for questions controller under v1 api\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Hanuman::Api::V1::QuestionsController, type: :controller do\n routes { Hanuman::Engine.routes }\n\n it { expect(subject.class.superclass.na...
ruby
chosen
[ { "from": "system", "value": "Insert a brief sleep to allow all messages to be confirmed before message_count is called\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe Bunny::Channel do\n let(:connection) do\n c = Bunny.new(:user => \"bunny_gem\", :password => \"bunny_...
ruby
chosen
[ { "from": "system", "value": "Change API link to full technical guide\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'trove/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Add \"/admin\" prefix to path for article_manager\n" }, { "from": "human", "value": "require_dependency \"uramon_article_viewer/application_controller\"\nrequire \"faraday\"\n\nmodule UramonArticleViewer\n class ArticlesController < ::ApplicationController\n BAS...
ruby
chosen
[ { "from": "system", "value": "Fix issues with missing translation handling\n\nUpdates to I18n and ActionView seem to have changed the behaviour. We always need to provide the `raise: false` option to activate the custom exception handler.\n" }, { "from": "human", "value": "if defined?(ActionView...
ruby
chosen
[ { "from": "system", "value": "Add ModuleManager dependence to TAC Life." }, { "from": "human", "value": "class TACLifeSupport < Kosmos::Package\n title 'TAC Life Support (WIP)'\n aliases 'tac life support'\n url 'https://github.com/taraniselsu/TacLifeSupport/releases/download/Release_v0.8/Tac...
ruby
chosen
[ { "from": "system", "value": "Fix test Rails class exists\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Swagger\n module Docs\n module Generator\n # # Generate JSON file\n #\n # Create a json file for swagger-ui service\n #\n # @!attribut...
ruby
chosen
[ { "from": "system", "value": "Set a default return type to \"Text\"" }, { "from": "human", "value": "module Tritium\n module Parser\n module Instructions\n class Instruction\n @@tab = \" \"\n\n attr :filename\n attr :line_num\n attr :is_arg, true\n at...
ruby
chosen
[ { "from": "system", "value": "Remove sound and audio for success and reduce audio time to 5 seconds\n" }, { "from": "human", "value": "module Blinky\n module AutomatedArchitecture\n module SirenOfShame\n\n def success!\n # Ding! sound and fade lights for 10 seconds\n set_a...
ruby
chosen
[ { "from": "system", "value": "Fix for lbvserver_service_bind destroy issues\n" }, { "from": "human", "value": "require 'puppet/provider/netscaler_binding'\n\nPuppet::Type.type(:netscaler_lbvserver_service_bind).provide(:rest, parent: Puppet::Provider::NetscalerBinding) do\n def netscaler_api_ty...
ruby
chosen
[ { "from": "system", "value": "Add CORS header to api" }, { "from": "human", "value": "require 'grape-swagger'\n\nmodule Pushificator\n class V1 < Grape::API\n version 'v1', using: :path, vendor: 'pushificator'\n # Specific content type to set UTF-8 and avoid codification problems\n con...
ruby
chosen
[ { "from": "system", "value": "Make address a simple function of input property code (always same street for testing)\n" }, { "from": "human", "value": "class FeedbackSms\n\n attr_reader :text\n\n @@code_hash = { \"D\" => \"Demolish\", \"R\" => \"Rehab\", \"O\" => \"Other\", \"d\" => \"Demolish...
ruby
chosen
[ { "from": "system", "value": "Add polymorphic has_one to the Enforcer\n" }, { "from": "human", "value": "require 'consistency_fail'\n\nmodule ConsistencyFail\n class Enforcer\n def problems(models, introspector)\n problems = models.map do |m|\n [m, introspector.missing_indexes(m)...
ruby
chosen
[ { "from": "system", "value": "Fix email test output formating\n" }, { "from": "human", "value": "=begin rdoc\n=Description\nScaffolding for EmailConfiguration Model\n=end\nclass EmailConfigurationsController < ApplicationController\n before_filter :super_authenticate\n before_filter :get_cart\...
ruby
chosen
[ { "from": "system", "value": "Add test for generate namespaced integration test\n" }, { "from": "human", "value": "require \"generators/generators_test_helper\"\nrequire \"rails/generators/rails/integration_test/integration_test_generator\"\n\nclass IntegrationTestGeneratorTest < Rails::Generato...
ruby
chosen
[ { "from": "system", "value": "Install mailutils, required for tests of sys::mail\n" }, { "from": "human", "value": "Vagrant.configure(2) do |config|\n # install the Debian-provided Chef package\n # exim4-base is required as MTA for sudo test\n config.vm.provision 'shell', inline: <<-SHELL\n ...
ruby
chosen
[ { "from": "system", "value": "Use helper function instead of manually accessing the DOM to close tour.\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe 'application tours', type: :feature do\n\n before :each do\n @user = FactoryGirl.create :user\n end\n\n context 'main...
ruby
chosen
[ { "from": "system", "value": "Use the new interface for callback def.\n" }, { "from": "human", "value": "# @abstract Poor Man's version of a FlightAware client\n#\n# @author Ollivier Robert <ollivier.robert@eurocontrol.int>\n# @copyright 2015 by Ollivier Robert for ECTL\n\n# External modules\nre...
ruby
chosen
[ { "from": "human", "value": "Add Printer Pro Desktop v1.3.7\n" }, { "from": "gpt", "value": "cask :v1 => 'printer-pro-desktop' do\n version '1.3.7'\n sha256 '6baa80352c3756824972a6aac8ebdabebcc082f693018d04a7a95f062565e704'\n\n url \"https://support.readdle.com/ppd/PrinterProDesktop-#{version...
ruby
chosen
[ { "from": "system", "value": "Fix relation Model id convert bug.\n" }, { "from": "human", "value": "module Mongoid\n class Counter\n include Components\n end\n \n class Identity \n protected\n def generate_id\n table_name = @document.class.to_s.tableize\n o = Coun...
ruby
chosen
[ { "from": "human", "value": "Implement basic tests for datapoint and counter methods\n" }, { "from": "gpt", "value": "require \"minitest/unit\"\nrequire \"minitest/autorun\"\nrequire \"mocha/setup\"\nrequire_relative \"../lib/daliagraphite\"\n\nclass DaliaGraphiteTest < MiniTest::Unit::TestCase\...
ruby
chosen
[ { "from": "system", "value": "Add :charset and :encoding options\n\nSigned-off-by: Piotr Usewicz <2c0eb4a25a7cde333ff2d0860cb06051925fd74f@layer22.com>" }, { "from": "human", "value": "module Rails\n module SequelConnection\n # Load configuration for current environment\n CONFIG = YAML::l...
ruby
chosen
[ { "from": "system", "value": "Configure hutch to use rails logger\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nnamespace :mnemosyne do\n desc 'Run hutch and consume messages from clients'\n task consume: :environment do\n require 'hutch'\n require 'hutch/cli'\n\n ...
ruby
chosen
[ { "from": "system", "value": "Use sanitize_sql according to the documentation\n" }, { "from": "human", "value": "require \"spec_helper\"\n\nmodule Scanny::Checks::Sql\n describe SanitizeCheck do\n before do\n @runner = Scanny::Runner.new(SanitizeCheck.new)\n @message = \"Use of ex...
ruby
chosen
[ { "from": "system", "value": "Upgrade cap dependency (required for previous_revision variable)\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'capistrano/hipchat/version'\n\nGem::Spe...
ruby
chosen
[ { "from": "system", "value": "Fix broken test for unlock instructions\n\nThere were some extra assertions left over from Devise's use of mocks that no\nlonger make sense.\n" }, { "from": "human", "value": "require 'spec_helper'\ndescribe 'devise/mailer/unlock_instructions.html.haml', :type => \"...
ruby
chosen
[ { "from": "system", "value": "Add required frameworks in podspec\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"Foursquare-API-v2\"\n s.version = \"1.4.3\"\n s.summary = \"Objective-C Foursquare API v2. With native authorisation now.\"\n s.homepage ...
ruby
chosen
[ { "from": "system", "value": "Remove redundant `self.` from article repository\n" }, { "from": "human", "value": "class ArticleRepository\n class ArticleNotFound < StandardError; end\n\n REPOSITORY = Rails.root.join('content')\n\n def initialize(repository = REPOSITORY)\n @repository = Pat...
ruby
chosen
[ { "from": "system", "value": "Refactor code quality reporting logic in CLI class\n" }, { "from": "human", "value": "require 'thor'\n\nmodule CodeclimateCi\n class CLI < Thor\n method_option :codeclimate_api_token, required: true\n method_option :repo_id, required: true\n method_option ...
ruby
chosen
[ { "from": "system", "value": "Revert \"Typo in hook declaration\"\n\nThis reverts commit a41d3a1723ccfbdff1a485dea394affe25df7039.\n" }, { "from": "human", "value": "class CoreChargesHooks < Spree::ThemeSupport::HookListener\n\n insert_bottom :admin_product_form_right do\n '<%= f.label :core...
ruby
chosen
[ { "from": "system", "value": "Update TG Pro.app to v2.8.5\n" }, { "from": "human", "value": "cask :v1 => 'tg-pro' do\n version '2.8.4'\n sha256 'e574e92e411b694f19c9a1ac0583361187f428524987d6a220ea82d39d64ac46'\n\n url \"http://www.tunabellysoftware.com/resources/TGPro_#{version.gsub('.','_')...
ruby
chosen
[ { "from": "system", "value": "Fix already initialized constant VERSION warning\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/gemgen/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Martin Chabot\"]\n gem.email ...
ruby
chosen
[ { "from": "system", "value": "Make BPE menu tab selected\n" }, { "from": "human", "value": "Deface::Override.new(:virtual_path => \"spree/admin/shared/_product_sub_menu\",\n :name => \"add_bulk_edit_tab_to_products_admin_sub_menu\",\n :insert_bottom => \"[...
ruby
chosen
[ { "from": "system", "value": "Add validations to Conversation model\n" }, { "from": "human", "value": "class Conversation < ApplicationRecord\n belongs_to :sender, class_name: 'User', foreign_key: :sender_id\n belongs_to :recipient, class_name: 'User', foreign_key: :recipient_id\n belongs_to ...
ruby
chosen
[ { "from": "system", "value": "Add development dependencies to gemspec" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'csv2avro/version'\n\nGem::Specification.new do |spec|\n spec.name...
ruby
chosen
[ { "from": "system", "value": "Add missing require to use Set\n" }, { "from": "human", "value": "require 'active_model/mass_assignment_security/sanitizer'\n\nmodule ActiveModel\n module MassAssignmentSecurity\n class PermissionSet < Set\n attr_accessor :logger\n\n def +(values)\n ...
ruby
chosen
[ { "from": "system", "value": "Add license format, disable ARC and add deployment targets to podspec\n\nAlso fixes format of tag version string. Passes `pod spec lint` validation." }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'Expecta'\n s.version = '0.2.4'\n s.license ...
ruby
chosen
[ { "from": "system", "value": "Fix class init test - `expected` was mixed with `actual`\n" }, { "from": "human", "value": "require './task_1.rb'\nrequire 'minitest/autorun'\n\nclass Task1Test < Minitest::Test\n def setup\n @money = Money.new(10, 'USD')\n end\n\n def teardown\n end\n\n def...
ruby
chosen
[ { "from": "human", "value": "Add code wars (7) - doggy daycare\n" }, { "from": "gpt", "value": "# http://www.codewars.com/kata/56951add53eccacf44000030/\n# --- iteration 1 ---\nclass Dog\n def check_dog\n case [vaccinated, wormed].count(true)\n when 1 then \"#{name} can only be accepted b...
ruby
chosen
[ { "from": "system", "value": "Update SDWebImage to Version 3.6 from 3.5.2\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'MHVideoPhotoGallery'\n s.version = '1.6'\n s.license = 'MIT'\n s.homepage = 'https://github.com/mariohahn/MHVideoPhotoGallery'\n...
ruby
chosen
[ { "from": "system", "value": "Add compare-locales via easy_install for Firefox\n" }, { "from": "human", "value": "\nuser = node[:settings][:user]\n\nexecute \"apt-get-update\" do\n command \"apt-get update\"\nend\n\n%w{ant ant-contrib autoconf autoconf2.13 autopoint bison cmake expect libtool l...
ruby
chosen
[ { "from": "system", "value": "Add devise helpers to tests\n" }, { "from": "human", "value": "ENV[\"RAILS_ENV\"] ||= \"test\"\nrequire File.expand_path('../../config/environment', __FILE__)\nrequire 'rails/test_help'\n\nclass ActiveSupport::TestCase\n ActiveRecord::Migration.check_pending!\n\n ...
ruby
chosen
[ { "from": "human", "value": "Add Adobe CC Cleaner Tool\n" }, { "from": "gpt", "value": "cask :v1 => 'adobe-creative-cloud-cleaner-tool' do\n version :latest\n sha256 :no_check\n\n # macromedia.com is the official download host per the vendor homepage\n url 'https://download.macromedia.com/Su...
ruby
chosen
[ { "from": "human", "value": "Add \"Air Video Server HD\" 1.0.15\n" }, { "from": "gpt", "value": "class AirVideoServerHd < Cask\n version '1.0.15'\n sha256 '06fa8089a3cc7ba7e6386aff9bab5f5827fc4add47ff4021e00d82b1d7a432b8'\n\n url \"https://s3.amazonaws.com/AirVideoHD/Download/Air+Video+Server...
ruby
chosen
[ { "from": "system", "value": "Upgrade YubiKey NEO Manager.app to v1.3.0\n" }, { "from": "human", "value": "cask :v1 => 'yubikey-neo-manager' do\n version '1.1.0'\n sha256 '3af16efa1ac02ea4244cf906d8d63d98e4b867b3f4ceaed668d405bd6d2b809e'\n\n url \"https://developers.yubico.com/yubikey-neo-man...
ruby
chosen
[ { "from": "system", "value": "Bump podspec version to 2.0.0-alpha.2\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"Hydrant\"\n s.version = \"2.0.0-alpha\"\n s.summary = \"A simple data mapper / object serializer for objective-...
ruby
chosen
[ { "from": "system", "value": "Change example to use cli exec\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'tty-command'\n\ncmd = TTY::Command.new\n\nstdin = StringIO.new\nstdin.puts \"hello\"\nstdin.puts \"world\"\nstdin.rewind\n\nout, _ = cmd.run(:cat, :in => stdin)\n\nputs \...
ruby
chosen
[ { "from": "system", "value": "Fix cukes, allow email pref update\n" }, { "from": "human", "value": "class Users::EmailPreferencesController < AuthenticateByUnsubscribeTokenController\n helper_method :any_memberships_have_volume_email?\n skip_before_filter :boot_angular_ui, only: :edit\n\n def...
ruby
chosen
[ { "from": "system", "value": "Remove version library from gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/ferrety_ferret/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Mark Tabler\\n\"]\n gem.email ...
ruby
chosen
[ { "from": "human", "value": "Add code wars (7) - share prices\n" }, { "from": "gpt", "value": "# http://www.codewars.com/kata/5603a4dd3d96ef798f000068/\n# --- iteration 1 ---\ndef share_price(invested, changes)\n \"%.2f\" % changes.reduce(invested) { |acc, el| acc += (acc * el.fdiv(100)) }\nend...
ruby
chosen
[ { "from": "system", "value": "Add current_user to API finded by token" }, { "from": "human", "value": "module Pushificator\n class V1 < Grape::API\n version 'v1', using: :path, vendor: 'pushificator'\n # Specific content type to set UTF-8 and avoid codification problems\n content_type ...
ruby
chosen
[ { "from": "system", "value": "Add guid if none using link content.\n" }, { "from": "human", "value": "require 'nokogiri'\n\ndef feed(input)\n doc = Nokogiri::XML(input){|x| x.noblanks }\n doc.to_xml(:indent => 2)\nend\n\n\nif $0 == __FILE__\n puts feed(ARGF)\nend\n" }, { "from": "gpt"...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary magic encoding comment\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire File.expand_path('../lib/version', __FILE__)\n\nGem::Specification.new do |s|\n s.name = \"twingly-url\"\n s.version = Twingly::URL::VERSION\n s.p...
ruby
chosen
[ { "from": "system", "value": "Check to see if scripture reference includes the passed verse\n" }, { "from": "human", "value": "class ScriptureReference < ActiveRecord::Base\n attr_accessible :start_verse, :end_verse\n\n REFERENCE_FORMAT = /^(\\d+)(?::(\\d+))?(?::(\\d+))?$/ #http://rubular.com/...
ruby
chosen
[ { "from": "system", "value": "Make sure the hashed_path is set in the migration\n" }, { "from": "human", "value": "class AddHashedPathToRepositories < ActiveRecord::Migration\n def self.up\n transaction do\n add_column :repositories, :hashed_path, :string\n add_index :repositories,...
ruby
chosen
[ { "from": "human", "value": "Add migration to associate stores with orders.\n\nThis does the same job as the existing\nsolidus:migrations:ensure_store_on_orders:up rake task, but is a\nmigration so that it is easier to run.\n" }, { "from": "gpt", "value": "class EnsureStoreOnOrders < ActiveRecor...
ruby
chosen
[ { "from": "system", "value": "Test for idempotency in spec:system.\n" }, { "from": "human", "value": "require 'spec_helper_system'\n\ndescribe 'basic tests' do\n it 'class should work without errors' do\n pp = <<-EOS\n class { 'gds_accounts':\n purge_ignore => ['vagrant', 'vboxad...
ruby
chosen
[ { "from": "system", "value": "Use snake_case for key names\n" }, { "from": "human", "value": "require 'mollie-api-ruby'\n\nbegin\n payment = Mollie::Payment.create(\n amount: { value: '10.0', currency: 'EUR' },\n description: 'My first payment',\n redirectUrl: 'https://webshop.exa...
ruby
chosen
[ { "from": "system", "value": "Fix migration for person to user migration\n" }, { "from": "human", "value": "class MigrateDataPersonToUser < ActiveRecord::Migration\n class TempPerson < ActiveRecord::Base\n self.table_name = 'people'\n end\n\n class TempUser < ActiveRecord::Base\n self.t...
ruby
chosen
[ { "from": "system", "value": "Clear out marks before running\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\nbegin\n require 'flog'\nrescue LoadError\n puts \"Install flog!\\ngem install flog\"\n exit 1\nend\n\nCOMPLEXITY_WARNING_THRESHOLD = 25\n\nif ARGV.include? '-d'\n require 'f...
ruby
chosen
[ { "from": "system", "value": "Fix podspec source_files & headers config; Bump version to 2.0.1\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"TTGTagCollectionView\"\n s.version = \"2.0.0\"\n s.summary = \"Show rich style text tags or custom ...
ruby
chosen
[ { "from": "system", "value": "Change query to not use a transaction\n" }, { "from": "human", "value": "class PopulateEditionsPart1 < ActiveRecord::Migration[5.0]\n def up\n execute \"UPDATE content_items SET document_id = (\n SELECT id FROM documents\n WHERE docum...
ruby
chosen
[ { "from": "system", "value": "Add a description to the 'deploy' task.\n" }, { "from": "human", "value": "require 'deployml/project'\n\nnamespace :deploy do\n task :project do\n @project = DeploYML::Project.new(Dir.pwd)\n end\n\n desc 'Downloads the project'\n task :download => :project do...
ruby
chosen
[ { "from": "system", "value": "Add email (and tokenized email parts) to dictionary only when non-nil\n" }, { "from": "human", "value": "require 'devise_zxcvbn/email_tokeniser'\n\nmodule Devise\n module Models\n module Zxcvbnable\n extend ActiveSupport::Concern\n\n delegate :min_pass...
ruby
chosen
[ { "from": "human", "value": "Add real account and parody account for News topic listings\n\n- Create one Topic \"News\"\n- Add real and fake accounts for CNN, BBC Sports, and The Onion\n- Each account listing is linked to the \"News\" topic\n" }, { "from": "gpt", "value": "topic = Topic.create!(...
ruby
chosen
[ { "from": "system", "value": "Revert \"A temp commit to test random failures\"\n\nThis reverts commit 0331336e77a919cfd6c45826eab143a80fa1e2c3.\n\nSigned-off-by: Andrew Su <6d7ded18778d8f6854a418786d073050217e1502@pivotal.io>\n" }, { "from": "human", "value": "require_relative '../../spec_helper...
ruby
chosen
[ { "from": "human", "value": "Add caching specs for Problems::SummaryComponent\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nrequire \"rails_helper\"\n\ndescribe Renalware::Problems::SummaryComponent, type: :component do\n let(:user) { create(:user) }\n let(:patient) { creat...
ruby
chosen
[ { "from": "system", "value": "Use member_of for helper methods" }, { "from": "human", "value": "module GroupsHelper\n\n def show_join_group_button?(person, group)\n if person == nil\n true\n else\n Membership.pluck(:group_id).include?(group.id) == false\n end\n end\n\n def ...
ruby
chosen
[ { "from": "system", "value": "Update podspec with new version" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"Whisper\"\n s.summary = \"Whisper is a component that will make the task of display messages and in-app notifications simple.\"\n s.version ...
ruby
chosen
[ { "from": "system", "value": "Return the raw TaskQueue::Task when using `add_build_runner`\n" }, { "from": "human", "value": "require_relative \"../features/build_runner/fastlane_build_runner\"\n\nmodule FastlaneCI\n # Responsible for\n # - Manage all `TestRunner` objects that are active (eith...
ruby
chosen
[ { "from": "system", "value": "Add timeout to eviction code\n" }, { "from": "human", "value": "# Keep track of all JWTs created incase we need to revoke them later (before the\n# expiration date).\nclass TokenIssuance < ApplicationRecord\n belongs_to :device\n after_destroy :maybe_evict_clients...
ruby
chosen
[ { "from": "system", "value": "Discard options that are not valid for the configure script\n" }, { "from": "human", "value": "# gem_config.rb - This script is executed by the gem command\n# to generate the top-level RMagick Makefile. Ref: rmagick.gemspec\n\n# The gem command calls us with s...
ruby
chosen
[ { "from": "system", "value": "Add prompt to effective_email_templates:regenerate_default_views rake task\n" }, { "from": "human", "value": "namespace :effective_email_templates do\n desc 'Import email templates from the filesystem to the database. This rake task does not overwrite existing data...
ruby
chosen
[ { "from": "system", "value": "Fix bug in spec configuration\n\nThe spec flag should have been switched to true. Oops.\n" }, { "from": "human", "value": "require \"minitest-rails\"\nrequire \"generators/minitest\"\n\nmodule Minitest\n module Generators\n class FeatureGenerator < Base\n\n ...
ruby
chosen
[ { "from": "system", "value": "Make snapshot name more unique\n" }, { "from": "human", "value": "module VagrantPlugins\n\n module ProviderVirtualBox\n\n module Driver\n\n class Base\n\n def snapshot_take\n execute(\"snapshot\", @uuid, \"take\...
ruby
chosen
[ { "from": "system", "value": "Hide acknowledged Nagios warnings by default\n" }, { "from": "human", "value": "require 'nagiosharder'\n\nclass Nagios < Dashing::Job\n class Counter\n def initialize(config)\n @crit_count = Nagios.criticals.count\n @warn_count = Nagios.warnings.count...
ruby
chosen
[ { "from": "system", "value": "Allow nil external_id on Proposition.\n" }, { "from": "human", "value": "class Proposition < ActiveRecord::Base\n attr_accessible :description, :on_behalf_of, :body, :representative_id\n\n belongs_to :vote\n belongs_to :representative\n\n alias_method :delivered...
ruby
chosen
[ { "from": "system", "value": "Kill mutations in state methods\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'promise/version'\n\nrequire 'promise/callback'\nrequire 'promise/progress'\n\nclass Promise\n Error = Class.new(RuntimeError)\n\n include Promise::Progress\n\n attr_r...
ruby
chosen
[ { "from": "system", "value": "Use sassc instead of sass\n" }, { "from": "human", "value": "require \"json\"\nrequire \"sinatra\"\nrequire \"sinatra/json\"\nrequire \"slim\"\nrequire \"sass\"\n\nrequire \"rubulex/version\"\nrequire \"rubulex/app\"\nrequire \"rubulex/regexp_parser\"\n\nmodule Rubu...
ruby
chosen
[ { "from": "system", "value": "Use article in the params again and fix the status response\n" }, { "from": "human", "value": "# open API to create articles\nclass Api::ArticlesController < ApplicationController\n skip_before_action :verify_authenticity_token\n before_action :log_request, :check...
ruby
chosen
[ { "from": "system", "value": "Change oracle_text and flavor_text to be db column type 'text' instead of 'string'\n" }, { "from": "human", "value": "class CreateMtgCards < ActiveRecord::Migration\n def self.up\n create_table :mtg_cards do |t|\n t.string :name\n t.string :gat...
ruby
chosen
[ { "from": "system", "value": "Test for succesful webservice call added" }, { "from": "human", "value": "# require 'assignment_helper'\nrequire 'rails_helper'\ninclude AssignmentHelper\n\ndescribe LotteryController do\n describe \"#run_intelligent_bid\" do\n it \"the assignment is intelligent...
ruby
chosen
[ { "from": "system", "value": "Add created_at to xls export\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass GenerateRegistrationsXlsJob < ApplicationJob\n queue_as :default\n\n def perform(event_id)\n event = Event.find(event_id)\n\n event.update!(export_status: ...
ruby
chosen
[ { "from": "system", "value": "Update activesupport requirement from >= 4.2, < 6 to >= 4.2, < 7\n\nUpdates the requirements on [activesupport](https://github.com/rails/rails) to permit the latest version.\n- [Release notes](https://github.com/rails/rails/releases)\n- [Changelog](https://github.com/rails/rail...
ruby
chosen
[ { "from": "system", "value": "Fix commit message HTML escaping\n\nFixes #76\n" }, { "from": "human", "value": "module StacksHelper\n\n def render_commit_message(commit)\n url = commit.pull_request_url || github_commit_url(commit.stack.repo_owner, commit.stack.repo_name, commit.sha)\n mess...
ruby
chosen
[ { "from": "system", "value": "Fix display window format on destination list\n" }, { "from": "human", "value": "json.extract! destination, :id, :name, :street, :postalcode, :city, :lat, :lng, :quantity, :open, :close\njson.tags do\n json.array! destination.tags.collect{ |t| t.id }\nend\n" }, ...
ruby
chosen
[ { "from": "system", "value": "Check if user is signed\n" }, { "from": "human", "value": "class PlacePolicy < ApplicationPolicy\n class Scope < Scope\n def resolve\n if user.admin?\n scope.all\n else\n scope.approved\n end\n end\n end\n\n def update?\n use...
ruby
chosen
[ { "from": "system", "value": "Use two queries to get latest_updated_at for linkables\n\nQuerying on a single document_type yields a significantly faster result\nthan two, so two queries beat one.\n" }, { "from": "human", "value": "module Queries\n LinkablePresenter = Struct.new(:content_id, :ti...
ruby
chosen