conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Add a JIRA timetrap formatter\n" }, { "from": "gpt", "value": "require File.join('timetrap','formatters','text')\nmodule Timetrap\n module Formatters\n\n class Jira < Text\n def initialize entries\n entries.map do |e|\n hours, minutes = Time....
ruby
chosen
[ { "from": "system", "value": "Support legacy name param in stops controller" }, { "from": "human", "value": "class Api::StopsController < ApplicationController\n def index\n searcher = StopSearcher.new(params)\n if searcher.valid?\n render json: searcher.results\n else\n ren...
ruby
chosen
[ { "from": "system", "value": "Use modified xml only if filter is applied\n\nSigned-off-by: Chris Dutra <7eb54fc324f04033595eb420f2ee7c112fb7259e@pivotal.io>\n" }, { "from": "human", "value": "require 'oga'\n\nmodule VSphereCloud\n module SdkHelpers\n class LogFilter\n\n FILTERS = [\n ...
ruby
chosen
[ { "from": "system", "value": "Set secret_key_base to quiet another warning.\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\n# Your secret key for verifying the integrity of signed cookies.\n# If you change this key, all old signed cookies will be...
ruby
chosen
[ { "from": "system", "value": "Update migrations to support Rails 5.1\n" }, { "from": "human", "value": "class AddUnconfirmedEmailToSpreeUsers < ActiveRecord::Migration[5.2]\n def change\n unless column_exists?(:spree_users, :unconfirmed_email)\n add_column :spree_users, :unconfirmed_ema...
ruby
chosen
[ { "from": "system", "value": "Update summary and email for 0.0.10 release\n" }, { "from": "human", "value": "$:.unshift(File.dirname(__FILE__) + '/lib')\nrequire 'knife-acl/version'\n\nGem::Specification.new do |s|\n s.name = 'knife-acl'\n s.version = KnifeACL::VERSION\n s.platform = Gem::Pla...
ruby
chosen
[ { "from": "system", "value": "Fix sample api did not find a shared collection\n" }, { "from": "human", "value": "module Chemotion\n class SampleAPI < Grape::API\n # TODO ensure user is authenticated\n\n resource :samples do\n\n #todo: more general search api\n desc \"Return seri...
ruby
chosen
[ { "from": "system", "value": "Allow blank reason for testing\n" }, { "from": "human", "value": "class SupervisorReport < ApplicationRecord\n has_paper_trail\n\n REASONS_FOR_TEST = ['Post-Accident', 'Reasonable Suspicion']\n TESTING_FACILITIES = [\n 'Occuhealth East Longmeadow',\n 'Occuh...
ruby
chosen
[ { "from": "system", "value": "Remove fake discourse_comments_count from projects\n" }, { "from": "human", "value": "attributes :id,\n :title,\n :county,\n :discourse_url,\n :comments_count\n\nif root_object.edition.show_results == true\n attributes :score...
ruby
chosen
[ { "from": "system", "value": "Return ‘large’ image version as default url.\n" }, { "from": "human", "value": "collection @images\n\nnode(:url) { |p| p.file.url }\nnode(:thumbnail_url) { |p| p.file.thumbnail.url }\nattribute :description\n" }, { "from": "gpt", "value": "collection @im...
ruby
chosen
[ { "from": "system", "value": "Stop requiring rubygems, for those folks who don't use it" }, { "from": "human", "value": "require 'rubygems'\nrequire 'activesupport'\nrequire 'nokogiri'\n\nrequire 'uri'\n\nrequire 'active_api/builder'\nrequire 'active_api/has_definition'\nrequire 'active_api/coll...
ruby
chosen
[ { "from": "system", "value": "Remove useless assignment for rubocop\n" }, { "from": "human", "value": "class ScsbLookup\n include Scsb\n\n def find_by_id(id)\n response = items_by_id(id)\n response.map { |r| [r['itemBarcode'], r] }.to_h\n rescue Faraday::ConnectionFailed => connection_f...
ruby
chosen
[ { "from": "system", "value": "Use shared spec included with library.\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'support/enumeration_sharedspec'\n\ndescribe <%= enumeration_class %> do\n\n it_should_behave_like 'an Enumeration'\n\n def self.keys\n %w(\n <% keys_and...
ruby
chosen
[ { "from": "system", "value": "Add project_store file to require statements\n" }, { "from": "human", "value": "require \"foofoberry/version\"\nrequire \"foofoberry/client\"\nrequire \"foofoberry/github_notification\"\nrequire \"foofoberry/project\"\n\nmodule Foofoberry\n # Your code goes here......
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary data guard from Value" }, { "from": "human", "value": "module Rico\n class Value\n include Rico::Object\n\n # Gets the value of the object\n #\n # Returns the deserialized value\n def get\n (data || {})[\"_value\"]\n end\n\...
ruby
chosen
[ { "from": "system", "value": "Add a TODO, fix some whitespace\n" }, { "from": "human", "value": "require 'rss'\nrequire 'open-uri'\n\nclass RssLoader\n def load\n purge_existing_data()\n load_data_from_rss_feed()\n end\n\n private\n\n def purge_existing_data\n Channel.de...
ruby
chosen
[ { "from": "system", "value": "Stop using Ruby 2.0 keyword arguments completely\n\nI'd like to have this parsed by Code Climate and it uses ruby_parser,\nwhich cannot parse the file as it is now.\n" }, { "from": "human", "value": "require 'httparty'\nrequire 'nokogiri'\n\nmodule Snoop\n class Ht...
ruby
chosen
[ { "from": "system", "value": "Mark Verso::Base as abstract in doc\n" }, { "from": "human", "value": "# A wrapper for the Virginia CTE Resource Center's Web API, providing access\n# to Virginia's Career and Technical Education curriculum, course, and\n# occupation data.\n#\n# @see http://api.cter...
ruby
chosen
[ { "from": "system", "value": "Modify to return empty array if consul kv parameters are nil.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# Copyright 2014 TIS Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in complia...
ruby
chosen
[ { "from": "human", "value": "Add implementation of nineteenth rule of disambiguator prefix\n" }, { "from": "gpt", "value": "module Sastrawi\n module Morphology\n module Disambiguator\n class DisambiguatorPrefixRule19\n def disambiguate(word)\n contains = /^memp([abcdfghi...
ruby
chosen
[ { "from": "system", "value": "Use tmpfs volume for builds directory. There is no real reason not to and it makes Ruby on Rails test suite FLY BABY FLY\n" }, { "from": "human", "value": "default[:travis_build_environment][:hosts] = Hash.new\ndefault[:travis_build_environment][:buil...
ruby
chosen
[ { "from": "system", "value": "Replace nbsp with spaces instead of removing" }, { "from": "human", "value": "require 'nokogiri'\n\nclass ConfluencePage\n \n def initialize(response)\n @doc = Nokogiri(response)\n end\n \n def title\n @doc.at('#content-title')[:value]\n end\n \n def c...
ruby
chosen
[ { "from": "system", "value": "Make \"and\" and \"or\" short circuit\n" }, { "from": "human", "value": "\nclass Flor::Pro::Logo < Flor::Procedure\n #\n # \"and\" has higher precedence than \"or\"\n\n names %w[ and or ]\n\n def pre_execute\n\n @node['rets'] = []\n end\n\n def receive_last...
ruby
chosen
[ { "from": "human", "value": "Add factory file that lucked previous commit\n" }, { "from": "gpt", "value": "# -*- coding: utf-8 -*-\n# Copyright 2014 TIS Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License...
ruby
chosen
[ { "from": "system", "value": "Raise deprecated major version to 7.0\n" }, { "from": "human", "value": "# frozen_string_literal: true\nmodule Alchemy\n Deprecation = ActiveSupport::Deprecation.new(\"6.0\", \"Alchemy\")\nend\n" }, { "from": "gpt", "value": "# frozen_string_literal: tr...
ruby
chosen
[ { "from": "system", "value": "Remove the help link in the error message.\n" }, { "from": "human", "value": "# Copyright (c) 2010 ThoughtWorks Inc. (http://thoughtworks.com)\n# Licenced under the MIT License (http://www.opensource.org/licenses/mit-license.php)\n\nmodule Oauth2\n module Provider\...
ruby
chosen
[ { "from": "system", "value": "Make setups and teardowns accessors protected methods\n" }, { "from": "human", "value": "require 'microspec/spec'\n\nmodule Microspec\n class Scope\n def description\n @_description\n end\n\n def parent\n @_parent\n end\n\n def setups\n ...
ruby
chosen
[ { "from": "system", "value": "Check for subclasses of Neography::Node and not just an instance." }, { "from": "human", "value": "module Neography\n module Index\n\n def self.included(base)\n base.extend(ClassMethods)\n end\n \n def add_to_index(index, key, value, unique = false)\...
ruby
chosen
[ { "from": "system", "value": "Remove setup method and alias to extended\n" }, { "from": "human", "value": "# encoding: utf-8\n\n# Module that adds descendant tracking to a class\nmodule DescendantsTracker\n\n # Return the descendants of this class\n #\n # @example\n # descendants = ParentC...
ruby
chosen
[ { "from": "system", "value": "Support brackets in '(was ...)' substitution\n" }, { "from": "human", "value": "require 'sequel'\n\nmodule PGQuilter\n class Topic < Sequel::Model\n one_to_many :patchsets\n\n SUBJECT_WAS_RE = /.*\\(\\s*was:?\\s*([^)]+)\\s*\\)/\n\n def self.active\n s...
ruby
chosen
[ { "from": "system", "value": "Fix bug from improper handling of raketask string\n" }, { "from": "human", "value": "module Postamt\n class Railtie < Rails::Railtie\n railtie_name \"postamt\"\n\n attr_accessor :running_in_rake\n rake_tasks do\n self.running_in_rake = true\n end\n...
ruby
chosen
[ { "from": "system", "value": "Fix sha sum for Poedit\n" }, { "from": "human", "value": "cask :v1 => 'poedit' do\n\n if MacOS.release <= :snow_leopard\n version '1.5.7'\n sha256 '2017538011239f07924b709e4c13aa3fd7f83a96f76208b8b746fcee29251caf'\n\n url \"http://poedit.net/dl/poedit-#{ve...
ruby
chosen
[ { "from": "system", "value": "Switch plek 'data' lookup for app name of 'imminence'\n" }, { "from": "human", "value": "require 'webmock'\nrequire 'webmock/cucumber'\n\ninclude WebMock::API\n\nWebMock.disable_net_connect!\n\nBefore do\n # Mock out all publisher URLs\n stub_request(:get, %r{^#{R...
ruby
chosen
[ { "from": "system", "value": "Add Admin Check for Email Addresses\n\nAdd a method to check 2 specific email addresses of the owners for admin\naccess.\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n protect_from_forgery\n\n helper_method :is_editing?\n...
ruby
chosen
[ { "from": "system", "value": "Update Xamarin Studio to v5.7.0.660-0\n" }, { "from": "human", "value": "cask :v1 => 'xamarin-studio' do\n version '5.5.0.227-0'\n sha256 '4c05b5174fd1d2eacef44f2f96557fc213f25381ad0ea3c139612217a20e8d46'\n\n url \"http://download.xamarin.com/studio/Mac/XamarinSt...
ruby
chosen
[ { "from": "system", "value": "Make it possible to run tools on a single file.\n" }, { "from": "human", "value": "require_relative \"source_file\"\nrequire \"pathname\"\n\nmodule Subjects\n class Project\n attr_reader :root\n\n def initialize(root)\n @root = root\n end\n\n def f...
ruby
chosen
[ { "from": "system", "value": "Use null_session when protecting from forgery\n\nThis is an API after all, so we should follow the advice.\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n # Prevent CSRF attacks by raising an exception.\n # For APIs, you m...
ruby
chosen
[ { "from": "system", "value": "Use Lines as the default ActiveRecord::Base logger\n" }, { "from": "human", "value": "require 'active_record'\nrequire 'lines'\n\nmodule Lines\n class ActiveRecordSubscriber < ActiveSupport::LogSubscriber\n def sql(event)\n payload = event.payload\n\n ...
ruby
chosen
[ { "from": "system", "value": "Remove duplicate log path generation\n" }, { "from": "human", "value": "namespace :sidekiq do\n desc \"GITLAB | Stop sidekiq\"\n task :stop do\n system \"bundle exec sidekiqctl stop #{pidfile}\"\n end\n\n desc \"GITLAB | Start sidekiq\"\n task :start => :res...
ruby
chosen
[ { "from": "system", "value": "Send an optional local database id with the activation request\n" }, { "from": "human", "value": "require 'her'\n\nmodule Userbin\n class Model\n include Her::Model\n end\n\n class User < Model; end\n\n class Token < Model;\n has_one :identity\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Put words in an array\n" }, { "from": "human", "value": "load \"#{Rails.root}/lib/ladder.rb\"\n\nclass HomeController < ApplicationController\n\tdef index\n\t\tdsize = dictionary.size\n\t\t@start_word = dictionary[rand(dsize)]\n\t\t@end_word = dictionary[rand(dsize)...
ruby
chosen
[ { "from": "system", "value": "Package version is increased form 0.5.1.0 to 0.6.0.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'messaging'\n s.version = '0.5.1.0'\n s.summary = 'Messaging primitives for Eventide'\n s.description = ' ...
ruby
chosen
[ { "from": "system", "value": "Add gravity flag to command line params\n" }, { "from": "human", "value": "require 'trollop'\nrequire 'sdl'\n\nclass Physeng\n class Application\n class << self\n def run!(*arguments)\n p = Trollop::Parser.new do\n end\n @opts = Trollop...
ruby
chosen
[ { "from": "system", "value": "Change Openstack_InfraManager service model use real model for subclass\n\nOpenstack_InfraManager was using the alias EmsInfra instead of the real subclass ManageIQ::Providers::InfraManager\n" }, { "from": "human", "value": "module MiqAeMethodService\n class MiqAeS...
ruby
chosen
[ { "from": "system", "value": "Fix bug with update and version\n" }, { "from": "human", "value": "module Spree\n module Callbackable\n extend ActiveSupport::Concern\n\n included do\n include Elasticsearch::Model\n\n after_commit :index_document, on: :create\n after_commit :u...
ruby
chosen
[ { "from": "system", "value": "Add framework search paths to podspec" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'Expecta'\n s.version = '0.3.1'\n s.license = { :type => 'MIT', :file => 'LICENSE' }\n s.summary = 'A matcher framework for Objective-C & Cocoa.'\n s.h...
ruby
chosen
[ { "from": "system", "value": "Add konacha as a dependency\n\nI would expect adding this to my Gemfile to also include konacha as a dependency" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nreq...
ruby
chosen
[ { "from": "system", "value": "Sort debian packages to be installed\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 flex gperf libarchive...
ruby
chosen
[ { "from": "human", "value": "Add project errors project_id and error index\n" }, { "from": "gpt", "value": "class AddProjectErrorsProjectidErrorIdx < ActiveRecord::Migration\n def up\n execute <<-SQL\n CREATE INDEX project_errors_projectid_error_idx\n ON public.project_errors\n ...
ruby
chosen
[ { "from": "human", "value": "Add a test for a subclass of Authentication\n" }, { "from": "gpt", "value": "RSpec.describe AuthUseridPassword do\n describe \".encrypted_columns\" do\n it \"returns the encrypted columns\" do\n expected = %w(password password_encrypted auth_key auth_key_enc...
ruby
chosen
[ { "from": "human", "value": "Add tests for remote downloader\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe RemoteDownloader do\n\n let(:filename) { 'file_name.pdf' }\n\n subject { described_class.new filename }\n\n describe '#url' do\n it { expect(subject.url).to eq 'h...
ruby
chosen
[ { "from": "system", "value": "seed: Fix peer review creation in seed data\n" }, { "from": "human", "value": "# NOTE: This has to be run after assignment and group generations since it is\n# dependant on groups existing for Assignment 1.\n\nnamespace :db do\n desc 'Create peer reviews and relate...
ruby
chosen
[ { "from": "system", "value": "Fix typo (compatability -> compatibility)\n" }, { "from": "human", "value": "module Category\n def self.bug_risk\n \"Bug Risk\"\n end\n\n def self.clarity\n \"Clarity\"\n end\n\n def self.compatability\n \"Compatibility\"\n end\n\n def self.complexit...
ruby
chosen
[ { "from": "system", "value": "Fix having one discussion on interests page\n" }, { "from": "human", "value": "require 'screenshot_helper'\n\ndescribe \"Check the tour\", type: :feature, driver: :poltergeist_slow do\n include PavlovSupport\n\n before do\n user = create(:full_user)\n sign_i...
ruby
chosen
[ { "from": "system", "value": "Add missing dep on rom to changeset\n" }, { "from": "human", "value": "require File.expand_path('../lib/rom/changeset/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.name = 'rom-changeset'\n gem.summary = 'Changeset abstraction for rom-...
ruby
chosen
[ { "from": "human", "value": "Test deleting everything from /etc/hosts\n" }, { "from": "gpt", "value": "# This will leave /etc/hosts with nothing but comments and whitespace\ncommands=\"\nrm /system/config/hosts\nsave\n\"\n\ndiff[\"/etc/hosts\"] = <<TXT\n--- /tmp/aug/etc/hosts\n+++ /tmp/aug/etc/h...
ruby
chosen
[ { "from": "system", "value": "Change table name to translations\n" }, { "from": "human", "value": "class CreateContenteditableContents < ActiveRecord::Migration\n def change\n create_table :contenteditable_contents do |t|\n t.string :key\n t.text :value\n\n t.timestamps\n e...
ruby
chosen
[ { "from": "system", "value": "Use ruby awesomeness to simplify code in file and directory methods\n" }, { "from": "human", "value": "# What_now definitions\n\nrequire 'ptools'\n\nTodo = Struct.new :text, :path, :line\n\nmodule WhatNow\n class << self\n\n def ignorecase\n @ignorecase = t...
ruby
chosen
[ { "from": "system", "value": "Enable memcached and redis in acceptance tests\n\n... because these are required as cache/coordination backend.\n\nChange-Id: I16594b5e046fcc6639c134bc8ce566f8ffbc3f43\n" }, { "from": "human", "value": "require 'spec_helper_acceptance'\n\ndescribe 'basic gnocchi' do...
ruby
chosen
[ { "from": "system", "value": "Add spec tests for postfix_instance\n" }, { "from": "human", "value": "require 'spec_helper_acceptance'\nrequire 'pry'\n\ndescribe 'postfix_instance' do\n before :all do\n # include postfix class for package installation\n apply_manifest('include postfix', :c...
ruby
chosen
[ { "from": "system", "value": "Add type and page params to announcements\n" }, { "from": "human", "value": "class AnnouncementsController < PublicFacingController\n\n def index\n announced = AnnouncementsFilter.new\n @results = announced.announcements\n end\n\nprivate\n\n class Announcem...
ruby
chosen
[ { "from": "system", "value": "Call VolunteerMatch method to access json data when cause is selected\n" }, { "from": "human", "value": "module Api\n module V1\n class CausesController < ApplicationController\n extend Volunteermatch\n\n def index\n causes = Cause.all\n ...
ruby
chosen
[ { "from": "system", "value": "Add hook to refresh organizations.\n" }, { "from": "human", "value": "class OrganizationsController < PlugitController\n before_filter :require_admin\n \n def index\n @organizations = Organization.all\n end\n \n def update_multiple\n Organization.all.eac...
ruby
chosen
[ { "from": "system", "value": "Remove extra code we won't be using\n" }, { "from": "human", "value": "class RegistrationsController < Devise::RegistrationsController\n # POST /resource\n def create\n unless Invite.key_valid?(params[:invite_key])\n set_flash_message :notice, :invalid_inv...
ruby
chosen
[ { "from": "system", "value": "Add some basic tests to ensure all services get started\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'Lumenvox' do\nend\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe 'Lumenvox' do\n describe service('lvttsd')...
ruby
chosen
[ { "from": "system", "value": "Fix ActivityObject obsolete column info\n" }, { "from": "human", "value": "class CreateActivityObjectAudiences < ActiveRecord::Migration\n def change\n create_table :activity_object_audiences do |t|\n t.references :activity_object\n t.references :relat...
ruby
chosen
[ { "from": "system", "value": "Add tests for new apt actions\n" }, { "from": "human", "value": "# run a test task\nrequire 'spec_helper_acceptance'\n\ndescribe 'apt tasks' do\n describe 'update and upgrade', if: pe_install? && puppet_version =~ %r{(5\\.\\d\\.\\d)} && fact_on(master, 'osfamily') ...
ruby
chosen
[ { "from": "system", "value": "Clean up comments and use admin_orders_path for checking current page\n" }, { "from": "human", "value": "require \"spec_helper\"\n\nfeature %q{\n As a payment administrator\n I want to capture multiple payments quickly from the one page\n} do\n include Authen...
ruby
chosen
[ { "from": "system", "value": "Manage sandbox test resources in setup/teardown\n" }, { "from": "human", "value": "require \"testing_env\"\nrequire \"sandbox\"\n\nclass SandboxTest < Homebrew::TestCase\n def setup\n skip \"sandbox not implemented\" unless Sandbox.available?\n end\n\n def tes...
ruby
chosen
[ { "from": "human", "value": "Add spec for TinyMCE integration\n\nThis spec would have caught the problem recently introduced by a TinyMCE version change and fixed in ec431bc761aadaaf3e45e13b5b9898b19e6b27da\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nrequire 'rails_helper'\...
ruby
chosen
[ { "from": "system", "value": "Fix for broken user helper spec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe UsersHelper do\n describe \"follow_user_button\" do\n let!(:us) { User.make! }\n let!(:them) { User.make! }\n\n before { helper.stub(:share_mode) { false }...
ruby
chosen
[ { "from": "system", "value": "Fix deprecation warnings in compression spec\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe 'response compression', type: :request do\n it 'compresses html' do\n get('/', nil, 'Accept-Encoding' => 'gzip, deflate, sdch')\n expect(respons...
ruby
chosen
[ { "from": "system", "value": "Verify install_ark resource is correctly called\n\nAdd tests to ensure that the correct parameters are passed into the\n`install_ark` resource.\n\nNote that we've overridden the default value of attributes for our Rspec\ntest, in order to ensure that we're correctly passing in ...
ruby
chosen
[ { "from": "system", "value": "Fix chefspec by stubbing Kernel.require method.\n" }, { "from": "human", "value": "#\n# Cookbook Name:: daun\n# Spec:: default\n#\n# Copyright (c) 2016 The Authors, All Rights Reserved.\n\nrequire 'spec_helper'\n\ndescribe 'daun::default' do\n context 'When all att...
ruby
chosen
[ { "from": "human", "value": "Test against Shell injection in users template\n\n[#139274045]\n" }, { "from": "gpt", "value": "require 'spec_helper'\nrequire 'bosh/template/renderer'\n\nRSpec.describe 'Users credentials file', template: true do\n let(:users_config) {\n compiled_template('rabbi...
ruby
chosen
[ { "from": "human", "value": "Test that the delete button is not present when the schedule is not dynamic\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\nfeature 'deleting a job from the dynamic schedule' do\n\n def visit_scheduler_page\n visit resque_scheduler_engine_routes.schedu...
ruby
chosen
[ { "from": "human", "value": "Add test to never break the app.json file again.\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nrequire \"rails_helper\"\nrequire \"yaml\"\nrequire \"json\"\nrequire \"pathname\"\n\ndescribe \"app.json\" do\n it \"loads from JSON\" do\n assert ...
ruby
chosen
[ { "from": "system", "value": "Remove pending spec on Rails 3.0\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Post do\n describe \"#==\" do\n before { Post.create }\n subject { Post.first }\n\n it \"is true for other instances' decorators\" do\n pending if Ra...
ruby
chosen
[ { "from": "system", "value": "Reset the backend connection after each run\n\nTo prevent ServerSpec from using the existing SSH connection for each\ntest run. The Monkey Patch can be removed once\nhttps://github.com/mizzy/specinfra/pull/504 is merged\n" }, { "from": "human", "value": "# Loading s...
ruby
chosen
[ { "from": "system", "value": "Mark Wiens kindly suggested a neater way to strip the '^' character\n" }, { "from": "human", "value": "module ActiveRecord\r\n class Errors\r\n\r\n # Redefine the ActiveRecord::Errors::full_messages method:\r\n # Returns all the full error messages in an arr...
ruby
chosen
[ { "from": "system", "value": "Add an option to not include <script> tag (useful when rendering in JS views)\n" }, { "from": "human", "value": "module Danthes\n module ViewHelpers\n # Publish the given data or block to the client by sending\n # a Net::HTTP POST request to the Faye server. ...
ruby
chosen
[ { "from": "system", "value": "Add a warning not to manually edit RUBYGEMS_VERSION\n" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\n\nrequire 'rails'\nrequire 'action_controller/railtie'\n\nunless Rails.env.maintenance?\n require 'rails/test_unit/railtie'\n requ...
ruby
chosen
[ { "from": "system", "value": "Print a message saying what the ExecJS runtime is.\n" }, { "from": "human", "value": "# Load the Rails application.\nrequire_relative 'application'\n\n# Initialize the Rails application.\nRails.application.initialize!\nENV['HOST_PORT'] ||= \":80\"\n" }, { "f...
ruby
chosen
[ { "from": "system", "value": "Update acronym version test comments to be more clear for user\n\nFound that users were getting confused by the version test and it's purpose (see ticket https://github.com/exercism/xruby/issues/188). Goal is to make it clear to users that there only need to return the number t...
ruby
chosen
[ { "from": "system", "value": "Update React Native documentation (0.12.0)\n" }, { "from": "human", "value": "module Docs\n class ReactNative < React\n self.name = 'React Native'\n self.slug = 'react_native'\n self.type = 'react'\n self.version = '0.10.0'\n self.base_url = 'https:/...
ruby
chosen
[ { "from": "system", "value": "Use TagParser to earn tag part from label (or tag)\n" }, { "from": "human", "value": "require 'emony/tag_matching/rules'\nrequire 'emony/tag_matching/cache'\n\nmodule Emony\n module TagMatching\n class Matcher\n def initialize(rules, cache: Cache.new)\n ...
ruby
chosen
[ { "from": "human", "value": "Add script to reset postgres id sequences\n" }, { "from": "gpt", "value": "# Script to reset id sequences\n# Written specifically for elixir/phoenix, but should be applicable for anything\n\n# to get list of sequences\n# SELECT c.relname FROM pg_class c WHERE c.relki...
ruby
chosen
[ { "from": "human", "value": "Swap sample resource to display correctly the parameters in the json\n" }, { "from": "gpt", "value": "require 'lims-api/core_action_resource'\nrequire 'lims-api/struct_stream'\nrequire 'lims-laboratory-app/laboratory/sample/swap_samples'\n\nmodule Lims::LaboratoryApp...
ruby
chosen
[ { "from": "human", "value": "Create automated alt tag addition, based on image name.\n\nNeeds documentation." }, { "from": "gpt", "value": "# Automatic Image alt tags from image names extension\nclass Middleman::Extensions::AutomaticAltTags < ::Middleman::Extension\n\n def initialize(app, optio...
ruby
chosen
[ { "from": "human", "value": "Add artifacts metadata field to `ci_builds`\n" }, { "from": "gpt", "value": "class AddArtifactsMetadataToCiBuild < ActiveRecord::Migration\n def change\n add_column :ci_builds, :artifacts_metadata, :text, limit: 4294967295\n end\nend\n" } ]
ruby
chosen
[ { "from": "system", "value": "Update KDEBase Runtime to 1.4.0 and fix homepage.\n" }, { "from": "human", "value": "require 'formula'\n\nclass KdebaseRuntime <Formula\n url 'ftp://ftp.kde.org/pub/kde/stable/4.4.2/src/kdebase-runtime-4.4.2.tar.bz2'\n homepage ''\n md5 'd46fca58103624c28fcdf3fbd...
ruby
chosen
[ { "from": "system", "value": "Move Pony configuration to initializer in EmailErrorReporter class\n\nPony configuration would have blown up on application startup if\nSendGrid not configured in config.yaml\n" }, { "from": "human", "value": "module HerokuBackupOrchestrator\n class ErrorReporter\n...
ruby
chosen
[ { "from": "system", "value": "Use random string in name of domain\n" }, { "from": "human", "value": "module VagrantPlugins\n module ProviderLibvirt\n module Action\n\n # Setup name for domain and domain volumes.\n class SetNameOfDomain\n def initialize(app, env)\n @...
ruby
chosen
[ { "from": "system", "value": "Fix init for mruby core\n" }, { "from": "human", "value": "module YARD::MRuby::Handlers::C::Source\n class InitHandler < Base\n MATCH1 = /mrb_\\w+_gem_init\\s*\\(/mx\n MATCH2 = /mrb_init_\\w\\s*\\(/mx\n\n handles MATCH1\n handles MATCH2\n statement_c...
ruby
chosen
[ { "from": "system", "value": "Exclude guider days from bookable slots\n\nThere is a two day guider event occurring on these newly added days so\nwe must ensure we display no booking availability during this time.\n" }, { "from": "human", "value": "# Days that are always excluded from availabilit...
ruby
chosen
[ { "from": "system", "value": "Add base hostname configuration for swagger initializer\n" }, { "from": "human", "value": "require \"swagger/blocks\"\n\nmodule ApiFlashcards\n include Swagger::Blocks\n swagger_root do\n key :swagger, \"2.0\"\n info do\n key :version, \"1.0.0\"\n ...
ruby
chosen
[ { "from": "system", "value": "Add LICENSE and README to gem\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"minitest-stub-const\"\n s.version = 0.1\n\n s.authors = [\"Adam Mckaig\"]\n s.email = [\"adam.mckaig@gmail.com\"]\n s.homepage = ...
ruby
chosen
[ { "from": "system", "value": "Choose 'from' field from available headers.\n\nFixes #46.\n\nIf as single invalid 'from' address is given, Mail::from[0] is nil.\n" }, { "from": "human", "value": "require \"mail\"\n\nmodule Email; end\n\nmodule Email::Mboxrd\n class Message\n attr_reader :suppl...
ruby
chosen
[ { "from": "system", "value": "Fix timestamp columns in notes.\n" }, { "from": "human", "value": "class CreateNotes < ActiveRecord::Migration\n def change\n create_table :notes do |t|\n t.string :title\n t.text :body_html\n t.text :body_text\n t.string :timestamps\n end...
ruby
chosen
[ { "from": "system", "value": "Revert \"Revert \"DRY the photos helper\"\"\n\nThis reverts commit 7f7f2cae47f3956d797456b626418e6fff49da14.\n" }, { "from": "human", "value": "module PhotosHelper\n def crop_image_path(crop, full_size: false)\n if crop.default_photo.present?\n photo = crop...
ruby
chosen