conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Use full name on columns. ident => identification\n" }, { "from": "gpt", "value": "class IdentToIdentification < ActiveRecord::Migration\n def self.up\n rename_column :lab_groups, :ident, :identification\n end\n\n def self.down\n rename_column :lab_groups, :...
ruby
chosen
[ { "from": "human", "value": "Add migration to add api_token column to admins table\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nclass AddApiTokenToAdmins < ActiveRecord::Migration[5.2]\n def change\n add_column :admin_admins, :api_token, :string, null: true\n end\nend\n...
ruby
chosen
[ { "from": "system", "value": "Remove files conflicting with binutils\n" }, { "from": "human", "value": "require 'formula'\n\nclass AvrGdb < Formula\n homepage 'http://www.gnu.org/software/gdb/'\n version '7.8.1'\n url \"http://ftp.gnu.org/gnu/gdb/gdb-#{version}.tar.gz\"\n mirror \"http://ftp...
ruby
chosen
[ { "from": "human", "value": "Update French postal codes for department from 1 to 9 without a leading 0.\n" }, { "from": "gpt", "value": "class UpdateFrenchPostalCodes < ActiveRecord::Migration\n def change\n \tlocations_count = Location.where(:name => \"France\")\n\t\t\t.first\n\t\t\t.children...
ruby
chosen
[ { "from": "human", "value": "Update foreign keys to bigint\n" }, { "from": "gpt", "value": "class ChangeExtraKeysToBigint < ActiveRecord::Migration[6.0]\n def up\n change_column :organization_users, :creator_id, :bigint\n change_column :pg_search_documents, :searchable_id, :bigint\n ch...
ruby
chosen
[ { "from": "human", "value": "Update project_id primary and foreign keys to bigint\n" }, { "from": "gpt", "value": "class ChangeProjectIdToBigint < ActiveRecord::Migration[6.0]\n def up\n change_column :projects, :id, :bigint\n\n change_column :subjects, :project_id, :bigint\n end\n\n de...
ruby
chosen
[ { "from": "system", "value": "Add rake as development dependency\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.unshift File.expand_path(\"../lib\", __FILE__)\nrequire \"csvision/version\"\n\nGem::Specification.new do |gem|\n gem.authors = [\"Enrique Vidal\"]\n gem.emai...
ruby
chosen
[ { "from": "system", "value": "Make use of Ruby's quote-word syntax\n" }, { "from": "human", "value": "module DesignerNews\n class Story\n include StoryFormatter\n\n attr_reader :title, :badge\n\n def initialize(hash)\n ['title', 'url', 'badge', 'created_at'].each do |key|\n ...
ruby
chosen
[ { "from": "system", "value": "Optimize search in fake domains list\n" }, { "from": "human", "value": "require 'mail'\n\nclass FakeEmailService\n\n def initialize\n fake_domains_file = File.expand_path('../../config/fake_domains.list', __FILE__)\n @fake_domains = File.readlines(fake_domain...
ruby
chosen
[ { "from": "system", "value": "Team: Remove old associations with participations and records.\n" }, { "from": "human", "value": "# lib/frecon/models/team.rb\n#\n# Copyright (C) 2014 Christopher Cooper, Sam Craig, Tiger Huang, Vincent Mai, Sam Mercier, and Kristofer Rye\n#\n# This file is part of ...
ruby
chosen
[ { "from": "system", "value": "Fix method missing on omniauth redirects.\n" }, { "from": "human", "value": "class Garelic::Middleware\n def initialize(app)\n @app = app\n Garelic::Metrics.reset!\n end\n\n def call(env)\n status, headers, response = @app.call(env)\n\n if headers[\"C...
ruby
chosen
[ { "from": "system", "value": "Remove the left in debugging\n" }, { "from": "human", "value": "module HubRelease\n module Commits\n def self.reverted_commits(base, head)\n @compare ||= HubRelease.client.compare(HubRelease.repo, base, head)\n\n reverts = @compare.commits.map do |c|\n...
ruby
chosen
[ { "from": "system", "value": "[hephaestus] Fix typo on task name\n" }, { "from": "human", "value": "require 'active_support/all'\n\nclass DocumentProcessBootstrapTask\n @queue = :document_process_bootstrap\n\n def self.perform(document_id)\n document = Document.find(document_id)\n task_f...
ruby
chosen
[ { "from": "system", "value": "rubocop: Refactor to split the method\n" }, { "from": "human", "value": "module Comable\n class ProductsController < Comable::ApplicationController\n def index\n @category = Comable::Category.where(id: params[:category_id]).first\n if @category\n ...
ruby
chosen
[ { "from": "system", "value": "Change number of unicorn worder\n" }, { "from": "human", "value": "app_path = '/home/journey/hound/current'\nstderr_path \"#{app_path}/log/unicorn-err.log\"\nstdout_path \"#{app_path}/log/unicorn-out.log\"\n\nlisten '/tmp/unicorn.sock', backlog: 2048\npid 'tmp/pids/...
ruby
chosen
[ { "from": "system", "value": "Check ruby version before compilation" }, { "from": "human", "value": "require \"mkmf\"\n\nyajl_inc, yajl_lib = pkg_config('yajl')\nabort \"----\\nCannot find YAJL\\n----\" unless yajl_inc && yajl_lib\n\n$CFLAGS << \" -Wall -Werror -Wno-unused-parameter \"\n\ncreate...
ruby
chosen
[ { "from": "system", "value": "Build system: clarify MustacheTask rationale\n" }, { "from": "human", "value": "# encoding: UTF-8\nrequire 'rake/smart_file_task'\nrequire 'mustache'\n\nmodule Rake\n # Rake task to generate files from Mustache templates using\n # dynamically generated data (as op...
ruby
chosen
[ { "from": "system", "value": "Move knowledge of the name of the resume data JSON file name to the only place it's needed: the resume data fetcher\n" }, { "from": "human", "value": "require 'open-uri'\nrequire 'json'\nrequire 'socket'\nrequire_relative '../network_connection_error'\nrequire_relat...
ruby
chosen
[ { "from": "system", "value": "Make the right method private\n" }, { "from": "human", "value": "module StackMaster\n class TemplateCompiler\n TemplateCompilationFailed = Class.new(RuntimeError)\n\n def self.compile(config, stack_definition, compile_time_parameters, compiler_options = {})\n...
ruby
chosen
[ { "from": "system", "value": "Use Rack::StaticCache for our static files." }, { "from": "human", "value": "module SchnitzelPress\n class App < Sinatra::Base\n set :views, ['./views/', File.expand_path('../../views/', __FILE__)]\n set :public_folder, File.expand_path('../../public/', __FIL...
ruby
chosen
[ { "from": "system", "value": "Reset queue key validitity for the moment until we sort out expiry with starlings server components\n\n\ngit-svn-id: 6d9b9a8f21f96071dc3ac7ff320f08f2a342ec80@86 daa9635f-4444-0410-9b3d-b8c75a019348\n" }, { "from": "human", "value": "require 'starling'\nrequire 'time...
ruby
chosen
[ { "from": "system", "value": "Make UrlNotFound error more descriptive.\n" }, { "from": "human", "value": "module Shrinker\n class Extractor < Struct.new(:token, :config)\n UrlNotFound = ArgumentError.new\n\n def self.unshrink(token, config = nil)\n self.new(token, config).unshrink\n ...
ruby
chosen
[ { "from": "system", "value": "Change [c] tag to use <span>\n" }, { "from": "human", "value": "class ContentParser\n def self.parse_mc_tags(content)\n return content unless content.present?\n\n content.gsub!('[mc]', '<pre lang=\"python\"><code>')\n content.gsub!('[/mc]', '</code></pre>'...
ruby
chosen
[ { "from": "system", "value": "Add command: Use initializer instead of instance_variable_set\n" }, { "from": "human", "value": "# frozen_string_literal: true\nrequire \"bundler/cli/common\"\n\nmodule Bundler\n class CLI::Add\n def initialize(options, gem_name)\n @gem_name = gem_name\n ...
ruby
chosen
[ { "from": "system", "value": "Read event data control consistency is improved\n" }, { "from": "human", "value": "module EventStore\n module Client\n module HTTP\n module Controls\n module EventData\n module Read\n module JSON\n def self.data(numbe...
ruby
chosen
[ { "from": "system", "value": "Add field description for model Product\n" }, { "from": "human", "value": "class Product < ActiveRecord::Base\nend\n\n#migrations\nclass CreateAllTables < ActiveRecord::Migration\n def self.up\n create_table(:products) { |t| t.string :name }\n end\nend\nActiveR...
ruby
chosen
[ { "from": "system", "value": "Use ARGV instead of $*\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'usaidwat'\n\nmodule USaidWat::Commands extend self\n def where\n damn where_usage unless ARGV.length == 1\n \n reddit_user = USaidWat::RedditUser.new $*.shift\n comme...
ruby
chosen
[ { "from": "human", "value": "Add a feature spec for DeliveryUpdates\n" }, { "from": "gpt", "value": "# encoding: utf-8\nrequire \"rails_helper\"\nrequire \"support/helpers/features/user_accounts\"\n\nRSpec.describe \"Adding delivery updates\" do\n let!(:user) { FactoryGirl.create(:normal_user) ...
ruby
chosen
[ { "from": "human", "value": "Add example branch instruction spec.\n" }, { "from": "gpt", "value": "require File.expand_path(\"../spec_helper\", __FILE__)\n\ndescribe \"Instruction goto_if_nil\" do\n before do\n @spec = InstructionSpec.new :goto_if_nil do |g|\n done = g.new_label\n\n ...
ruby
chosen
[ { "from": "system", "value": "Put the accidently commented out specs back in.\n\nThanks alovak!" }, { "from": "human", "value": "require File.expand_path('../spec_helper', File.dirname(__FILE__))\n\ndescribe Capybara::Session do\n context 'with selenium driver' do\n before do\n @session...
ruby
chosen
[ { "from": "system", "value": "Fix sql issue with reserved column name 'default'\n" }, { "from": "human", "value": "class PriorityType < ActiveRecord::Base\n \n #attr_accessible :name, :description, :active, :default\n \n # default scope\n default_scope { where(:active => tru...
ruby
chosen
[ { "from": "system", "value": "Improve first_name and last_name setup\n" }, { "from": "human", "value": "class SplitCustomersName < ActiveRecord::Migration[6.1]\n class Customer < ActiveRecord::Base\n end\n\n def change\n add_column :customers, :first_name, :string\n add_column :customer...
ruby
chosen
[ { "from": "human", "value": "Add listado method to notas report, with pases history" }, { "from": "gpt", "value": "class NotasReport\n\n attr_accessor :notas\n\n def initialize notas\n self.notas = notas\n end\n\n def listado_notas\n\n# numero, area, tipo de iniciador, iniciador, tags, w...
ruby
chosen
[ { "from": "system", "value": "Correct the generator name bug\n" }, { "from": "human", "value": "require 'securerandom'\n\nmodule Datetimepicker_rails\n module Generators\n class InstallGenerator < Rails::Generators::Base\n source_root File.expand_path(\"../../templates/inputs\", __FILE_...
ruby
chosen
[ { "from": "system", "value": "Deal with the case where something like TT-32 returns a 404.\n" }, { "from": "human", "value": "require 'jiralicious'\n\nmodule Noteworthy\n class Jira\n attr_accessor :configured\n \n def configure(config=nil)\n @configured = false\n return fals...
ruby
chosen
[ { "from": "system", "value": "Fix Fog file loading and yaml keys\n" }, { "from": "human", "value": "require 'yaml'\n\nmodule Opstwerk\n class Config\n attr_reader :environment\n\n def initialize(environment)\n @environment = environment.to_sym\n end\n\n def aws_config\n lo...
ruby
chosen
[ { "from": "system", "value": "Return values array from response\n\nReturning an array of the data rather than the entire response to allow iteration over\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule BitBucket\n class Teams < API\n extend AutoloadHelper\n\n def initialize...
ruby
chosen
[ { "from": "human", "value": "Create a basic Either monad for chaining operators together\n" }, { "from": "gpt", "value": "module USaidWat\n class Either\n attr_reader :value\n\n def initialize(value)\n @value = value\n end\n end\n\n class Left < Either\n def method_missing(me...
ruby
chosen
[ { "from": "system", "value": "Include Commands module outside the Command class\n" }, { "from": "human", "value": "require_relative '../helpers/hyphenizer'\n\nmodule Passman\n class Command\n attr_reader :global, :options, :args\n attr_reader :config, :database\n\n def initialize(globa...
ruby
chosen
[ { "from": "system", "value": "Set couch tests to pending when couch isn't being run" }, { "from": "human", "value": "# encoding: utf-8\nrequire 'spec_helper'\nrequire File.dirname(__FILE__) + '/shared_data_store_examples'\n\ndescribe Dragonfly::DataStorage::CouchDataStore do\n before(:each) do\...
ruby
chosen
[ { "from": "human", "value": "Add tests for data API query controller\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nrequire \"test_helper\"\n\nmodule GobiertoData\n module Api\n module V1\n class QueryControllerTest < GobiertoControllerTest\n\n def site\n ...
ruby
chosen
[ { "from": "system", "value": "Order the list of articles.\n" }, { "from": "human", "value": "class Backend::ArticlesController < Backend::BaseController\n include Concerns::Backend::TranslatableController\n include Concerns::PaginationController\n\n before_action :find_model, only: [:edit, :u...
ruby
chosen
[ { "from": "system", "value": "Fix assets precompile needing a database connection.\n" }, { "from": "human", "value": "# frozen_string_literal: true\nmodule ApplicationUserstampConcern\n extend ActiveSupport::Concern\n\n module ClassMethods\n # Bring forward the userstamp association definit...
ruby
chosen
[ { "from": "system", "value": "Change weird Capistrano version check\n" }, { "from": "human", "value": "require 'capistrano'\nrequire 'capistrano/version'\n\nif Capistrano.constants.include? :VERSION\n require 'opbeat/integration/capistrano2'\nelse\n require 'opbeat/integration/capistrano3'\nen...
ruby
chosen
[ { "from": "system", "value": "Add a hashtag for tweets.\n" }, { "from": "human", "value": "module VoteTracker\n class Vote\n ABBREVIATIONS = {\n 'and' => '&',\n 'with' => 'w/',\n 'without' => 'w/o'\n }\n\n BASE_URL = 'http://www.senate.gov/legislative/LIS/roll_cal...
ruby
chosen
[ { "from": "human", "value": "Add code wars (7) jaden case\n" }, { "from": "gpt", "value": "# http://www.codewars.com/kata/5390bac347d09b7da40006f6/\n# --- iterations ---\nclass String\n def to_jaden_case\n split(\" \").map(&:capitalize).join(\" \")\n end\nend\n\nclass String\n def to_jaden...
ruby
chosen
[ { "from": "system", "value": "Rename document -> section in PublishingApiManualWithSectionsPublisher\n" }, { "from": "human", "value": "class PublishingApiManualWithSectionsPublisher\n def call(manual, action = nil)\n update_type = (action == :republish ? \"republish\" : nil)\n Publishing...
ruby
chosen
[ { "from": "system", "value": "Disable monothly short track standings\n" }, { "from": "human", "value": "module Competitions\n module PortlandShortTrackSeries\n class Overall < Competitions::Overall\n include PortlandShortTrackSeries::Common\n\n def maximum_events(race)\n 7\n...
ruby
chosen
[ { "from": "human", "value": "Change name of recipe search controller\n" }, { "from": "gpt", "value": "get '/search_recipes' do\n response = RestClient.get \"https://api.bigoven.com/recipes?pg=1&rpp=25&title_kw=salsa&api_key=#{ENV['API_KEY']}\",{:Accept => 'application/json'}\n\n p response\n\n...
ruby
chosen
[ { "from": "human", "value": "Add a thin integration test to ensure that the correct autoscroll class appears when viewing a thread.\n" }, { "from": "gpt", "value": "require \"spec_helper\"\n\n# This is a very thin test, since most of the functionality is tested\n# in the controller test. Here we...
ruby
chosen
[ { "from": "system", "value": "Fix restaurants controller rspec test file to pass Travis CI\n" }, { "from": "human", "value": "require 'rails_helper'\n\n# RSpec.describe RestaurantsController, type: :controller do\n#\n# let(:restaurants) { search_by_zip(\"94030\") }\n#\n#\n# it 'responds with JSO...
ruby
chosen
[ { "from": "system", "value": "Use the more accurate ~>0.18.b1 rugged version\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire 'docurium/version'\n\nGem::Specification.new do |s|\n s.name = \"docurium\"\n s.version ...
ruby
chosen
[ { "from": "system", "value": "Support libvirt lxc as well\n" }, { "from": "human", "value": "class Specinfra::Command::Linux::Base::LxcContainer < Specinfra::Command::Base::LxcContainer\n class << self\n def check_exists(container)\n \"lxc-ls -1 | grep -w #{escape(container)}\"\n end...
ruby
chosen
[ { "from": "system", "value": "Add batch action to toggle status for VideoUpload\n" }, { "from": "human", "value": "ActiveAdmin.register VideoUpload do\n menu parent: I18n.t('admin_menu.assets')\n\n permit_params :id,\n :video,\n :online\n\n decorate_with VideoUpl...
ruby
chosen
[ { "from": "system", "value": "Add Jekyll v3.3 as dependency\n" }, { "from": "human", "value": "# coding: utf-8\n\nGem::Specification.new do |spec|\n spec.name = \"minimal-mistakes-jekyll\"\n spec.version = \"4.0.2\"\n spec.authors = [\"Michae...
ruby
chosen
[ { "from": "system", "value": "Remove lost character from gemspec" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'curriculum_vitae/version'\n\nGem::Specification.new do |spec|\n spec.n...
ruby
chosen
[ { "from": "system", "value": "Use RubyGems class methods to get bindir instead of exec'ing out to the shell\n" }, { "from": "human", "value": "env = YAML::load( `gem environment` )[\"RubyGems Environment\"].detect { |x| x[\"EXECUTABLE DIRECTORY\"] }\ntemplate \"/etc/init.d/unicorn\" do\n source...
ruby
chosen
[ { "from": "system", "value": "Fix job create route (redirect issue)\n" }, { "from": "human", "value": "class Api::V1::JobsController < ApplicationController\n def index\n render json: Job.all\n end\n\n def show\n render json: Job.find(params[:id])\n end\n \n def create\n job = Job...
ruby
chosen
[ { "from": "system", "value": "Refresh stack information prior to polling to prevent immediate exit\n" }, { "from": "human", "value": "require 'knife-cloudformation'\n\nclass Chef\n class Knife\n # Cloudformation destroy command\n class CloudformationDestroy < Knife\n\n include KnifeC...
ruby
chosen
[ { "from": "human", "value": "Add test for the InfluxDB service\n" }, { "from": "gpt", "value": "require \"serverspec\"\n\ninclude Serverspec::Helper::Exec\ninclude Serverspec::Helper::DetectOS\n\nRSpec.configure do |c|\n c.before :all do\n c.path = \"/sbin:/usr/sbin\"\n end\nend\n\ndescribe...
ruby
chosen
[ { "from": "system", "value": "Improve a bit the error handling stuff in aquarii shell\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\nrequire 'pathname'\n\nbase = Pathname(__FILE__).expand_path\nlib = base + \"../lib/aq_lib.rb\"\n\nrequire lib\n\n# kick start the thing :\nAqLib::Comman...
ruby
chosen
[ { "from": "human", "value": "Add a migration to remove conflicting content items\n" }, { "from": "gpt", "value": "require_relative \"helpers/delete_content_item\"\n\nclass January6RemoveConflictingContentItems < ActiveRecord::Migration[5.0]\n def up\n to_delete = [1624168, 1624157, 1622943]\...
ruby
chosen
[ { "from": "system", "value": "Update example to use :all syntax\n" }, { "from": "human", "value": "#!/usr/bin/env creeper -j\n#\n# There are 2 ways to run this file:\n# creeper -j jack.rb\n# OR\n# ./jack.rb\n\n$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../lib') unless $LOAD_PATH.include?(File...
ruby
chosen
[ { "from": "system", "value": "[minor] Fix podspec summary (wrong project)\n\nJust a very minor tweak. It appears that the podspec's summary is describing\r\nhttps://github.com/airbnb/react-native-maps, so probably just a copy-and-paste\r\nerror." }, { "from": "human", "value": "require 'json'\n\...
ruby
chosen
[ { "from": "system", "value": "Fix before type cast values when loaded from database\n" }, { "from": "human", "value": "module MongoModel\n module Attributes\n module Typecasting\n def []=(key, value)\n values_before_typecast[key] = value\n \n result = super(key, typ...
ruby
chosen
[ { "from": "system", "value": "Update gem summary and description to help potential users\n\nI lost the discussion about changing the gem name, but I think it's\nworth expanding the summary and description to provide more detail.\n\nIn particular, I wanted to include \"linter\" as a short cut to\ncommunicati...
ruby
chosen
[ { "from": "system", "value": "Switch to teamocil for tmux\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'finances/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "human", "value": "Add spec and fix exception for Fiddle::Handle.new with a missing library\n\n* Fixes https://github.com/oracle/truffleruby/issues/2714\n" }, { "from": "gpt", "value": "require_relative '../../../spec_helper'\nrequire 'fiddle'\n\ndescribe \"Fiddle::Handle#initialize\" ...
ruby
chosen
[ { "from": "human", "value": "Add benchmarking script for metric types\n" }, { "from": "gpt", "value": "require 'statsd-instrument'\nrequire 'benchmark/ips'\n\ndef helperFunction()\n a = 10\n a += a\n a -= a\n a *= a\nend\n\nBenchmark.ips do |bench|\n bench.report(\"increment metric ...
ruby
chosen
[ { "from": "system", "value": "Add rspec as development dependency" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"fonetica/version\"\n\nGem::Specification.new do |s|\n s.name = \"fonetica\"\n s.version = Fonetica:...
ruby
chosen
[ { "from": "system", "value": "Add missing 'virtus' gem dependency\n" }, { "from": "human", "value": "lib = File.expand_path('../lib/', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\n\nGem::Specification.new do |s|\n s.name = 'fragrant'\n s.version = \"0.0.1\"\n ...
ruby
chosen
[ { "from": "system", "value": "Improve code style: Use fancy string.\n" }, { "from": "human", "value": "class UpdateDisplayTextForOboSentences < ActiveRecord::Migration\n def up\n obo_ontologies = Ontology.joins(:ontology_version).\n where(ontology_versions: {file_extension: '.obo'})\n ...
ruby
chosen
[ { "from": "system", "value": "Define up migration to avoid re-importing all SSPs\n" }, { "from": "human", "value": "class AddOperatorToScheduleStopPair < ActiveRecord::Migration\n def change\n add_reference :current_schedule_stop_pairs, :operator, index: true\n add_reference :old_schedule...
ruby
chosen
[ { "from": "system", "value": "Fix host parameter in case of creating user.\n" }, { "from": "human", "value": "#\n# Cookbook Name:: mysql_part\n# Recipe:: create_database\n#\n# Copyright 2014, YOUR_COMPANY_NAME\n#\n# All rights reserved - Do Not Redistribute\n#\n\ninclude_recipe 'database::mysql'...
ruby
chosen
[ { "from": "system", "value": "Fix name left over from copy-paste\n" }, { "from": "human", "value": "require 'spec_helper'\n\nfeature 'Exercise Flow', organization_workspace: :test do\n let(:user) { create(:user, id: 1) }\n let(:user2) { create(:user, id: 2) }\n\n let!(:problem) { build(:probl...
ruby
chosen
[ { "from": "system", "value": "Handle empty uuids on associations\n" }, { "from": "human", "value": "module HasUuid\n module ActiveRecord\n module Associations\n module SingularAssociation\n extend ActiveSupport::Concern\n included do\n def uuid_writer(uuid)\n ...
ruby
chosen
[ { "from": "system", "value": "Use environment variables by default\n" }, { "from": "human", "value": "class AwsAccessor\n def initialize(access_key_id, secret_access_key)\n @access_key_id = access_key_id\n @secret_access_key = secret_access_key\n end\n\n def ecs\n @ecs ||= Aws::ECS::...
ruby
chosen
[ { "from": "system", "value": "Fix core for PUT & PATCH\n" }, { "from": "human", "value": "# encoding: utf-8\nmodule ActionController::CORSProtection\n\n extend ActiveSupport::Concern\n\n included do\n before_filter :allow_cors\n after_filter :set_cors\n end\n\n def set_cors\n if $s...
ruby
chosen
[ { "from": "system", "value": "Fix bug when saving SongSection with blank order\n\nWe were not properly checking for a blank field before assuming it was a\nnumeric. This is corrected.\n\nCloses #2\n" }, { "from": "human", "value": "class SongSection < ActiveRecord::Base\n belongs_to :song\n\n ...
ruby
chosen
[ { "from": "system", "value": "Remove cancan from users/contributions controller\n" }, { "from": "human", "value": "class Users::ContributionsController < ApplicationController\n after_filter :verify_authorized, except: [:index]\n after_filter :verify_policy_scoped, only: [:index]\n inherit_re...
ruby
chosen
[ { "from": "system", "value": "Fix issue adding work package\n" }, { "from": "human", "value": "# Leap - Electronic Individual Learning Plan Software\n# Copyright (C) 2015 South Devon College\n\n# Leap is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero...
ruby
chosen
[ { "from": "system", "value": "Remove redundant private methods & reduce complexity of perform method" }, { "from": "human", "value": "require_relative 'api'\n\nmodule Jadu\n class Claim < Struct.new(:claim)\n class << self\n def create(claim)\n new(claim).tap &:perform\n end...
ruby
chosen
[ { "from": "system", "value": "Add sudo default recipe for /etc/sudoers fix.\n" }, { "from": "human", "value": "default_source :community\ndefault_source :chef_repo, '..'\ncookbook 'redis', path: '../../..'\nrun_list 'redis::default'\nnamed_run_list :centos, 'yum::default', 'yum-epel::default', r...
ruby
chosen
[ { "from": "system", "value": "Fix a deprecation warning in Rails 2.3.6 and newer\n" }, { "from": "human", "value": "# Adapted from the rails3 compatibility shim in Haml 2.2\nmodule Formtastic\n module Util\n extend self\n ## Rails XSS Safety\n\n # Returns the given text, marked as bein...
ruby
chosen
[ { "from": "system", "value": "Allow regions to be supplied.\n" }, { "from": "human", "value": "require \"erb\"\n\nmodule StaticSync\n class Config < Hash\n\n def log\n self.fetch('log', true)\n end\n\n def cache\n self.fetch('cache', {})\n end\n\n def source\n self...
ruby
chosen
[ { "from": "system", "value": "Use http git when HATCHET_GIT_PROTOCOL is set for http\n" }, { "from": "human", "value": "module Hatchet\n # used for deploying a test app to heroku via git\n class GitApp < App\n HATCHET_BUILDPACK_BASE = (ENV['HATCHET_BUILDPACK_BASE'] || \"https://github.com...
ruby
chosen
[ { "from": "system", "value": "Add missing frozen_string_literal: true comment\n" }, { "from": "human", "value": "module Transproc\n # @api private\n class Compiler\n InvalidFunctionNameError = Class.new(StandardError)\n\n attr_reader :registry, :transformer\n\n def initialize(registry...
ruby
chosen
[ { "from": "system", "value": "Set a class path method, ditch the output_path override method.\n" }, { "from": "human", "value": "module UsesThis\n class Interview < Salt::Post\n\n def initialize(site, path)\n super(site, path)\n @metadata['layout'] = 'interview'\n end\n\n def...
ruby
chosen
[ { "from": "system", "value": "Stop returning a charge object in POST\n" }, { "from": "human", "value": "require 'sinatra'\nrequire 'stripe'\nrequire 'digest'\n\nStripe.api_key = ENV[\"STRIPE_API_KEY\"]\n\nclass Cashin < Sinatra::Base\n get '/' do\n md5 = Digest::MD5.new.update(ENV['USER_EMAI...
ruby
chosen
[ { "from": "system", "value": "Document __FILE__ == $0 hack\n" }, { "from": "human", "value": "require \"rubygems\"\nrequire \"bundler/setup\"\n\nrequire \"./lib/ext/hash.rb\"\nrequire \"./lib/ext/string.rb\"\nrequire \"./lib/ext/symbol.rb\"\n\nrequire \"./lib/helperloader.rb\"\n\nrequire \"./lib...
ruby
chosen
[ { "from": "system", "value": "Support path to corpus file. attr_reader :corpus.\n" }, { "from": "human", "value": "require 'json'\nrequire 'nokogiri'\n\nclass Chbs::Generator\n def initialize(options={})\n corpusname = options[:corpus] || 'tv-and-movies'\n \n corpusdir = File.expand_p...
ruby
chosen
[ { "from": "system", "value": "Use a warning for the deprecation notice\n" }, { "from": "human", "value": "require \"git_tracker/prepare_commit_message\"\nrequire \"git_tracker/hook\"\nrequire \"git_tracker/version\"\n\nmodule GitTracker\n module Runner\n def self.execute(cmd_arg = \"help\", ...
ruby
chosen
[ { "from": "system", "value": "Use File.foreach to avoid the need to close files\n" }, { "from": "human", "value": "require \"email_assessor/email_validator\"\n\nmodule EmailAssessor\n DISPOSABLE_DOMAINS_FILE_NAME = File.expand_path(\"../../vendor/disposable_domains.txt\", __FILE__)\n BLACKLIST...
ruby
chosen
[ { "from": "system", "value": "Add latest changes from gitlab-org/gitlab@master\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'set'\n\nclass Feature\n class Gitaly\n # Server feature flags should use '_' to separate words.\n SERVER_FEATURE_FLAGS =\n %w[\n...
ruby
chosen
[ { "from": "system", "value": "Include FReCon on Pry start\n" }, { "from": "human", "value": "module FReCon\n\tclass Console\n\t\tdef self.start\n\t\t\tFReCon::Database.setup(FReCon::Server.environment)\n\t\t\t\n\t\t\tbegin\n\t\t\t\trequire \"pry\"\n\n\t\t\t\tPry.start\n\t\t\trescue Exception => ...
ruby
chosen
[ { "from": "system", "value": "Fix Sign::RSA key arg missing\n" }, { "from": "human", "value": "require 'openssl'\nrequire 'base64'\n\nmodule Alipay\n module Sign\n class RSA\n def self.sign(key, string)\n rsa = OpenSSL::PKey::RSA.new(key)\n Base64.encode64(rsa.sign('sha1',...
ruby
chosen
[ { "from": "human", "value": "Add tests for livecheck_formula utils\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nrequire \"utils/livecheck_formula\"\n\ndescribe LivecheckFormula do\n describe \"init\", :integration_test do\n it \"runs livecheck command for Formula\" do\n ...
ruby
chosen
[ { "from": "system", "value": "Allow to change the notes config directly from Footnotes.setup\n" }, { "from": "human", "value": "require 'rails'\nrequire 'action_controller'\nrequire 'rails-footnotes/backtracer'\nrequire 'rails-footnotes/abstract_note'\nrequire 'rails-footnotes/each_with_rescue'\...
ruby
chosen
[ { "from": "system", "value": "Add kwargs splats to TestHelpers\n" }, { "from": "human", "value": "module Oprah\n module TestHelpers\n def present_many(*args, &block)\n Oprah.present_many(*args, &block)\n end\n\n def present(*args, &block)\n Oprah.present(*args, &block)\n e...
ruby
chosen
[ { "from": "system", "value": "Save minimum ruby for version 3\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire \"./lib/rotp/version\"\n\nGem::Specification.new do |s|\n s.name = \"rotp\"\n s.version = ROTP::VERSION\n s.platform = Gem::Platform::RUBY\n s.req...
ruby
chosen