conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix Uglifier dependency for Middleman >= 3.2\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"middleman-google-analytics/version\"\n\nGem::Specification.new do |s|\n s.name = \"middleman-google-...
ruby
chosen
[ { "from": "system", "value": "Test that the proper version of react is found by sprockets\n" }, { "from": "human", "value": "require 'test_helper'\nrequire 'fileutils'\n\nclass ReactTest < ActionDispatch::IntegrationTest\n test 'asset pipeline should deliver drop-in react file replacement' do\n...
ruby
chosen
[ { "from": "system", "value": "Make specs ruby 1.8 compatible\n" }, { "from": "human", "value": "require 'spec_helper'\n# Rename this file to classname_spec.rb\n# Check other boxen modules for examples\n# or read http://rspec-puppet.com/tutorial/\ndescribe 'scroll_reverser' do\n it do\n shoul...
ruby
chosen
[ { "from": "human", "value": "Add missing spec for env\n" }, { "from": "gpt", "value": "describe KnapsackPro::Config::Env do\n describe '.ci_node_total' do\n subject { described_class.ci_node_total }\n\n context 'when ENV exists' do\n context 'when KNAPSACK_PRO_CI_NODE_TOTAL has value...
ruby
chosen
[ { "from": "human", "value": "Use transactional fixtures with poltergeist\n" }, { "from": "gpt", "value": "class ActiveRecord::Base\n mattr_accessor :shared_connection\n @@shared_connection = nil\n \n def self.connection\n @@shared_connection || retrieve_connection\n end\nend\n \n# Forces ...
ruby
chosen
[ { "from": "system", "value": "Set default_format to reuse JSON error formatter\n" }, { "from": "human", "value": "require 'grape'\nrequire 'warden'\nrequire 'json'\nrequire 'errors_helper'\nrequire 'sirius_api'\nrequire 'api/events_endpoints'\nmodule API\n class Base < Grape::API\n extend Er...
ruby
chosen
[ { "from": "system", "value": "Include RGlossa stylesheets in the created app\n" }, { "from": "human", "value": "def install_devise\n generate(\"devise:install\")\n\n devise_sender = ask(\"Please provide a sender e-mail address to use when sending info to users \" +\n \...
ruby
chosen
[ { "from": "system", "value": "Windows: Add shell script as well for msys users\n" }, { "from": "human", "value": "# Make the path Windows-style if we're on Windows\npackage_name = node[:vagrant][:gem_path].gsub(\"/\", \"\\\\\")\n\ngem_package package_name do\n version \"> 0\"\n gem_binary \"#{...
ruby
chosen
[ { "from": "system", "value": "Add node_modules folder to the asset load path\n\nThis is so the bundled version of jQuery can be picked up.\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\n# Version of your assets, change this if you want to expire...
ruby
chosen
[ { "from": "system", "value": "Include tracking url in shipping_method show template\n" }, { "from": "human", "value": "object @shipment\ncache [I18n.locale, root_object]\nattributes *shipment_attributes\nnode(:order_id) { |shipment| shipment.order.number }\nnode(:stock_location_name) { |shipment...
ruby
chosen
[ { "from": "system", "value": "Package version is incremented from 0.2.0.0 to 0.3.0.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'data_aggregation-accumulator'\n s.version = '0.2.0.0'\n s.summary = 'Data aggregation accumulator librar...
ruby
chosen
[ { "from": "system", "value": "Fix query for line item in update service\n" }, { "from": "human", "value": "module Shopping\n class UpdateLineItemService < Shopping::BaseService\n\n attr_accessor :cart, \n :source,\n :quantity\n\n validates :cart, :source,...
ruby
chosen
[ { "from": "system", "value": "Include location in the status ping\n" }, { "from": "human", "value": "json.should_standby !(@bot.preferred_instance == @bot_instance)\n" }, { "from": "gpt", "value": "json.should_standby !(@bot.preferred_instance == @bot_instance)\njson.location @bot_in...
ruby
chosen
[ { "from": "human", "value": "Test for presence and absence of parameter\n" }, { "from": "gpt", "value": "RSpec.describe StackMaster::ParameterResolvers::ParameterStore do\n\n describe '#resolve' do\n\n let(:config) { double(base_dir: '/base') }\n let(:stack_definition) { double(stack_name...
ruby
chosen
[ { "from": "system", "value": "Use an actual object for location instead of hash\n\nThis fixes a broken test that I wasn't paying attention to.\n" }, { "from": "human", "value": "require 'clearwater/router'\n\nmodule Clearwater\n RSpec.describe Router do\n let(:component_class) {\n Class...
ruby
chosen
[ { "from": "system", "value": "Build candidates automatically to return valid environment by FactoryGirl\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# Copyright 2014 TIS Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file excep...
ruby
chosen
[ { "from": "human", "value": "Add authinfo sample for Ruby\n" }, { "from": "gpt", "value": "require 'net/http'\nrequire 'json'\n\nuri = URI('http://localhost:8081/api/authinfo/inquire/PIGEON')\nhttp = Net::HTTP.new(uri.host, uri.port)\n\nbegin\n\treq = Net::HTTP::Post.new(uri.path, initheader = {...
ruby
chosen
[ { "from": "system", "value": "Update the Users Controller for verify_paypal\n\nAdd the verify_paypal action to the Users controller to verify the\nUser-specified PayPal email address (check if it is a VERIFIED account).\n" }, { "from": "human", "value": "class UsersController < ApplicationContro...
ruby
chosen
[ { "from": "system", "value": "Update users controller with correct pluralization.\n" }, { "from": "human", "value": "class UserController < ApplicationController\n\n def index\n @users = User.all\n end\n\n def create\n user = User.new(user_params)\n if user.save\n session[:user_...
ruby
chosen
[ { "from": "system", "value": "Hide quadicon setting for decorators that inherit the quadicon method\n" }, { "from": "human", "value": "module ConfigurationHelper\n include_concern 'ConfigurationViewHelper'\n\n # Model class name comparison method that sorts provider models first\n def compare...
ruby
chosen
[ { "from": "system", "value": "Add missing dependency for Beaker tests\n" }, { "from": "human", "value": "require 'beaker-rspec/helpers/serverspec'\nrequire 'beaker-rspec/spec_helper'\nrequire 'beaker/puppet_install_helper'\n\nrun_puppet_install_helper\n\nSUPPORTED_PLATFORMS = ['Debian'].freeze\n...
ruby
chosen
[ { "from": "system", "value": "Fix for version on newrelic npm install\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'newrelic_lwrp_test::agent_nodejs' do\n before do\n stub_resources\n end\n\n context 'Centos' do\n let(:chef_run) do\n ChefSpec::SoloRunner.new...
ruby
chosen
[ { "from": "system", "value": "Add logged_in? helper for abilities\n" }, { "from": "human", "value": "class Ability\n include CanCan::Ability\n\n def initialize(user)\n user ||= User.new\n #\n # Posts\n #\n can :read, Question do |q|\n false\n true unless q.deleted? && ...
ruby
chosen
[ { "from": "system", "value": "Change can_be_voted_on logic to consider candidate as the other party\n" }, { "from": "human", "value": "class Request < ActiveRecord::Base\n before_create :defaultly_unfulfilled\n\n has_many :messages\n has_many :transactions\n has_many :votes\n\n belongs_to :...
ruby
chosen
[ { "from": "system", "value": "Remove redundant calls to `self`\n" }, { "from": "human", "value": "class Species\n FILE_PATH = Rails.root.join('config', 'data', 'species.yml')\n\n include ActiveModel::Validations\n include ActiveModel::Conversion\n extend ActiveModel::Naming\n\n attr_accesso...
ruby
chosen
[ { "from": "system", "value": "Update rubocop to version 0.91.0" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire_relative 'lib/filewatcher'\nrequire_relative 'lib/filewatcher/version'\n\nGem::Specification.new do |s|\n s.name = 'filewatcher'\n s.version =...
ruby
chosen
[ { "from": "system", "value": "Replace broken Rake TestTask with custom one\n\nRake::TestTask always add it's lib directory to $LOAD_PATH, making\nimpossible, even using `gem` to load updated versions of any gem that is\nnot bundled with Ruby.\n\nThis custom version support both 1.8.x and 1.9.3 and works pro...
ruby
chosen
[ { "from": "system", "value": "Fix redirect pass after AdventCalendarItem created\n" }, { "from": "human", "value": "class AdventCalendarItemsController < ApplicationController\n\tdef new\n\t\t@advent_calendar_item = AdventCalendarItem.new(date: params[:date])\n\tend\n\n\tdef create\n\t\tAdventCa...
ruby
chosen
[ { "from": "system", "value": "Adjust presentation of active ballots table JSON\n" }, { "from": "human", "value": "json.name 'Active Ballots'\njson.description \"Active ballots for #{ENV['COMMITTEE']} at #{Date.today}\"\njson.options do\n json.table_head true\n json.table_foot false\n json.alt...
ruby
chosen
[ { "from": "system", "value": "Create constant for minimum number of players\n" }, { "from": "human", "value": "\nrequire 'gosu'\n\n# Defines application wide constants.\nmodule Constants\n\n\tMAJOR_VERSION = \"0\"\n\tMINOR_VERSION = \"0\"\n\tPATCH = \"0\"\n\n\tVERSION = [MAJOR_VERSION, MINOR_VER...
ruby
chosen
[ { "from": "system", "value": "Move to adcli version 8, woops\n" }, { "from": "human", "value": "case node['platform']\nwhen 'ubuntu'\n default['sssd']['packages'] = %w(expect sssd sssd-ad sssd-ad-common sssd-tools adcli krb5-user)\nwhen 'centos'\n default['sssd']['packages'] = %w(expect sssd s...
ruby
chosen
[ { "from": "system", "value": "Add iOS deployment target to spec\n" }, { "from": "human", "value": "Pod::Spec.new do |spec|\n spec.name = \"AVSTaggedAttributedString\"\n spec.version = \"0.0.3\"\n spec.summary = \"Tag-based formatting for NSAttributedString.\"\n spec.homepage = \"https://gith...
ruby
chosen
[ { "from": "system", "value": "Fix tests to reference ActiveSupport::Dependencies instead of Dependencies\n" }, { "from": "human", "value": "require 'test/unit'\nrequire 'fileutils'\n\n$:.unshift(\"#{File.dirname(__FILE__)}/../lib\")\n\n# Ensure the app root is empty\nFileUtils.rm_rf('test/app_ro...
ruby
chosen
[ { "from": "system", "value": "Add not null constraint to slug columns\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n# require 'coveralls'\n# Coveralls.wear!\n\nrequire \"minitest/autorun\"\nrequire \"sqlite3\"\nrequire \"sluggi\"\n\nbegin\n require \"byebug\"\nrescue LoadE...
ruby
chosen
[ { "from": "system", "value": "Add extra assertion to integration test\n" }, { "from": "human", "value": "require 'test_helper'\n\nPerson = Struct.new(:name)\n\nclass PersonValidator < Allowing::Validator\n validates :name, presence: true\nend\n\nmodule IntegrationTests\n class ValidationsTest ...
ruby
chosen
[ { "from": "system", "value": "Remove initializer template call from custom user generator\n" }, { "from": "human", "value": "module Spree\n class CustomUserGenerator < Rails::Generators::NamedBase\n include Rails::Generators::ResourceHelpers\n\n desc \"Set up a Spree installation with a c...
ruby
chosen
[ { "from": "system", "value": "Modify migration to set proper state for photos and documents" }, { "from": "human", "value": "class AddStateToDocumentsAndPhotos < ActiveRecord::Migration\n def change\n add_column :documents, :state, :string, :default => 'initialized'\n add_column :photos, ...
ruby
chosen
[ { "from": "system", "value": "Fix class name for NoContent oepration\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Pragma\n module Operation\n class Response\n class UnprocessableEntity < Response\n def initialize(headers: {})\n super(status:...
ruby
chosen
[ { "from": "system", "value": "Add json response to Comments create action.\n" }, { "from": "human", "value": "class CommentsController < ApplicationController\n before_action :set_resource, only: [:index, :new, :create]\n before_action :set_comment, only: [:edit, :update, :destroy]\n\n def in...
ruby
chosen
[ { "from": "system", "value": "Add starlight to a new comment's entry.\n" }, { "from": "human", "value": "class CommentsController < ApplicationController\n def create\n raise \"Empty comment!\" if params[:comment][:body].blank?\n @entry = Entry.find params[:entry_id]\n created_comment ...
ruby
chosen
[ { "from": "system", "value": "Add code comment about where the auth comes from\n" }, { "from": "human", "value": "class IepStorer\n def initialize(file_name:,\n path_to_file:,\n file_date:,\n local_id:,\n client:,\n ...
ruby
chosen
[ { "from": "system", "value": "Include `updated_at` in serialized scenario\n" }, { "from": "human", "value": "class ScenarioSerializer < PresetSerializer\n # Creates a new Scenario API serializer.\n #\n # @param [#api_v3_scenario_url] controller\n # The controller which created the serializ...
ruby
chosen
[ { "from": "system", "value": "Make nested groups deletion synchronous to avoid potential race\n" }, { "from": "human", "value": "module Groups\n class DestroyService < Groups::BaseService\n def async_execute\n # Soft delete via paranoia gem\n group.destroy\n job_id = GroupDest...
ruby
chosen
[ { "from": "system", "value": "Add some other methods to track geocoded rows\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule CartoDB\n # The purpose of this class is to encapsulate storage of usage metrics.\n # This shall be used for billing, quota checking and metrics.\n class ...
ruby
chosen
[ { "from": "human", "value": "Fix empty mime type for ActiveStorage local file service [SCI-4360]\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nmodule ActiveStorage\n class DirectUploadsController < CustomBaseController\n def create\n blob = ActiveStorage::Blob.create...
ruby
chosen
[ { "from": "system", "value": "Reorder documents so featuring a doc is quicker\n\nMost of the time you end up scrolling to the end of the list.\n" }, { "from": "human", "value": "class Admin::EditionWorldLocationsController < Admin::BaseController\n before_filter :find_world_location\n before_f...
ruby
chosen
[ { "from": "system", "value": "Initialize records without let bang method.\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'sequel/extensions/pagination_compat'\n\ndescribe Sequel::PaginationExtension do\n describe '.paginate' do\n let!(:commodity1) { create :commodity }\n ...
ruby
chosen
[ { "from": "system", "value": "Upgrade PyCharm CE.app to 5.0\n\nThis commit upgrades PyCharm CE.app to latest version 5.0.\n\nJetBrains offers also a version with a bundled JDK, should this cask\nbe switched to that version and the caveeat removed?\n" }, { "from": "human", "value": "cask :v1 => '...
ruby
chosen
[ { "from": "system", "value": "Add another test to SeparatedUrl to round out test coverage\n" }, { "from": "human", "value": "require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')\n\ndescribe ATDIS::SeparatedURL do\n describe \"#merge\" do\n it \"should add a new parameter\" do...
ruby
chosen
[ { "from": "system", "value": "Put BaseHelper spec into Alchemy module.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Alchemy::BaseHelper do\n\n describe \"#render_message\" do\n\n context \"if no argument is passed\" do\n it \"should render a div with an info icon...
ruby
chosen
[ { "from": "system", "value": "Revert \"Use older version of sprockets\"\n\nThis reverts commit 3d86bec6d7424e5c055fa43c8e3118740adf60f8.\n" }, { "from": "human", "value": "# coding: utf-8\nGem::Specification.new do |spec|\n spec.name = \"sprockets-memcache-store\"\n spec.version ...
ruby
chosen
[ { "from": "system", "value": "Remove Active Storage duplicated classes from the API site\n\nSince cb5af0d7, some classes that are under Active Storage are now\npart of the API site.\n\nHowever, these classes aren't nested under a definition of the\n`ActiveStorage` module but rather name-spaced under it like...
ruby
chosen
[ { "from": "system", "value": "Change gemspec for rails 4.1.16 for stable env\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"complex_dates/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specifica...
ruby
chosen
[ { "from": "system", "value": "Upgrade Rails 5.2.6 -> 6.0.0\n\n- Update 5.1 -> 6.0\n" }, { "from": "human", "value": "require_relative 'boot'\n\nrequire 'rails/all'\n\n# Require the gems listed in Gemfile, including any gems\n# you've limited to :test, :development, or :production.\nBundler.requi...
ruby
chosen
[ { "from": "system", "value": "Stop setting activerecord time to local\n" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\n\nrequire 'rails/all'\n# Require the gems listed in Gemfile, including any gems\n# you've limited to :test, :development, or :production.\nBundl...
ruby
chosen
[ { "from": "human", "value": "Add missing helper class for test\n" }, { "from": "gpt", "value": "# Generated by the protocol buffer compiler. DO NOT EDIT!\n# source: TestMessage.proto3\n\nrequire 'google/protobuf'\n\nGoogle::Protobuf::DescriptorPool.generated_pool.build do\n add_message \"com.f...
ruby
chosen
[ { "from": "system", "value": "Check for kernel modules required by Neutron" }, { "from": "human", "value": "require 'spec_helper'\n\n####################################\n#\n# OpenStack Network services\n#\n####################################\n\ndescribe service('openvswitch-switch') do...
ruby
chosen
[ { "from": "system", "value": "Fix the RSpec testing fix\n\nAccidentally broke the testing Rake task with the previous fix. Now it\nworks again.\n" }, { "from": "human", "value": "namespace 'cuke_cataloger' do\n\n desc 'Run all of the RSpec tests'\n task :run_rspec_tests => [:clear_old_results]...
ruby
chosen
[ { "from": "human", "value": "Add migration to add data to tournaments\n" }, { "from": "gpt", "value": "Sequel.migration do\n up do\n alter_table(:tournaments) do\n add_column :data, String, :text=>true\n end\n end\n\n down do\n alter_table(:tournaments) do\n drop_column :...
ruby
chosen
[ { "from": "system", "value": "Return all error message when unexpected error occured\n" }, { "from": "human", "value": "module ErrorHandler\n def self.registered(app)\n app.error 404 do\n json message: 'Not Found' if response.body.empty?\n end\n app.error 500 do\n Log.error \...
ruby
chosen
[ { "from": "system", "value": "Change to allow any bundler version\n" }, { "from": "human", "value": "lib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'tty/spinner/version'\n\nGem::Specification.new do |spec|\n spec.name = 'tty...
ruby
chosen
[ { "from": "human", "value": "Remove default type value for orders table\n" }, { "from": "gpt", "value": "class RemoveDefaultTypeForOrders < ActiveRecord::Migration[5.0]\n def up\n change_column_default(:paypal_orders, :type, nil)\n end\n def down\n change_column_default(:paypal_orders, ...
ruby
chosen
[ { "from": "system", "value": "Use schema only if compiling workspace\n" }, { "from": "human", "value": "require 'open3'\n\nmodule Bwoken\n class Build\n\n def scheme\n Bwoken.app_name\n end\n\n def configuration\n 'Debug'\n end\n\n def sdk\n 'iphonesimulator5.1'\n ...
ruby
chosen
[ { "from": "human", "value": "Add User Resend Email Rake Task\n\nAdd a Rake task to resend confirmation emails to Users that have not yet\nconfirmed their account.\n" }, { "from": "gpt", "value": "namespace :user do\n task :resend_confirmation => :environment do\n users = User.where('confirma...
ruby
chosen
[ { "from": "system", "value": "Check session when updating card\n" }, { "from": "human", "value": "class CardsController < ApplicationController\n\n def new\n @template = CardTemplate.find(params[:card_template_id])\n end\n\n def create\n new_card = Card.new(card_params)\n\n if new_ca...
ruby
chosen
[ { "from": "system", "value": "Allow creating external sources with nil geom types\n" }, { "from": "human", "value": "# encoding: UTF-8\n\nrequire 'active_record'\n\nclass Carto::ExternalSource < ActiveRecord::Base\n # Seconds\n REFRESH_INTERVAL = 30*24*60*60\n\n has_many :external_data_import...
ruby
chosen
[ { "from": "system", "value": "Check if theme exists before adding it to the list of args\n" }, { "from": "human", "value": "require 'rake/testtask'\n\nclass Ecrire::TestTask < Rake::TestTask\n attr_accessor :theme\n\n def define\n desc @description\n task @name do\n Rake::FileUtilsE...
ruby
chosen
[ { "from": "human", "value": "Add basic rspec tests for the task model.\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Task do\n\n before(:each) do\n @task = InstanceTask.new( {} )\n end\n\n it \"should begin in a queued state\" do\n @task.state.should eql('queued')\n...
ruby
chosen
[ { "from": "system", "value": "Add recommended gemspec attributes - licenses\n\nIt is better to add licenses explicitly in gemspec.\n\n % gem specification cool.io | \\grep licenses\n licenses: []\n\nref. https://guides.rubygems.org/specification-reference/\n" }, { "from": "human", "value": "# ...
ruby
chosen
[ { "from": "system", "value": "Add some summary and description\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/fake-ajax-server/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Rodrigo Rosenfeld Rosas\"]\n gem.email ...
ruby
chosen
[ { "from": "system", "value": "Update 1Password to beta 7.\n" }, { "from": "human", "value": "cask :v1 => '1password-beta' do\n version '5.3.BETA-6'\n sha256 '3655e044c87ed89ad39f49dae0159e403d38bedfde153b88ae58deb8340e9dbc'\n\n url \"https://cache.agilebits.com/dist/1P/mac4/1Password-#{versio...
ruby
chosen
[ { "from": "system", "value": "Update Xamarin Studio to v4.2.4" }, { "from": "human", "value": "class XamarinStudio < Cask\n url 'http://download.xamarin.com/studio/Mac/XamarinStudio-4.2.3.60-60.dmg'\n homepage 'http://xamarin.com/studio'\n version '4.2.3'\n sha256 'e95bd713b8790990c769dc9cb7...
ruby
chosen
[ { "from": "human", "value": "Add a test for the existing behaviour" }, { "from": "gpt", "value": "require \"rails_helper\"\n\nmodule Renalware\n describe AgeCalculator do\n describe \"#compute\" do\n it \"returns a hash for the year, month and day\" do\n result = AgeCalculator.co...
ruby
chosen
[ { "from": "system", "value": "Store secret token in env variable\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\n# Your secret key for verifying the integrity of signed cookies.\n# If you change this key, all old signed cookies will become invali...
ruby
chosen
[ { "from": "system", "value": "Update Homebrew recipe to v0.9.\n\nAlso add macdeployqt step so that the resulting .app bundle is self contained.\n" }, { "from": "human", "value": "class TarsnapGui < Formula\n desc \"Cross platform GUI for the Tarsnap command-line client\"\n homepage \"https://g...
ruby
chosen
[ { "from": "human", "value": "Add tests for Qubell::Revision class\n" }, { "from": "gpt", "value": "require 'rspec'\n\nmodule Qubell\n describe Revision do\n let(:config) { FactoryGirl.build :configuration }\n let(:revision) { FactoryGirl.build :revision }\n let(:revision_url) { \"#{con...
ruby
chosen
[ { "from": "system", "value": "Set testing for multi page fetches\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe PageFetcher do\n let(:domain) { \"duckduckgo.com\" }\n\n before do\n file_path = \"./spec/support/duckduckgo_com\"\n\n FakeWeb.register_uri :get,\n ...
ruby
chosen
[ { "from": "system", "value": "Use lowercase extention name for content type lookup\n" }, { "from": "human", "value": "require 'sinatra/base'\nrequire 'mountable_image_server/image_locator'\nrequire 'mountable_image_server/image_processor'\n\nmodule MountableImageServer\n class Server < Sinatra:...
ruby
chosen
[ { "from": "system", "value": "Improve allowed urls accept one RegExp\n" }, { "from": "human", "value": "module OrganicSitemap\n class UrlProcessor\n\n attr_accessor :status, :headers, :request, :env\n\n def initialize(status, headers, env)\n @request = Rack::Request.new env\n @s...
ruby
chosen
[ { "from": "system", "value": "Change rescue to allow non IPv4 string.\n\nThis solves the following error;\n Error: /Stage[main]/Mongodb::Server::Service/Mongodb_conn_validator[mongodb]: Could not evaluate: invalid address\n\nWhen using the following puppet configuration;\n class { 'mongodb::server':\n ...
ruby
chosen
[ { "from": "system", "value": "Extend handling of special symbol names\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule Rubocop\n module Cop\n class SymbolSnakeCase < Cop\n ERROR_MESSAGE = 'Use snake_case for symbols.'\n SNAKE_CASE = /^@?[\\da-z_]+[!?=]?$/\n\n def...
ruby
chosen
[ { "from": "system", "value": "Remove dependency on Rake to stop Bundler dependency error\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire 'rake'\nrequire 'log4r/version'\n\nGem::Specification.new do |gem|\n # gem is a Gem::Spe...
ruby
chosen
[ { "from": "system", "value": "Remove year from key index as it is not a string\n" }, { "from": "human", "value": "class WidenSourceReferenceTitleField < ActiveRecord::Migration\n def up\n remove_index \"source_references\", :name => \"by_ln_fn_year_title_url\"\n remove_index \"source_refe...
ruby
chosen
[ { "from": "system", "value": "Fix path to License file" }, { "from": "human", "value": "Pod::Spec.new do |s|\n\n\ts.name \t\t= 'NSDate-Time-Ago'\n\ts.version \t= '1.0'\n\ts.summary \t= 'Implements Facebooks format for Time Ago (on their mobile apps)'\n\ts.homepage \t= 'https://github.com/nikilst...
ruby
chosen
[ { "from": "system", "value": "Update solution to not use conditionals (as per instructions)\n" }, { "from": "human", "value": "# convert a string into an integer.\n# from https://www.hackerrank.com/challenges/30-exceptions-string-to-integer\n\ns = gets.strip\nputs ((s.to_i != 0 || s == '0') ? s....
ruby
chosen
[ { "from": "system", "value": "Add users with predictable username and password\n\nto development seed.\n" }, { "from": "human", "value": "Gitlab::Seeder.quiet do\n (2..20).each do |i|\n begin\n User.seed(:id, [{\n id: i,\n username: Faker::Internet.user_name,\n nam...
ruby
chosen
[ { "from": "system", "value": "Switch Server::UDP to class << self\n" }, { "from": "human", "value": "require 'socket'\nrequire_relative '../udp_addr'\nrequire_relative 'sock'\n\nmodule Kamerling\n module Server\n class UDP < Sock\n def self.default_addr\n UDPAddr[ENV['HOST'], ENV...
ruby
chosen
[ { "from": "system", "value": "Add name to control group css classes\n" }, { "from": "human", "value": "require 'action_view'\n\nmodule Cave\n class Form\n class Builder < ActionView::Helpers::FormBuilder\n def bootstrap control_type, name\n error = object.errors[name]\n if...
ruby
chosen
[ { "from": "system", "value": "Change mistake made in license declaration in podspec.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"TOMGooglePlaces\"\n s.version = \"1.0.0\"\n s.summary = \"A Library for auto completing addresses using Google Places.\"\...
ruby
chosen
[ { "from": "system", "value": "Remove unused data hygiene task\n\nThis task is probably not useful anymore, since all content is in the\ncontent-store.\n" }, { "from": "human", "value": "namespace :db do\n desc \"Report any data integrity issues\"\n task lint: :environment do\n require 'data...
ruby
chosen
[ { "from": "system", "value": "Rewrite valid_attribute_name? to be a little easier to read.\n\nNote: I am not sure if removing the check for attribute methods\non super is really needed. I've left it for now, as the previous\ncode did something like that. We should, however, expand the\ntest cases as it will...
ruby
chosen
[ { "from": "system", "value": "Tweak to loggerto drop trailing newlines.\n" }, { "from": "human", "value": "require :logger.to_s unless BBLib::in_opal?\n\nmodule BBLib\n\n def self.logger\n @logger ||= default_logger\n end\n\n def self.default_logger\n log = ::Logger.new(STDOUT)\n log...
ruby
chosen
[ { "from": "system", "value": "Pick: Use a sane separator in comma\n" }, { "from": "human", "value": "class Bot::Plugin::Pick < Bot::Plugin\n def initialize(bot)\n @s = {\n trigger: {\n pick: [:pick, 0, 'pick [n=1] item1 item2 item3'],\n shuffle: [:shuffle, 0, 'shuffle item...
ruby
chosen
[ { "from": "system", "value": "Use ActiveSupport.on_load hook for defining anything on top of AR\n" }, { "from": "human", "value": "require 'postgresql_cursor/version'\nrequire 'postgresql_cursor/cursor'\nrequire 'postgresql_cursor/active_record/relation/cursor_iterators'\nrequire 'postgresql_cur...
ruby
chosen
[ { "from": "human", "value": "Add read_only attribute to MiqPolicy and Condition\n" }, { "from": "gpt", "value": "class AddReadOnlyToPolicies < ActiveRecord::Migration[5.0]\n def change\n add_column :miq_policies, :read_only, :boolean\n add_column :conditions, :read_only, :boolean\n end...
ruby
chosen
[ { "from": "system", "value": "Add tests for finding and updating tasks\n" }, { "from": "human", "value": "require 'spec_helper'\n\nmodule Asana\n describe Task do\n\n before do\n VCR.insert_cassette('tasks', :record => :all)\n Asana.configure do |c|\n c.api_key = ENV['ASANA_...
ruby
chosen
[ { "from": "system", "value": "Fix TZInfo version error in .gemspec\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'ruy'\n s.version = '0.2.1'\n s.date = '2014-07-22'\n s.files = %w(LICENSE README.md) + Dir['lib/**/*']\n s.author = 'M...
ruby
chosen
[ { "from": "system", "value": "Add a missing require statement\n" }, { "from": "human", "value": "require 'ayari/router'\nrequire 'ayari/routing_rules'\nrequire 'ayari/local_storage'\nrequire 'ayari/dropbox'\n\n\nmodule Ayari\n\n\tVERSION = \"0.1.1\"\n\nend\n" }, { "from": "gpt", "val...
ruby
chosen
[ { "from": "system", "value": "Use the correct method, delivering_email\n" }, { "from": "human", "value": "require \"bcc/version\"\nrequire \"bcc/railtie\" if defined?(Rails::Railtie)\n\nmodule Bcc\n class Base\n def self.delivering_message(message)\n return unless BCC_EMAILS.any?\n ...
ruby
chosen
[ { "from": "system", "value": "Remove sudo for drakov setup\n" }, { "from": "human", "value": "module BlueprintAgreement\n class DrakovService\n attr :pid, :port, :hostname, :root_path, :allow_headers\n\n def initialize\n @port = Config.port\n @allow_headers = Config.allow_header...
ruby
chosen