conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Enable watchOS support in podspec and bump to 1.2.0\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"Latch\"\n s.version = \"1.1.0\"\n s.summary = \"A simple Swift Keychain Wrapper for iOS\"\n s.homepage ...
ruby
chosen
[ { "from": "system", "value": "[LazySpecification] Fix indentation of an end\n" }, { "from": "human", "value": "module Pod\n class Specification\n class Set\n class LazySpecification < BasicObject\n attr_reader :name, :version, :source\n\n def initialize(name, version, sour...
ruby
chosen
[ { "from": "system", "value": "Add description of LICENSE and Modify" }, { "from": "human", "value": "# encoding: utf-8\nrequire 'puppet/provider/ce/device_ssh/device_ssh.rb'\nrequire 'puppet/provider/ce/api/apibase.rb'\nrequire 'puppet/provider/ce/session/session.rb'\nrequire 'puppet/provider/ce...
ruby
chosen
[ { "from": "system", "value": "Return an empty favicon.ico for browsers that request it (if it does not exist in static paths)\n" }, { "from": "human", "value": "require 'webrick/httputils'\n\nmodule YARD\n module Server\n module Commands\n class StaticFileCommand < Base\n include...
ruby
chosen
[ { "from": "system", "value": "Add -U to `lein uberjar`\n\nWithout this, we don't always check for updated SNAPSHOTs.\n" }, { "from": "human", "value": "# Task for building the jar file containing all the things\n\ndesc \"Build the uberjar\"\ntask :uberjar => [ ] do\n if `which lein`\n sh \"...
ruby
chosen
[ { "from": "system", "value": "Revert \"close the file after putting it on the grid\"\n\nThis reverts commit 4ecfeaae2c800c5a37d60a1566dfe7f923221055.\n\nCaused all the tests to fail and came with none of its own. Need to know more of the problem it was solving.\n" }, { "from": "human", "value": ...
ruby
chosen
[ { "from": "system", "value": "Add AppleScript support for iterm2\n" }, { "from": "human", "value": "require \"uri\"\nrequire \"net/http\"\nrequire \"json\"\nrequire \"openssl\"\nrequire \"newline_cli/api\"\n\nmodule NewlineHw\n class GuiTrigger\n attr_reader :editor\n def initialize(data)...
ruby
chosen
[ { "from": "system", "value": "Replace with space to keep in the spirit of things.\n" }, { "from": "human", "value": "require \"active_support/all\"\n\n# Add tagify methods to string\nString.class_eval do\n def tagify(options = {})\n default_options = {:upcase => true, :sep => \"-\"}\n opt...
ruby
chosen
[ { "from": "human", "value": "Add code to fetch staff list by school\n\n+ This is part of the process of onboarding a second school onto Student Insights\n+ We need to check the second school's staff list in X2 for missing educators and Active/Inactive status set correctly\n+ #293\n" }, { "from": "gp...
ruby
chosen
[ { "from": "system", "value": "Use alias_method instead of duplicating the method code\n" }, { "from": "human", "value": "module Discordrb::Events\n class MessageEvent\n attr_reader :message\n\n def initialize(message)\n @message = message\n end\n\n def author; @message.author; ...
ruby
chosen
[ { "from": "system", "value": "Remove a redundant block parameter\n" }, { "from": "human", "value": "require 'fact_check_message_processor'\nrequire_relative 'fact_check_mail'\n\n# A class to pull messages from an email account and send relevant ones\n# to a processor.\n#\n# It presumes that the ...
ruby
chosen
[ { "from": "system", "value": "Use require rather than require_relative.\n\nThis is consistent with all the other generator includes.\n" }, { "from": "human", "value": "require 'delegate'\nrequire 'forwardable'\nrequire_relative 'template_values'\n\nmodule Generator\n class Implementation\n e...
ruby
chosen
[ { "from": "system", "value": "Define package_name on Null compressor to be the empty string" }, { "from": "human", "value": "#\n# Copyright 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 compliance with the ...
ruby
chosen
[ { "from": "system", "value": "Use Rails naming conventions for partials\n" }, { "from": "human", "value": "require 'rails/generators'\n\nmodule Refills\n class ImportGenerator < Rails::Generators::Base\n desc 'Copy refills'\n source_root File.expand_path(\"../../../source\", __FILE__)\n ...
ruby
chosen
[ { "from": "system", "value": "Fix a stupid syntax error" }, { "from": "human", "value": "module RSpecRayo\n class Tropo1Driver\n require 'drb'\n require 'net/http'\n require 'uri'\n require 'countdownlatch'\n\n attr_accessor :script_content, :result, :drb, :config\n\n def init...
ruby
chosen
[ { "from": "human", "value": "Add a test for version command\n" }, { "from": "gpt", "value": "require \"fileutils\"\nrequire \"stringio\"\nrequire \"clipcellar/version\"\nrequire \"clipcellar/command\"\n\nclass CommandTest < Test::Unit::TestCase\n class << self\n def startup\n @@tmpdir =...
ruby
chosen
[ { "from": "system", "value": "Add documentation to the gem\n" }, { "from": "human", "value": "\nGem::Specification.new do |s|\n s.name = 'dsass'\n s.version = '1.0'\n s.date = '2012-06-08'\n s.summary = 'SASS runner for Drupal'\n s.description = 'Provides the dsass command to run sass --wat...
ruby
chosen
[ { "from": "system", "value": "Use ruby 1.8 compatible httparty in gemspec for older rubies\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"bugsnag\"\n s.version = File.read(\"VERSION\").strip\n\n s.authors = [\"James Smith\"]\n s.email = \"james@bugsnag.com\"\n\...
ruby
chosen
[ { "from": "system", "value": "Remove reference to the old EmailValidator\n\nIt was removed in https://github.com/spree/spree/commit/f80b0c30cac356f465ba35d1a98d29b7bd945f54" }, { "from": "human", "value": "require 'spree/core/validators/email'\nSpree::CheckoutController.class_eval do\n before_a...
ruby
chosen
[ { "from": "system", "value": "Add RW permissions to image folders\n" }, { "from": "human", "value": "node[:deploy].each do |application, deploy|\n script \"storage_permissions\" do\n interpreter \"bash\"\n user \"root\"\n cwd \"#{deploy[:deploy_to]}/current\"\n code <<-EOH\n chow...
ruby
chosen
[ { "from": "system", "value": "Add a new version 0.1.18 for CocoaPods.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"CUtil\"\n s.version = \"0.1.17\"\n s.summary = \"CUtil is a common utilities collection. It is designed as a tool-box for iOS developmen...
ruby
chosen
[ { "from": "human", "value": "Add specs for the new crondotdee class\n" }, { "from": "gpt", "value": "require_relative '../../../../spec_helper'\n\ndescribe 'cron::crondotdee' do\n\n let(:title) { 'true_cron' }\n\n let (:default_params) {{\n :command => '/bin/true',\n :hour => '12',\n ...
ruby
chosen
[ { "from": "system", "value": "Add method to deal with markdown text\n" }, { "from": "human", "value": "module ExercisesHelper\n def pluralize_questions(count)\n return \"#{count} questões cadastradas\" if count >= 0\n \"#{count} questão cadastrada\"\n end\nend\n" }, { "from": "gp...
ruby
chosen
[ { "from": "system", "value": "Patch upgrade 1.4.5 to 1.4.6, to remove deprecation warnings from Faraday\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Buildkit\n VERSION = '1.4.5'\nend\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nmodu...
ruby
chosen
[ { "from": "system", "value": "Make sure we don't accidentally modify the body\n\nSince we don't know where it comes from in the driver. Related to #958" }, { "from": "human", "value": "# encoding: UTF-8\n\nmodule Capybara\n module Helpers\n class << self\n ##\n #\n # Normalize...
ruby
chosen
[ { "from": "system", "value": "Use find_each vs. find when possible\n" }, { "from": "human", "value": "module Coalesce\n class Grouper\n attr_accessor :enabled\n attr_reader :rules\n\n def initialize(enabled: true, &proc)\n @enabled = enabled\n @rules = []\n @line...
ruby
chosen
[ { "from": "system", "value": "Copy 251 characters from the journal, instead of 200\n" }, { "from": "human", "value": "#\n# This hook copies the comment from the issue to the time entry if the latter is\n# blank (when updating an issue)\n#\nclass DiaryIssueHook < Redmine::Hook::Listener\n def co...
ruby
chosen
[ { "from": "system", "value": "Replace fake sales and purchases by more real one\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nEkylibre::FirstRun.add_loader :demo do |first_run|\n\n if Preference.get!(:demo, false, :boolean).value\n\n Ekylibre::FirstRun::Faker::Sales.run(max: fi...
ruby
chosen
[ { "from": "system", "value": "Update how TrainingModule records are collected for a Block\n\nWe're in ActiveRecord world now.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n# == Schema Information\n#\n# Table name: blocks\n#\n# id :integer not null,...
ruby
chosen
[ { "from": "system", "value": "[issue-331] Remove unnecessary TODO in region rules\n" }, { "from": "human", "value": "module Holidays\n module Finder\n module Rules\n class InRegion\n class << self\n def call(requested, available)\n return true if requested.inc...
ruby
chosen
[ { "from": "system", "value": "Use `endpoint` from config instead of hardcoding it.\n" }, { "from": "human", "value": "require 'acme/client'\n\nmodule LetsEncryptHeroku\n class AcmeClient\n\n attr_accessor :endpoint, :email, :private_key\n\n def initialize(endpoint, email, private_key)\n ...
ruby
chosen
[ { "from": "system", "value": "Create the path if it does not exist when performing mysql dump\n" }, { "from": "human", "value": "require 'toolshed/error'\nrequire 'toolshed/password'\n\nmodule Toolshed\n module Databases\n module Mysql\n class Backup\n include Toolshed::Password\...
ruby
chosen
[ { "from": "system", "value": "Clean up GNU user provider\n\nExtract system_user_options method.\n" }, { "from": "human", "value": "require 'wright/provider'\nrequire 'wright/provider/user'\n\nmodule Wright\n class Provider\n class User\n # GNU passwd user provider. Used as a provider fo...
ruby
chosen
[ { "from": "system", "value": "Use arel style instead of dynamic finder.\n" }, { "from": "human", "value": "module Refinery\n module Pages\n module Admin\n module InstanceMethods\n\n def error_404(exception=nil)\n if (@page = Page.find_by_menu_match(\"^/404$\", :include =...
ruby
chosen
[ { "from": "system", "value": "Add some more error types.\n" }, { "from": "human", "value": "module JokerAPI\n class AuthorisationError < RuntimeError; end\nend\n" }, { "from": "gpt", "value": "module JokerAPI\n class AuthorisationError < RuntimeError; end\n class ObjectNotFound < ...
ruby
chosen
[ { "from": "system", "value": "Change Evaluator class to a module\n" }, { "from": "human", "value": "module Malady\n class Evaluator\n\n class << self\n def evaluate(env, ast)\n type = ast.first\n rest = ast[1..-1]\n if type == :list\n evaluated_list = eval_...
ruby
chosen
[ { "from": "system", "value": "Add global reference to the location of XSD files\n" }, { "from": "human", "value": "module MWS\n module API\n class Feeds < Base\n Actions = [:get_feed_submission_list, :get_feed_submission_list_by_next_token,\n :get_feed_submission_count, ...
ruby
chosen
[ { "from": "system", "value": "Add a description for translate\n" }, { "from": "human", "value": "require \"thor\"\n\nrequire \"translations/serializer\"\n\nmodule Translations\n class CLI < Thor\n class_option :directory, aliases: [\"-d\"], default: \"config/locales\", type: :string, desc: \...
ruby
chosen
[ { "from": "system", "value": "Update gemspec to specify files\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\n\nrequire 'holidays/version'\n\nGem::Specification.new do |gem|\n gem....
ruby
chosen
[ { "from": "system", "value": "Fix warning about top level constant access\n\nStub the constant on the test controller instead of creating a new,\ntop-level constant.\n" }, { "from": "human", "value": "describe \"miq_policy/_alert_details.html.haml\" do\n before do\n @alert = FactoryGirl.crea...
ruby
chosen
[ { "from": "system", "value": "Use pesimitic locking for dev 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 'giphy/version'\n\nGem::Specification.new do |spec|\n spec.na...
ruby
chosen
[ { "from": "human", "value": "Add add it up challenge\n" }, { "from": "gpt", "value": "# Add it up!\n\n# Complete each step below according to the challenge directions and\n# include it in this file. Also make sure everything that isn't code\n# is commented in the file.\n\n# I worked on this chal...
ruby
chosen
[ { "from": "system", "value": "Fix rake & pry version a bit tigher\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'limit_detectors/version'\n\nGem::Specification.new do |spec|\n spec...
ruby
chosen
[ { "from": "human", "value": "Add ACH payment support for Stripe Gateway\n" }, { "from": "gpt", "value": "module Spree\n class Gateway::StripeAchGateway < Gateway::StripeGateway\n\n def method_type\n 'stripe_ach'\n end\n\n def create_profile(payment)\n return unless payment.so...
ruby
chosen
[ { "from": "system", "value": "Allow order_attributes to be appended to by extensions. Adds token attribute\n" }, { "from": "human", "value": "module Sprangular\n class OrderSerializer < BaseSerializer\n attributes :id, :number, :item_total, :total, :ship_total, :state,\n :adjus...
ruby
chosen
[ { "from": "system", "value": "Fix additional div container classes not working on v3 responsive media object.\n" }, { "from": "human", "value": "module Twitter\n module Bootstrap\n module Components\n module V3\n class ResponsiveMediaObject < Twitter::Bootstrap::Components::V3::M...
ruby
chosen
[ { "from": "system", "value": "Fix i18n dependency load error\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'conekta/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Use mattr_accessor to save state of scope key\n\nInstance variables in modules get messy with inheritance. This ensures\nthat @_scope_keys is the same at the parent module and child module\nlevel.\n" }, { "from": "human", "value": "module ActiveRemote\n module Scop...
ruby
chosen
[ { "from": "system", "value": "Update render plain to rails 5 syntax\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 source_at...
ruby
chosen
[ { "from": "system", "value": "Add gemspec description and summary\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'multilateration/version'\n\nGem::Specification.new do |spec|\n spec...
ruby
chosen
[ { "from": "system", "value": "Update gem version to 0.4.7\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nGem::Specification.new do |spec|\n spec.name = \"no-style-please\"\n spec.version = \"0.4.6\"\n spec.authors = [\"Riccardo Graziosi\"]\n spec.ema...
ruby
chosen
[ { "from": "system", "value": "Update podspec to remove XCTest\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'LolayPair'\n s.version = '1'\n s.summary = 'A library for handling key value pairs'\n s.homepage = 'https://gith...
ruby
chosen
[ { "from": "human", "value": "Copy template for scrapers controller\n" }, { "from": "gpt", "value": "# started the scraper controller\n#\n# require 'pry'\n# require_relative '..\\..\\lib\\housing_listing_scraper\\housing_listing_scraper'\n#\n# class ListingsController < ApplicationController\n# ...
ruby
chosen
[ { "from": "system", "value": "Fix redirect_to :back (removed in Rails 5.1)\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n def create\n auth = request.env['omniauth.auth']\n\n twitch_id = auth.uid\n user = User.find_by(twitch_id: twitch_id) || User...
ruby
chosen
[ { "from": "system", "value": "Write compiled templates to a file.\n" }, { "from": "human", "value": "require 'guard'\nrequire 'guard/guard'\nrequire 'ejs'\n\nmodule Guard\n class EJS < Guard\n def initialize(watchers = [], options = {})\n super\n @options = {\n run_on_start:...
ruby
chosen
[ { "from": "human", "value": "Add test for detecting new Gherkin versions\n\nThe test suite will now fail if a newer version of Gherkin exists. This\nway I won't not notice half a dozen new versions getting released for\nmonths at a time.\n" }, { "from": "gpt", "value": "require \"#{File.dirname(...
ruby
chosen
[ { "from": "system", "value": "Update CONTENT_LENGTH after converting to underscore\n" }, { "from": "human", "value": "module CamelCaser\n module Strategies\n class RawInput\n include Transformable\n\n attr_reader :env\n \n def self.handle(env)\n self.new(env).handl...
ruby
chosen
[ { "from": "system", "value": "Update some attributes that needs to be displayed.\n" }, { "from": "human", "value": "require 'hpcloud/commands/servers/add'\nrequire 'hpcloud/commands/servers/remove'\nrequire 'hpcloud/commands/servers/reboot'\n\nmodule HP\n module Cloud\n class CLI < Thor\n\n ...
ruby
chosen
[ { "from": "system", "value": "Use .include? instead of .in?\n" }, { "from": "human", "value": "require 'singleton'\n\n\nclass SQLRecorder\n include Singleton\n\n @db_queries = []\n def flush\n captured_queries = @db_queries\n @db_queries = []\n return captured_queries\n end\n\n def...
ruby
chosen
[ { "from": "system", "value": "Fix a minor doc error.\n" }, { "from": "human", "value": "module KQueue\n class Watcher\n # The {Watcher} subclass for events fired when a signal is received.\n # File events are watched via {Queue#watch_for_signal}.\n class Signal < Watcher\n # The n...
ruby
chosen
[ { "from": "system", "value": "Refactor the code a bit\n" }, { "from": "human", "value": "module SimpleForm\n module Inputs\n class NumericInput < Base\n def input\n @builder.text_field(attribute_name, input_html_options)\n end\n\n def input_html_options\n input_o...
ruby
chosen
[ { "from": "system", "value": "Send emails only to users with receives_notifications true\n" }, { "from": "human", "value": "module GeorgiaMailer\n class Notifier < ActionMailer::Base\n\n def new_message_notification(message)\n @message = GeorgiaMailer::MessageDecorator.decorate(message)...
ruby
chosen
[ { "from": "system", "value": "Add some notes to main\n" }, { "from": "human", "value": "require 'anal_uuid/version'\n\nmodule AnalUUID\n # Your code goes here...\nend\n" }, { "from": "gpt", "value": "require 'anal_uuid/version'\n\n# Parse a UUID as defined in IETF RFC 4122, \"A Univ...
ruby
chosen
[ { "from": "human", "value": "Add orders migration from neigborly balanced\n" }, { "from": "gpt", "value": "# This migration comes from neighborly_balanced (originally 20140817195359)\nclass CreateNeighborlyBalancedOrders < ActiveRecord::Migration\n def change\n create_table :neighborly_balan...
ruby
chosen
[ { "from": "system", "value": "Send along suggested stack rebase\n" }, { "from": "human", "value": "require 'stackprofx'\nrequire 'rack'\n\nmodule Stackprofiler\n class Middleware\n attr_accessor :ui_url\n\n def initialize(app, options={})\n @app = app\n\n pred = options[:predica...
ruby
chosen
[ { "from": "system", "value": "Define db_config class method with site argument in GobiertoData::Connection\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire_dependency \"gobierto_data\"\n\nmodule GobiertoData\n class Connection < ActiveRecord::Base\n self.abstract_c...
ruby
chosen
[ { "from": "system", "value": "Clean up the implementation of YamlStore a bit\n" }, { "from": "human", "value": "require \"yaml\"\nrequire \"active_support/core_ext/module/delegation\"\n\nmodule Vault\n module Storage\n class YamlStore\n include Enumerable\n\n delegate :[], :[]=, :s...
ruby
chosen
[ { "from": "system", "value": "Extend timeout on ZenDesk calls\n" }, { "from": "human", "value": "require 'httmultiparty'\n\nmodule Zensana\n class Zendesk\n include HTTMultiParty\n default_timeout 10\n #debug_output\n\n def self.inst\n @inst ||= new\n end\n\n module Acces...
ruby
chosen
[ { "from": "system", "value": "Remove unneeded Budler.require from main lib file.\n" }, { "from": "human", "value": "#! /usr/bin/env ruby\n\nrequire 'bundler/setup'\nBundler.require\n\nrequire 'erubis'\nrequire 'pry'\n\nrequire 'erbtex/version'\nrequire 'erbtex/command_line'\nrequire 'erbtex/find...
ruby
chosen
[ { "from": "system", "value": "Make sure connect tokens are included in gem.\n" }, { "from": "human", "value": "require_relative 'contextio/version'\n\nrequire_relative 'contextio/errors'\n\nrequire_relative 'contextio/api'\n\nrequire_relative 'contextio/api_resource'\nrequire_relative 'contextio...
ruby
chosen
[ { "from": "system", "value": "Make shrink's monkey patching opt-in\n" }, { "from": "human", "value": "$:.unshift(File.dirname(__FILE__)) unless\n $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))\n\nclass Rantly\nend\n\nrequire 'rantly/generator'\nrequ...
ruby
chosen
[ { "from": "system", "value": "Add required ruby version into 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 'csstats/version'\n\nGem::Specification.new do |gem|\n gem.name =...
ruby
chosen
[ { "from": "system", "value": "Use UI.term instead of Interrupt in 'configure'\n" }, { "from": "human", "value": "module Nehm\n module UI\n class Menu\n\n def initialize\n @choices = {}\n @inc_index = 1\n @items = []\n\n yield self\n select\n end\n...
ruby
chosen
[ { "from": "system", "value": "Add reasoning, dg links and existing services to CSV export\n" }, { "from": "human", "value": "require 'csv_renderer'\nrequire 'csv'\n\nclass NeedsCsv < CsvRenderer\n def to_csv\n CSV.generate do |csv|\n csv << [\"Id\", \"Lead department\", \"Priority\", \"...
ruby
chosen
[ { "from": "system", "value": "Add rake & rdoc to development dependency\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/croudia/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = ['wktk']\n gem.email = ['wktk@wktk...
ruby
chosen
[ { "from": "system", "value": "Remove conditional logic around Active Record 2 named_scope." }, { "from": "human", "value": "require \"active_record\"\nrequire \"pg_search/configuration\"\nrequire \"pg_search/features\"\nrequire \"pg_search/normalizer\"\nrequire \"pg_search/scope\"\nrequire \"pg_...
ruby
chosen
[ { "from": "system", "value": "Add a comment to clarify a piece of code\n" }, { "from": "human", "value": "require 'thor'\n\nmodule Poper\n class CLI < Thor\n require 'poper'\n require 'poper/version'\n\n class << self\n def is_thor_reserved_word?(word, type)\n return false ...
ruby
chosen
[ { "from": "system", "value": "Fix an issue with --verbose by disabling the pager for git stash\n" }, { "from": "human", "value": "require 'thor'\nrequire 'pathname'\n\nmodule Repos\n # The command line interface for the repos executable.\n class CLI < Thor\n desc 'list [DIRECTORY]', 'lists ...
ruby
chosen
[ { "from": "system", "value": "Test that not a child story is considered at Product.stories('no-name', user) call.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Product do\n describe 'member methods' do\n describe 'next_task_for_user' do\n it 'principally works' do...
ruby
chosen
[ { "from": "human", "value": "Add tests for friendship creation\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe FriendshipsController do\n describe \"POST #create\" do\n let(:user) { FactoryGirl.create :user }\n let(:user_two) { FactoryGirl.create :user }\n it \"adds ...
ruby
chosen
[ { "from": "system", "value": "Add solution to pass all tests\n" }, { "from": "human", "value": "# cities = [[1, 2], [3, 4], [8, 7], [10, 12], [2, 4]]\n\nclass TSP\n\n attr_reader :cities\n\n def initialize(cities)\n @cities = cities\n end\n\n def get_total\n counter = 1\n total = ge...
ruby
chosen
[ { "from": "human", "value": "Migrate existing need_ids to Array field `need_ids`\n" }, { "from": "gpt", "value": "class CopyArtefactNeedIdToArrayFieldNeedIds < Mongoid::Migration\n def self.up\n artefacts_with_need_id = Artefact.where(:need_id.exists => true, :need_id.nin => [\"\", nil])\n ...
ruby
chosen
[ { "from": "system", "value": "Fix require bug on rails 3.2.\n" }, { "from": "human", "value": "require 'active_model'\n\nrequire 'acfs/model/attributes'\nrequire 'acfs/model/loadable'\nrequire 'acfs/model/locatable'\nrequire 'acfs/model/query_methods'\nrequire 'acfs/model/relations'\nrequire 'ac...
ruby
chosen
[ { "from": "system", "value": "Add ability to disable SSL validation on controllers." }, { "from": "human", "value": "# Copyright (c) 2010 ThoughtWorks Inc. (http://thoughtworks.com)\n# Licenced under the MIT License (http://www.opensource.org/licenses/mit-license.php)\n\nmodule Oauth2\n module ...
ruby
chosen
[ { "from": "system", "value": "Fix courses pagination when 'page' param is empty\n" }, { "from": "human", "value": "# frozen_string_literal: true\nclass CoursesController < ApplicationController\n has_scope :by_name\n has_scope :by_category\n has_scope :by_organizer\n\n decorates_assigned :co...
ruby
chosen
[ { "from": "system", "value": "Load 10 projects per list on explore page\n" }, { "from": "human", "value": "class ExploreController < ApplicationController\n def index\n @platforms = Project.popular_platforms(:facet_limit => 40).first(28)\n @keywords = Project.popular_keywords(:facet_limit...
ruby
chosen
[ { "from": "system", "value": "Update option to render reponse as JSON or instance variable\n" }, { "from": "human", "value": "class WelcomeController < ApplicationController\n require 'net/http'\n require 'uri'\n\n def index\n\n # Setting up the cURL-like URL request (see https://propublic...
ruby
chosen
[ { "from": "system", "value": "Add authorize user to tests\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe CommentsController, :type => :controller do\n\n\tlet!(:query) { FactoryGirl.create :query }\n\n\tcontext \"GET #new\" do\n\n\t\tit \"assigns a new comment to @comment\"...
ruby
chosen
[ { "from": "system", "value": "Change the default canonical URL for a store to example.com\n\n[Fixes #5674]\n" }, { "from": "human", "value": "# Possibly already created by a migration.\nunless Spree::Store.where(code: 'spree').exists?\n Spree::Store.new do |s|\n s.code = 'spree'...
ruby
chosen
[ { "from": "system", "value": "Add build constraint for aws-sdk and slop\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'ec2list/version'\n\nGem::Specification.new do |spec|\n spec.n...
ruby
chosen
[ { "from": "system", "value": "Improve a comment in RNAAdapter" }, { "from": "human", "value": "class ApiEntreprise::RNAAdapter < ApiEntreprise::Adapter\n private\n\n def get_resource\n ApiEntreprise::API.rna(@siret, @procedure_id)\n end\n\n def process_params\n # Responses with a 206 c...
ruby
chosen
[ { "from": "system", "value": "Add pending test for Sunspot-dependent feature\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe \"admissions/index\", type: :view do\nend\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\nRSpec.describe \"admissions/in...
ruby
chosen
[ { "from": "system", "value": "Remove random pry in Faker::Role\n" }, { "from": "human", "value": "require 'faker'\n\nmodule Faker\n class Role < Base\n class << self\n def name\n fetch('role.name')\n end\n\n def by_index i\n all_values.fetch(i) { require 'pry'; b...
ruby
chosen
[ { "from": "system", "value": "Use more generic team name" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe FCReminder::Providers::Base do\n subject(:provider) { FCReminder::Providers::Base.new }\n\n describe \"#initialize\" do\n it \"sets #client\" do\n expect(provider...
ruby
chosen
[ { "from": "system", "value": "Modify to Player::authorize return the Player object.\n" }, { "from": "human", "value": "require 'scrypt'\n\nclass Player < ActiveRecord::Base\n has_many :scores\n\n validates :name, presence: true, uniqueness: true,\n format: { with: /\\A[a-zA-Z0-9_]+\\z/ }\n ...
ruby
chosen
[ { "from": "human", "value": "Delete branch service with permission checks\n\nSigned-off-by: Dmitriy Zaporozhets <be23d75b156792e5acab51b196a2deb155d35d6a@gmail.com>\n" }, { "from": "gpt", "value": "class DeleteBranchService\n def execute(project, branch_name, current_user)\n repository = pro...
ruby
chosen
[ { "from": "system", "value": "Add versioning for dependency gems\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'vignette/version'\n\nGem::Specification.new do |gem|\n gem...
ruby
chosen
[ { "from": "system", "value": "Define a helper to count unread messages\n" }, { "from": "human", "value": "module MailpennyHelper\n private\n\n # Returns the profile for the specified user\n # @param [user] the user whose profile path is required\n # @return [String] absolute path to the user...
ruby
chosen
[ { "from": "system", "value": "Make it a default assumption that you want all helpers, all the time (yeah, yeah)\n\ngit-svn-id: afc9fed30c1a09d8801d1e4fbe6e01c29c67d11f@6222 5ecf4fe2-1ee6-0310-87b1-e25e094e27de\n" }, { "from": "human", "value": "# Filters added to this controller apply to all con...
ruby
chosen
[ { "from": "system", "value": "Make sure ENV['RAILS_ENV'] and RAILS_ENV are kept in sync\n\n\ngit-svn-id: afc9fed30c1a09d8801d1e4fbe6e01c29c67d11f@2539 5ecf4fe2-1ee6-0310-87b1-e25e094e27de\n" }, { "from": "human", "value": "require 'optparse'\n\noptions = { :environment => \"development\" }\n\nAR...
ruby
chosen