conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Allow newer sassc for m1 macs compatibility\n\nNewer sassc versions use newer ffi versions,\nwhich are needed for m1 macs.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.inclu...
ruby
chosen
[ { "from": "system", "value": "Remove debug from monkey module\n\nSigned-off-by: Aki Saarinen <278bc57fbbff6b7b38435aea0f9d37e3d879167e@akisaarinen.fi>\n" }, { "from": "human", "value": "require \"yaml\"\n\nclass Module_Monkey\n def init_module(bot)\n filename = bot.module_config[\"monkey_fil...
ruby
chosen
[ { "from": "system", "value": "Drop unneeded user info from Group serialization\n" }, { "from": "human", "value": "module Transferatu::Serializers\n class Group < Base\n structure(:default) do |group|\n {\n uuid: group.uuid,\n name: group.name,\n ...
ruby
chosen
[ { "from": "system", "value": "Support runtime environments without asset pipeline\n" }, { "from": "human", "value": "require 'haml'\nclass WebComponentsRails::Railtie < Rails::Railtie\n # Register our asset tag helpers\n initializer 'web_components.asset_tag_helper' do\n ActionView::Base.mo...
ruby
chosen
[ { "from": "system", "value": "Update the way user challenges, submissions and awards are loaded.\n" }, { "from": "human", "value": "module Hovercard\n class UsersController < ApplicationController\n before_filter :find_user\n\n def hovercard\n @challenges_count = @user.supported_chal...
ruby
chosen
[ { "from": "system", "value": "FIX: Add missing task def id to ticket serialiser\n" }, { "from": "human", "value": "class HelpdeskTicketSerializer < ActiveModel::Serializer\n attributes :id,\n :student,\n :task,\n :tutorial,\n :target_grade,\n ...
ruby
chosen
[ { "from": "system", "value": "Change dependency railties to ~> 3.0\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'medium-editor-rails/version'\n\nGem::Specification.new do |gem|\n ...
ruby
chosen
[ { "from": "system", "value": "Fix URI::InvalidURIError: bad URI(is not URI?) in stats test\n\nrake-test 0.7.0 stopped formatting params in urls[1] if they were already\nin rest format. Test was passing in previous versions as side effect of\npath being escaped by Rack::Test:Untils.build_nested_query (`#{esc...
ruby
chosen
[ { "from": "system", "value": "Revert \"Changed the order of images in the srcset attrib\"\n\nThis reverts commit 33e665a8c0cb7ce36f3d5121fa0a7c164b6994e8.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Api::PagesHelper\n def image_url(page, size = 'medium')\n path...
ruby
chosen
[ { "from": "system", "value": "Use www.mirrorservice.org because googlecode.com will be shutdown\n" }, { "from": "human", "value": "#\n# Copyright 2012-2014 Chef Software, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in complianc...
ruby
chosen
[ { "from": "system", "value": "Switch the retired logic as proposed by tinaafitz\n\nSee: https://www.pivotaltracker.com/story/show/145237979\n" }, { "from": "human", "value": "class RetirementManager\n def self.check\n ems_ids = MiqServer.my_server.zone.ext_management_system_ids\n [LoadBal...
ruby
chosen
[ { "from": "system", "value": "Use rspec and yard in development\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\n$:.push File.expand_path(\"../lib\", __FILE__)\n\nrequire \"shepherd/version\"\n\nGem::Specification.new do |s|\n s.name = \"shepherd\"\n s.version = Sheph...
ruby
chosen
[ { "from": "system", "value": "Use `key` as primary key in schema." }, { "from": "human", "value": "require 'active_record/scoping/default'\nrequire 'active_record/scoping/named'\n\nmodule ActiveRecord\n # This class is used to create a table that keeps track of values and keys such\n # as whic...
ruby
chosen
[ { "from": "system", "value": "Update RSpec to 2.14.0 to fix ActiveSupport::Deprecation bug in Ruby 2.x.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'open_badges/version'...
ruby
chosen
[ { "from": "system", "value": "Fix 404 in assoc. request count to be correct\n" }, { "from": "human", "value": "require 'json'\nrequire 'chef_zero/rest_base'\n\nmodule ChefZero\n module Endpoints\n # /users/NAME/association_requests/count\n class UserAssociationRequestsCountEndpoint < Rest...
ruby
chosen
[ { "from": "system", "value": "Revert \"Fix UserManager Spec, check for valid_password\"\n\nThis reverts commit 0080c2e92e03519a07684ca93ed123525c6e2d7e.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe FactlinkApi::UserManager do\n it \"should create a user with the right ar...
ruby
chosen
[ { "from": "system", "value": "Disable symlinking of node package\n" }, { "from": "human", "value": "require_relative \"task_helpers\"\ninclude ReactOnRails::TaskHelpers\n\nnamespace :node_package do\n task :build do\n sh 'npm run build'\n end\n\n desc \"Has all examples and dummy apps use ...
ruby
chosen
[ { "from": "system", "value": "Order groups by full name in search dropdown\n" }, { "from": "human", "value": "class API::MembershipsController < API::RestfulController\n\n def index\n @group = Group.find(params[:group_id])\n authorize! :show, @group\n\n @memberships = Queries::VisibleM...
ruby
chosen
[ { "from": "system", "value": "Maintain compatibility with newrelic ~3.3.3\n\nAs per #8 newrelic changed the signature of the dispatch methods in\n3.3.3. This commit restores compatibilty with 3.3.3 and higher, closing\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nGem::Specifica...
ruby
chosen
[ { "from": "system", "value": "Update spec for Alpine Linux.\n" }, { "from": "human", "value": "require \"spec_helper_#{ENV['SPEC_TARGET_BACKEND']}\"\n\ndescribe package('python-dev'), :if => os[:family] == 'debian' do\n it { should be_installed }\nend\n\ndescribe package('build-essential'), :if...
ruby
chosen
[ { "from": "system", "value": "Add time range params to stats action; include errors count" }, { "from": "human", "value": "class Api::V1::StatsController < ApplicationController\n respond_to :json, :xml\n\n # The stats API only requires an api_key for the given app.\n skip_before_action :auth...
ruby
chosen
[ { "from": "system", "value": "Use other flash keys for progress status messages\n" }, { "from": "human", "value": "class JobMessagesController < ApplicationController\n before_filter :authorize_only_for_admin\n\n def show\n @job_message = Rails.cache.fetch(params[:job_id])\n respond_to do...
ruby
chosen
[ { "from": "system", "value": "3491: Disable CSRF protection on select-phone form\n\nThis is so that requests from old frontend wont be rejected because they\ndo not contain the csrf value.\n\nAuthors: 4128f4e12f262ed8971b6235be968af8ca8e7344@vixus0\n" }, { "from": "human", "value": "require 'evi...
ruby
chosen
[ { "from": "system", "value": "Add todo regarding saving the page seo.\n" }, { "from": "human", "value": "class Backend::PageTranslationForm < Reform::Form\n include Composition\n\n model :page\n\n property :title, on: :translation\n property :subtitle, on: :translation\n\n property :seo_tit...
ruby
chosen
[ { "from": "system", "value": "Add note about ActiveModel::Validations monkey patch" }, { "from": "human", "value": "# encoding: UTF-8\nmodule MongoMapper\n module Plugins\n module EmbeddedCallbacks\n def self.configure(model)\n model.class_eval do\n extend ::ActiveModel...
ruby
chosen
[ { "from": "system", "value": "Remove extra spaces from gemspec" }, { "from": "human", "value": "# coding: utf-8\n\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'piperator/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Make some assertions about script run output\n" }, { "from": "human", "value": "describe Chirp::Runner do\n subject { described_class.new(%w(whatever)) }\n\n it 'has a Child class' do\n expect(Chirp::Runner::Child).to_not be_nil\n end\n\n it 'accepts an actio...
ruby
chosen
[ { "from": "system", "value": "Use be(true) in spec because be_true has changed.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe(Jekyll::Converters::CoffeeScript) do\n let(:configuration) { Jekyll::Configuration::DEFAULTS }\n let(:converter) do\n Jekyll::Converters::Coff...
ruby
chosen
[ { "from": "human", "value": "Add chef-spec for backup_directory recipe\n" }, { "from": "gpt", "value": "require_relative '../spec_helper'\n\ndescribe 'backup_restore::backup_directory' do\n let(:chef_run) do\n ChefSpec::Runner.new(\n cookbook_path: %w(site-cookbooks cookbooks),\n p...
ruby
chosen
[ { "from": "system", "value": "Use new Hash syntax in Entry model\n" }, { "from": "human", "value": "class Entry\n include Mongoid::Document\n include Mongoid::Timestamps\n\n field :script, :type => Binary\n field :score, :type => Integer\n\n embeds_many :comments\n embedded_in :challenge, ...
ruby
chosen
[ { "from": "system", "value": "Change from _xclick to _s-xclick\n" }, { "from": "human", "value": "class Order < ActiveRecord::Base\n has_many :paypal_notifications\n belongs_to :selected, class_name: \"Lead\"\n belongs_to :selector, class_name: \"User\"\n \n validates :selected_id, presence...
ruby
chosen
[ { "from": "system", "value": "Add method Tweet to get overall average sentiment for a country\n" }, { "from": "human", "value": "class Tweet < ActiveRecord::Base\n\tbelongs_to :trend\n\n\tdef get_sentiment\n\t\tAlchemyAPI.search(:sentiment_analysis, :text => self.text.delete(\"#\").delete(\"&amp...
ruby
chosen
[ { "from": "system", "value": "Update How_to & spec tdd file\n" }, { "from": "human", "value": "# spec/Dockerfile_spec.rb\n\nrequire \"serverspec\"\nrequire \"docker\"\n\ndescribe \"Dockerfile\" do\n before(:all) do\n image = Docker::Image.build_from_dir('.')\n\n set :os, family: :debian\n...
ruby
chosen
[ { "from": "system", "value": "Use ' instead of \"\n" }, { "from": "human", "value": "require \"dolphy/router\"\nrequire \"dolphy/template_engines\"\nrequire 'rack'\n\nmodule Dolphy\n class Core\n include Dolphy::TemplateEngines\n include Dolphy::Router\n\n attr_reader :status, :headers...
ruby
chosen
[ { "from": "system", "value": "Allow the Client to handle server ports\n\nSplit out the hostname & port from the server name when connecting the RPC\nclient.\n" }, { "from": "human", "value": "require 'msgpack/rpc'\nrequire_relative 'logger'\n\nmodule Mist\n class Client\n def initialize(pool...
ruby
chosen
[ { "from": "human", "value": "Implement the mixin (oh my god, my eyes!)" }, { "from": "gpt", "value": "require \"node_module/version\"\nrequire 'live_ast/to_ruby'\nrequire 'v8'\n\nmodule NodeModule\n\n def self.included(base)\n base.extend ClassMethods\n end\n\n module ClassMethods\n def...
ruby
chosen
[ { "from": "system", "value": "Fix includes - Psych was clearing out the !include\n" }, { "from": "human", "value": "require 'yaml'\nrequire 'raml/parser/root'\nrequire 'raml/parser/resource'\nrequire 'raml/parser/method'\nrequire 'raml/parser/response'\nrequire 'raml/parser/body'\nrequire 'raml/...
ruby
chosen
[ { "from": "system", "value": "Replace dashes with double dashes\n" }, { "from": "human", "value": "require \"runscope-rb/version\"\nrequire \"runscope-rb/configuration\"\nrequire \"ext/net_http\"\n\nmodule Runscope\n extend Configuration\n\n def self.version_string\n \"Runscope version #{Ru...
ruby
chosen
[ { "from": "system", "value": "Use File.directory? for 1.8 compatibility\n" }, { "from": "human", "value": "\nclass Sheet::Write\n\n attr_accessor :name\n\n def initialize(name)\n @name = name\n end\n\n def write\n create_dir_if_doesnt_exist\n if editor_is_set?\n Sheet.exec(\"#{...
ruby
chosen
[ { "from": "system", "value": "Add a little rant about library name and how it should be required\n" }, { "from": "human", "value": "require \"virtus\"\nrequire \"yard\"\n\n_dir = File.dirname(__FILE__)\nrequire File.join(_dir, \"yard\", \"virtus\", \"version\")\n\nrequire File.join(_dir, \"yard\...
ruby
chosen
[ { "from": "system", "value": "Use instance variables in Resolver with accessors\n" }, { "from": "human", "value": "module Emcee\n # Resolver is responsible for interfacing with Sprockets.\n class Resolver\n def initialize(context)\n @context = context\n @directory = File.dirname(c...
ruby
chosen
[ { "from": "system", "value": "Move Endpoints under proper module\n" }, { "from": "human", "value": "module Endpoints\n # The base class for all Sinatra-based endpoints. Use sparingly.\n class Base < Sinatra::Base\n register Pliny::Extensions::Instruments\n register Sinatra::Namespace\n\n...
ruby
chosen
[ { "from": "system", "value": "Create a method to extract the auth token from the header\n" }, { "from": "human", "value": "module Endpoints\n # The base class for all Sinatra-based endpoints. Use sparingly.\n class Base < Sinatra::Base\n register Pliny::Extensions::Instruments\n register...
ruby
chosen
[ { "from": "system", "value": "Change the way current param is calculated\n" }, { "from": "human", "value": "module Filters\n class Filter\n include Enumerable\n\n attr_reader :name, :selection_policy, :selected_values\n private :selection_policy, :selected_values\n\n def initialize(...
ruby
chosen
[ { "from": "system", "value": "Add Rubocop gem to allow it to be run locally\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'gmail/slack/notifier/version'\n\nGem::Specification.new do...
ruby
chosen
[ { "from": "system", "value": "Fix source_files file path in podspec\n\nThe addition of the Swift Package file changed the file path for the math parser's source files. This change updates the podspec with the new source_files file path." }, { "from": "human", "value": "Pod::Spec.new do |s|\n s....
ruby
chosen
[ { "from": "human", "value": "Add asset compilation task for webpack\n" }, { "from": "gpt", "value": "Rake::Task['assets:precompile']\n .clear_prerequisites\n .enhance(['assets:compile_environment'])\n\nnamespace :assets do\n # In this task, set prerequisites for the assets:precompile task\n ...
ruby
chosen
[ { "from": "system", "value": "Update Beatport Pro to v2.1.0" }, { "from": "human", "value": "class BeatportPro < Cask\n version '2.0.5_124'\n sha256 '8c1c7dd3bc180eef7f5d12f258241522a659aab1f6dcdc8f077cf151952d1ff2'\n\n url \"http://pro.beatport.com/mac/#{version}/beatportpro_#{version}.dmg\"...
ruby
chosen
[ { "from": "system", "value": "Add rdoc as development dependency\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'hanke-henry/version'\n\nGem::Specification.new do |gem|\n ...
ruby
chosen
[ { "from": "system", "value": "Package version increased from 0.0.3.5 to 0.0.4.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'event_store-client-http'\n s.version = '0.0.3.5'\n s.summary = 'HTTP Client for EventStore'\n s.description ...
ruby
chosen
[ { "from": "system", "value": "Replace hardcoded categories with data fetches from spree_storefront.yaml file\n" }, { "from": "human", "value": "module Spree\n module NavigationHelper\n def categories_data\n [\n {\n name: :women,\n url: nested_taxons_path('women'...
ruby
chosen
[ { "from": "system", "value": "Add missing authorize calls to work experiences controller\n" }, { "from": "human", "value": "module Manage\n class WorkExperiencesController < ManageController\n before_action :set_work_experience, only: [:edit, :update, :destroy]\n\n respond_to :html, :json...
ruby
chosen
[ { "from": "system", "value": "Update Air Video Server HD to 2.2.0\n" }, { "from": "human", "value": "cask :v1 => 'air-video-server-hd' do\n version '2.1.4'\n sha256 '7c516edccbc7556d798af330fada0498f9a57ddd91e325be69ad81c9357d241a'\n\n # amazonaws.com is the official download host per the ven...
ruby
chosen
[ { "from": "human", "value": "Add response to lesson 4.2.1\n" }, { "from": "gpt", "value": "#Solution Below\n\nfirst_name = \"Brian\"\nlast_name = \"Wagner\"\nage = 39\n\n\n# RSpec Tests. They are included in this file because the local variables you are creating are not accessible across files. ...
ruby
chosen
[ { "from": "system", "value": "Move calendar_date_range calculation into method\n" }, { "from": "human", "value": "module GobiertoPeople\n class PersonEventsController < GobiertoPeople::ApplicationController\n include PoliticalGroupsHelper\n\n def index\n if params[:date]\n @ev...
ruby
chosen
[ { "from": "system", "value": "Fix for failed view spec\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe \"themes/index\", type: :view do\n before(:each) do\n assign(:themes, [\n Theme.create!(\n :title => \"Title\"\n ),\n Theme.create!(\n ...
ruby
chosen
[ { "from": "human", "value": "Add own extended euklid algorithm implementation\n" }, { "from": "gpt", "value": "# Ruby script to calculate ggT(a,b) via euklid\n@a = ARGV[0].to_i\n@b = ARGV[1].to_i\n\n# Function to validate our own implementation\n# Found on http://blade.nagaokaut.ac.jp/cgi-bin/sc...
ruby
chosen
[ { "from": "system", "value": "Make Array smarter. Fixes cases without the square brackets\n" }, { "from": "human", "value": "require_relative 'literals'\n\nmodule DeepCover\n class Node::Array < Node\n include NodeBehavior::CoverEntry\n\n Static = Node::Literal\n\n def self.reclassify(...
ruby
chosen
[ { "from": "system", "value": "Fix problem with chunked stanza\n" }, { "from": "human", "value": "require 'openssl'\nrequire 'rc4'\n\nmodule WhatsApp\n module Protocol\n\n class Keystream\n INIT = (0..255).map(&:chr).join\n\n def initialize(key)\n @key = key\n @rc4 = R...
ruby
chosen
[ { "from": "system", "value": "Change from .nil? to .blank?\n" }, { "from": "human", "value": "class DriversLicenseInvalidValidator < ActiveModel::Validator\n def validate(record)\n if !@options[:attributes].include?(:drivers_license_number)\n record.errors.add(:base, 'Missing required s...
ruby
chosen
[ { "from": "system", "value": "Fix same migration number error\n" }, { "from": "human", "value": "# encoding: UTF-8\nrequire 'rails/generators/migration'\n\nmodule Georgia\n module Generators\n class UpgradeGenerator < ::Rails::Generators::Base\n include Rails::Generators::Migration\n ...
ruby
chosen
[ { "from": "system", "value": "Tidy up code a bit\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule HumanAttributeValues\n extend ActiveSupport::Concern\n\n def human_attribute_value(attribute, options = {})\n value = public_send(attribute)\n self.class.human_attr...
ruby
chosen
[ { "from": "system", "value": "Include more source files in CocoaPods specification\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'QuadernoKit'\n s.version = '0.0.1'\n s.license = 'MIT'\n s.summary = 'Objective-C wrapper ...
ruby
chosen
[ { "from": "system", "value": "Add FeeCoverageAmount when creating recurring donation detail\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule RockRMS\n class Client\n module RecurringDonationDetail\n def create_recurring_donation_detail(\n recurring_donat...
ruby
chosen
[ { "from": "system", "value": "Raise NotImplementedError in parse method\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule TrySailBlogNotification::Parser\n class BaseParser\n\n include TrySailBlogNotification::Util\n\n # Initialize parser.\n def initialize\n ...
ruby
chosen
[ { "from": "system", "value": "Switch version to 0.0.1 and add tag to Podspec\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"RKXMLReaderSerialization\"\n s.version = \"0.20.0\"\n s.summary = \"A RestKit serialization format implementation for XML using X...
ruby
chosen
[ { "from": "system", "value": "Use of custom objects is not necessary here\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'multi_json/version'\n\nGem::Specification.new do |spec|\n s...
ruby
chosen
[ { "from": "system", "value": "feature: Add Canvas account ID to the JWT\n\nWe need a secure way to determine the account ID associated with the request. Storing it in the JWT on the LTI launch will allow us to do this.\n" }, { "from": "human", "value": "module JwtHelper\n\n def jwt_token\n r...
ruby
chosen
[ { "from": "system", "value": "Update Forem::Forum order in the default_scope\n\nFix to avoid ambiguous column errors\n\nFixes #533\nFixes #529\n" }, { "from": "human", "value": "require 'friendly_id'\n\nmodule Forem\n class Forum < ActiveRecord::Base\n include Forem::Concerns::Viewable\n\n ...
ruby
chosen
[ { "from": "system", "value": "Validate association instead of attribute\n" }, { "from": "human", "value": "# == Schema Information\n#\n# Table name: reservations\n#\n# id :integer not null, primary key\n# item_id :integer\n# user_id :integer\n...
ruby
chosen
[ { "from": "system", "value": "Add security validation as required by paperclip 4.0.0 and later\n\nhttps://github.com/thoughtbot/paperclip#security-validations\n" }, { "from": "human", "value": "module Spree\n\tclass Sound < Asset\n\n validate :no_attachment_errors\n\n\t\thas_attached_file :at...
ruby
chosen
[ { "from": "system", "value": "Add ext dir for Java stuff.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nGem::Specification.new do |s|\n s.name = %q{atomic}\n s.version = \"0.0.3\"\n s.authors = [\"Charles Oliver Nutter\", \"MenTaLguY\"]\n s.date = Time.now.strftime('YYYY-MM...
ruby
chosen
[ { "from": "system", "value": "Update HandbrakeCLI Nightly to v6536svn\n\nHandBrakeCLI Nightly Build 6536svn released 2014-11-21.\n" }, { "from": "human", "value": "cask :v1 => 'handbrakecli-nightly' do\n version '6509svn'\n sha256 '5beb028c999cebf8112413c46821b348d2584139fbe2070704522ade45c44e...
ruby
chosen
[ { "from": "system", "value": "Fix syntax in local authority migration\n\nChanged the create_local_authorities migration to use the new hash syntax\n" }, { "from": "human", "value": "class CreateLocalAuthorities < ActiveRecord::Migration\n def change\n create_table :local_authorities do |t|\n...
ruby
chosen
[ { "from": "human", "value": "Update form_id primary and foreign keys to bigint\n" }, { "from": "gpt", "value": "class ChangeFormIdToBigint < ActiveRecord::Migration[6.0]\n def up\n change_column :forms, :id, :bigint\n\n change_column :variable_forms, :form_id, :bigint\n end\n\n def down...
ruby
chosen
[ { "from": "system", "value": "Configure OmniAuth.config.full_host so that the application can work behind a reverse proxy (we're redirected to request.url otherwise, which is an internal domain on a private port)\n" }, { "from": "human", "value": "require 'omniauth/enterprise'\n\ncas_server = Ra...
ruby
chosen
[ { "from": "system", "value": "Set OmniAuth to use Rails logger\n" }, { "from": "human", "value": "Rails.application.config.middleware.use OmniAuth::Builder do\n provider :spotify, ENV[\"SPOTIFY_CLIENT_ID\"], ENV[\"SPOTIFY_CLIENT_SECRET\"], scope: 'playlist-read-private playlist-modify-public pl...
ruby
chosen
[ { "from": "system", "value": "Remove status on page factory\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :georgia_page, class: Georgia::Page do\n template 'one-column'\n sequence(:slug) {|n| \"page#{n}\"}\n association :status, factory: :georgia_status\n end\nend...
ruby
chosen
[ { "from": "system", "value": "Fix missing sequences in notification factory\n\nIf we don't define a sequence, `n` becomes an object instead of a\nnumber.\n" }, { "from": "human", "value": "FactoryBot.define do\n factory :notification do\n user\n association :notifiable, factory: :proposal...
ruby
chosen
[ { "from": "system", "value": "Make test organization names more unique\n\nThe addition of a uniqueness validation on Organization#name is causing\na lot of random failures; the Organization factory uses a Faker value,\nbut appears to be producing repetitive results, so I've added a\nFactoryGirl sequence to ...
ruby
chosen
[ { "from": "system", "value": "Use ENV for api keys in testing\n" }, { "from": "human", "value": "require 'yelp'\n\ndescribe Yelp::Client::Search do\n let(:keys) { Hash[consumer_key: 'abc',\n consumer_secret: 'def',\n token: 'ghi',\n token...
ruby
chosen
[ { "from": "system", "value": "Use double quotes consistently in gemspec\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'slugworth/version'\n\nGem::Specification.new do |spec|\n spec...
ruby
chosen
[ { "from": "system", "value": "Call helper methods on helper instance.\n" }, { "from": "human", "value": "require 'spec_helper'\n\nmodule ApplicationHelper\n def resource\n @resource ||= FactoryGirl.create(:vacancy)\n end\nend\n\ndescribe ApplicationHelper do\n describe '#general_attribute?...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.1.0.1 to 0.2.0.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'error_data'\n s.version = '0.1.0.1'\n s.summary = 'Representation of an error as a data structure'\n s.de...
ruby
chosen
[ { "from": "system", "value": "Delete unused visible? method tests\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe Board, :type => :model do\n let(:board) { create :board }\n \n it 'has valid factories with 5 placed ships' do\n expect(board).to be_valid\n expe...
ruby
chosen
[ { "from": "system", "value": "Adjust exit code for basic spec:system test\n\nThis class shouldn't make any changes when applied to a fresh system because\nthe default manifest behaviour matches the stock install.\n" }, { "from": "human", "value": "require 'spec_helper_system'\n\ndescribe 'basic ...
ruby
chosen
[ { "from": "system", "value": "Change example to demonstrate log level has no impact on logging behaviour\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'logger'\nrequire_relative '../lib/tty-command'\n\nlogger = Logger.new('dev.log')\n\ncmd = TTY::Command.new(output:...
ruby
chosen
[ { "from": "system", "value": "Add info to comment factory\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :user do\n \tsequence(:username) { |n| \"user#{n}\"}\n # sequence(:email) {|n| \"email#{n}@gmail.com\" }\n password \"password\"\n end\n \n factory :fluency do\...
ruby
chosen
[ { "from": "system", "value": "Set database connection timezone to UTC\n\nThis is required for consistent timezone behaviour." }, { "from": "human", "value": "require 'fileutils'\nrequire 'logger'\nrequire 'sequel'\nrequire 'pact_broker'\nrequire 'delegate'\n\nclass DatabaseLogger < SimpleDelegat...
ruby
chosen
[ { "from": "system", "value": "Fix the nil error case with no current build\n" }, { "from": "human", "value": "require \"open3\"\n\nmodule Altria\n module Git\n class Repository\n attr_reader :job\n\n def initialize(job)\n @job = job\n end\n\n def before_enqueue\n ...
ruby
chosen
[ { "from": "system", "value": "Load ActionView instrumentation after Rails initialization\n" }, { "from": "human", "value": "require \"instana/rack\"\n\nif defined?(::Rails)\n # In Rails, let's use the Rails logger\n ::Instana.logger = ::Rails.logger if ::Rails.logger\n\n if ::Rails::VERSION::...
ruby
chosen
[ { "from": "system", "value": "Use globals rather than constants for IO\n\nNormally STDOUT == $stdout so they can be used interchangably. Trying to\ntest the captured output and it is inconsistent because we are logging\nto either STDOUT or $stdout (or the err version).\n\nThis makes it impossible to capture...
ruby
chosen
[ { "from": "human", "value": "Add class for test response janus is an error\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nrequire 'bunny'\n\nmodule RubyRabbitmqJanus\n # @author VAILLANT Jeremy <jeremy.vaillant@dazzl.tv>\n # Class for test if response return an janus error\n...
ruby
chosen
[ { "from": "system", "value": "Update unit tests for latest version of chefspec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'g5-postgresql::default' do\n let(:chef_run) do\n ChefSpec::Runner.new do |node|\n node.set['postgresql']['password']['postgres'] = postgre...
ruby
chosen
[ { "from": "system", "value": "Use template default values, when available\n\nAWS will set the defaults if we don't. Might as well. The diff will\nnow also accurately reflect what's being changed.\n\nSigned-off-by: Evan Owen <a31932a4150a6c43f7c4879727da9a731c3d5877@gmail.com>\n" }, { "from": "human"...
ruby
chosen
[ { "from": "human", "value": "Implement View according to ViewTest\n" }, { "from": "gpt", "value": "View = Struct.new(:args) do\n def report\n report = robot.report\n output.puts report_string(report) if report\n end\n\n private\n\n def report_string(report)\n \"(#{report[:x]},#{repo...
ruby
chosen
[ { "from": "system", "value": "Add additional test for single digit (9 pence)\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe CoinCalculator::Coin do\n before do\n @coins = CoinCalculator::Coin.new\n end\n\n context 'single digit' do\n it 'returns the correct number ...
ruby
chosen
[ { "from": "system", "value": "Build on Travis doesn't find ContentItem for some reason\n" }, { "from": "human", "value": "class Section < ActiveRecord::Base\n include Ublisherp::PublishableWithInstanceShortcuts\n\n has_many :content_items\n\n publish_stream class: ContentItem\n publish_strea...
ruby
chosen
[ { "from": "system", "value": "Clean up docs for ErrorHelpers\n\nJust some minor documentation changes to ensure things are up to date.\n" }, { "from": "human", "value": "module Peribot\n # A module to provide standard functionality for printing error messages\n # within Peribot components. It ...
ruby
chosen
[ { "from": "system", "value": "Use to_json to generate the REST responses\n" }, { "from": "human", "value": "require 'sinatra/base'\n\nrequire 'rest/helpers'\n\nrequire 'ws/ws_server'\n\nrequire 'common/model'\nrequire 'common/patches'\nrequire 'common/util'\n\n\nmodule Ldash\n class RestServer ...
ruby
chosen