conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Support testing message key in RSpec\n" }, { "from": "human", "value": "require \"streamy/helpers/have_hash_matcher\"\n\nmodule Streamy\n module Helpers\n module RspecHelper\n def expect_published_event(topic: kind_of(String), type:, body:, event_time: nil)...
ruby
chosen
[ { "from": "human", "value": "Add integration test for Rails app\n" }, { "from": "gpt", "value": "require \"spec_helper\"\n\ndescribe \"practicingruby::_rails\" do\n let(:shared_dir) { \"/home/deploy/shared\" }\n\n it \"installs JavaScript runtime\" do\n expect(package \"nodejs\").to be_inst...
ruby
chosen
[ { "from": "system", "value": "Revert \"[digitalocean] update flavor tests to match v2 mock\"\n\nThis reverts commit 78c209d1f941cff19bd022ed1dcf3eb70be7d3fb.\n" }, { "from": "human", "value": "Shindo.tests(\"Fog::Compute[:digitalocean] | flavor model\", ['digitalocean', 'compute']) do\n\n servi...
ruby
chosen
[ { "from": "system", "value": "Update to Rails 3.0.1, fix bson at 1.1.1 and paperclip at 2.3.3\n" }, { "from": "human", "value": "# Setup our Gems\ngem \"rails\", \"3.0.0\"\n\nif @mongomapper\n gem 'mongo_mapper', \"=0.8.4\"\n gem \"bson_ext\"\n gem \"bcrypt-ruby\", :require => \"bcrypt\"\n g...
ruby
chosen
[ { "from": "system", "value": "Add newline to end of doc\n" }, { "from": "human", "value": "#!/usr/bin/ruby\n#\n# :Author: Garry Dolley\n# :Date: 03-11-2014\n\nrequire 'rubygems'\nrequire 'nokogiri'\n\nXML_FILE_OLD=ARGV[0].to_s\nXML_FILE_NEW=ARGV[1].to_s\n\ndef usage\n puts \"./migrate-interface...
ruby
chosen
[ { "from": "human", "value": "Create class for extending migration methods for the queues.\n" }, { "from": "gpt", "value": "module Activerecord\n module Oracle\n module Queue\n #\n # Module Activerecord::Oracle::Queue::Schema provides migrations for oracle queues\n #\n # @...
ruby
chosen
[ { "from": "system", "value": "Revert ! idiom change for RailsFormBuilder; it's on the bang_idiom branch." }, { "from": "human", "value": "module Erector\n class RailsFormBuilder\n attr_reader :parent, :template\n\n def initialize(object_name, object, template, options, proc)\n @templ...
ruby
chosen
[ { "from": "system", "value": "Fix no issues backuped when repo or issue is not set by env\n" }, { "from": "human", "value": "require 'backup_github_issues/renderer'\n\nclass Executor\n def config\n @config ||= Config.new\n end\n\n def renderer\n @renderer ||= Renderer.new\n end\n\n de...
ruby
chosen
[ { "from": "system", "value": "Fix unauthorized response status when no auth for public posts\n" }, { "from": "human", "value": "module TentD\n class API\n\n class DeletePost < Middleware\n def action(env)\n return env unless post = env.delete('response.post')\n params = en...
ruby
chosen
[ { "from": "system", "value": "Add configure_server block to example code.\n" }, { "from": "human", "value": "# Run with `sidekiq -r /path/to/simple.rb`\n\nrequire 'sidekiq'\nrequire 'sidetiq'\n\nSidekiq.options[:poll_interval] = 1\n\nclass MyWorker\n include Sidekiq::Worker\n include Sidetiq::...
ruby
chosen
[ { "from": "system", "value": "Fix from_commit and to_commit params\n" }, { "from": "human", "value": "require 'sinatra'\nrequire 'grit'\n\nrequire './diff_presenter'\n\nhelpers do\n\tinclude Rack::Utils\n\talias_method :h, :escape_html\nend\n\nget '/' do\n\trepository = params[:repository]\n\n\t...
ruby
chosen
[ { "from": "system", "value": "Define a time for reason weight update" }, { "from": "human", "value": "# frozen_string_literal: true\n\nevery 1.day do\n runner 'ReasonsHelper.check_for_inactive_reasons'\n runner 'ReasonsHelper.calculate_weights_for_flagging'\nend\n\nevery 1.day at: '6:00 pm' do...
ruby
chosen
[ { "from": "system", "value": "Enable SSA for AWS Images\n\nPreviously SSA was enabled for AWS Instances but not for Images.\nThis change will turn on the support for Images as well.\n" }, { "from": "human", "value": "class ManageIQ::Providers::Amazon::CloudManager::Template < ManageIQ::Providers...
ruby
chosen
[ { "from": "system", "value": "Revert \"change package content layout\"\n\nThis reverts commit 35b55404a989ad090b51362bef0e696de143d851.\n" }, { "from": "human", "value": "#!/bin/env ruby\n# encoding: utf-8\n\nclass ZalandoCMDBClient < FPM::Cookery::Recipe\n description \"Python client library f...
ruby
chosen
[ { "from": "human", "value": "Add simple ruby script that counts lines of code\n\nThe script displays the breakdown of the number of lines generated by API." }, { "from": "gpt", "value": "#!/usr/bin/env ruby\n\nclass Count\n attr_writer :path\n attr_writer :name\n attr_writer :client_count\n ...
ruby
chosen
[ { "from": "system", "value": "Hide quote on the admin panel.\n" }, { "from": "human", "value": "class AdminController < ApplicationController\n \n before_filter :allow_only_admins\n def allow_only_admins\n # This shouldn't be needed becuse we also check for admin-ness in the routes.\n #...
ruby
chosen
[ { "from": "system", "value": "Create instace variable to refer to current item\n" }, { "from": "human", "value": "class ItemsController < ApplicationController\n def index\n @items = Item.all\n end\n\n def new\n @item = Item.new\n end\n\n def create\n item_params = params.require(:...
ruby
chosen
[ { "from": "system", "value": "Add country field to package dashboard" }, { "from": "human", "value": "require \"administrate/base_dashboard\"\n\nclass PackageDashboard < Administrate::BaseDashboard\n # ATTRIBUTE_TYPES\n # a hash that describes the type of each of the model's fields.\n #\n # ...
ruby
chosen
[ { "from": "system", "value": "Split define attributes into two methods\n" }, { "from": "human", "value": "require 'csv'\n\nmodule ImportTopicsHelper\n def self.define_attributes(columns)\n attributes = {}\n attributes[\"topic_identifier\"] = columns[0].strip\n attributes[\"topic_name\"...
ruby
chosen
[ { "from": "human", "value": "Add custom Liquid tag - render tag list for each site category\n" }, { "from": "gpt", "value": "require 'json'\n\nmodule Jekyll\n class RenderCategoryTagsTag < Liquid::Tag\n safe = true\n\n def initialize(tag_name, text, tokens)\n super\n end\n\n de...
ruby
chosen
[ { "from": "system", "value": "Validate shipments before processing payments\n" }, { "from": "human", "value": "module Spree\n class Order::ShipmentValidationError < StandardError; end\n Order.class_eval do\n state_machines[:state].before_transition to: :complete, do: :ensure_valid_shipments...
ruby
chosen
[ { "from": "system", "value": "Fix for cron task generation\n" }, { "from": "human", "value": "# Use this file to easily define all of your cron jobs.\n#\n# It's helpful, but not entirely necessary to understand cron before proceeding.\n# http://en.wikipedia.org/wiki/Cron\n\n# Example:\n#\n# set ...
ruby
chosen
[ { "from": "system", "value": "Add $LANG to fix cron mail mojibake\n" }, { "from": "human", "value": "# Use this file to easily define all of your cron jobs.\n#\n# It's helpful, but not entirely necessary to understand cron before proceeding.\n# http://en.wikipedia.org/wiki/Cron\n#\n# Learn more:...
ruby
chosen
[ { "from": "system", "value": "Increment version, add controls as runtime dep\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'connection'\n s.version = '0.2.2'\n s.summary = 'TCP client/server connection library'\n s.description = ' '\n\...
ruby
chosen
[ { "from": "system", "value": "Update rubocop requirement from ~> 0.58.2 to ~> 0.60.0\n\nUpdates the requirements on [rubocop](https://github.com/rubocop-hq/rubocop) to permit the latest version.\n- [Release notes](https://github.com/rubocop-hq/rubocop/releases)\n- [Changelog](https://github.com/rubocop-hq/r...
ruby
chosen
[ { "from": "system", "value": "Fix to hex to use 3 spots.\n" }, { "from": "human", "value": "module AAlib\n class Pixel\n attr_reader :chr, :attr, :color\n\n def initialize(ascii, attr, color)\n @chr = ascii.chr\n @attr = attr\n @color = color\n end\n\n def hex\n ...
ruby
chosen
[ { "from": "system", "value": "Update Rome formula to 0.14.0.38\n" }, { "from": "human", "value": "class Rome < Formula\n desc \"A shared cache tool for Carthage on S3\"\n homepage \"https://github.com/blender/Rome\"\n url \"https://github.com/blender/Rome/releases/download/v0.13.1.35/rome.zip...
ruby
chosen
[ { "from": "system", "value": "Add method to Bot to check if user is global admin\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'logger'\n\nrequire 'chatrix/bot/errors'\nrequire 'chatrix/bot/version'\nrequire 'chatrix/bot/config'\n\nrequire 'chatrix'\n\nmodule Chatri...
ruby
chosen
[ { "from": "system", "value": "Use fake sidekiq in tests\n" }, { "from": "human", "value": "ENV[\"RAILS_ENV\"] = \"test\"\nENV['ELASTICSEARCH_URL'] = setting_to_nil_to_disable_search_in_test = nil\n\nrequire File.expand_path(\"../../config/environment\", __FILE__)\nrequire \"rails/test_help\"\nre...
ruby
chosen
[ { "from": "system", "value": "Add `DuckHuntTestCase`, adds `test` method from ActiveSupport\n\n* https://github.com/rails/rails/blob/8bec77cc0f1fd47677a331a64f68c5918efd2ca9/activesupport/lib/active_support/test_case.rb#L39\n" }, { "from": "human", "value": "# add our ./lib path to the require p...
ruby
chosen
[ { "from": "system", "value": "Add easy way to get logging information inline for test failure diagnosis\n" }, { "from": "human", "value": "# Configure Rails Environment\nENV[\"RAILS_ENV\"] = \"test\"\n\nrequire_relative \"../test/dummy/config/environment\"\nActiveRecord::Migrator.migrations_path...
ruby
chosen
[ { "from": "system", "value": "Fix random nil pointer test failure\n" }, { "from": "human", "value": "ENV['RAILS_ENV'] ||= 'test'\nrequire File.expand_path('../../config/environment', __FILE__)\nrequire 'rails/test_help'\nrequire 'capybara/rails'\n\nclass ActiveSupport::TestCase\n # Setup all fi...
ruby
chosen
[ { "from": "system", "value": "Use the redgreen gem. It's pretty." }, { "from": "human", "value": "$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), *%w[ .. lib ])))\n\nrequire 'shoulda'\nrequire 'spriter'\n" }, { "from": "gpt", "value": "$:.unshift(File.expand_path(File.j...
ruby
chosen
[ { "from": "system", "value": "Add Windows platform logic to use attributes\n" }, { "from": "human", "value": "#\n# Cookbook Name:: git\n# Recipe:: package\n#\n# Copyright 2008-2015, Chef Software, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use thi...
ruby
chosen
[ { "from": "system", "value": "Add some debug output to packaging script\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'zip'\n\n# Delete existing file\nfolder = Dir.pwd\nzipfile_name = folder + \"/drumpfinator.zip\"\nFile.delete(zipfile_name) if File.exist?(zipfile_name)\n\n# Get...
ruby
chosen
[ { "from": "system", "value": "Move parameterizing function to private。\n" }, { "from": "human", "value": "module Fappu\n class Manga\n\n URL = \"https://api.fakku.net/manga\"\n\n attr_accessor :title, :url, :description, :language, :category, :date, :filesize,\n :favorites, :comments...
ruby
chosen
[ { "from": "system", "value": "Add an implementation of the remove_node method, it passes the space. The\nfunctionality that is still missing though is dealing with the vertices.\n" }, { "from": "human", "value": "# graph module\nmodule Graph\n\n # graph.rb\n #\n # a class that represents a gr...
ruby
chosen
[ { "from": "system", "value": "Call revert in case of error\n" }, { "from": "human", "value": "#\n# Copyright (c) 2011, SoundCloud Ltd., Rany Keddo, Tobias Bielohlawek, Tobias\n# Schmidt\n#\n# Apply a change to the database.\n#\n\nmodule Lhm\n module Command\n def self.included(base)\n ...
ruby
chosen
[ { "from": "system", "value": "Update Tunnelblick to 3.5.2 build 4270.4346\n" }, { "from": "human", "value": "cask :v1 => 'tunnelblick' do\n version '3.5.0_build_4265'\n sha256 '3ed4b749f85924937e41f5c78d84db2cdaf52cb60b5528d5e019468be7a1ad04'\n\n # sourceforge.net is the official download hos...
ruby
chosen
[ { "from": "system", "value": "Raise if non-LDAP URI is specified\n" }, { "from": "human", "value": "require 'uri'\nrequire 'net/ldap'\n\nclass Net::LDAP::Entry\n def fix_encoding!\n each do |n, v|\n v.each do |s|\n s.force_encoding('UTF-8')\n end\n end\n self\n end\ne...
ruby
chosen
[ { "from": "human", "value": "Test the recently visited convos list\n" }, { "from": "gpt", "value": "require File.dirname(__FILE__) + '/../test_helper'\n\nclass RecentlyVisitedConvosTest < ActionController::IntegrationTest\n fixtures :users, :conversations, :subscriptions\n\n context \"crossbla...
ruby
chosen
[ { "from": "system", "value": "Allow to pass options for searchable block\n" }, { "from": "human", "value": "class Seeker::Base\n class_attribute :model\n\n def self.construct(model)\n self.model = model\n model.searchable &@_searchable if @_searchable\n self\n end\n\n def initialize...
ruby
chosen
[ { "from": "system", "value": "Fix Rails < 4.0 compatability\n\nJust use before_filter, no before_action\n" }, { "from": "human", "value": "require 'stringio'\nclass ConsoleController < ApplicationController\n skip_before_action :verify_authenticity_token\n\n def index\n end\n\n def run\n ...
ruby
chosen
[ { "from": "human", "value": "Add Mustang Fuse XML parser to print names of presets" }, { "from": "gpt", "value": "require 'nokogiri'\r\n\r\nres = Dir[\"*.fuse\"].map do |fuse|\r\n\tdoc = File.open(fuse) do |f|\r\n\t\t Nokogiri::XML(f)\r\n\tend\r\n\tdoc.css('Info').first['name']\r\nend.reverse\r...
ruby
chosen
[ { "from": "system", "value": "Add .all to guests in guest_list\n\nIf an invitation was loaded by a .join on the 'guests' table\n(which happens when searching for an inviation by guest name),\nand all the guests didn’t match the join conditions,\nthen all guests are not present on the in-memory invitation, m...
ruby
chosen
[ { "from": "system", "value": "Allow OPTIONS requests when CORS is enabled\n" }, { "from": "human", "value": "if GlobalSetting.enable_cors\n class Discourse::Cors\n def initialize(app, options = nil)\n @app = app\n if GlobalSetting.enable_cors && GlobalSetting.cors_origin.present?\n...
ruby
chosen
[ { "from": "system", "value": "Change secret token for cookies\n" }, { "from": "human", "value": "# -*- encoding : utf-8 -*-\n# 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 c...
ruby
chosen
[ { "from": "system", "value": "Update cocoapods sources in Podspec\n" }, { "from": "human", "value": "Pod::Spec.new do |spec|\n spec.name = 'SwiftExpression'\n spec.version = '3.0'\n spec.license = { :type => 'MIT' }\n spec.homepage = 'https://github.com/lostatseajoshua/...
ruby
chosen
[ { "from": "system", "value": "Return 1 if nothing is changed\n" }, { "from": "human", "value": "require_relative 'git_crecord/git'\nrequire_relative 'git_crecord/hunks'\nrequire_relative 'git_crecord/ui'\n\nmodule GitCrecord\n def self.main\n Dir.chdir(Git.toplevel_dir) do\n result = UI...
ruby
chosen
[ { "from": "system", "value": "Add encoding comment to shared spec\n" }, { "from": "human", "value": "shared_examples 'it calls super' do |method|\n around do |example|\n # Restore original method after each example\n original = \"original_#{method}\"\n superclass.class_eval do\n a...
ruby
chosen
[ { "from": "system", "value": "Change the require statement for client.rb to prevent name clashes\n" }, { "from": "human", "value": "$: << File.expand_path(File.dirname(__FILE__))\n\nrequire 'protocol/spec'\nrequire 'protocol/protocol'\n\nrequire 'transport/buffer'\nrequire 'transport/frame'\n\nr...
ruby
chosen
[ { "from": "system", "value": "Add mode ruby in gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/goblin/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"tomi\"]\n gem.email = [\"tomiacannondale@gmail.co...
ruby
chosen
[ { "from": "system", "value": "Add Evernote dependency to podspec" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"OvershareKit\"\n s.version = \"1.2.0\"\n s.summary = \"A soup-to-nuts sharing library for iOS.\"\n s.homepage = \"https://github.com/overs...
ruby
chosen
[ { "from": "system", "value": "Add forgotten spec for one_of 2 case\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'Parameter Sets' do\n describe 'one_of' do\n it 'returns 400 on requests that contain more than one mutually exclusive parameter' do\n params = [\n ...
ruby
chosen
[ { "from": "system", "value": "Improve unit test for SCM::Git\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe DeliverySugar::SCM::Git do\n before do\n @scm = Object.new\n @scm.extend(described_class)\n end\n\n describe '#changed_files' do\n let(:workspace) { 'work...
ruby
chosen
[ { "from": "system", "value": "Add source description support for PPAs\n" }, { "from": "human", "value": "define :ppa,\n :key_id => nil,\n :distribution => nil do\n\n # ppa name should have the form \"user/archive\"\n unless params[:name].count('/') == 1\n raise \"Invalid PPA name\"\n ...
ruby
chosen
[ { "from": "system", "value": "Switch from runtime_dependency to development_dependency.\n\nRubygems and Bundler both install runtime_dependencies if defined so\nwe were getting both sidekiq and resque installed when sunspot-queue was\nadded to a gemfile.\n\nIn your gemfile our outside remember to also insta...
ruby
chosen
[ { "from": "human", "value": "Move initialization phase of kadmin to its own recipe\n" }, { "from": "gpt", "value": "#\n# Cookbook Name:: krb5\n# Recipe:: kadmin\n#\n# Copyright 2014, Continuuity, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this...
ruby
chosen
[ { "from": "system", "value": "Add RegisteredProvider to extension support\n" }, { "from": "human", "value": "begin\n init_settings = Setting.table_exists?\n if init_settings\n Dir[Rails.root.join 'app', 'models', 'setting', '*.rb'].each do |setting_model|\n require_dependency setting_m...
ruby
chosen
[ { "from": "system", "value": "Change Idea request pending message\n\nAdd individual pending tests for the remaining idea request actions\nthat still need to be tested.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe \"IdeaRequests\" do\n before do\n @idea1 = create(:idea...
ruby
chosen
[ { "from": "system", "value": "Add Paul as an author\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"do_nothing\"\n s.version = \"0.0.5\"\n s.date = \"2015-10-02\"\n s.summary = \"The do_nothing rubygem, pretty self-explanatory.\"\n s.description = \"A gem that ...
ruby
chosen
[ { "from": "system", "value": "Define device missing and unauthorized exceptions\n" }, { "from": "human", "value": "require 'device_api/sys_log'\n\nmodule DeviceAPI\n attr_accessor :log\n\n @@log = DeviceAPI::SysLog.new\n\n def self.set_logger(log)\n @@log = log\n end\n\n def self.log\n ...
ruby
chosen
[ { "from": "system", "value": "Add LogoutRequest to EPP module autoloading\n" }, { "from": "human", "value": "require 'openssl'\nrequire 'socket'\nrequire 'xml'\n\nrequire File.expand_path('../epp-client/version', __FILE__)\n\n# EPP Module\nmodule EPP\n # Generic error class for all EPP errors\n...
ruby
chosen
[ { "from": "system", "value": "Clarify that the JSON encoder strips all whitespace\n" }, { "from": "human", "value": "# Copyright 2017 Holger Just\n#\n# This software may be modified and distributed under the terms\n# of the MIT license. See the LICENSE.txt file for details.\n\nrequire 'spec_help...
ruby
chosen
[ { "from": "system", "value": "Revert \"Add thread ID to api logs\"\n\nThis reverts commit 7e95ecf8aacb29195b89b497882c13204211d82c.\n" }, { "from": "human", "value": "module ApiLogging\n extend ActiveSupport::Concern\n \n API_LOGGER = ActiveSupport::TaggedLogging.new(Rails.logger)\n \n def ...
ruby
chosen
[ { "from": "system", "value": "Add create action and permits\n" }, { "from": "human", "value": "module AuthorizeIt::PermittedParams\n class Base\n def initialize(controller, options = {})\n @options = options.with_indifferent_access\n @controller = controller\n @params = @contr...
ruby
chosen
[ { "from": "system", "value": "Add extra randomness to account names to avoid duplicates in tests\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :account do\n user\n assigned_to nil\n name { Faker::Company.name }\n access \"Publ...
ruby
chosen
[ { "from": "system", "value": "Add methods for authorization objects" }, { "from": "human", "value": "module Maybee\n\n module AuthorizationSubject\n \n def may?(access, object)\n \n end\n\n end\n \nend\n" }, { "from": "gpt", "value": "module Maybee\n\n module Authoriz...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.12.1.1 to 0.12.2.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'evt-messaging'\n s.version = '0.12.1.1'\n s.summary = 'Messaging primitives for Eventide'\n s.descripti...
ruby
chosen
[ { "from": "system", "value": "Add extra logging when NR responds with !200\n" }, { "from": "human", "value": "require 'time'\n\nmodule Dynosaur\n class NewRelicApiClient\n def initialize(api_key, component_id)\n @api_key = api_key\n @component_id = component_id\n end\n\n def ...
ruby
chosen
[ { "from": "system", "value": "Resolve to_prepare deprecation warning in Rails 5.0\n" }, { "from": "human", "value": "module HamlUserTags\n class Reloader < Rails::Railtie\n initializer \"haml_user_tags.enable_reloading\" do\n watcher = ActiveSupport::FileUpdateChecker.new([], \"#{Rails....
ruby
chosen
[ { "from": "system", "value": "Move build requests to their own queue.\n" }, { "from": "human", "value": "require 'sidekiq/worker'\nrequire 'multi_json'\n\nmodule Travis\n module Sidekiq\n class BuildRequest\n class ProcessingError < StandardError; end\n\n include ::Sidekiq::Worker\...
ruby
chosen
[ { "from": "system", "value": "Fix typo in alias method chain name.\n\nThe file location *was* the issue with NameError.\n" }, { "from": "human", "value": "module OverviewForwardPluginPatch\n def self.included(base)\n base.send(:include, InstanceMethods)\n base.class_eval do\n ...
ruby
chosen
[ { "from": "system", "value": "Make EventSearch behave like AnimalSearch and OrganizationSearch\n\n* Inherit from BaseSearch and define the fields to use\n" }, { "from": "human", "value": "require_relative './filter'\nrequire_relative './event_field'\n\nclass EventSearch\n attr_accessor :start, ...
ruby
chosen
[ { "from": "system", "value": "Add controller hook for adapter initialization\n" }, { "from": "human", "value": "module Responders\n module PaginateResponder\n def to_format\n paginate! if get?\n\n super\n end\n\n private\n\n def paginate!\n adapter = ::Responders::Pag...
ruby
chosen
[ { "from": "system", "value": "Refactor the base endpoint generation to support organization subdomains\n" }, { "from": "human", "value": "require 'rest-client'\nrequire 'json'\n\nmodule Roadmapster\n module Wizeline\n module BaseApi\n\n BASE_ENDPOINT = 'https://platform.wizelineroadmap....
ruby
chosen
[ { "from": "system", "value": "Remove dependency on :pass plugin\n" }, { "from": "human", "value": "# frozen-string-literal: true\n\n#\nclass Roda\n module RodaPlugins\n # The run_append_slash plugin automatically adds a trailing slash\n # redirect where rack applications are mounted using...
ruby
chosen
[ { "from": "system", "value": "Swap version numbers to be more correcter.\n" }, { "from": "human", "value": "\n\nmodule TorqueBox\n\n class VersionSpec\n attr_reader :major, :minor, :revision, :tag, :str\n\n def initialize(str)\n @str = str\n @major, @minor, @revision, @tag = str...
ruby
chosen
[ { "from": "system", "value": "Add desc to rake task\n" }, { "from": "human", "value": "require 'spontaneous/cli/site'\n\nnamespace :spot do\n desc \"Migrate the core Spontaneous database\"\n task :migrate do\n Spontaneous.database.logger = Spontaneous.logger\n Sequel.extension :migration...
ruby
chosen
[ { "from": "system", "value": "Simplify locate code in controller helper\n" }, { "from": "human", "value": "module Context\n module ControllerHelper\n\n # Returns the current Context::Page for the given path.\n # Defaults to params[:path] if path is not provided.\n #\n # Can be used ...
ruby
chosen
[ { "from": "system", "value": "Use ||= rather than checking for nil\n" }, { "from": "human", "value": "module Context\nmodule ControllerHelper\n\n # Returns the current Context::Page for the given path.\n # Defaults to params[:path] if path is not provided.\n #\n # Can be used within custom a...
ruby
chosen
[ { "from": "system", "value": "Remove keyword arg from cache class\n" }, { "from": "human", "value": "module MontageRails\n class QueryCache\n attr_reader :cache\n\n def initialize\n @cache = {}\n end\n\n def get_or_set_query(klass, query)\n cached = cache.keys.include?(\"#...
ruby
chosen
[ { "from": "system", "value": "Use Ruby version instead of the PKCS7 constant's bare existence to check for which version to use. That'll shut up the deprecation warnings in Ruby 1.8.7.\n" }, { "from": "human", "value": "if defined?(OpenSSL::PKCS7::PKCS7)\n Nanite::PKCS7 = OpenSSL::PKCS7::PKCS7\...
ruby
chosen
[ { "from": "system", "value": "Refactor to avoid caching ivars across requests" }, { "from": "human", "value": "require 'rack'\nrequire 'action_dispatch'\n\nclass RailsSessionKeyRotator\n def initialize(app, options = {})\n @app = app\n @session_cookie_key = options.fetch(:key)\n @old_s...
ruby
chosen
[ { "from": "system", "value": "Add method for return session_id and handle_id\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule RubyRabbitmqJanus\n module Janus\n # Modules for manipulate responses sending by Janus\n module Responses\n # Response for events me...
ruby
chosen
[ { "from": "system", "value": "Fix odd problem CareKit dependency version in podspec.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"CMHealth\"\n s.version = \"0.4.0\"\n s.summary = \"A HIPAA compliant data storage interface for ResearchKi...
ruby
chosen
[ { "from": "system", "value": "Add link to licence holder for debug middleware\n" }, { "from": "human", "value": "module Spektrix\n class DebugMiddleware < Faraday::Response::Middleware\n\n def self.default_logger\n require \"logger\"\n ::Logger.new(STDOUT)\n end\n\n # Public:...
ruby
chosen
[ { "from": "system", "value": "Update Endless Sky to 0.8.8\n" }, { "from": "human", "value": "cask :v1 => 'endlesssky' do\n version '0.8.7'\n sha256 'cd8e56145a7b8639c9302798e5dfb8d2684bfc734a6d6aa38ef498b457816840'\n\n url \"https://github.com/endless-sky/endless-sky/releases/download/#{versi...
ruby
chosen
[ { "from": "system", "value": "Add missing /Keys mount to Account\n" }, { "from": "human", "value": "module Twilio\n module REST\n class Accounts < ListResource; end\n\n class Account < InstanceResource\n def initialize(path, client, params={})\n super path, client, params\n ...
ruby
chosen
[ { "from": "system", "value": "Define to_s to make life easier\n" }, { "from": "human", "value": "class Entity < ActiveRecord::Base\n # Associations\n has_one :contact, as: :contactable\n has_one :manifest\n has_many :channels\n has_many :items, through: :channels\n has_and_belongs_to_many ...
ruby
chosen
[ { "from": "system", "value": "Fix failing move-to-dashboard cron job\n\nSure has been 5 years off and on that this has been broken...\n" }, { "from": "human", "value": "env 'PATH', '/opt/ruby/bin:/usr/sbin:/usr/bin:/sbin:/bin'\n\nevery :day, at: '12:00am' do\n runner 'ApplicationSubmission.move...
ruby
chosen
[ { "from": "system", "value": "Remove Maher Sallam as an author\n\nAs v2.0 has been fully rewritten by me.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path('../lib', __FILE__)\nrequire 'listen/version'\n\nGem::Specification.new do |s|\n s.name = 'list...
ruby
chosen
[ { "from": "system", "value": "Add rake as development dependency.\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\nrequire \"pure/version\"\n\nGem::Specification.new do |s|\n s.name = \"pure-rails\"\n s.version = Pure::Rails::VERSION\n s.authors ...
ruby
chosen
[ { "from": "system", "value": "Add stats and logs commands\n" }, { "from": "human", "value": "module Gtt\n\n require 'httparty'\n class Tracker\n\n attr_reader :token, :url\n\n def initialize(token, url='http://gtt.heroku.com')\n @token, @url = token, url\n end\n\n def start_da...
ruby
chosen
[ { "from": "system", "value": "Add test to cover basic auth, username:password\n" }, { "from": "human", "value": "require 'helper'\n\ndescribe Octokit::Client do\n\n it \"should connect using the endpoint configuration\" do\n client = Octokit::Client.new\n endpoint = URI.parse(client.endpo...
ruby
chosen
[ { "from": "system", "value": "Support higher minor versions of Rails\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"tl_ember_edit/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new...
ruby
chosen
[ { "from": "system", "value": "Update document and refactor provide method\n" }, { "from": "human", "value": "######################################################################\n### provide matcher\nSpec::Matchers.define :provide do |expected|\n match do |obj|\n (obj.public_methods + obj....
ruby
chosen
[ { "from": "system", "value": "Fix warnings, platform check, and usage of the all flag\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "#\n# Author:: Timothy Smith (<tsmith@chef.io>)\n# Cookbook:: ms_dotnet35\n# Recipe:: default\n#\...
ruby
chosen
[ { "from": "system", "value": "Remove duplicated code in Oauth::AuthorizationsController\n" }, { "from": "human", "value": "class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController\n before_action :authenticate_resource_owner!\n\n layout 'profile'\n\n def new\n if pre_au...
ruby
chosen
[ { "from": "system", "value": "Use GeneDetailPresenter for gene advanced search to include lifecycle actions\n" }, { "from": "human", "value": "class GeneWithStateParamsPresenter < GeneIndexPresenter\n def as_json(options = {})\n super.merge(state_params)\n end\n\n private\n def state_para...
ruby
chosen