conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Remove a painful test that does not make much sense\n\nIf you choose to use Bunny in single-threaded mode, you\nprobably won't open channels in other threads heavily.\n" }, { "from": "human", "value": "require \"spec_helper\"\n\nunless ENV[\"CI\"]\n describe \"Rapi...
ruby
chosen
[ { "from": "human", "value": "Define project policy for admins\n\nThe policy uses the moderation permissions of projects\nPermission for destroy action is implemented considering author of\nproject with a method overwriting the default permission set by\nALLOWED_ACTIONS\n" }, { "from": "gpt", "va...
ruby
chosen
[ { "from": "system", "value": "Make sure redirects are only sent as paths\n\nDepending on the environment the Unpublishing was created in, the\nalternative_url may or may not start with `Whitehall.public_root`. For example,\n, the unpublishings we get from a data sync will us the \"https://www.gov.uk\"\ndoma...
ruby
chosen
[ { "from": "system", "value": "Fix hide keyboard on iOS\n\nFix #65\n" }, { "from": "human", "value": "# encoding: utf-8\nmodule Appium::Ios\n # @private\n # class_eval inside a method because class Selenium::WebDriver::Element\n # will trigger as soon as the file is required. in contrast a met...
ruby
chosen
[ { "from": "system", "value": "Update Apache HTTP Server documentation (2.4.25)\n" }, { "from": "human", "value": "module Docs\n class Apache < UrlScraper\n self.name = 'Apache HTTP Server'\n self.slug = 'apache_http_server'\n self.type = 'apache'\n self.release = '2.4.23'\n self....
ruby
chosen
[ { "from": "system", "value": "Remove existing user notification rules before running controller specs\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Users::NotificationRulesController do\n fixtures :users \n\n let(:valid_attributes) do\n {\n :rule => {\n :n...
ruby
chosen
[ { "from": "human", "value": "Add self referential 1:1 veritas integration specs\n" }, { "from": "gpt", "value": "require 'spec_helper_integration'\n\ndescribe 'Relationship - Self referential One To One' do\n include_context 'Models and Mappers'\n\n before(:all) do\n setup_db\n\n insert_...
ruby
chosen
[ { "from": "system", "value": "Remove pg gem from dependencies\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'cl_mina/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Use method search_by_ingredients in search\n" }, { "from": "human", "value": "class HomeController < ApplicationController\n def index\n end\n\n def search\n @query = params[:query].presence || '*'\n\n @recipes = Recipe.search @query\n end\nend\n" }, {...
ruby
chosen
[ { "from": "system", "value": "Make sure @events is set for TagsController\n" }, { "from": "human", "value": "class TagsController < ApplicationController\n\n resource_controller\n\n actions :index, :show\n\n index.wants.html { @title = \"Tags\" }\n show.failure.wants.html { rescue_404 }\n\n ...
ruby
chosen
[ { "from": "human", "value": "Create mailer to send notification email to user\n" }, { "from": "gpt", "value": "class NotificationMailer < BaseMailer\n def notification_message user, account, entry\n @user = user\n @account = account\n @entry = entry\n\n @value = number_to_currency(@...
ruby
chosen
[ { "from": "system", "value": "Replace XML version of SOAP response from 1.0 to 1.1\n" }, { "from": "human", "value": "=begin\n This file is part of Viewpoint; the Ruby library for Microsoft Exchange Web Services.\n\n Copyright © 2011 Dan Wanek <dan.wanek@gmail.com>\n\n Licensed under the Apac...
ruby
chosen
[ { "from": "system", "value": "Create instance var with sockaddr\n" }, { "from": "human", "value": "module GELF\n module Transport\n class TCPSocket\n attr_accessor :socket\n\n def initialize(host, port)\n @host = host\n @port = port\n connect\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add details about request to exception\n\nWhen we get a generic error from the auth API include some details about\nthe request when creating the exception.\n" }, { "from": "human", "value": "module Kracken\n class TokenAuthenticator\n attr_reader :response\n ...
ruby
chosen
[ { "from": "system", "value": "Make virtual attributes with explicit setter editable by default\n" }, { "from": "human", "value": "module Netzke\n module Basepack\n # Common parts of FieldConfig and ColumnConfig\n class AttrConfig < ActiveSupport::OrderedOptions\n def initialize(c, da...
ruby
chosen
[ { "from": "system", "value": "Fix misnamed example in documentation\n" }, { "from": "human", "value": "require 'grocer/notification'\n\nmodule Grocer\n # Public: A specialized form of a Grocer::Notification which only requires a\n # `push_magic` and `device_token` to be present in the payload....
ruby
chosen
[ { "from": "system", "value": "Define a test to check the generator generates new configuration file in YAML\n" }, { "from": "human", "value": "require 'spec_helper'\n\nrequire 'generators/rakuten_web_service/config_generator'\n\ndescribe RakutenWebService::ConfigGenerator, type: :generator do\n ...
ruby
chosen
[ { "from": "system", "value": "Remove Brexit CTA from drafts only\n" }, { "from": "human", "value": "gds_user = User.find_by!(name: \"GDS Inside Government Team\")\n\nbrexit_cta_editions = Edition.in_default_locale\n .includes(:document)\n .where(\"edition_translations.body LIKE ?\", \"%$Brexit...
ruby
chosen
[ { "from": "system", "value": "Move setting of Groonga from action to initialize\n" }, { "from": "human", "value": "module EPUB\n module Search\n class Database\n FILE_NAME = 'epub-search.db'\n\n def initialize(db_dir)\n @db_dir = Pathname.new(db_dir)\n end\n\n def ...
ruby
chosen
[ { "from": "human", "value": "Make old competition data consistent with newer\n" }, { "from": "gpt", "value": "# TODO CascadeCrossOverall\n# TODO RiderRankings\n# TODO WSBA BARR\nclass SetCorrectTypeForOldEvents < ActiveRecord::Migration\n def self.up\n Bar.find(:all, :conditions => [\"date <...
ruby
chosen
[ { "from": "system", "value": "Clean up installed_versions error message\n" }, { "from": "human", "value": "require 'wright/provider'\nrequire 'wright/provider/package'\n\nmodule Wright\n class Provider\n class Package\n # Apt package provider. Used as a provider for\n # {Resource::...
ruby
chosen
[ { "from": "system", "value": "Rewrite delete cmd tests to use debug_code method\n" }, { "from": "human", "value": "module Byebug\n class DeleteTestCase < TestCase\n def setup\n @example = lambda do\n byebug\n x = 1\n x += 1\n return x\n end\n\n supe...
ruby
chosen
[ { "from": "system", "value": "Add documentation about the JIRA module." }, { "from": "human", "value": "module JIRA\nclass JIRAService < Handsoap::Service\n include RemoteAPI\n\n attr_reader :auth_token, :user\n\n def self.instance_at_url(url, user, password)\n jira = JIRAService.new url\n...
ruby
chosen
[ { "from": "human", "value": "Add stable ids to all types de champ\n" }, { "from": "gpt", "value": "namespace :after_party do\n desc 'Deployment task: add_stable_id_to_types_de_champ'\n task add_stable_id_to_types_de_champ: :environment do\n types_de_champ = TypeDeChamp.where(stable_id: nil)...
ruby
chosen
[ { "from": "system", "value": "Use FileUtils.rm_f instead of the UNIX 'rm' command\n\n[#1327 state:resolved]" }, { "from": "human", "value": "require 'dm-migrations/sql/table'\n\nmodule SQL\n module Sqlite\n\n def supports_schema_transactions?\n true\n end\n\n def table(table_name)...
ruby
chosen
[ { "from": "system", "value": "Refactor CommandRegistry and add YARD docs\n\nThis makes a couple of improvements:\n\n * CommandRegistry supports options now\n * CommandRegistry wraps a plain registry object\n * Registry#key? was added since it's needed in many places\n" }, { "from": "human", "...
ruby
chosen
[ { "from": "system", "value": "Make it so that the API allows restriction based on location and radius\n" }, { "from": "human", "value": "class Api::V1::OrganizationsController < Api::V1::ApplicationController\n def index\n @organizations = Organization.paginate(:page => params[:page])\n end...
ruby
chosen
[ { "from": "system", "value": "Make Response::Exception::Output work with mutant\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'spec_helper'\n\ndescribe Response::Exception::Output, 'equalizer behavior' do\n subject { object == other }\n\n let(:object) { described_class.new...
ruby
chosen
[ { "from": "system", "value": "Set up local email delivery\n" }, { "from": "human", "value": "FeverNotes::Application.configure do\n # Settings specified here will take precedence over those in config/application.rb.\n\n # In the development environment your application's code is reloaded on\n ...
ruby
chosen
[ { "from": "system", "value": "Use copy/link/mkdir builtin Builder methods\n" }, { "from": "human", "value": "name 'loom-standalone'\ndefault_version 'develop'\n\nsource :git => 'git://github.com/continuuity/loom.git'\nrelative_path 'standalone'\n\nbuild do\n command \"mkdir -p #{install_dir}/bi...
ruby
chosen
[ { "from": "system", "value": "Check that Rake.application is loaded as well\n\nI failed to run the test suite because Rake.application wasn't\ndefined, but Rake was defined. Change to check what I'm using.\n" }, { "from": "human", "value": "require_dependency 'remote_rails_rake_runner/applicatio...
ruby
chosen
[ { "from": "system", "value": "Reset AR column information after AddFieldGroupsKlassName migration.\n" }, { "from": "human", "value": "class AddFieldGroupsKlassName < ActiveRecord::Migration\n def up\n add_column :field_groups, :klass_name, :string, :limit => 32\n\n # Add a default field g...
ruby
chosen
[ { "from": "system", "value": "Initialize default test mode in constructor\n" }, { "from": "human", "value": "module HelloSign\n module Parameters\n class ReusableFormSignatureRequest\n attr_accessor :reusable_form_id, :title, :subject, :message, :test_mode\n private :reusable_form_...
ruby
chosen
[ { "from": "system", "value": "Update Transporter Desktop to 3.1.21\n\nThis commit updates the version number and SHA for the 3.1.21 version.\n" }, { "from": "human", "value": "cask :v1 => 'transporter-desktop' do\n version '3.1.17_18519'\n sha256 'c62adff9e27ebdc424d7fb01b02d5d5ba06a53305c7f6d...
ruby
chosen
[ { "from": "system", "value": "Change redirect after sign up 2\n" }, { "from": "human", "value": "module SimpleUser\n\tclass Users::RegistrationsController < Devise::RegistrationsController\n\n\t\t def after_sign_up_path_for(resource)\n\t\t \tif ENV['REDIRECT_USER_AFTER_SIGNIN'] == 'false' || !...
ruby
chosen
[ { "from": "human", "value": "Add numbers to words file\n" }, { "from": "gpt", "value": "# Numbers to English Words\n\n\n# I worked on this challenge [by myself, with: ].\n# This challenge took me [#] hours.\n\n\n# Pseudocode\n\n\n\n# Initial Solution\n\n\n\n\n# Refactored Solution\n\n\n\n\n\n\n#...
ruby
chosen
[ { "from": "system", "value": "Add some tests for param library\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe JSONAPI::Param do\n it 'has a version number' do\n expect(JSONAPI::Param::VERSION).not_to be nil\n end\nend\n" }, { "from": "gpt", "value": "requir...
ruby
chosen
[ { "from": "system", "value": "Comment out this test for now. TODO: examine this." }, { "from": "human", "value": "rails = ::ActiveRecord::VERSION::STRING.first(3)\n\nif %w(3.2 4.0 4.1).include?(rails) || rails == '3.1' && RUBY_VERSION < '2.2'\n describe 'Ransack' do\n it 'can be required wit...
ruby
chosen
[ { "from": "system", "value": "Add \"_fabicator\" to the name of generated files\n" }, { "from": "human", "value": "require 'rails/generators/fabrication_generator'\n\nmodule Fabrication\n module Generators\n class ModelGenerator < Base\n argument :attributes, :type => :array, :default =...
ruby
chosen
[ { "from": "system", "value": "Revert \"base url changed to link to html page on travis CI, not json\"\n\nThis reverts commit d3d6b228860c15be3c4eb91b4c78bb133e501da2.\n" }, { "from": "human", "value": "class TravisProject < Project\n\n attr_accessible :travis_github_account, :travis_repository\...
ruby
chosen
[ { "from": "system", "value": "Use 'syck' as YAML engine.\n" }, { "from": "human", "value": "require 'rubygems'\n\n# Set up gems listed in the Gemfile.\nENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)\n\nrequire 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])\n" }, ...
ruby
chosen
[ { "from": "system", "value": "Use string, not symbol in VALID_SERVICES.\n" }, { "from": "human", "value": "require \"pv_output_wrapper/version\"\nrequire \"pv_output_wrapper/request\"\nrequire \"pv_output_wrapper/response\"\n\nmodule PvOutputWrapper\n # Include the scheme to prevent Addressable...
ruby
chosen
[ { "from": "system", "value": "Add some comment to global variable\n" }, { "from": "human", "value": "require \"room_tiny_manager/version\"\nrequire 'rest_client'\nrequire 'json'\n\nbegin \n require \"pry\"\nrescue LoadError\nend\n\nmodule RoomTinyManager\n\n class Fetcher\n ROOMS_END_POINT ...
ruby
chosen
[ { "from": "system", "value": "Fix a bug, we should default to \"cbc\" IF mode is nil.\n" }, { "from": "human", "value": "module DUKPT\n class Decrypter\n include Encryption\n \n attr_reader :bdk\n \n def initialize(bdk, mode=nil)\n @bdk = bdk\n cipher_mode = mode ? 'cbc...
ruby
chosen
[ { "from": "system", "value": "Add rake task to send ReminderMail.\n" }, { "from": "human", "value": "desc \"This task is called by the Heroku scheduler add-on\"\n\ntask :send_notification => :environment do\n User.all.each do |user|\n from = \"+18457649208\"\n to = \"#{user.phone_number}\...
ruby
chosen
[ { "from": "system", "value": "Maintain type as array when building set of usernames\n" }, { "from": "human", "value": "require 'nokogiri'\nrequire 'open-uri'\n\nmodule Twexport\n\n # Exporter that scrapes a web page for Twitter usernames to lookup on Twitter\n class WebPage < Exporter\n\n d...
ruby
chosen
[ { "from": "system", "value": "Use a bang for exception checking\n" }, { "from": "human", "value": "namespace :after_party do\n desc 'Deployment task: update_bath_lat_long'\n task update_bath_lat_long: :environment do\n puts \"Running deploy task 'update_bath_lat_long'\"\n\n # Put your ta...
ruby
chosen
[ { "from": "human", "value": "Upgrade task include renaming and moving all assets when necessary\n" }, { "from": "gpt", "value": "namespace :georgia do\n\n def ask question\n STDOUT.puts question\n STDIN.gets.chomp\n end\n\n task upgrade: :environment do\n Rake::Task['georgia:assets:r...
ruby
chosen
[ { "from": "system", "value": "Add hamster as a dependency\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'thread_attr_accessor/version'\n\nGem::Specification.new do |spec|\n spec.na...
ruby
chosen
[ { "from": "system", "value": "Remove dependance on a version for connection_pool\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'rhod/version'\n\nGem::Specification.new do |spec|\n ...
ruby
chosen
[ { "from": "human", "value": "Rename an oil and gas industry sector tag\n\nRename the tag \"oil-and-gas/exploration-and-development\" to \n\"oil-and-gas/exploration-and-production\".\n\nNothing is currently tagged with this ID in any environment, so we don't \nneed to migrate any artefacts over." }, { ...
ruby
chosen
[ { "from": "system", "value": "Fix for rails 5.0.3 config\n" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\n\n# Pick the frameworks you want:\nrequire \"active_record/railtie\"\nrequire \"action_controller/railtie\"\nrequire \"action_mailer/railtie\"\n# require \"s...
ruby
chosen
[ { "from": "human", "value": "Add variables for my first_name, last_name, and age\n" }, { "from": "gpt", "value": "#Solution Below\nfirst_name = \"Kim\"\nlast_name = \"Allen\"\nage = 38\n\n\n\n# RSpec Tests. They are included in this file because the local variables you are creating are not acces...
ruby
chosen
[ { "from": "system", "value": "Remove tests for removed method" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Yardstick::V2Client::TestCentreTimeWindow do\n subject { Yardstick::V2Client::TestCentreTimeWindow }\n\n let(:token) { 'abcdefg' }\n\n describe :upcoming_and_recent...
ruby
chosen
[ { "from": "system", "value": "Set the book in the session as the image asset\n" }, { "from": "human", "value": "# encoding: UTF-8\n\nclass ApplicationController < ActionController::Base\n include AuthorizationHelper\n\n protect_from_forgery\n\n http_basic_authenticate_with(:name => CONFIG[:re...
ruby
chosen
[ { "from": "system", "value": "Use or statement instead of if-then to avoid a default not being set\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n protect_from_forgery\n before_filter :set_locale\n #def set_locale\n # I18n.locale = params[:locale] |...
ruby
chosen
[ { "from": "system", "value": "Support array JSONs in CartoJsonSerializer\n" }, { "from": "human", "value": "module Carto\n # Rails 3 stores nil strings with JSON serialization as 'null', so we need to replace it with a valid value.\n # See https://github.com/rails/rails/issues/13144\n class C...
ruby
chosen
[ { "from": "system", "value": "Handle platformio projects with no versions\n" }, { "from": "human", "value": "module PackageManager\n class PlatformIO < Base\n HAS_VERSIONS = true\n HAS_DEPENDENCIES = false\n LIBRARIAN_PLANNED = true\n URL = 'http://platformio.org'\n COLOR = '#f34...
ruby
chosen
[ { "from": "system", "value": "Update omniauth-oath2 dependency because of security issues\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\n$LOAD_PATH.push File.expand_path('../lib', __FILE__)\nrequire 'omniauth-artsy/version'\n\nGem::Specification.new do |s|\n s.name = 'omniauth-...
ruby
chosen
[ { "from": "system", "value": "Change to regular dash for RubyGems' sake\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'pivotal-github/version'\n\nGem::Specification.new do...
ruby
chosen
[ { "from": "system", "value": "Fix framework reference in podspec\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"plaid-ios-link\"\n s.version = \"0.1.1\"\n s.summary = \"Native iOS implementation of Plaid Link\"\n\n s.homepage = \"ht...
ruby
chosen
[ { "from": "system", "value": "Update git checkout integration tests\n" }, { "from": "human", "value": "require 'serverspec'\n\n# Test that the git repository's directory is properly set up\ndescribe file('/opt/tutorial_a/source') do\n it { should be_directory }\n it { should be_grouped_into 't...
ruby
chosen
[ { "from": "system", "value": "Add timestamps to user table\n" }, { "from": "human", "value": "class CreateUsers < ActiveRecord::Migration\n def change\n create_table :users do |t|\n t.string :name\n end\n end\nend\n" }, { "from": "gpt", "value": "class CreateUsers < Acti...
ruby
chosen
[ { "from": "human", "value": "Add specs to wakame adapter\n" }, { "from": "gpt", "value": "module CloudConductor\n module Adapters\n describe WakameVdcAdapter do\n before do\n options = {\n key: 'a-shpoolxx',\n entry_point: 'http://localhost:9001/api/12.03/'\n ...
ruby
chosen
[ { "from": "system", "value": "Remove unused code from the checkout controller\n" }, { "from": "human", "value": "class SolidusPaypalBraintree::CheckoutsController < Spree::CheckoutController\n PERMITTED_ORDER_PARAMS = [\n ].freeze\n\n PERMITTED_PAYMENT_PARAMS = [\n :payment_method_id,\n ...
ruby
chosen
[ { "from": "system", "value": "Make source https to suppress warning\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"Layout\"\n s.version = \"0.1\"\n s.summary = \" \"\n s.description = <<-DESC\n Readable layout constraints.\n DESC\n s.homepage = \"git@github.com:no...
ruby
chosen
[ { "from": "system", "value": "Remove hack to fix :onwhen when disable? is true\n" }, { "from": "human", "value": "class ApplicationHelper::Button::SmartStateScan < ApplicationHelper::Button::Basic\n def check_smart_roles\n my_zone = MiqServer.my_server.my_zone\n MiqServer::ServerSmartProx...
ruby
chosen
[ { "from": "system", "value": "Use reload, better safe than sorry" }, { "from": "human", "value": "#\n# Cookbook Name:: archiva\n# Recipe:: nginx_proxy\n#\n# Copyright 2012, Jorge Espada\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in...
ruby
chosen
[ { "from": "system", "value": "Use normal multiline syntax, debug env\n" }, { "from": "human", "value": "bash \"setup system rubies\" do\n # use mount command and S3 bucket for azn lnx 2014.09 ruby build\n # also faster than building\n code \"/usr/local/rvm/bin/rvm mount -r https://s3.amazonaw...
ruby
chosen
[ { "from": "human", "value": "Remove the rows from schema_migrations for deleted migration files\n\nThese migrations were removed in #11197 and #9696 and are now\ncausing a warning in the logs if the schema_migrations row is present,\nbut the files are not.\n\nhttps://bugzilla.redhat.com/show_bug.cgi?id=1417...
ruby
chosen
[ { "from": "system", "value": "Use .joins instead of .includes on users controller\n\nThat was not working on rails 4.1.1\n" }, { "from": "human", "value": "module Neighborly::Admin\n class UsersController < BaseController\n inherit_resources\n before_filter :set_title\n before_filter :...
ruby
chosen
[ { "from": "system", "value": "Add route option to tab helper\n" }, { "from": "human", "value": "Deface::Override.new( :virtual_path => \"spree/admin/shared/_product_sub_menu.html.erb\",\n :insert_bottom => \"[data-hook='admin_product_sub_tabs']\",\n :te...
ruby
chosen
[ { "from": "system", "value": "Fix test for Windows::Invoice so it's actually using the right class\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe \"Quickeebooks::Online::Model::Invoice\" do\n it \"can parse invoice from XML\" do\n xml = onlineFixture(\"invoice.xml\")\n ...
ruby
chosen
[ { "from": "system", "value": "Set TOPLEVEL_BINDING if not already set\n" }, { "from": "human", "value": "# ****************************************************************************\n#\n# Copyright (c) Microsoft Corporation. \n#\n# This source code is subject to terms and conditions of the Mic...
ruby
chosen
[ { "from": "human", "value": "Add db migration to add institution id to courses table.\n" }, { "from": "gpt", "value": "class AddInstitutionIdToCourses < ActiveRecord::Migration\n def self.up\n add_column \"courses\",\"institutions_id\",:integer, :default => nil\n end\n\n def self.down\n ...
ruby
chosen
[ { "from": "system", "value": "Test that MatchOrders is being called from job\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe MatchOrdersJob, type: :job do\n pending \"add some examples to (or delete) #{__FILE__}\"\nend\n" }, { "from": "gpt", "value": "req...
ruby
chosen
[ { "from": "system", "value": "Make simplecov HTML formatter optional\n" }, { "from": "human", "value": "def codeclimate?\n ENV['CODECLIMATE_REPO_TOKEN']\nend\n\ndef simplecov?\n ENV['COVERAGE']\nend\n\ndef coverage?\n simplecov? || codeclimate?\nend\n\ndef measure_coverage\n require 'simplec...
ruby
chosen
[ { "from": "system", "value": "Fix version extraction logic when on tag\n" }, { "from": "human", "value": "desc 'Continuous Integration task'\ntask 'ci' do\n contents = IO.read('CHANGELOG.md')\n if contents =~ /^### Unreleased/\n previous_version = contents[/^### \\[v(\\d+\\.\\d+)\\]/, 1]\n ...
ruby
chosen
[ { "from": "system", "value": "Set the migration version to 5.0\n" }, { "from": "human", "value": "class CreateAdministrators < ActiveRecord::Migration\n def change\n\n create_table :administrators, force:true do |t|\n\n t.timestamps null:false\n\n # The email used to log into this ...
ruby
chosen
[ { "from": "system", "value": "Make the exchange rate cache dir\n" }, { "from": "human", "value": "bank = EuCentralBank.new\n\nif !Rails.env.test?\n cf = Rails.root.join('tmp', 'cache', 'eu_bank_rates.xml')\n bank.save_rates(cf)\n bank.update_rates(cf)\n\n if !bank.rates_updated_at || bank.ra...
ruby
chosen
[ { "from": "system", "value": "Use basic auth password as key if `basic_auth` is enabled\n" }, { "from": "human", "value": "require_dependency 'cangaroo/application_controller'\n\nmodule Cangaroo\n class EndpointController < ApplicationController\n before_action :ensure_json_request\n befo...
ruby
chosen
[ { "from": "system", "value": "Fix nil error in periodic payments total\n" }, { "from": "human", "value": "class PeriodicPaymentsController < MyplaceonlineController\n skip_authorization_check :only => MyplaceonlineController::DEFAULT_SKIP_AUTHORIZATION_CHECK + [:monthly_total]\n\n def monthly_...
ruby
chosen
[ { "from": "human", "value": "Move protobuf podspec to gRPC repo\n" }, { "from": "gpt", "value": "Pod::Spec.new do |s|\n s.name = \"wkrpt401-grpc\"\n s.version = \"0.0.1\"\n s.license = \"MIT\"\n s.authors = { 'Lloyd Torres' => 'lloyd@lloydtorres.com' }\n s.homepage = \"http://www.llo...
ruby
chosen
[ { "from": "system", "value": "Fix editing of start time on event.\n\nThis might be temporary fix. Time zone stuff\nneeds a serious clean-up.\n" }, { "from": "human", "value": "module EventsHelper\n\n def timeslots\n slots = Array.new\n @conference.max_timeslots.times do |i|\n slots <...
ruby
chosen
[ { "from": "system", "value": "Handle the empty case for midpoints.\n" }, { "from": "human", "value": "module PointsHelper\n\n # Identify the midpoint of a series of points.\n # Uses a center of gravity technique, based off the \n # cartesian coordinates for each point.\n # Logic from: http:/...
ruby
chosen
[ { "from": "system", "value": "Use Google Static API v3\n" }, { "from": "human", "value": "class LocationBlock < Block\n\n settings_items :zoom, :type => :integer , :default => 4\n settings_items :map_type, :type => :string , :default => 'roadmap'\n\n def self.description\n _('Location map'...
ruby
chosen
[ { "from": "system", "value": "Improve response when invoke via ConfigurationManagement fails\n" }, { "from": "human", "value": "# Copyright (C) 2013, 2014, 2015 Dr. Thomas Schank (DrTom@schank.ch, Thomas.Schank@algocon.ch)\n# Licensed under the terms of the GNU Affero General Public License v...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.0.3.0 to 0.0.4.0\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'http-commands'\n s.version = '0.0.3.0'\n s.summary = 'Convenience abstractions for common HTTP operations, such as post and get'\n s...
ruby
chosen
[ { "from": "system", "value": "Set correct base class for Lenovo Manager\n" }, { "from": "human", "value": "class ManageIQ::Providers::Lenovo::PhysicalInfraManager < ManageIQ::Providers::InfraManager\n has_many :physical_servers, foreign_key: \"ems_id\", class_name: \"ManageIQ::Providers::Lenovo...
ruby
chosen
[ { "from": "system", "value": "Add Rake to test dependencies.\n" }, { "from": "human", "value": "$:.unshift(File.expand_path('../lib/', __FILE__))\n\nrequire 'dolphy/version'\n\nGem::Specification.new do |s|\n s.name = \"Dolphy\"\n s.version = Dolphy::VERSION\n s.date = \"201...
ruby
chosen
[ { "from": "system", "value": "Fix factory for NewsItem so tests pass.\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :news_item do\n title 'News Headline'\n link 'http://example.com/news/1'\n end\nend\n" }, { "from": "gpt", "value": "FactoryGirl.define do\...
ruby
chosen
[ { "from": "system", "value": "Update unit test for redis_broker link\n\n[#147827715]\n\nSigned-off-by: Josh Hill <d8b194a1fc06171ecd965621d47d83f9b6bf4885@pivotal.io>\n" }, { "from": "human", "value": "require 'yaml'\n\nPROJECT_ROOT = File.join(File.dirname(__FILE__), '..', '..')\nBROKER_SPEC_PA...
ruby
chosen
[ { "from": "system", "value": "Fix style issues in gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire 'fastly/gem_version'\n\nGem::Specification.new do |s|\n s.name = \"fastly\"\n s.version = Fastly::VERSION\n...
ruby
chosen
[ { "from": "system", "value": "Update Googe Analytics label for reverse footnote\n" }, { "from": "human", "value": "module Jekyll\n module Tags\n class ReverseFootnoteTag < Liquid::Tag\n include Liquid::StandardFilters\n\n def initialize(tag_name, text, tokens)\n super\n ...
ruby
chosen
[ { "from": "system", "value": "Update gem summary and description.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'affirm/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "human", "value": "Add code wars (7) - printer errors\n" }, { "from": "gpt", "value": "# http://www.codewars.com/kata/56541980fa08ab47a0000040/\n# --- iteration 1 ---\ndef printer_error(str)\n \"#{str.count(\"^a-m\")}/#{str.length}\"\nend\n" } ]
ruby
chosen
[ { "from": "system", "value": "Add docker to brew packages\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\nbrews = %w{\n autoconf\n automake\n bash\n curl\n elasticsearch\n faac\n ffmpeg\n freetype\n freexl\n gdal\n gdbm\n geos\n giflib\n git\n git-extras\n git-flow\n g...
ruby
chosen
[ { "from": "system", "value": "Add exception handling and loading from secrets.yml.\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n$LOAD_PATH << './app/models/'\nrequire 'active_record'\n\nActiveRecord::Base.establish_connection :adapter => 'sqlite3', :database => 'ruby.db'\n\nDir.glob('...
ruby
chosen
[ { "from": "system", "value": "Convert the attribute to a string before gsubbing\n" }, { "from": "human", "value": "module Api\n class OffersController < ApiController\n before_action :authenticate_user!\n\n def create\n @product = Product.find_by!(slug: params[:product_id])\n @b...
ruby
chosen
[ { "from": "system", "value": "Disable browser cache on api_token request\n" }, { "from": "human", "value": "# coding: utf-8\nclass ApiTokensController < ApplicationController\n TOKEN_TTL = 1.hour\n\n def show\n unless CatarseSettings[:api_host].present? && CatarseSettings[:jwt_secret].prese...
ruby
chosen