conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Update .podspec file according to the new framework name\n\n+ minor minor internal file formatting/implementation\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n\n s.name = \"MKHSequenceCtrl\"\n s.version = \"1.0.3\"\n s.summary = \"Li...
ruby
chosen
[ { "from": "system", "value": "Update podspec to version 0.0.3\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'RTAlertView'\n s.version = '0.0.1'\n s.summary = 'Customizable replacement for iOS 7 UIAlertView'\n s.license = 'MIT'\n s.homepage = '...
ruby
chosen
[ { "from": "system", "value": "Fix test for Nori integration\n" }, { "from": "human", "value": "require \"test_helper\"\nrequire \"ostruct\"\n\ndescribe Autodiscover::PoxRequest do\n let(:_class) {Autodiscover::PoxRequest }\n let(:http) { mock(\"http\") }\n let(:client) { OpenStruct.new({http:...
ruby
chosen
[ { "from": "system", "value": "Include scripts directory when building pathname\n" }, { "from": "human", "value": "require \"vagrant\"\n\nrequire 'vagrant/util/platform'\n\nmodule VagrantPlugins\n module HostWindows\n class Host < Vagrant.plugin(\"2\", :host)\n def detect?(env)\n ...
ruby
chosen
[ { "from": "system", "value": "Allow use with Rails 5.1\n\nSigned-off-by: Steven Hoffman <f5bcacb8ce1651b7d1e56f2693431f20e085fdeb@valenciamgmt.com>\n" }, { "from": "human", "value": "$LOAD_PATH.push File.expand_path('../lib', __FILE__)\nrequire 'fustrate/rails/version'\n\nGem::Specification.new ...
ruby
chosen
[ { "from": "system", "value": "Switch web servers at IC to ruby 2.3\n" }, { "from": "human", "value": "name \"ic\"\ndescription \"Role applied to all servers at Imperial College\"\n\ndefault_attributes(\n :accounts => {\n :users => {\n :icladmin => { :status => :user }\n }\n },\n :n...
ruby
chosen
[ { "from": "human", "value": "Add failing spec for argparse\n" }, { "from": "gpt", "value": "require File.expand_path(File.dirname(__FILE__) + '/spec_helper')\n\nMULTIUSER_CONFIG = { accounts: {\n :rich0H =>\n { oauth_token: \"I'mtotallyatokenbrah\",\n oauth_token_secre...
ruby
chosen
[ { "from": "system", "value": "Enable analytics in all APM services\n" }, { "from": "human", "value": "if ENV['DATADOG_RAILS_APM']\n Datadog.configure do |c|\n c.use :rails, service_name: 'rails'\n c.use :delayed_job, service_name: 'delayed_job'\n c.use :dalli, service_name: 'memcached'...
ruby
chosen
[ { "from": "system", "value": "Remove tests referring to static pages being removed\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe StaticPagesController do\n describe \"home\" do\n it \"should respond to root path\" do\n expect({:get => \"/\"}).to route_to({:contro...
ruby
chosen
[ { "from": "human", "value": "Add homebrew formula for odbc\n" }, { "from": "gpt", "value": "# A formula that installs the Instant Client ODBC package.\nclass InstantclientOdbc < Formula\n desc \"Oracle Instant Client ODBC x64\"\n homepage \"https://www.oracle.com/database/technologies/instant-...
ruby
chosen
[ { "from": "human", "value": "Add skeleton for Header::TCP::Options class\n" }, { "from": "gpt", "value": "module PacketGen\n module Header\n class TCP\n\n # Container for TCP options in {TCP TCP header}.\n # @author Sylvain Daubert\n class Options < Array\n\n def read(s...
ruby
chosen
[ { "from": "system", "value": "Make sample data use OFN's calculators\n" }, { "from": "human", "value": "require \"tasks/sample_data/addressing\"\nrequire \"tasks/sample_data/logging\"\n\nclass PaymentMethodFactory\n include Logging\n include Addressing\n\n def create_samples(enterprises)\n ...
ruby
chosen
[ { "from": "system", "value": "Fix ruby installation with RVM\n" }, { "from": "human", "value": "module VagrantPlugins\n module Ventriloquist\n module Cap\n module Linux\n module RvmInstallRuby\n def self.rvm_install_ruby(machine, version)\n if ! machine.commun...
ruby
chosen
[ { "from": "system", "value": "Fix bug with double-counting solo commits in PairMatrix\n\nI mistakenly thought that an array like `['Joe', 'Joe']` would get\npermuted to `[['Joe', 'Joe']]`, but it actually gets permuted to\n`[['Joe', 'Joe'], ['Joe', 'Joe']]`.\n\nWill follow-up with a spec.\n\nChange-Id: Ia89...
ruby
chosen
[ { "from": "system", "value": "Update subscriber message translator doc" }, { "from": "human", "value": "module ActivityBroker\n # This class knows that any message coming from the subscribers is\n # the subscription message and then tells to register the subscriber to the\n # translated messa...
ruby
chosen
[ { "from": "system", "value": "Return email in reset_password api response\n" }, { "from": "human", "value": "class API::V2::PasswordsController < API::V2::BaseController\n skip_before_action :require_authentication\n\n # Request to send password reset instructions to user email\n # POST /rese...
ruby
chosen
[ { "from": "system", "value": "Rename entity to section in ChangeNoteValidator\n\nWe only ever initialize a ChangeNoteValidator with a Section(ish) thing\n(e.g. SectionValidator). Renaming `entity` to `section` makes this more\nexplicit.\n" }, { "from": "human", "value": "require \"delegate\"\n\n...
ruby
chosen
[ { "from": "system", "value": "Add Honeybadger class dependecy injection\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass UniformNotifier\n class HoneybadgerNotifier < Base\n def self.active?\n !!UniformNotifier.honeybadger\n end\n\n protected\n\n def se...
ruby
chosen
[ { "from": "system", "value": "Add and remove facts from a Channel\n" }, { "from": "human", "value": "class Channel < OurOhm\n \n attribute :title\n attribute :description\n \n set :facts, Fact\n \n reference :user, GraphUser\n \n def validate\n assert_present :title\n # assert_pre...
ruby
chosen
[ { "from": "system", "value": "Fix and add more model data check\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe Localdoc::ApplicationController do\n it \"GET /\" do\n get :show, use_route: :localdoc\n expect(response).to be_success\n end\n\n it \"GET /path/to/non-e...
ruby
chosen
[ { "from": "system", "value": "Enable integration tests for System.Integer" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'System.Integer', :blur do\n after(:each) { assert_exit_status(0) }\n\n [\n [ :+, 2, 3, '5' ]\n ].each do |(operator, a, b, result)|\n describe \"...
ruby
chosen
[ { "from": "human", "value": "Test for profiling unit tests.\n\ngit-svn-id: a649f8b53cef7d15963550bf81aeba716f52dec1@136 5fb4a865-4516-0410-ae3b-a609ddf12040\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\n\nrequire 'test/unit'\nrequire 'ruby-prof'\nrequire 'timeout'\nrequire 'test_helper'\...
ruby
chosen
[ { "from": "system", "value": "Change from name of PA entry mail\n" }, { "from": "human", "value": "class SongMailer < ApplicationMailer\n default to: '\"PA\" <pa@ku-unplugged.net>'\n\n def entry(song, applicant)\n @song = song\n @applicant = applicant\n email_with_name = %(\"#{applica...
ruby
chosen
[ { "from": "system", "value": "Remove index from long string\n\n\nFormer-commit-id: be21bb62ca39513916c464c6806965d339283e5b" }, { "from": "human", "value": "# Model for storing versions of nodes.\n\n# Note that this version (currently only in the \"mongo\" branch) uses\n# MongoDB and MongoMapper...
ruby
chosen
[ { "from": "system", "value": "Add title validation on Organization" }, { "from": "human", "value": "class Organization < ActiveRecord::Base\n extend FriendlyId\n friendly_id :slug_candidate, use: [:slugged, :finders]\n\n default_scope { where(deleted_at: nil) }\n\n has_many :assignments, ...
ruby
chosen
[ { "from": "system", "value": "Reset timestamp field after tests.\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass TimestampTest < ActiveSupport::TestCase\n\n setup do\n PaperTrail.config.timestamp_field = :custom_created_at\n change_schema\n Version.reset_column_inform...
ruby
chosen
[ { "from": "system", "value": "Fix examples/native to use $global for window reference\n" }, { "from": "human", "value": "require 'opal'\n\n$window.addEventListener 'DOMContentLoaded', proc {\n\n css = <<-CSS\n body {\n font-family: 'Arial';\n }\n CSS\n\n title = $document.createEle...
ruby
chosen
[ { "from": "system", "value": "Fix belongs_to always requiring the second options parameter.\n" }, { "from": "human", "value": "module PluginAWeek #:nodoc:\n module Acts #:nodoc:\n module Enumeration #:nodoc:\n module Extensions #:nodoc:\n module Associations #:nodoc:\n d...
ruby
chosen
[ { "from": "system", "value": "Add option for JSON output at /lists.\n" }, { "from": "human", "value": "class ListsController < ApplicationController\n before_filter :signed_in_user, only: [:create, :destroy]\n before_filter :correct_user, only: :destroy\n\n def create\n @list = current_u...
ruby
chosen
[ { "from": "system", "value": "Remove extra controller instance variables\n" }, { "from": "human", "value": "class PostsController < ApplicationController\n\n\tdef index\n\t\t@posts = Post.all\n\t\t@power_posts = @posts.where(tag_id: 1)\n\t\t@growth_posts = @posts.where(tag_id: 2)\n\t\t@facts_pos...
ruby
chosen
[ { "from": "human", "value": "Make the program work on the surface\n" }, { "from": "gpt", "value": "# Create a new list\n# Creating an empty Hash\n# Input: Name your shopping list\n# Output: (list name) created\n#\n# Add an item with a quantity to the list\n# Input: Item\n# Input: Quanitity\n# Ou...
ruby
chosen
[ { "from": "system", "value": "Use a tmp folder in Rails tmp not /tmp or /var /tmp\n\nTo avoid postgres access errors when it reads in the tmp file\n" }, { "from": "human", "value": "require_dependency \"renalware\"\n\nmodule Renalware\n class ZipArchive\n def initialize(file)\n @file = ...
ruby
chosen
[ { "from": "system", "value": "Send invitation emails to new collaborators\n" }, { "from": "human", "value": "class ContributorService < Service\n def self.invite_contributor_to_universe universe:, email:\n # First, look up whether a user already exists for this invite\n related_user = Use...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary require in gem's entry point\n" }, { "from": "human", "value": "require 'active_replicas/version'\nrequire 'active_replicas/log_subscriber'\nrequire 'active_replicas/proxying_connection'\nrequire 'active_replicas/proxying_connection_pool'\n\nif de...
ruby
chosen
[ { "from": "system", "value": "Use a different location for the script path.\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'celluloid'\nrequire 'tempfile'\nrequire 'fileutils'\n\nmodule Buildbox\n class Runner\n include Celluloid\n include Celluloid::Logger\n\n attr_rea...
ruby
chosen
[ { "from": "system", "value": "Include CTEs in SQL output\n" }, { "from": "human", "value": "require 'json'\nrequire 'forwardable'\nrequire_relative 'scope'\nrequire_relative 'nodifier'\n\nmodule ConceptQL\n class Query\n extend Forwardable\n def_delegators :all, :count, :execute, :order\n...
ruby
chosen
[ { "from": "system", "value": "Allow negative scores for PyLintAdapter and improve regex handling\n" }, { "from": "human", "value": "class PyLintAdapter < TestingFrameworkAdapter\n REGEXP = /Your code has been rated at (\\d+\\.?\\d*)\\/(\\d+\\.?\\d*)/\n ASSERTION_ERROR_REGEXP = /^.*?\\(.*?,\\ (...
ruby
chosen
[ { "from": "system", "value": "RotasApp: Correct opts passing bug; simplify init\n" }, { "from": "human", "value": "require 'yaml'\nrequire 'forwardable'\n\nmodule Rotas\n class RotasApp\n extend ::Forwardable\n def_delegator :@file_loader, :config_yaml, :config\n\n attr_reader :source_...
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 a `proc` in favour of a `begin`/`end` block." }, { "from": "human", "value": "module Alephant\n module Broker\n module LoadStrategy\n module Revalidate\n class Refresher\n include Logger\n\n attr_reader :component_meta\n\n ...
ruby
chosen
[ { "from": "system", "value": "Update Targets property name for consistent plurality\n" }, { "from": "human", "value": "require_relative '../resource'\n\nmodule Convection\n module Model\n class Template\n class Resource\n ##\n # AWS::Events::Rule\n ##\n clas...
ruby
chosen
[ { "from": "system", "value": "Refactor variables to top scope\n" }, { "from": "human", "value": "module Puppet::Parser::Functions\n newfunction(:get_knownhosts, :type => :rvalue) do |args|\n fqdn = args[0].to_s\n hostname = fqdn.split('.').shift\n aliases = []\n aliases.push hostnam...
ruby
chosen
[ { "from": "human", "value": "Add watch server. Make sure is executable\n" }, { "from": "gpt", "value": "#!/usr/bin/ruby\n# run as bg process: ./watch_server.rb 40000 > /dev/null &\n\nrequire 'socket'\nrequire 'rubygems'\n# Gem.use_paths(\"/Users/mitch/.gem/ruby/1.8\", \"/Library/Ruby/Gems/1.8\",...
ruby
chosen
[ { "from": "system", "value": "Upgrade for rails 3.2.18 and ruby 1.9.3\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"validates_immutability/version\"\n\nGem::Specification.new do |s|\n s.name = \"validates_immutabil...
ruby
chosen
[ { "from": "system", "value": "Include finder not error handler\n" }, { "from": "human", "value": "require 'api_consumer/version'\nrequire 'api_consumer/parser_registry'\nrequire 'api_consumer/processor'\nrequire 'api_consumer/parsers/base'\nrequire 'api_consumer/parsers/collection'\nrequire 'api...
ruby
chosen
[ { "from": "system", "value": "Add required ruby version in gemspec file\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'yaml_bot/version'\n\nGem::Specification.new do |spec|\n spec....
ruby
chosen
[ { "from": "system", "value": "Add explicit require to super class.\n" }, { "from": "human", "value": "module RamlPoliglota\n module Gen\n\n class JavaGen < CodeGen\n\n def initialize\n @logger = AppLogger.create_logger self\n end\n\n def generate(raml)\n return i...
ruby
chosen
[ { "from": "system", "value": "Stop action pid kill logging\n" }, { "from": "human", "value": "require 'guard'\nrequire 'guard/guard'\nrequire 'rainbow'\n\nmodule Guard\n\n class Daemon < Guard\n\n def start\n daemon_restart\n end\n\n def run_on_changes(paths)\n daemon_restart...
ruby
chosen
[ { "from": "system", "value": "Use a more random ID.\n" }, { "from": "human", "value": "module IdGenerator\n def self.random_id\n (0...16).map { |x| rand(16).to_s(16) }.join\n end\nend" }, { "from": "gpt", "value": "module IdGenerator\n def self.random_id\n (0...32).map { |x|...
ruby
chosen
[ { "from": "system", "value": "Add missing docs for Metasploit::Cache::Actionable::Action\n\nMSP-12352\n" }, { "from": "human", "value": "# Actions that can be performed by {Metasploit::Cache::Auxiliary::Instance#actions auxiliary Metasploit Modules}.\nclass Metasploit::Cache::Actionable::Action ...
ruby
chosen
[ { "from": "system", "value": "Change ordering for RAG widget\n" }, { "from": "human", "value": "json.item do\n json.array! [\n {\n value: @reporter.authorised_in_full,\n text: 'Authorised'\n },\n {\n value: @reporter.authorised_in_part,\n text: 'Part authorised'\n ...
ruby
chosen
[ { "from": "system", "value": "Allow to send to multiple channels\n" }, { "from": "human", "value": "require \"slack-notify/version\"\nrequire \"slack-notify/error\"\n\nrequire \"json\"\nrequire \"faraday\"\n\nmodule SlackNotify\n class Client\n def initialize(team, token, options={})\n ...
ruby
chosen
[ { "from": "system", "value": "Replace hardcoded filename with the proper variable\n" }, { "from": "human", "value": "require \"valid_email2/email_validator\"\n\nmodule ValidEmail2\n DISPOSABLE_DOMAINS_FILE = File.expand_path(\"../../vendor/disposable_domains.txt\", __FILE__)\n BLACKLISTED_DOMA...
ruby
chosen
[ { "from": "human", "value": "Add missing spec for Action\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\nmodule EndState\n describe Action do\n subject(:action) { Action.new(object, state) }\n let(:object) { OpenStruct.new(state: nil) }\n let(:state) { :a }\n\n describe '#...
ruby
chosen
[ { "from": "system", "value": "Remove randomness from membership factory\n" }, { "from": "human", "value": "FactoryBot.define do\n factory :membership do\n state { Membership.states.keys.sample }\n roles [\"group_member\"]\n user\n user_group\n end\nend\n" }, { "from": "gpt"...
ruby
chosen
[ { "from": "system", "value": "Fix name of withdrawn study stage in factory\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :study_stage, aliases: [:concept_stage] do\n name \"Concept\"\n\n factory :protocol_stage do\n name \"Protocol & ERB\"\n end\n\n factory...
ruby
chosen
[ { "from": "system", "value": "Delete test object after tests\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Component do\n\n before do\n @pid = \"test:1\"\n c = Component.new(:pid => @pid)\n c.save!\n end\n \n it \"should retrieve the component\" do\n c = Co...
ruby
chosen
[ { "from": "system", "value": "Update doubles to instance doubles in specs\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe YertleFormatter do\n let(:output) { StringIO.new }\n let(:notification) { double }\n let(:execution_result) { double }\n let(:example) { double }\n...
ruby
chosen
[ { "from": "system", "value": "Add Github home page to gemspec.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"tod/version\"\n\nGem::Specification.new do |s|\n s.name = \"tod\"\n s.version = TimeOfDay::VERSION\n...
ruby
chosen
[ { "from": "system", "value": "Use latest version of spree 1.0.x\n" }, { "from": "human", "value": "# encoding: utf-8\nGem::Specification.new do |s|\n s.platform = Gem::Platform::RUBY\n s.name = 'spree_email_to_friend'\n s.version = '1.2'\n s.summary = 'Spree extension to se...
ruby
chosen
[ { "from": "system", "value": "Modify serf user and group to root.\n" }, { "from": "human", "value": "include_attribute 'yum-epel'\ndefault['yum']['epel']['enabled'] = false\n\n\ninclude_attribute 'serf'\ndefault['serf']['version'] = '0.6.3'\ndefault['serf']['agent']['bind'] = '0.0.0.0'\ndefault[...
ruby
chosen
[ { "from": "system", "value": "Add the tree read-only attribute to the AbstractProcess class.\n" }, { "from": "human", "value": "require 'scorm2004/sequencing'\nrequire 'forwardable'\n\nmodule Scorm2004\n module Sequencing\n class AbstractProcess\n include SequencingException\n\n AC...
ruby
chosen
[ { "from": "system", "value": "Fix logic error in method.\n" }, { "from": "human", "value": "class Team\n\tattr_accessor :name\n\tattr_reader :player_count\n\tdef initialize(name)\n\t\t@name = name\n\t\t@player_count = 0\n\tend\n\tdef add_player(name, position)\n\t\t@player_count = @player_count...
ruby
chosen
[ { "from": "system", "value": "Fix NoMethodError exception when method has no @return tags\n" }, { "from": "human", "value": "module YARD\n module Generators::Helpers\n module MethodHelper\n def format_args(object)\n if object.signature\n h object.signature[/#{Regexp.quot...
ruby
chosen
[ { "from": "system", "value": "Switch to Undefined = Module.new.freeze\n\nA new module instance provides slightly less API than a new class\ninstance (specifically, it doesn’t expose .new)\n\n“Ideally” we would do Undefined = BasicObject.new but that doesn’t\nreally play nice with #inspect\n" }, { "f...
ruby
chosen
[ { "from": "system", "value": "Fix required ruby version to >= 1.9.3\n\nThe prior version specification `'~>'` was limiting ruby versions to 1.9.X and so ruby 2.0 and 2.1 were not compatible.\r\nSee http://guides.rubygems.org/specification-reference/#required_ruby_version=" }, { "from": "human", ...
ruby
chosen
[ { "from": "system", "value": "Use s3 asset caching only when we want it.\n" }, { "from": "human", "value": "use_s3_caching true\ns3_access_key ENV['CACHE_AWS_ACCESS_KEY_ID']\ns3_secret_key ENV['CACHE_AWS_SECRET_ACCESS_KEY']\ns3_bucket ENV['CACHE_AWS_BUCKET']\ns3_region ENV['CACHE_AWS_S3_REGION']...
ruby
chosen
[ { "from": "system", "value": "Disable ddl transactions for realz!" }, { "from": "human", "value": "class MigrateWordCounts < ActiveRecord::Migration\n def up\n\n disable_ddl_transaction\n\n post_ids = execute(\"SELECT id FROM posts WHERE word_count IS NULL LIMIT 500\").map {|r| r['id'].to...
ruby
chosen
[ { "from": "system", "value": "Define effective_datatables as a hard dependency\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"effective_logging/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Spe...
ruby
chosen
[ { "from": "system", "value": "FIX reload! within rails console --sandbox causes undefined method rollback upon exiting [https://github.com/rails/rails/issues/11834]\n" }, { "from": "human", "value": "ActiveRecord::Base.connection.begin_transaction(joinable: false)\n\nat_exit do\n ActiveRecord::...
ruby
chosen
[ { "from": "human", "value": "Add analysis script of calculating review summaries\n" }, { "from": "gpt", "value": "#!/bin/sh ruby\n# -*- encoding: utf-8 -*-\n\n###\n### Calculating summary of reviews\n### Kazuki Hamasaki (ashphy@ashphy.com)\n### \n\nrequire 'rubygems'\nrequire 'active_record'\n\n...
ruby
chosen
[ { "from": "system", "value": "Update gcc on Ubuntu 12.04 and install the glog library.\n" }, { "from": "human", "value": "include_recipe 'hhvm::_source_common_hhvm'\n" }, { "from": "gpt", "value": "if node[:platform_version] == \"12.04\"\n apt_repository \"gcc47\" do\n uri \"...
ruby
chosen
[ { "from": "system", "value": "Update gemspec with new README in markdown [ci skip]\n" }, { "from": "human", "value": "# encoding: utf-8\n\n$: << File.expand_path('../lib', __FILE__)\nrequire 'i18n/version'\n\nGem::Specification.new do |s|\n s.name = \"i18n\"\n s.version = I18n::VE...
ruby
chosen
[ { "from": "system", "value": "Add public and private scopes to threads.\n" }, { "from": "human", "value": "# == Schema Information\n#\n# Table name: message_threads\n#\n# id :integer not null, primary key\n# issue_id :integer\n# created_by_id :integer not null\...
ruby
chosen
[ { "from": "human", "value": "Add test for game master apis.\n" }, { "from": "gpt", "value": "require 'minitest/autorun'\nrequire 'test_helper'\n\nmodule StockFighter::ApiMixin\n class GameMasterApi::Test < MiniTest::Test\n class TestApi\n include GameMasterApi\n end\n\n def setup\...
ruby
chosen
[ { "from": "human", "value": "Add specs for firewall_rules in refresh_parser\n" }, { "from": "gpt", "value": "describe ManageIQ::Providers::Amazon::NetworkManager::RefreshParser do\n require 'aws-sdk'\n let(:ems) { FactoryGirl.create(:ems_amazon_with_authentication) }\n let(:parser) { describe...
ruby
chosen
[ { "from": "system", "value": "Add down migration for change_column type\n" }, { "from": "human", "value": "class ChangeStoryPermalinkColumn < ActiveRecord::Migration\n def up\n change_column :stories, :permalink, :text\n end\nend\n" }, { "from": "gpt", "value": "class ChangeStor...
ruby
chosen
[ { "from": "system", "value": "Fix migration to add version\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n# Add audio prompt to question table for paperclip\nclass AddAudioPromptToQuestions < ActiveRecord::Migration\n def up\n add_attachment :questions, :audio_prompt\n ...
ruby
chosen
[ { "from": "system", "value": "Make debugger agent also authenticate with Logging scope\n" }, { "from": "human", "value": "# Copyright 2017 Google Inc. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance wi...
ruby
chosen
[ { "from": "system", "value": "Add a missing require statement\n" }, { "from": "human", "value": "require \"ironment/cl\"\nrequire \"ironment/config\"\nrequire \"ironment/finder\"\nrequire \"ironment/optparse/help_texts\"\nrequire \"ironment/optparse\"\nrequire \"ironment/populator\"\nrequire \"i...
ruby
chosen
[ { "from": "system", "value": "Edit documentation for triump subaccount node\n" }, { "from": "human", "value": "module SynapsePayRest\n # Represents a Synapse node allowing any user to hold funds. You can use this\n # node as a wallet, an escrow account or something else along those lines.\n c...
ruby
chosen
[ { "from": "system", "value": "Modify printLoanitem to convert all variables to strings\n" }, { "from": "human", "value": "class Loanitem\n def initialize(id, title, loandate, duedate, renewals)\n @id = id\n @title = title\n @loandate = loandate\n @duedate = duedate...
ruby
chosen
[ { "from": "system", "value": "Generalize parser to other operands\n" }, { "from": "human", "value": "# Stub for testing\n\n# Parser Regex from http://stackoverflow.com/questions/8071533/convert-input-value-to-integer-or-float-as-appropriate-using-ruby\n\nclass RPNEval\n attr :stack\n def initi...
ruby
chosen
[ { "from": "system", "value": "Read in data location from rc, load overloads into a model\n" }, { "from": "human", "value": "require_relative \"rtasklib/version\"\nrequire_relative \"rtasklib/models\"\nrequire_relative \"rtasklib/execute\"\nrequire_relative \"rtasklib/controller\"\nrequire_relati...
ruby
chosen
[ { "from": "system", "value": "[Webhook] Add notes, and run each URL in its own fork.\n" }, { "from": "human", "value": "# A minimal web hook implementation.\n#\n# Use WebHook.call(\"message\") in the server.\n# Use WebHook.run in a worker process.\n#\n# Note that WebHook.call will currently bloc...
ruby
chosen
[ { "from": "system", "value": "Remove binary from SpecsController File.open" }, { "from": "human", "value": "module Avocado\n class AvocadoController < ActionController::Base\n\n def create\n File.open(json, 'wb+') { |f| f.write params[:file].read }\n head :ok\n end\n\n def in...
ruby
chosen
[ { "from": "system", "value": "Return full image when uploaded\n" }, { "from": "human", "value": "class RedactorImagesController < ApplicationController\n skip_before_filter :verify_authenticity_token\n respond_to :json \n\n def index\n @redactor_images = RedactorImage.limit(25)\n render...
ruby
chosen
[ { "from": "system", "value": "Initialize instance of Lsi with command, path, and list_command and call run on instance\n" }, { "from": "human", "value": "require \"lsi/version\"\n\nclass Lsi\n def self.run(command:, path:, list_command:)\n apply = if command\n lambda do |path|\n ...
ruby
chosen
[ { "from": "system", "value": "Fix migration. Add all current issues to version history\n" }, { "from": "human", "value": "class CreateIssueVersions < ActiveRecord::Migration\n def self.up\n create_table :issue_versions do |t|\n t.column :issue_id, :integer\n t.column :journal_id, :...
ruby
chosen
[ { "from": "system", "value": "Fix spec by specifying the GOD id association in the GO object\n" }, { "from": "human", "value": "describe GenericObjectController do\n include CompressedIds\n\n let!(:server) { EvmSpecHelper.local_miq_server(:zone => zone) }\n let(:zone) { FactoryGirl.build(:zon...
ruby
chosen
[ { "from": "human", "value": "Add spec for VersionHelpers module\n" }, { "from": "gpt", "value": "require 'spec_helper'\nrequire 'ostruct'\n\nmodule PaperTrailScrapbook\n ::RSpec.describe VersionHelpers do\n\n let(:person) do\n p = Person.new(name: 'The Tim Man')\n p.save!\n p\...
ruby
chosen
[ { "from": "system", "value": "Raise RunTimeError when top-level pages are not present\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe RootBrowsePagePresenter do\n\n describe \"#render_for_publishing_api\" do\n it \"is valid against the schema without browse pages\...
ruby
chosen
[ { "from": "system", "value": "Add tag in podspec description\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n\n s.name = 'NCICharts'\n s.version = '1.0.0'\n s.summary = 'Simple, zoom, dynamic and charts with ranges for iOS'\n\n s.description = <<-DESC\n Simple, z...
ruby
chosen
[ { "from": "system", "value": "Fix is:custom checking printing, not card\n" }, { "from": "human", "value": "class ConditionIsCustom < ConditionSimple\n def match?(card)\n return true if card.custom?\n false\n end\n\n def to_s\n \"is:custom\"\n end\nend\n" }, { "from": "gpt", ...
ruby
chosen
[ { "from": "system", "value": "Minor: Add email validation literature in comments\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule EmailInquire\n\n class EmailValidator\n\n def initialize(email)\n @email = email.downcase\n end\n\n attr_reader :email\n\n ...
ruby
chosen
[ { "from": "system", "value": "Fix typo in consul dequeue pauser\n" }, { "from": "human", "value": "require 'etl/redshift/client'\nrequire 'diplomat'\n\nmodule ETL\n module Queue\n class ConsulQueueValueClient\n def initialize\n @consul_key_path = ENV[\"ETL_PAUSE_QUEUE_CONSUL_KEY_...
ruby
chosen
[ { "from": "human", "value": "Add task to transfer db dump\n" }, { "from": "gpt", "value": "desc \"Import production DB's entries\"\ntask :import_entries do\n system <<~SHELL\n target_date=$(date \"+%Y-%m-%d\")\n ssh portalshit.net 'mysqldump -u portalshit -p portalshit entries --default-c...
ruby
chosen
[ { "from": "system", "value": "Add a very (not really) important check.\n" }, { "from": "human", "value": "module Algorithms\n module Sorting\n class Selection\n def sort(array)\n for index in 0..(array.size - 2)\n min_index = array.find_inde...
ruby
chosen
[ { "from": "system", "value": "Print helpful message if \"mkmf\" require fails\n\nOr at least hopefully a bit helpful...\n" }, { "from": "human", "value": "# Copyright 2010-2014 Greg Hurrell. All rights reserved.\n# Licensed under the terms of the BSD 2-clause license.\n\nrequire 'mkmf'\n\ndef he...
ruby
chosen
[ { "from": "system", "value": "Refactor task lists to use a quoted array\n" }, { "from": "human", "value": "desc 'Run metrics with Heckle'\ntask :ci => [ 'ci:metrics', :heckle ]\n\nnamespace :ci do\n desc 'Run metrics'\n task :metrics => [ :verify_measurements, :flog, :flay, :reek, :roodi, 'met...
ruby
chosen