conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Change to require all matchers.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nif RUBY_VERSION > '1.9' and (ENV['COVERAGE'] || ENV['TRAVIS'])\n require 'simplecov'\n require 'coveralls'\n\n SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[\n ...
ruby
chosen
[ { "from": "system", "value": "Correct uri string used for storage in test\n" }, { "from": "human", "value": "require 'uuidtools'\nclass Attachment < ActiveRecord::Base\n serialize :metadata, Hash\n\n attr_protected([:mime_type, :size, :filename, :digest])\n\n belongs_to :attachee, :polymorphi...
ruby
chosen
[ { "from": "system", "value": "Add 'path' fact to fix spec tests\n\ncamptocamp/archive fails if this fact doesn't exist\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'puppetlabs_spec_helper/module_spec_helper'\n\nshared_examples :compile, :compile => true do\n it { should compil...
ruby
chosen
[ { "from": "system", "value": "Update example class to use new syntax.\n" }, { "from": "human", "value": "$LOAD_PATH.unshift(File.dirname(__FILE__))\nrequire 'rspec'\nrequire './lib/antidote'\n\nclass CustomType\n attr_accessor :a, :b\n\n def initialize(a, b)\n @a = a\n @b = b\n end\nend...
ruby
chosen
[ { "from": "system", "value": "Add rspec config to helper.\n" }, { "from": "human", "value": "require 'chefspec'\nrequire 'chefspec/berkshelf'\n" }, { "from": "gpt", "value": "require 'chefspec'\nrequire 'chefspec/berkshelf'\n\nRSpec.configure do |config|\n # Specify the path for Che...
ruby
chosen
[ { "from": "system", "value": "Change simplecov config to be consistent with other gems\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'spec'\nrequire 'spec/autorun'\n\n# require spec support files and shared behavior\nDir[File.expand_path('../{support,shared}/**/*.rb', __FILE__)...
ruby
chosen
[ { "from": "system", "value": "Set up stricter timeouts for tests\n\nSet stricter timeouts for rspec/eventually as well as all tests in\ngeneral. When mutation testing, this prevents infinite cases from being\ngenerated.\n" }, { "from": "human", "value": "begin\n require 'simplecov'\n SimpleCov...
ruby
chosen
[ { "from": "system", "value": "Allow net connect for first example\n" }, { "from": "human", "value": "require_relative '../lib/payment_processor'\nrequire_relative '../lib/payment_processor_connection'\nrequire_relative '../lib/charge_result'\nrequire_relative '../lib/user'\n\nrequire 'uri'\nrequ...
ruby
chosen
[ { "from": "system", "value": "Initialize Stash in the RSpec helper\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.dirname(__FILE__)\n$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\n\nrequire 'stash'\nrequire 'rspec'\nrequire 'rspec/autorun'" }, { "from": "gpt", ...
ruby
chosen
[ { "from": "system", "value": "Order projects list by name\n\nTo prevent these from moving around willy-nilly and to improve the\nfindability of data, I am alphabetizing the list of projects on the\nProjectsController#index page.\n\nChange-Id: I2164558e236de843198c12a782a64f44cf20e78a\n" }, { "from":...
ruby
chosen
[ { "from": "system", "value": "Modify status controller URI encode\n" }, { "from": "human", "value": "class StatusesController < ApplicationController\n\n # GET /statuses\n # GET /statuses.json\n def index\n @statuses = Status.all\n end\n\n # POST /statuses\n def create\n @status = St...
ruby
chosen
[ { "from": "system", "value": "Remove ID from admin subscribers index\n" }, { "from": "human", "value": "require \"administrate/base_dashboard\"\n\nclass SubscriberDashboard < Administrate::BaseDashboard\n # ATTRIBUTE_TYPES\n # a hash that describes the type of each of the model's fields.\n #\...
ruby
chosen
[ { "from": "human", "value": "Add tests for empty objects\n" }, { "from": "gpt", "value": "# -*- coding: utf-8 -*-\n\nrequire \"stringio\"\nrequire \"pp\"\nrequire \"lazy/pp/json\"\n\nmodule Lazy::PP\n class JSONTest < Test::Unit::TestCase\n def setup\n @original_stdout = $stdout.dup\n ...
ruby
chosen
[ { "from": "system", "value": "Revert \"Reduce CPU up scaling for IC systems due to cooling pressure\"\n\nThis reverts commit 90503ef133f53d9f2d45dea515904965e85222ce.\n" }, { "from": "human", "value": "name \"ic\"\ndescription \"Role applied to all servers at Imperial College\"\n\ndefault_attrib...
ruby
chosen
[ { "from": "system", "value": "Move snmp require so that it's available for other files.\n" }, { "from": "human", "value": "require 'copian/version'\nrequire 'copian/collector/abstract_collector'\nrequire 'copian/collector/addresses_collector'\nrequire 'copian/collector/bandwidth_collector'\nrequ...
ruby
chosen
[ { "from": "system", "value": "Fix brand display with no page title\n" }, { "from": "human", "value": "module MetaRailsHelpers\n module TitleHelper\n # Produces html title element\n def title(options = {})\n page_title = content_for(options[:page_title] || :title)\n separator = ...
ruby
chosen
[ { "from": "system", "value": "Change SOAP Client Response Value\n\nSOAP client now responds with the body hash from the Savon client if\nthe response is successful. Otherwise, it raises an exception.\n" }, { "from": "human", "value": "require 'savon'\n\nmodule ThreePLCentralAPI\n class SOAPClie...
ruby
chosen
[ { "from": "system", "value": "Use provided jars instead of CLASSPATH. Also added Eureka::Version\n" }, { "from": "human", "value": "require \"java\"\n\n# weka.jar must be on your CLASSPATH\nrequire \"weka.jar\"\n\n$:.unshift(here = File.dirname(__FILE__))\n\nrequire \"eureka/core\"\n" }, { ...
ruby
chosen
[ { "from": "system", "value": "Fix typo about autoload expression.rb\n" }, { "from": "human", "value": "module Goohub\n dir = File.dirname(__FILE__) + \"/goohub\"\n\n autoload :Client, \"#{dir}/client.rb\"\n autoload :Command, \"#{dir}/command.rb\"\n autoload :Confi...
ruby
chosen
[ { "from": "system", "value": "Update quantity of Cart items\n" }, { "from": "human", "value": "class Cart < ActiveRecord::Base\n has_many :line_items, :dependent => :destroy\nend\n" }, { "from": "gpt", "value": "class Cart < ActiveRecord::Base\n has_many :line_items, :dependent => ...
ruby
chosen
[ { "from": "system", "value": "Add MiniTest and SQLite 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 'orm/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Update hashie dependency to version ~> 1.1.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"rash/version\"\n\nGem::Specification.new do |s|\n s.name = %q{rash}\n s.authors = [\"tcocca\"]\n s...
ruby
chosen
[ { "from": "human", "value": "Add example: create rpm&deb packages with init scripts\n\nTook me some time to figure out how to use the api -- So I am submitting this example to add some documentation for the API, specifically pleaserun." }, { "from": "gpt", "value": "#!/usr/bin/env ruby\n$: << Fi...
ruby
chosen
[ { "from": "system", "value": "Fix Watcher.close for inotify backend\n" }, { "from": "human", "value": "require 'rb-inotify'\nrequire 'io/nonblock'\n\nmodule EMDirWatcher\nmodule Platform\nmodule Linux\n\nclass Watcher\n\n def initialize path, inclusions, exclusions\n @notifier = INotify::Not...
ruby
chosen
[ { "from": "system", "value": "Add encoding shebang in the benchmark file\n" }, { "from": "human", "value": "require 'benchmark'\nrequire 'turkish_stemmer'\n\nBenchmark.bmbm(7) do |x|\n\n x.report('regex') do\n TurkishStemmer.class_eval do\n def self.turkish?(word)\n !! word.match...
ruby
chosen
[ { "from": "system", "value": "Add Asynchrony to the authors list\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire 'hashy_db/version'\n\nGem::Specification.new do |s|\n s.name = \"hashy_db\"\n s.version = HashyDb::V...
ruby
chosen
[ { "from": "system", "value": "Bring back GitHubby pryrc helpers\n" }, { "from": "human", "value": "# common utilities that can be shared between irb and pry.\n\nclass Object\n def local_methods obj = self\n (obj.methods - obj.class.superclass.instance_methods).sort\n end\nend\n" }, { ...
ruby
chosen
[ { "from": "system", "value": "Use builtin routes implementation instead\n" }, { "from": "human", "value": "module Rails\n module Routes\n module Js\n module Utils\n VERSION = \"1.0.1\"\n end\n end\n end\nend\n" }, { "from": "gpt", "value": "module Rails\n mo...
ruby
chosen
[ { "from": "human", "value": "Add test coverage for a couple of helper methods.\n\nI'm planning on refactoring these methods, so it's useful to have some\ntest coverage beforehand.\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nclass Admin::DocumentActionsHelperTest < ActionView::TestC...
ruby
chosen
[ { "from": "system", "value": "Add rspec dependency and spec folder\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'dooie/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Support for collecting inline feedback\n" }, { "from": "human", "value": "module Telegrammer\n module DataTypes\n # Telegram Update data type.\n #\n # @attr [Integer] update_id The updateโ€˜s unique identifier. Update identifiers start from a certain positiv...
ruby
chosen
[ { "from": "system", "value": "Load strategies on first exception\n" }, { "from": "human", "value": "$:.unshift File.expand_path('../', __FILE__)\n\nmodule Safely\n\n VERSION = \"0.1.0pre\"\n\n autoload :Config, 'safely/config'\n autoload :Mixin, 'safely/mixin'\n autoload :Strategy, 'saf...
ruby
chosen
[ { "from": "system", "value": "Fix the name of the the cookbook to test\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'default installation' do\n let(:runner) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '12.04') }\n let(:chef_run) { runner.converge('smokepin...
ruby
chosen
[ { "from": "system", "value": "Add seed data for development\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 rake db:seed (or created alongside the db with db:setup)....
ruby
chosen
[ { "from": "system", "value": "Add 'Skip review' permissions to Test User\n" }, { "from": "human", "value": "if User.where(name: \"Test user\").blank?\n gds_organisation_id = \"af07d5a5-df63-4ddc-9383-6a666845ebe9\"\n user_id = \"026530a0-750f-41e6-8863-b539d1467145\"\n\n User.create!(\n ui...
ruby
chosen
[ { "from": "human", "value": "Migrate preferences onto serialized column\n\nFixes #4373\n" }, { "from": "gpt", "value": "class MigrateOldPreferences < ActiveRecord::Migration\n def up\n migrate_preferences(Spree::Calculator)\n migrate_preferences(Spree::PaymentMethod)\n migrate_preferen...
ruby
chosen
[ { "from": "human", "value": "Add another test for creating new editions\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nclass EditionTest < ActiveSupport::TestCase\n def template_user_and_published_transaction\n without_metadata_denormalisation(Transaction) do\n user = User.cr...
ruby
chosen
[ { "from": "system", "value": "Make src accessible from event object" }, { "from": "human", "value": "# Copyright 2016 LINE\n#\n# LINE Corporation licenses this file to you under the Apache License,\n# version 2.0 (the \"License\"); you may not use this file except in compliance\n# with the Licen...
ruby
chosen
[ { "from": "system", "value": "Include categories in article drop\n" }, { "from": "human", "value": "class Liquid::ArticleDrop < Liquid::BaseDrop\n \n include ERB::Util # So we can simply use <tt>h(...)</tt>.\n \n class_inheritable_reader :liquid_attributes\n write_inheritable_attribute :liq...
ruby
chosen
[ { "from": "system", "value": "Remove unneeded option from ResourceRouteGenerator\n" }, { "from": "human", "value": "module Rails\n module Generators\n class ResourceRouteGenerator < NamedBase # :nodoc:\n class_option :api, type: :boolean,\n desc: \"Preconfigure s...
ruby
chosen
[ { "from": "system", "value": "Change timing to call callback from before_save to before_create\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 except in comp...
ruby
chosen
[ { "from": "system", "value": "Fix migration for jruby, require missing\n" }, { "from": "human", "value": "require 'common'\n\n::Sequel.migration do\n up do\n # Change all serialized column initial Marshalled to JSON.\n self[:orders].each do |row|\n [:state, :parameters].each do |colu...
ruby
chosen
[ { "from": "system", "value": "TEST: Add output to debug CI issue with db concat\n" }, { "from": "human", "value": "module DbHelpers\n def db_concat(*args)\n env = ENV['RAILS_ENV'] || 'development'\n adapter = ActiveRecord::Base.configurations[env]['adapter'].to_sym\n args.map! { |arg| ...
ruby
chosen
[ { "from": "system", "value": "Rename the shell script since the converter is platform dependent.\n" }, { "from": "human", "value": "require 'nokogiri'\n\nclass WordConverter\n attr_reader :raw_html, :html\n \n def initialize(raw_html)\n puts raw_html\n @raw_html = raw_html\n end\n \n ...
ruby
chosen
[ { "from": "system", "value": "Add validation to Status received from USCIS before add new Step. Disable temporarily before and after create actions.\n" }, { "from": "human", "value": "class Application < ActiveRecord::Base\n attr_accessible :complete, :number, :user_id\n\n validates_presence_o...
ruby
chosen
[ { "from": "system", "value": "Move describing of feature selections into a class method so that it can be also be used to describe an array of feature selections not yet associated with a basket item\n" }, { "from": "human", "value": "class BasketItem < ActiveRecord::Base\n validates_numericali...
ruby
chosen
[ { "from": "system", "value": "Adjust timer algorithm to not make wait times so long\n" }, { "from": "human", "value": "class Reservation < ActiveRecord::Base\n after_save :update_times\n\tbelongs_to :user\n\tbelongs_to :restaurant\n\n def update_times\n update_column(:table_ready_time...
ruby
chosen
[ { "from": "human", "value": "Add migration for new fields: crypto weaknesses and crypto alternatives\n" }, { "from": "gpt", "value": "class CryptoWeaknessesAlternatives < ActiveRecord::Migration\n def change\n add_column :projects, :crypto_weaknesses_status, :string, default: '?'\n add_co...
ruby
chosen
[ { "from": "system", "value": "Add a brief description for the gem\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"sift/version\"\n\nGem::Specification.new do |s|\n s.name = \"sift\"\n s.version = Sift::VERSION\n...
ruby
chosen
[ { "from": "system", "value": "Update podspec to use 5.0.0-beta.1\n[skip ci]\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'SwiftyUserDefaults'\n s.version = '4.0.0'\n s.license = 'MIT'\n s.summary = 'Swifty API for NSUserDefaults'\n s.homepage = 'https://github.com/rade...
ruby
chosen
[ { "from": "system", "value": "Add a UPNP unsubscribe method + timeouts\n" }, { "from": "human", "value": "require 'httpclient'\n\nmodule Sonos::Endpoint::Upnp\n\n # Subscribes to UPNP events, with callbacks being sent to the provided URL\n # @param [String] The URL to receive http callbacks fr...
ruby
chosen
[ { "from": "system", "value": "Add explicit LoadError to rescue potentially failing require\n\nrescue without arguments rescues only StandardErrors. The LoadError\n(that is raised by a file not found) is not a StandardError but a\nScriptError (see\nhttp://blog.nicksieger.com/articles/2006/09/06/rubys-excepti...
ruby
chosen
[ { "from": "system", "value": "Rename rspec_context var to context\n" }, { "from": "human", "value": "module AssemblyLine\n class Constructor\n extend Forwardable\n\n def_delegators :rspec_context, :let, :before\n\n attr_reader :name, :code_block, :rspec_context, :options\n\n def ini...
ruby
chosen
[ { "from": "system", "value": "Fix rails version diff syntax limited User.all\n" }, { "from": "human", "value": "namespace :db do\n desc \"Fill database with sample data\"\n task populate: :environment do\n make_users\n make_microposts \n end\nend\n\ndef make_users\n admin = User.cre...
ruby
chosen
[ { "from": "system", "value": "Address factory uses valid phone number.\n\nArea codes can not begin with 1, therefore the area code for this phone\nnumber is invalid.\n\nThis causes issues for anyone who wishes to implement some level of\nbasic phone number validation, as if they use the address factory it\n...
ruby
chosen
[ { "from": "system", "value": "Rewrite Stock Location Filter specs\n\nIn order to avoid stubbing the implementation. This could have benefits\nin terms of speed but everything is more complex to read and\nit's causing flaky specs in combination with verifying partial doubles.\n" }, { "from": "human",...
ruby
chosen
[ { "from": "system", "value": "Add fonts to assets precompile\n" }, { "from": "human", "value": "module MetroUiCss\n module Rails\n class Engine < ::Rails::Engine\n end\n end\nend\n" }, { "from": "gpt", "value": "module MetroUiCss\n module Rails\n class Engine < ::Rails::E...
ruby
chosen
[ { "from": "system", "value": "Add Vagrantfile VM name to the container name\n\nCloses #115\n" }, { "from": "human", "value": "module Vagrant\n module LXC\n module Action\n class Create\n def initialize(app, env)\n @app = app\n end\n\n def call(env)\n ...
ruby
chosen
[ { "from": "system", "value": "Add graphite API key to statsd namespace\n" }, { "from": "human", "value": "ActiveSupport::Notifications.subscribe('request.faraday') do |name, starts, ends, _, env|\n url = env[:url]\n http_method = env[:method].to_s.upcase\n duration = ends - starts\...
ruby
chosen
[ { "from": "human", "value": "Create test for `Initializable` module\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nmodule ExampleModule\n extend Initializable\nend\nclass ExampleModule::Example1; end\nclass ExampleModule::Example2; end\n\nclass InitializableTest < ActiveSupport::Test...
ruby
chosen
[ { "from": "human", "value": "Update question table, more fields added related to different q_type.\n" }, { "from": "gpt", "value": "class AddQuestionTypeToQuestions < ActiveRecord::Migration\n def self.up\n add_column \"questions\",\"seq\",:float, :default => nil\n add_column \"questions\...
ruby
chosen
[ { "from": "system", "value": "Change aggregation flag check logic\n" }, { "from": "human", "value": "module Jetpants\n class DB\n def aggregator?\n return @aggregator unless @aggregator.nil?\n version_info = query_return_array('SHOW VARIABLES LIKE \"%version%\"')\n @aggregator...
ruby
chosen
[ { "from": "system", "value": "Allow using size and index on the same query execution\n" }, { "from": "human", "value": "module EsEasyQuery\n # a class to send the raw quary to es and get the results\n class QueryExecutor\n # the Query object to execute\n attr_reader :query_class\n\n #...
ruby
chosen
[ { "from": "system", "value": "Add 'should require login' test\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass ProductsControllerTest < ActionController::TestCase\n setup do\n @product = products(:one)\n @update = {\n title: 'Lorem Ipsum',\n description: '...
ruby
chosen
[ { "from": "system", "value": "Add newline at end of file to create a line 60 at last lab step\n" }, { "from": "human", "value": "def start\n puts \"Welcome to my inn, Stranger! Grab a seat.\"\n puts \"1. Take a seat at the bar\"\n puts \"2. Take a seat away from the crowd\"\n\n action = gets...
ruby
chosen
[ { "from": "system", "value": "Add addressable 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)\n\nGem::Specification.new do |spec|\n spec.name = \"yoga_pants-thrift\"\...
ruby
chosen
[ { "from": "system", "value": "Add revert method for item revisions\n" }, { "from": "human", "value": "class Podio::ItemDiff < ActivePodio::Base\n property :field_id, :integer\n property :type, :string\n property :external_id, :integer\n property :label, :string\n property :from, :array\n p...
ruby
chosen
[ { "from": "system", "value": "Add activesupport as runtime dependency\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'project_honeypot_rails/version'\n\nGem::Specification....
ruby
chosen
[ { "from": "system", "value": "Bump minimum required pry version to 0.13.0\n\nThis is nice for folks using ruby 2.7, as pry 0.13.0 resolves a\ndeprecation warning introduced in Ruby 2.7. This warning gets a little\nannoying to see everytime you fire up pry.\n\nEx warning:\n<main>: warning: __FILE__ in eval m...
ruby
chosen
[ { "from": "system", "value": "Fix bug where ActiveRecord Paginator didnโ€™t offset pages correctly\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire_relative '../base_adapter'\nrequire_relative '../base_processor'\n\nclass ActiveSet\n class PaginateProcessor < BaseProces...
ruby
chosen
[ { "from": "system", "value": "Remove version restriction for bundler\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'takarabako/version'\n\nGem::Specification.new do |spec|\n spec.n...
ruby
chosen
[ { "from": "human", "value": "Add rake task to symlink all missing curves in one dataset to corresponding curves in another\n" }, { "from": "gpt", "value": "desc <<-DESC\n Symlinks all missing curves to DESTINATION dataset. Excludes\n weather years as these are highly dataset specific.\n Examp...
ruby
chosen
[ { "from": "system", "value": "Add Release Task to Update version.rb\n" }, { "from": "human", "value": "task 'release:require-version' do\n unless ENV['VERSION']\n warn(\"usage: VERSION=x.y.z rake release\")\n exit\n end\nend\n\n# bumps the VERSION file\ntask 'release:bump-version' do\n ...
ruby
chosen
[ { "from": "system", "value": "Speed up tests by downloading only one record\n" }, { "from": "human", "value": "require \"tmpdir\"\nrequire \"fileutils\"\n\nRSpec.describe Forecaster::Forecast do\n before do\n Forecaster.configure do |config|\n config.cache_dir = Dir.mktmpdir\n end\n\...
ruby
chosen
[ { "from": "system", "value": "Clean up after Ant version test\n\n\ngit-svn-id: d8f3215415546ce936cf3b822120ca56e5ebeaa0@923049 13f79535-47bb-0310-9956-ffa450edef68\n" }, { "from": "human", "value": "# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agree...
ruby
chosen
[ { "from": "system", "value": "Refresh users every hour in development\n" }, { "from": "human", "value": "require 'exlibris-aleph'\nclass UserSession < Authlogic::Session::Base\n pds_url Settings.pds.login_url\n redirect_logout_url Settings.pds.logout_url\n aleph_url Exlibris::Aleph::Config.ba...
ruby
chosen
[ { "from": "system", "value": "Add language defaults to Accounts and Organizations.\n" }, { "from": "human", "value": "class AddLanguageToAccountsAndOrganizations < ActiveRecord::Migration\n def self.up\n add_column :accounts, :language, :string, :limit => 3\n add_column :organizations, :...
ruby
chosen
[ { "from": "system", "value": "Bump pod version to 0.5.1\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"SocketRocket\"\n s.version = '0.5.0'\n s.summary = 'A conforming WebSocket (RFC 6455) client library.'\n s.homepage = 'ht...
ruby
chosen
[ { "from": "system", "value": "Concatenate file paths with File.join\n" }, { "from": "human", "value": "module RackCommitStats\n class CommitFromEnv < Commit\n def branch\n @_branch ||= File.open(\n \"#{RackCommitStats.config.file_path_prefix}/BRANCH\", 'r'\n ).read.gsub /[\\...
ruby
chosen
[ { "from": "system", "value": "Allow unwrapping of a DOMReference\n" }, { "from": "human", "value": "module Clearwater\n class DOMReference\n def mount node, previous\n @node = node\n end\n\n def unmount node, previous\n @node = nil\n end\n\n def mounted?\n !!@node\...
ruby
chosen
[ { "from": "system", "value": "Fix listing platforms and devices from CL\n" }, { "from": "human", "value": "module OpenCL\n class CL\n include FFI::OpenCL\n\n def initialize\n @buffers = []\n end\n\n def finalize\n @contexts.each(&:finalize)\n @buffers.each(&:finalize)...
ruby
chosen
[ { "from": "system", "value": "Add class inherits Thor in the module\n" }, { "from": "human", "value": "require \"remindice/version\"\n\nmodule Remindice\n # Your code goes here...\nend\n" }, { "from": "gpt", "value": "require \"remindice/version\"\nrequire \"thor\"\n\nmodule Remindi...
ruby
chosen
[ { "from": "system", "value": "Remove sprockets-commonjs from the gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/tay/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Thomas Rix\"]\n gem.email = [\"tom...
ruby
chosen
[ { "from": "human", "value": "Add test for JSON \"page freshness\" API\n" }, { "from": "gpt", "value": "RSpec.describe PageFreshness do\n describe \"#to_json\" do\n it \"returns JSON\" do\n sitemap = double(resources: [\n double(url: \"/a\", data: double(title: \"A thing\", owner_...
ruby
chosen
[ { "from": "system", "value": "Support stubbing out OCR content in Factory.\n" }, { "from": "human", "value": "FactoryBot.define do\n factory :iiif_resource, class: IIIFResource do\n transient do\n # Fixture to use for stubbing the manifest.\n manifest_fixture { nil }\n # Sourc...
ruby
chosen
[ { "from": "system", "value": "Fix lint issue with ToJson" }, { "from": "human", "value": "module Mailosaur\n module Models\n class BaseModel\n def to_json\n hash = {}\n instance_variables.each do |var|\n key = var.to_s.delete('@').split('_').coll...
ruby
chosen
[ { "from": "system", "value": "Add space around edge labels\n" }, { "from": "human", "value": "require 'graphviz'\nrequire_relative 'edge'\n\nmodule Architect\n \n class Association < Edge\n \n attr_accessor :attributes, :graph\n\n TYPES = {\n \"<>\" => \"odiamond\",\n \"+\" ...
ruby
chosen
[ { "from": "system", "value": "Add tests for successful purge and successful soft purge\n" }, { "from": "human", "value": "require 'helper'\n\n# API Key Tests\nclass Fastly\n describe 'ApiKeyTest' do\n let(:opts) { login_opts(:api_key) }\n let(:client) { Client.new(op...
ruby
chosen
[ { "from": "system", "value": "Use an anonymous module instead of a class_eval\n" }, { "from": "human", "value": "Spree::ProductsController.class_eval do\n respond_to :rss, :only => [:index]\n before_filter :check_rss, only: :index\n\n def check_rss\n if request.format.rss?\n @products...
ruby
chosen
[ { "from": "system", "value": "Fix test to pass with v0.14\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'bundler'\nbegin\n Bundler.setup(:default, :development)\nrescue Bundler::BundlerError => e\n $stderr.puts e.message\n $stderr.puts \"Run `bundle install` to install missin...
ruby
chosen
[ { "from": "system", "value": "Revert \"Add a fields and fieldset method to the form builder.\"\n\nThis reverts commit 8284175ebb0cce7feecb54ea07350a8e06a379a7.\n" }, { "from": "human", "value": "module FormSan\n class FormBuilder\n attr_accessor :output\n alias to_s output\n \n def ...
ruby
chosen
[ { "from": "human", "value": "Add spec for rendering Back button during policy simulation\n" }, { "from": "gpt", "value": "describe 'layouts/_x_edit_buttons.html.haml' do\n context 'policy simulation' do\n let(:record) { FactoryBot.create(:vm_infra) }\n\n before { assign(:record, record) }...
ruby
chosen
[ { "from": "system", "value": "Fix typo on method name\n" }, { "from": "human", "value": "require 'pundit'\n\nmodule ActiveAdmin\n\n class PunditAdapter < AuthorizationAdapter\n\n def authorized?(action, subject = nil)\n policy = retreive_policy(subject)\n action = format_action(act...
ruby
chosen
[ { "from": "system", "value": "Use the fog model for Server Groups. List/show work.\n" }, { "from": "human", "value": "module Brightbox\n class ServerGroup < Api\n\n def self.create_server_groups(count,options)\n (0...count).map {|i| create(options) }\n end\n\n def self.create(opti...
ruby
chosen
[ { "from": "system", "value": "Fix list attribute usage in rds_db_security_group\n" }, { "from": "human", "value": "require_relative '../resource'\n\nmodule Convection\n module Model\n class Template\n class Resource\n ##\n # AWS::RDS::DBSecurityGroup\n ##\n c...
ruby
chosen
[ { "from": "system", "value": "Update minitest requirement from ~> 4.0 to ~> 5.12\n\nUpdates the requirements on [minitest](https://github.com/seattlerb/minitest) to permit the latest version.\n- [Release notes](https://github.com/seattlerb/minitest/releases)\n- [Changelog](https://github.com/seattlerb/minit...
ruby
chosen
[ { "from": "system", "value": "Support light-service version to be used on first-circle-app\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'tufy/version' \nGem::Specification.new do |...
ruby
chosen
[ { "from": "human", "value": "Add v0.0.1 implementation of Hiera Backend\n" }, { "from": "gpt", "value": "# Vault backend for Hiera\nclass Hiera\n module Backend\n class Vault_backend\n\n def initialize()\n require 'json'\n require 'vault'\n\n @config = Config[:vault...
ruby
chosen
[ { "from": "system", "value": "Add details to search by date interval\n" }, { "from": "human", "value": "require_relative '../../boot'\n\n# Search Subscriptions by date interval\n#\n# You need to give AccountCredentials (EMAIL, TOKEN) and some date interval\n#\n# P.S: See the boot file example fo...
ruby
chosen
[ { "from": "system", "value": "Add Friendly ID to Course Model\n\nUpdate the Course model to include a FriendlyID slug.\n" }, { "from": "human", "value": "class Course < ActiveRecord::Base\n attr_accessible :description, :logo, :title\n\n acts_as_list :scope => :club\n\n validates :title, ...
ruby
chosen