conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Update the signups list for recent schema changes\n\nThings have gotten both simpler (in one place) and more complicated\n(in others) in the signups table in this branch. The signups list\nneeds to be updated to account for the new logic in there.\n" }, { "from": "huma...
ruby
chosen
[ { "from": "system", "value": "Add some functionality and comment Command class\nInspired by rubygems\n" }, { "from": "human", "value": "module Nehm\n class Command\n \n attr_accessor :options\n\n attr_reader :post_value_options\n\n attr_reader :pre_value_options\n\n attr_reader :...
ruby
chosen
[ { "from": "system", "value": "Make the data argument optional for loop and dispatch.\n" }, { "from": "human", "value": "require 'pcap/ffi'\nrequire 'pcap/data_link'\n\nrequire 'ffi'\n\nmodule FFI\n module PCap\n class Handler\n\n include Enumerable\n\n # Default snaplen\n SNAP...
ruby
chosen
[ { "from": "human", "value": "Remove duplicates from sorted array II\n" }, { "from": "gpt", "value": "# https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/\n# Follow up for \"Remove Duplicates\":\n# What if duplicates are allowed at most twice?\n#\n# For example,\n# ...
ruby
chosen
[ { "from": "system", "value": "Fix ActiveRecordLikeInterface to expose a model_name instance method\n" }, { "from": "human", "value": "module ActiveRecordLikeInterface\n include ActiveModel::Conversion\n module ClassMethods\n def primary_key\n :id\n end\n\n def repository\n @...
ruby
chosen
[ { "from": "system", "value": "Add a require for util classes.\n" }, { "from": "human", "value": "\n$:.unshift File.dirname(__FILE__) + '/../lib'\n\nWAKAME_ROOT=\"#{File.dirname(__FILE__)}/..\"\nWAKAME_FRAMEWORK_ROOT=\"#{File.dirname(__FILE__)}/..\"\nWAKAME_ENV=:StandAlone\n\nrequire 'rubygems' r...
ruby
chosen
[ { "from": "system", "value": "Use kaminari syntax for pagination\n" }, { "from": "human", "value": "module AppFrame\n \n module ControllerMethods\n def self.included(klass)\n klass.extend(ClassMethods)\n end\n \n module ClassMethods\n def app_frame(options = {})\n la...
ruby
chosen
[ { "from": "system", "value": "Allow a Rails application to be initialized from any directory and not just from inside it (ht: Andre Arko).\n" }, { "from": "human", "value": "require 'rubygems'\n# Set up gems listed in the Gemfile.\nif File.exist?(File.expand_path('../../Gemfile', __FILE__))\n r...
ruby
chosen
[ { "from": "system", "value": "Revert \"turn off compression to help with debugging in production.\"\n\nThis reverts commit d3bc0d0eb5b44688b50a02475ae629f1a6eaa04c.\n" }, { "from": "human", "value": "require_relative '../../app/actions/facebook_share_widget/application_action'\nrequire_relative ...
ruby
chosen
[ { "from": "system", "value": "Fix cucumber error due to link being removed\n" }, { "from": "human", "value": "require_relative '../section'\n\nmodule UI::Sections\n class ChildCategory < UI::Section\n element :heading, 'h2'\n element :title, 'h2 a'\n\n # can be a list of categories or ...
ruby
chosen
[ { "from": "system", "value": "[155] Remove adult rule from SubmissionRejector\n" }, { "from": "human", "value": "class SubmissionRejector\n RULES = [\n Rules::EnglishRule.new,\n Rules::FirstTimeRule.new,\n Rules::AdultRule.new\n ]\n\n def initialize(rules = RULES)\n @rules = rules...
ruby
chosen
[ { "from": "system", "value": "Add passing tests on user relations: tutor_connections, learner_connections, tutors, learners\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe User, type: :model do\n pending \"add some examples to (or delete) #{__FILE__}\"\nend\n" }, ...
ruby
chosen
[ { "from": "system", "value": "Remove duplication from SampleFile spec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe SampleFile do\n describe :image do\n it \"should call #file on an instance of Image\" do\n described_class::Image.any_instance.should_receive(:file)...
ruby
chosen
[ { "from": "system", "value": "Add haml gem to 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 'simple_mvc/version'\n\nGem::Specification.new do |spec|\n spec.name = ...
ruby
chosen
[ { "from": "system", "value": "Use URI to simplify host detection and generation.\n" }, { "from": "human", "value": "module Rack\n class CanonicalHost\n class Redirect\n HTML_TEMPLATE = <<-HTML\n <!DOCTYPE html>\n <html lang=\"en-US\">\n <head><title>301 Moved Perm...
ruby
chosen
[ { "from": "human", "value": "Add controller tests for LoginProtection module\n" }, { "from": "gpt", "value": "require 'test_helper'\nrequire 'action_controller'\n\nclass HelpersController < ActionController::Base\n include ShopifyApp::LoginProtection\n helper_method :shop_session\n\n def inde...
ruby
chosen
[ { "from": "system", "value": "Add sudo LWRP matcher and rename docker matcher module\n" }, { "from": "human", "value": "# Define matchers for the docker LWRPs\n# Need chef-docker to define its own LWRP matchers eventually\n\nmodule DockerLWRPs\n [:pull, :build, :remove, :import].each do |meth|\...
ruby
chosen
[ { "from": "system", "value": "Include timestamps to SeoDatum table\n" }, { "from": "human", "value": "class CreateSeoData < ActiveRecord::Migration\n def change\n create_table :seo_data do |t|\n t.references :datable, polymorphic: true, index: true\n t.string :meta_keywords\n ...
ruby
chosen
[ { "from": "system", "value": "Add nokogiri as a dependency\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"ember_cli/assets/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s|...
ruby
chosen
[ { "from": "system", "value": "Fix attirbute names that allow choosing the nginx-mainline repo\n" }, { "from": "human", "value": "case node['nginx_server']['repo']\nwhen 'epel'\n include_recipe 'yum-epel::default'\nwhen 'nginx-stable'\n include_recipe 'yum-nginx::default'\nwhen 'nginx-mainline'...
ruby
chosen
[ { "from": "system", "value": "Fix gemspec for this branch\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'bureaucrat'\n s.version = '0.0.3'\n s.summary = %{Form handling for Ruby inspired by Django forms.}\n s.date = %q{2009-11-03}\n s.author = \"Bruno Deferrari...
ruby
chosen
[ { "from": "system", "value": "Disable FC075 where we actually need it\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "#\n# Cookbook:: drbd\n# Recipe:: default\n#\n# Copyright:: 2009-2016, Chef Software, Inc.\n#\n# Licensed under t...
ruby
chosen
[ { "from": "system", "value": "Switch to update_column, which will not run geocoding callback of Enterprise\n" }, { "from": "human", "value": "class AddPermalinkToEnterprises < ActiveRecord::Migration\n def up\n add_column :enterprises, :permalink, :string\n\n Enterprise.reset_column_infor...
ruby
chosen
[ { "from": "human", "value": "Update category_id primary and foreign keys to bigint\n" }, { "from": "gpt", "value": "class ChangeCategoryIdToBigint < ActiveRecord::Migration[6.0]\n def up\n change_column :categories, :id, :bigint\n\n change_column :documents, :category_id, :bigint\n cha...
ruby
chosen
[ { "from": "system", "value": "Remove unused resources from podfile\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"UIScrollSlidingPages\"\n s.version = \"1.3\"\n s.summary = \"This control allows you to add multiple view controllers and have them scroll horizontally, each...
ruby
chosen
[ { "from": "system", "value": "Build ansi => html conversion hash once when the module gets included\n" }, { "from": "human", "value": "module AwesomePrintActionView\n\n def ap_debug(object, options = {})\n formatted = object.ai(options)\n\n if options[:plain]\n %Q|<pre class=\"debug_...
ruby
chosen
[ { "from": "system", "value": "Update to use win32-process ~> 0.7.0\n" }, { "from": "human", "value": "# x86-mingw32 Gemspec #\ngemspec = eval(IO.read(File.expand_path(\"../mixlib-shellout.gemspec\", __FILE__)))\n\ngemspec.platform = \"x86-mingw32\"\n\ngemspec.add_dependency \"win32-process\", \"...
ruby
chosen
[ { "from": "system", "value": "Mark the beta_label template as a non-layout template\n\nInclude \"beta_label\" as part of the NON_LAYOUT_TEMPLATES list, so that \nwe don't show the GOV.UK wrapper around it when we include it in \nother pages." }, { "from": "human", "value": "class RootController ...
ruby
chosen
[ { "from": "system", "value": "Refactor duplicate method bodies into shared private method\n" }, { "from": "human", "value": "require_relative \"../../lib/notification_file_lookup\"\n\nmodule NotificationHelper\n include ActionView::Helpers::TagHelper\n\n def banner_notification\n banner = N...
ruby
chosen
[ { "from": "system", "value": "Fix the wording of the initiated email’s subject" }, { "from": "human", "value": "module Mails\n class InitiatedMail < ApplicationRecord\n include MailTemplateConcern\n\n SLUG = \"initiated_mail\"\n TEMPLATE_NAME = \"mails/initiated_mail\"\n DISPLAYED_N...
ruby
chosen
[ { "from": "human", "value": "Add temporary rake task to update titles on hmrc_manual_Section items.\n\nTo simplify front-end rendering, we need to add the parent manual title\nto hmrc manual section items.\n\nThis commit adds a task to update the values on existing records (can be\nremoved once this job is ...
ruby
chosen
[ { "from": "system", "value": "Remove usage of Safe Navigation Operator '&.'\n\nThe Safe Navigation Operator was introduced in ruby 2.3. However, it\nwould be nice to have compatibility with ruby versions below that. This\ncommit has been tested with ruby 2.2.4.\n" }, { "from": "human", "value": ...
ruby
chosen
[ { "from": "system", "value": "Replace ruby_parser with ripper_ruby_parser for Ruby 1.9.\n" }, { "from": "human", "value": "require 'ruby_parser'\nrequire File.join(File.dirname(File.expand_path(__FILE__)), 'config_file')\nrequire File.join(File.dirname(File.expand_path(__FILE__)), 'tree_dresser'...
ruby
chosen
[ { "from": "system", "value": "Use gem.summary instead of gem.description\n\nNoob mistake\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'mongo_rates/version'\n\nGem::Specification.ne...
ruby
chosen
[ { "from": "system", "value": "Revert \"Explicitely call to_s on symbol before calling upcase\"\n\nThis reverts commit f57cafe5d8d13f9d3a557950bb8d4ea7243ee475.\n" }, { "from": "human", "value": "module Skimlinks\n class Configuration\n VALID_CONFIG_KEYS = [\n :api_key,\n :format\n ...
ruby
chosen
[ { "from": "human", "value": "Add rake task to apply metadata\n" }, { "from": "gpt", "value": "require 'rummager'\n\ndesc \"Apply metadata from the json file\"\ntask :tag_json_metadata do\n file_path = File.join(settings.root, '../../config/metadata.json')\n Indexer::MetadataTagger.amend_indexe...
ruby
chosen
[ { "from": "system", "value": "Change podspec to be valid\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"XDKAirMenu\"\n s.version = \"1.1.11\"\n s.summary = \"A short description of XDKAirMenu.\"\n s.license = 'MIT'\n s.author ...
ruby
chosen
[ { "from": "system", "value": "FIX: Create unique username and password\n" }, { "from": "human", "value": "require 'faker'\n\nFactoryGirl.define do\n factory :user do\n username { Faker::Internet.user_name }\n email { Faker::Internet.email }\n first_name { Faker::Name.first_na...
ruby
chosen
[ { "from": "system", "value": "Refactor config helpers to share logic that swaps config values\n\nIt's the same logic, just working on a different config instance object,\nso we can have a shared method used by both.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire \"ju...
ruby
chosen
[ { "from": "system", "value": "Define readers of DecryptResult and Recipient instance variables\n" }, { "from": "human", "value": "module GPGME\n class EngineInfo\n private_class_method :new\n\n attr_reader :protocol, :file_name, :version, :req_version, :home_dir\n alias required_versio...
ruby
chosen
[ { "from": "system", "value": "Use full path to require railtie\n" }, { "from": "human", "value": "require 'railtie' if defined?(Rails) && Rails::VERSION::MAJOR >= 3\nrequire 'git'\nrequire 'heroku_san/stage'\nrequire 'heroku_san/project'\nrequire 'heroku_san/deploy/rails'\nrequire 'heroku_san/de...
ruby
chosen
[ { "from": "system", "value": "Remove dependency on test-unit because test-unit/power_assert support is\nexperimental currently\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'servers...
ruby
chosen
[ { "from": "system", "value": "Add rails back as a dev dependency\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"webpack/rails/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do ...
ruby
chosen
[ { "from": "system", "value": "Add 'update type' property to initializer input class\n" }, { "from": "human", "value": "module Atlas\n class InitializerInput\n include ActiveDocument\n\n DIRECTORY = 'initializer_inputs'\n\n attribute :query, String\n attribute :share_group,...
ruby
chosen
[ { "from": "system", "value": "Add Errno::ECONNRESET to the errors that trigger https attempt\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Capybara\n class Server\n class Checker\n def initialize(host, port)\n @host, @port = host, port\n @ssl =...
ruby
chosen
[ { "from": "human", "value": "Add nuke_pave task for resetting development database\n" }, { "from": "gpt", "value": "namespace :db do\n desc \"drops, creates, migrates, and seeds database\"\n task :nuke_pave => :environment do\n unless Rails.env == \"Production\"\n Rake::Task[\"db:drop\...
ruby
chosen
[ { "from": "system", "value": "Use a next to skip iteration in each block (style).\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nmodule Emeril\n\n # Exception class raised when there is a metadata.rb parsing issue.\n #\n class MetadataParseError < StandardError ; end\n\n # A...
ruby
chosen
[ { "from": "system", "value": "Add check if Gem is defined\n\nOn e.g. Ubuntu 12.04 LTS Gem is not there by default so i added a check to not fail in that fact if this is the case." }, { "from": "human", "value": "# Fact: package_provider\n#\n# Purpose: Returns the default provider Puppet will cho...
ruby
chosen
[ { "from": "system", "value": "Convert page text to UTF-8\n" }, { "from": "human", "value": "module Hiraoyogi\n module Database\n class Base\n def initialize(analyzer)\n @index_table = {}\n @analyzer = analyzer\n end\n\n def index(url, doc)\n @index_table[u...
ruby
chosen
[ { "from": "system", "value": "Update rubocop version for security\n\nSee CVE-2017-8418\n\nSigned-off-by: Mike Fiedler <af44b651315133051dded0e55830cbf76e9bfef9@gmail.com>\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unles...
ruby
chosen
[ { "from": "system", "value": "Change accept header to application/json\n" }, { "from": "human", "value": "module Restulicious\n class Connection\n\n def get(url, params)\n request = ::Typhoeus::Request.new(url,\n method: :get,\n headers: { Accept: \"text/json\...
ruby
chosen
[ { "from": "human", "value": "Set up pagination in testing app\n" }, { "from": "gpt", "value": "JSONAPI.configure do |config|\n # built in paginators are :none, :offset, :paged\n config.default_paginator = :paged\n\n config.default_page_size = 10\n config.maximum_page_size = 20\nend\n" } ]
ruby
chosen
[ { "from": "system", "value": "Remove order from count subquery\n" }, { "from": "human", "value": "require 'active_record/relation'\nrequire 'active_record/version'\n\nmodule ActiveRecord\n module ConnectionAdapters\n module SQLServer\n module CoreExt\n module Calculations\n ...
ruby
chosen
[ { "from": "system", "value": "Consolidate __Init checks inside report_init method\n" }, { "from": "human", "value": "# Copyright (c) 2013 AppNeta, Inc.\n# All rights reserved.\n\nmodule TraceView\n module API\n ##\n # Provides methods related to layer initialization and reporting\n mod...
ruby
chosen
[ { "from": "system", "value": "Change SSH server in auth methods test\n" }, { "from": "human", "value": "require \"rye\"\n\n# May need to update this in the future with a\n# different free SSH provider\n@hostname = \"shellmix.com\"\n\n## Don't prompt for password if \"publickey\" is the only :aut...
ruby
chosen
[ { "from": "system", "value": "Use root_user attribute in recipe\n" }, { "from": "human", "value": "#\n# Author:: Seth Chisamore (<schisamo@chef.io>)\n# Cookbook Name:: chef_handler\n# Recipe:: default\n#\n# Copyright 2011-2016, Chef Software, Inc.\n#\n# Licensed under the Apache License, Version...
ruby
chosen
[ { "from": "system", "value": "Install tmpwatch (tmpreaper on Ubuntu).\n" }, { "from": "human", "value": "#\n# Cookbook Name:: cron\n# Recipe:: default\n#\n# Copyright 2010-2013, Opscode, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file exc...
ruby
chosen
[ { "from": "system", "value": "[shindo-minitest] Split up CollectionSpec tests into smaller bits\n" }, { "from": "human", "value": "module Fog::CollectionSpec\n extend Minitest::Spec::DSL\n\n # this should be reimplemented in the subject's spec if the subject has required params\n def params\n...
ruby
chosen
[ { "from": "system", "value": "Fix bug in test when accessing @message field\n\n[#116514499]\n\nSigned-off-by: Derik Evangelista <70505a31063ee00d819d9d243caf579a659cbb4f@pivotal.io>\n" }, { "from": "human", "value": "require 'json'\nrequire 'uri'\nrequire 'prof/ssh_gateway'\n\nrequire \"support/...
ruby
chosen
[ { "from": "system", "value": "Make the specs shorter by listing routes in word array.\n" }, { "from": "human", "value": "ENV['RACK_ENV'] = 'test'\n\nrequire_relative '../app/feels' # <-- your sinatra app\nrequire 'rspec'\nrequire 'rack/test'\n\ndescribe 'Test the routes' do\n include Rack::Tes...
ruby
chosen
[ { "from": "system", "value": "Add test for popping from an empty Stack\n" }, { "from": "human", "value": "require_relative '../stack.rb'\n\nRSpec.describe \"Stack\" do\n before(:each) do\n @stack = Stack.new\n end\n\n it \"should have no values when initialized\" do\n expect(@stack.top)...
ruby
chosen
[ { "from": "system", "value": "Send mongo logging to dev null\n" }, { "from": "human", "value": "require 'test_helper'\nrequire 'flipper/adapters/mongo'\n\nclass MongoTest < MiniTest::Test\n prepend SharedAdapterTests\n\n def setup\n host = '127.0.0.1'\n port = '27017'\n collection = M...
ruby
chosen
[ { "from": "system", "value": "Make properties appear on the root level of the element\n" }, { "from": "human", "value": "module OpenXml\n module Docx\n module Elements\n class AbstractNumber < OpenXml::Docx::Element\n include HasChildren, HasProperties\n tag :abstractNum\n...
ruby
chosen
[ { "from": "system", "value": "Change default test port to 80\n\nThe test port can be configured with the env variable TEST_PORT.\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\nrequire 'net/http'\nrequire 'minitest/autorun'\nrequire 'socket'\n\nclass JenkinsSampleTest < MiniTest::Unit:...
ruby
chosen
[ { "from": "system", "value": "Fix error since we moved to 'collection_name'" }, { "from": "human", "value": "module WoocommerceAPI\n module Associations\n module ClassMethods\n def has_many(association_name, options={})\n class_name = options[:class_name].presence || association_...
ruby
chosen
[ { "from": "system", "value": "Remove host from s3 fog credentials\n" }, { "from": "human", "value": "def storage_config\n path = File.join(Rails.root.to_s, 'config/filesystem.yml')\n unless File.file?(path)\n return nil\n end\n\n config = YAML::load(ERB.new(File.read(path)).result)\n unl...
ruby
chosen
[ { "from": "system", "value": "Test doc_class and doc_folder attribute\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'spec_helper'\n\ndescribe SwaggerDocsGenerator::Configuration, type: :gem,\n name: :configuration do\n d...
ruby
chosen
[ { "from": "system", "value": "Add laravel project at deploy\n\nAdd laravel project at deploy" }, { "from": "human", "value": "node[:deploy].each do |application, deploy|\n script \"install_composer\" do\n interpreter \"bash\"\n user \"root\"\n cwd \"#{deploy[:deploy_to]}/current\"\n ...
ruby
chosen
[ { "from": "system", "value": "Duplicate extension - Change test object\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe package('newrelic-php5') do\n it { should be_installed }\nend\n\ndescribe command('php --re newrelic') do\n it { should return_exit_status 0 }\nend\n\ndes...
ruby
chosen
[ { "from": "system", "value": "Use he (current Hebrew locale) as the fallback locale for iw (old Hebrew locale)\n" }, { "from": "human", "value": "# tell the I18n library where to find your translations\nI18n.load_path += Dir[Rails.root.join('config', 'locales', '*.{rb,yml}')].sort\nI18n.load_pat...
ruby
chosen
[ { "from": "human", "value": "Remove unique constraint on mock titles\n" }, { "from": "gpt", "value": "class RemoveUniqueConstraintFromTitlesOnMockLists < ActiveRecord::Migration\n def self.up\n remove_index :mock_lists, [:project_id, :title]\n add_index :mock_lists, [:project_id, :title]\...
ruby
chosen
[ { "from": "system", "value": "Change the path to where ruby will be\n" }, { "from": "human", "value": "env 'PATH', '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'\n\nevery :day, at: '12:00am' do\n runner 'ApplicationSubmission.move_to_dashboard'\nend\n" }, { "from": "gpt"...
ruby
chosen
[ { "from": "system", "value": "Fix whenever environment variables from RAILS_ENV to RACK_ENV\n" }, { "from": "human", "value": "set :output, '/home/stillmaintained/shared/log/cron.log'\n\nevery 6.hours do\n rake \"github:refresh\"\nend\n" }, { "from": "gpt", "value": "job_type :rake,...
ruby
chosen
[ { "from": "system", "value": "Create first badge to seed database\n" }, { "from": "human", "value": "# This file should contain all the record creation needed to seed the database with its default values.\n# The data can then be loaded with the rails db:seed command (or created alongside the dat...
ruby
chosen
[ { "from": "system", "value": "Create seed data for making questions\n" }, { "from": "human", "value": "10.times do { User.create!( username: Faker::Internet.user_name, email: Faker::Internet.email, password:\"password\" )}\n\nusers = User.all\n\n#Make Questions:\nusers.each do |user|\n user.cre...
ruby
chosen
[ { "from": "system", "value": "Handle js error in RSpec 3.7\n\nHandle an issues ocurring with the introduction of RSpec 3.7 - presumably a timing issue - which means we can get an `TypeError: undefined is not a constructor (evaluating 'window.sessionTimeoutCheck()’)` as the js has not loaded yet.\n" }, {...
ruby
chosen
[ { "from": "system", "value": "Check that limit is initialized and is > 0 before raising log length limit exceptions\n\nBuffer#<< is called asynchronously by a separate thread Net::SSH is using. Buffer#initialize may or may not happen by then.\nThis causes build to be immediately terminated w/o log output so...
ruby
chosen
[ { "from": "system", "value": "Use latest Rubocop like Jekyll" }, { "from": "human", "value": "# frozen_string_literal: true\n\nGem::Specification.new do |spec|\n spec.name = \"jekyll-commonmark\"\n spec.summary = \"CommonMark generator for Jekyll\"\n spec.version = \"1.1....
ruby
chosen
[ { "from": "system", "value": "Fix bug in return value of creating digest history\n" }, { "from": "human", "value": "class DigestHistory < ActiveRecord::Base\n\n def self.create_new!(frequency)\n history = new(frequency: frequency)\n history.last_discussion_id = Discussion.last.id rescue ...
ruby
chosen
[ { "from": "system", "value": "Comment out (currently) unused code for RCov…" }, { "from": "human", "value": "require 'excon'\n\nmodule Nomis\n class Client\n def initialize(host)\n @host = host\n @connection = Excon.new(host, persistent: true)\n end\n\n def get(route, params ...
ruby
chosen
[ { "from": "system", "value": "Add reflection to MD file\n" }, { "from": "human", "value": "#first question\nputs \"What is your first name?\"\nfirst_name=gets.chomp.capitalize\n\nputs \"What is your middle name?\"\nmiddle_name= gets.chomp\n\nputs \"What is your last name?\"\nlast_name= gets.chom...
ruby
chosen
[ { "from": "system", "value": "Revert \"uglifier 3.0 uses globals too!\"\n\nThis reverts commit 2d8b0d2ae25fe04812d620fc6964195eab2e626e.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequir...
ruby
chosen
[ { "from": "system", "value": "Replace first+last name w/ name\n\ncc @robertdolca\n" }, { "from": "human", "value": "attributes :title,\n :description,\n :location,\n :date,\n :discourse_url\n\nchild :users do\n attributes :first_name, :last_name, :email_m...
ruby
chosen
[ { "from": "system", "value": "Fix test for destroying a like\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe LikesController do\n describe \"POST #create\" do\n # Throwing an error on line 10 here!\n let(:user) { FactoryGirl.create :user }\n let(:checkin) { Factory...
ruby
chosen
[ { "from": "system", "value": "Test that home page responses successfully.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe PagesController do\nend\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe PagesController do\n describe \"#home\" do\n i...
ruby
chosen
[ { "from": "system", "value": "Update gem_toys to version 0.7.1" }, { "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": "Update URL and summary in gemspec\n" }, { "from": "human", "value": "require File.expand_path(\"../lib/hiredis/version\", __FILE__)\n\nGem::Specification.new do |s|\n s.name = \"hiredis\"\n s.version = Hiredis::VERSION\n s.homepage = \"http://github.com/pietern/h...
ruby
chosen
[ { "from": "system", "value": "Fix lint error from travis failure.\n" }, { "from": "human", "value": "actions :set\ndefault_action :set\n\nattribute :key, kind_of: String, name_attribute: true\nattribute :value, kind_of: String, required: true\nattribute :scope, equal_to: %w(local global system...
ruby
chosen
[ { "from": "human", "value": "Add Logitech Touch Mouse Server Latest\n\nFor everyone who sometimes do not want to use Mac's trackpad.\n" }, { "from": "gpt", "value": "cask :v1 => 'itouch-server' do\n version '1.0'\n sha256 'e8aae0461ce7056adcc4940dda65d3ec8e4929092f0f2465b3e1dc5e353a362e'\n\n ...
ruby
chosen
[ { "from": "system", "value": "Improve the spec by checking the email that was sent\n" }, { "from": "human", "value": "require \"light-service\"\nrequire \"rails_spec_helper\"\nrequire \"./app/services/creates_new_user/sends_activation_needed_email\"\n\ndescribe Services::Actions::SendsActivation...
ruby
chosen
[ { "from": "system", "value": "Remove the weak ref which is breaking KVO... for now.\n" }, { "from": "human", "value": "module MotionBindable\n\n #\n # Represents a binding strategy. Designed to be as flexible as possible.\n #\n class Strategy\n\n @strategies_map = [{ class: Strategy, cand...
ruby
chosen
[ { "from": "system", "value": "Update Hopper to use versioned downloads\n" }, { "from": "human", "value": "cask :v1 => 'hopper-disassembler' do\n version :latest\n sha256 :no_check\n\n url 'http://www.hopperapp.com/HopperWeb/download_last_v3.php'\n appcast 'http://www.hopperapp.com/HopperWeb/...
ruby
chosen
[ { "from": "system", "value": "Remove comma in content_collaborators has_attribution down migration.\n" }, { "from": "human", "value": "class AddHasAttributionToContentCollaborators < ActiveRecord::Migration[5.2]\n def up\n add_column :content_collaborators, :has_attribution, :boolean, defaul...
ruby
chosen
[ { "from": "system", "value": "Check for nil klass when looking up class names\n\nfixes #27" }, { "from": "human", "value": "module MemoryProfiler\n class Helpers\n\n def initialize\n @gem_guess_cache = Hash.new\n @location_cache = Hash.new { |h,k| h[k] = Hash.new.compare_by_identit...
ruby
chosen
[ { "from": "system", "value": "Add HTTP methods to custom routes\n\nThe survey POSTs a non-alaveteli endpoint so shouldn't need POST.\n" }, { "from": "human", "value": "# Here you can override or add to the pages in the core website\n\nRails.application.routes.draw do\n # Add a route for the sur...
ruby
chosen
[ { "from": "system", "value": "Allow output_stream to be overridden in configuration\n" }, { "from": "human", "value": "module RSpec\n module Core\n class CommandLine\n def initialize(options, configuration=RSpec::configuration, world=RSpec::world)\n if Array === options\n ...
ruby
chosen
[ { "from": "system", "value": "Check for mismatched start_time before combining timeseries\n" }, { "from": "human", "value": "module TimeSeries\n class TimeSeries\n\n attr_reader :start_time, :interval, :data\n\n def initialize(start_time, interval, data)\n @start_time, @interval, @da...
ruby
chosen
[ { "from": "human", "value": "Add S3 Bucket Website Example for Ruby\n" }, { "from": "gpt", "value": "# Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# This file is licensed under the Apache License, Version 2.0 (the \"License\").\n# You may not use this file ex...
ruby
chosen
[ { "from": "system", "value": "Add samplers only if newrelic is present and not shimmed\n" }, { "from": "human", "value": "require 'trashed/newrelic/samplers'\n\n[Trashed::LiveObjectsSampler, Trashed::AllocatedObjectsSampler].each do |sampler|\n NewRelic::Agent.instance.add_sampler(sampler.new) ...
ruby
chosen
[ { "from": "system", "value": "Resolve remote log removed_by via removed_by_id instead\n" }, { "from": "human", "value": "require 'virtus'\n\nclass RemoteLog\n include Virtus.model(nullify_blank: true)\n\n attribute :aggregated_at, Time\n attribute :archive_verified, Boolean, default: false\n ...
ruby
chosen