conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix problem where we could not open remote (http, https, ...) files anymore\n" }, { "from": "human", "value": "class ArchiveDocument::Base\n attr_reader :document\n\n def initialize(document)\n @document = document\n end\n\n def add_to_archive(zipfile)\n z...
ruby
chosen
[ { "from": "system", "value": "Allow self.page_id as a possible target\n" }, { "from": "human", "value": "class PageAssociation < Datum\n key :page_template_ids, Array, typecast: 'ObjectId'\n key :page_id, ObjectId\n belongs_to :page\n\n def page_template_id=(page_template_id)\n @page_temp...
ruby
chosen
[ { "from": "system", "value": "Fix issue w/ .present? invalid byte sequences\n\nLook up of existing geo coder results was triggering failure.\n" }, { "from": "human", "value": "class GeoDataFromRequest\n attr_accessor :request, :geo_data\n\n def initialize(request)\n @request = request\n en...
ruby
chosen
[ { "from": "system", "value": "Define the end date of virtual milestones too. Which is nil.\n" }, { "from": "human", "value": "class LessonPlanMilestone < ActiveRecord::Base\n attr_accessible :title, :description, :end_at\n\n belongs_to :course\n belongs_to :creator, class_name: \"User\"\n\n ...
ruby
chosen
[ { "from": "system", "value": "Revert \"Adds upload fabricator for subfolder image upload\"\n\nThis reverts commit b619bd2782d6d24f0cd93e22c50a74f8a27b8fda.\n" }, { "from": "human", "value": "Fabricator(:upload) do\n user\n sha1 \"e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98\"\n original_filename ...
ruby
chosen
[ { "from": "system", "value": "Add media_statuses_count field in api/v1/accounts/:id\n" }, { "from": "human", "value": "object @account\n\nattributes :id, :username, :acct, :display_name, :locked, :created_at\n\nnode(:note) { |account| Formatter.instance.simplified_format(account) }\nn...
ruby
chosen
[ { "from": "system", "value": "Update user-script test for recent changes\n" }, { "from": "human", "value": "require 'spec_helper'\n\n# This test requires that you are provisioning a VM with user-script \n# that contains:\n#\n# #!/bin/sh\n# echo \"testing user-script\" >> /var/tmp/test\ndescribe ...
ruby
chosen
[ { "from": "human", "value": "Add Google Analytics API wrapper class" }, { "from": "gpt", "value": "class GoogleAnalytics\n\n def initialize(profile)\n @version = 1\n @profile = \"UA-XXXXXXXX-X\"\n @endpoint = \"http://www.google-analytics.com/collect\"\n end\n\n def event(attributes,...
ruby
chosen
[ { "from": "system", "value": "Clean up and try to make intent of method clearer\n\nPaul was confused about what `#hash_visit_data` did. We disucssed, but\ndid not arrive at a better alternative. In the end, we agreed that the\nbest way to deal with it was to rename it and include a comment. The\nrenaming o...
ruby
chosen
[ { "from": "system", "value": "Remove duplication between two variants of map\n" }, { "from": "human", "value": "module EmailsHelper\n # Mapping from status strings to bootstrap classes\n # The naming of the classes is not entirely consistent. There are two variants\n def bootstrap_status_mapp...
ruby
chosen
[ { "from": "system", "value": "Upgrade RSpec version to 3.x\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"hamlbars/version\"\n\nGem::Specification.new do |s|\n s.name = \"hamlbars\"\n s.version = Hamlbars::...
ruby
chosen
[ { "from": "human", "value": "Add initial gemspec for V0.1\n" }, { "from": "gpt", "value": "# -*- encoding: utf-8 -*-\n\nGem::Specification.new do |s|\n s.name = %q{shared-mime-info}\n s.version = \"0.1\"\n\n s.required_rubygems_version = Gem::Requirement.new(\">= 0\") if s.respond_to? :requir...
ruby
chosen
[ { "from": "system", "value": "Fix version constant in gemspec\n" }, { "from": "human", "value": "$LOAD_PATH.unshift 'lib'\nrequire 'smartfocus4rails/version'\n\nGem::Specification.new do |s|\n s.name = \"smartfocus4rails\"\n s.summary = \"Smartfocus (ex Emailvision) library for Ruby on Rails\"...
ruby
chosen
[ { "from": "system", "value": "Use 0/1 for TRUE/FALSE to increase SQLite compatibility\n" }, { "from": "human", "value": "class BooleanExpression < Object\n\n def initialize(value)\n @value = value\n end\n\n def build_arel(arel_table)\n return @value ? Arel::Nodes::True.new() : Arel::Nod...
ruby
chosen
[ { "from": "system", "value": "Update tests to handle location booking improvements\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\nrequire 'bundler/setup'\nrequire 'date'\nrequire 'mechanize'\n\ndomain = ARGV[0]\n\nputs \">> Checking #{domain} at #{Time.now}\"\n\nmech = Mechanize.new\n...
ruby
chosen
[ { "from": "system", "value": "Add Podfiles to lintable RuboCop list\n" }, { "from": "human", "value": "module Linter\n class Rubocop < Base\n FILE_REGEXP = /.+(\\.rb|\\.rake|\\.jbuilder)|(Gemfile|Rakefile)\\z/\n end\nend\n" }, { "from": "gpt", "value": "module Linter\n class Ru...
ruby
chosen
[ { "from": "system", "value": "Clean up error handling of sasl plain\n" }, { "from": "human", "value": "module Kafka\n class SaslPlainAuthenticator\n PLAIN_IDENT = \"PLAIN\"\n\n def initialize(connection:, logger:, authzid:, username:, password:)\n @connection = connection\n @log...
ruby
chosen
[ { "from": "system", "value": "Unify quoting style in the gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/vim-flavor/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Kana Natsuno\"]\n gem.email = [\"de...
ruby
chosen
[ { "from": "system", "value": "Add missing ssl_cert domain for ideditor\n" }, { "from": "human", "value": "#\n# Cookbook:: ideditor\n# Recipe:: default\n#\n# Copyright:: 2022, OpenStreetMap Foundation\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this ...
ruby
chosen
[ { "from": "system", "value": "Use .call instead of .execute\n" }, { "from": "human", "value": "#graph_user_ids_following_fact_spec.rb\nrequire_relative '../../../../app/interactors/queries/activities/graph_user_ids_following_fact'\nrequire 'pavlov_helper'\n\ndescribe Queries::Activities::GraphUs...
ruby
chosen
[ { "from": "system", "value": "Fix bad migration of v2.60.2\n" }, { "from": "human", "value": "class RemoveNatureAndWithAccountingFromPurchaseNature < ActiveRecord::Migration\n def change\n execute <<-SQL\n UPDATE purchase_natures\n SET journal_id = j.id\n FROM (SELECT id\n ...
ruby
chosen
[ { "from": "human", "value": "Add synchronization_id to data_imports table\n" }, { "from": "gpt", "value": "# encoding: utf-8\n\nclass AddSynchronizationIdToDataImport < Sequel::Migration\n def up\n add_column :data_imports, :synchronization_id, :bigint\n end\n\n def down\n drop_column :...
ruby
chosen
[ { "from": "system", "value": "Update addressable gem dependency to specify minimum version\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire File.expand_path('../lib/dm-core/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.name = 'dm-core'\n gem.version = D...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.2.0 to 0.2.1\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'initializer'\n s.version = '0.2.0'\n s.summary = 'Generates initializers and attributes'\n s.description = ' ...
ruby
chosen
[ { "from": "system", "value": ":arrow_up: Update faraday 0.x.x -> 1.x.x\n" }, { "from": "human", "value": "lib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'docbase/version'\n\nGem::Specification.new do |spec|\n spec.name = 'do...
ruby
chosen
[ { "from": "human", "value": "Make sure people use nodejs for ExecJS\n\nOn OS X screen.css does not render using JavascriptCore as the backend.\nIn general it's the best strategy to have developers using the same\nsetup as in production.\n" }, { "from": "gpt", "value": "name = ExecJS.runtime.name...
ruby
chosen
[ { "from": "system", "value": "Update the TopicsController for Slugs\n\nUpdate the TopicsController to be able to handle Slugs.\n" }, { "from": "human", "value": "class TopicsController < ApplicationController\n before_filter :authenticate_user!, :except => [ :show ]\n before_filter :get_discus...
ruby
chosen
[ { "from": "system", "value": "Fix extension path for new layout.\n" }, { "from": "human", "value": "require 'mkmf-rice'\n\nOCE_INCLUDE_DIR = '/usr/local/include/oce'\nOCE_LIB_DIR = '/usr/local/lib'\n\ndir_config('TKG3d', OCE_INCLUDE_DIR, OCE_LIB_DIR)\ndir_config('TKBRep', OCE_INCLUDE_DIR, OCE_LI...
ruby
chosen
[ { "from": "system", "value": "Update podspec for 0.2.0 release.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'GABoardGameGeek'\n s.version = '0.1.0'\n s.summary = 'A Swift Library for interacting with the BoardGameGeek XMLAPI2'\n\n s.descri...
ruby
chosen
[ { "from": "human", "value": "Fix for my dodgy ruby :-)\n" }, { "from": "gpt", "value": "# Encoding utf-8\nOhai.plugin(:Sophos) do\n provides 'sophos'\n\n def sophos_bin()\n if File.exist?('/opt/sophos-av/bin/savdstatus')\n return true\n end\n end\n\n def get_sophos_data()\n sop...
ruby
chosen
[ { "from": "system", "value": "Fix `url` stanza comment for JuicePhone.\n" }, { "from": "human", "value": "cask 'juicephone' do\n version '2.4.1'\n sha256 '4c5edb9197f7ae093681e810692b81e447a063cc0a59c025afc59cea0f59d33e'\n\n url \"http://download.addpod.de/juicephone/#{version}\"\n appcast '...
ruby
chosen
[ { "from": "system", "value": "Add htmlentities dependency and bindir to gemspec\n" }, { "from": "human", "value": "require 'rake'\n\nGem::Specification.new do |s|\n s.name = \"premailer\"\n s.version = \"1.5.3\"\n s.date = \"2009-12-03\"\n s.summary = \"Preflight for HTML e-mail.\"...
ruby
chosen
[ { "from": "system", "value": "Fix calling private method for ruby 1.9.3\n" }, { "from": "human", "value": "# coding: utf-8\nrequire 'date'\n\nmodule Ehou\n module EhouExtend\n def ehou\n return @ehou if @ehou\n @ehou = EhouString.new(self.year)\n end\n end\nend\n\nDate.include(...
ruby
chosen
[ { "from": "system", "value": "Fix \"The summary should be a short version of `description` (max 140 characters).\" warning\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'MCAnimationView'\n s.version = '0.1.1'\n s.license = 'BSD 3-Clause'\n s.summary = 'UIImageView...
ruby
chosen
[ { "from": "system", "value": "Rename programs parameter to 'program_file'\n" }, { "from": "human", "value": "class Grid\n\n def initialize(window, user, mapfile, tileset, programs=nil)\n @window, @user = window, user\n @map = Map.new(window, mapfile, tileset)\n end\n\n def draw\n @ma...
ruby
chosen
[ { "from": "system", "value": "Change the source code URL of Mathtodon\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Mastodon\n module Version\n module_function\n\n def major\n 2\n end\n\n def minor\n 3\n end\n\n def patch\n 3\n en...
ruby
chosen
[ { "from": "system", "value": "Add production option to deployment\n" }, { "from": "human", "value": "require \"extensions/views\"\n\nactivate :views\nactivate :directory_indexes\n\nset :relative_links, true\nset :css_dir, 'assets/stylesheets'\nset :js_dir, 'assets/javascripts'\nset :images_dir, ...
ruby
chosen
[ { "from": "system", "value": "Add production option to deployment\n" }, { "from": "human", "value": "activate :directory_indexes\nactivate :autoprefixer\n\nset :relative_links, true\nset :css_dir, \"assets/stylesheets\"\nset :js_dir, \"assets/javascripts\"\nset :images_dir, \"assets/images\"\nse...
ruby
chosen
[ { "from": "system", "value": "Load No Content response automatically\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'trailblazer/operation'\n\nrequire 'pragma/operation/version'\nrequire 'pragma/operation/base'\n\nrequire 'pragma/operation/response'\nrequire 'pragma/...
ruby
chosen
[ { "from": "system", "value": "Improve before_address in CheckoutController decorator to provide compatibility with Spree 0.50.x too\n" }, { "from": "human", "value": "CheckoutController.class_eval do\n private\n def before_address\n @order.bill_address ||= Address.new(:country => default_co...
ruby
chosen
[ { "from": "system", "value": "Set minimal required ruby version\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'opmac2html/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "squash-bottle-pr: Fix for GNU sed for Linuxbrew\n" }, { "from": "human", "value": "require \"formula\"\n\nmodule Homebrew\n # Squash the last two commits of build-bottle-pr.\n # Usage:\n # brew build-bottle-pr foo\n # brew pull --bottle 123\n # brew sq...
ruby
chosen
[ { "from": "system", "value": "Add requirement to code builders.\n" }, { "from": "human", "value": "require 'logging'\nrequire 'optparse'\nrequire 'raml_parser'\nrequire 'json'\n\nmodule RamlPoliglota\n module Support\n\n class SourceLoader\n\n def initialize\n @ignorable_source_f...
ruby
chosen
[ { "from": "system", "value": "Allow tolerance for precision in specs\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'lib/fast_haversine'\n\ndescribe FastHaversine do\n describe '.distance_between' do\n let(:sf) { [37.7833, -122.4167] }\n let(:chi) { [41.8819, -87.6278] ...
ruby
chosen
[ { "from": "system", "value": "Move logic of advancing to next step into step itself." }, { "from": "human", "value": "class GameWrapper\n def initialize(game)\n @game = game\n end\n\n def players\n @game.players\n end\n\n def rounds_left?\n @game.rounds_left?\n end\n\n def winner...
ruby
chosen
[ { "from": "system", "value": "Fix spec errors related to the Student model due to factory refactoring\n" }, { "from": "human", "value": "describe Student do\n describe \"relations\" do\n let(:student) { Factory.create(:student) }\n\n it \"should have a user\" do\n student.user.should...
ruby
chosen
[ { "from": "system", "value": "Convert client spec to rspec3 syntax\n" }, { "from": "human", "value": "require \"spec_helper\"\nrequire \"opsicle/client\"\n\nmodule Opsicle\n describe Client do\n subject { Client.new('derp') }\n let(:aws_client) { double }\n let(:config) { double }\n ...
ruby
chosen
[ { "from": "system", "value": "Update code to follow the project styleguide\n" }, { "from": "human", "value": "module Formulaic\n module Inputs\n class StringInput < Input\n def fill\n if page.has_selector?(:fillable_field, label, wait: Formulaic.default_wait_time)\n fill...
ruby
chosen
[ { "from": "system", "value": "Allow non-websafe SKU's for sku_count\n" }, { "from": "human", "value": "require 'json'\nrequire 'rest-client'\n\nmodule Gcore\n class Api\n class Stores\n class SalesOrders\n \n def self.list(params = {})\n store_code = params[:store...
ruby
chosen
[ { "from": "system", "value": "Return empty hash if initialized with blank url\n" }, { "from": "human", "value": "require 'open-uri'\nrequire 'nokogiri'\nrequire 'phantomjs'\nrequire 'lego_stock_checker/web_page_preprocessor'\nrequire 'lego_stock_checker/object'\n\nmodule LegoStockChecker\n clas...
ruby
chosen
[ { "from": "system", "value": "Revert \"removed the 'file' prefix and URI.parse call\"\n\nThis reverts commit 036190a0bcaef9e0f203055ff9eae013d0f09369.\n" }, { "from": "human", "value": "module LetterOpener\n class DeliveryMethod\n class InvalidOption < StandardError; end\n\n attr_accessor...
ruby
chosen
[ { "from": "system", "value": "Set precise python versions correctly/better\n" }, { "from": "human", "value": "override['python']['pyenv']['pythons'] = %w(\n 2.6.9\n 2.7.9\n 3.2.5\n 3.3.5\n 3.4.2\n 3.5.0\n pypy-2.6.1\n pypy3-2.4.0\n)\noverride['travis_packer_templates']['job_board']['code...
ruby
chosen
[ { "from": "system", "value": "Add configuration methods to PuppetParse class\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path(File.join(File.dirname(__FILE__), \"vendor\"))\nrequire 'puppet'\nrequire 'puppet-parse/version'\nrequire 'puppet-parse/parser'\nrequire 'puppet-par...
ruby
chosen
[ { "from": "human", "value": "Allow use of User model outside of sinatra\n" }, { "from": "gpt", "value": "# Allows you to use the models from cron scripts etc\nif !Object.const_defined?(\"Sinatra\")\n class Sinatra;end # To please the testing for Sinatra.const_defined?('FacebookObject')\n requi...
ruby
chosen
[ { "from": "system", "value": "Include pry and byebug, but not pry-byebug\n\nPreviously we were using pry-byebug ~> 1.0 to avoid behaviour of newer\nbyebug versions which locks all threads when the debugger is entered.\nThis made debugging and developing feature specs impossible.\n\nSee https://github.com/de...
ruby
chosen
[ { "from": "system", "value": "Include RSpec features as 'requests'.\n" }, { "from": "human", "value": "module Kracken\n module SpecHelper\n @@current_user = nil\n\n def self.current_user\n @@current_user\n end\n\n def self.current_user=(current_user)\n @@current_user = cur...
ruby
chosen
[ { "from": "system", "value": "Add minimum required ruby version to gemspec\n\n[Fix #9]\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire File.expand_path('../lib/axiom/types/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.name = 'axiom-types'\n gem.version ...
ruby
chosen
[ { "from": "system", "value": "Revert the change to the product catalogue link.\n" }, { "from": "human", "value": "Islay::Engine.extensions.register do |e|\n e.namespace :islay_shop\n\n e.admin_styles true\n e.admin_scripts false\n\n # Navigation\n e.nav_entry('Products', :product_categories...
ruby
chosen
[ { "from": "system", "value": "Set class name as string\n" }, { "from": "human", "value": "autoload :ActiveRecord, 'active_record'\n\nrequire \"settingcrazy/version\"\nrequire \"settingcrazy/settings_proxy\"\nrequire \"settingcrazy/setting_value\"\nrequire \"settingcrazy/class_methods\"\nrequire ...
ruby
chosen
[ { "from": "system", "value": "Add ability to provide password\n" }, { "from": "human", "value": "require \"eventmachine\"\nrequire \"em-websocket\"\n\nmodule Sonia\n module Server\n extend self\n\n def run!\n EventMachine.run {\n @twitter = Sonia::Widgets::Twitter.new('pusewic...
ruby
chosen
[ { "from": "system", "value": "Remove giphy query from end of error strings\n" }, { "from": "human", "value": "module SlackMathbot\n module Commands\n class Calculate < SlackRubyBot::Commands::Base\n operator '='\n command 'calculate'\n\n def self.call(client, data, match)\n ...
ruby
chosen
[ { "from": "system", "value": "Fix ticket count calculation when calculation item fees for packages\n" }, { "from": "human", "value": "module Tray\n module Calculator\n module Fees\n class ItemFee\n class << self\n\n def call(cart, registers)\n registers.each d...
ruby
chosen
[ { "from": "system", "value": "Test was failing because mandatory argument followed optional arguement within constructor\n" }, { "from": "human", "value": "require 'json'\n\nmodule KumoKeisei\n class ParameterBuilder\n def initialize(dynamic_params = {}, file_path)\n @dynamic_params = d...
ruby
chosen
[ { "from": "system", "value": "Remove magic comment, obsolete on Ruby 2.0\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'regexp_parser/version'\nrequire 'regexp_parser/token'\nrequire 'regexp_parser/scanner'\nrequire 'regexp_parser/syntax'\nrequire 'regexp_parser/lexer'\nrequire...
ruby
chosen
[ { "from": "system", "value": "Check for property before emitting\n" }, { "from": "human", "value": "module RelaxDB\n\n class ViewCreator\n \n def self.all(target_class)\n map = <<-QUERY\n function(doc) {\n if(doc.class == \"${target_class}\")\n emit(null, doc);\n...
ruby
chosen
[ { "from": "system", "value": "Fix gemspec for the proper ruby version and bump the version\n" }, { "from": "human", "value": "require File.join(File.dirname(__FILE__), 'lib', 'net', 'ntlm')\n\nGem::Specification.new do |s|\n s.platform = Gem::Platform::RUBY\n s.name = 'rubyntlm'\n s.version =...
ruby
chosen
[ { "from": "system", "value": "Update spec to ensure a CC::Yaml object works\n" }, { "from": "human", "value": "require \"spec_helper\"\n\nmodule CC::Analyzer\n describe EngineOutputFilter do\n it \"does not filter arbitrary output\" do\n filter = EngineOutputFilter.new\n\n filter.f...
ruby
chosen
[ { "from": "system", "value": "Update license declaration in podspec" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"FeedbackLoop\"\n s.version = \"0.0.1\"\n s.summary = \"Customer support through Slack\"\n s.description = <<-DESC\n Suppo...
ruby
chosen
[ { "from": "system", "value": "Add support for checking if the user is a subscriber\n" }, { "from": "human", "value": "require 'gpsoauth'\n\nmodule GoogleMusicApi\n class MobileClient\n\n SERVICE = 'sj'\n APP = 'com.google.android.music'\n CLIENT_SIGNATURE = '38918a453d07199354f8b19af05...
ruby
chosen
[ { "from": "system", "value": "Use endless method definition in `UseCase::Base`\n\nCo-authored-by: Georg Gadinger <9e8f1a26fbf401b045347f083556ffd7c0b25a58@nilsding.org>" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire \"dry-initializer\"\nrequire \"types\"\nrequire \"err...
ruby
chosen
[ { "from": "system", "value": "Check for presence of URL override\n\nWe want to make sure there's something there. Redirecting to a blank URL\nwould probably be undesirable.\n" }, { "from": "human", "value": "class TaxonsController < ApplicationController\n rescue_from Taxon::InAlphaPhase, with:...
ruby
chosen
[ { "from": "system", "value": "Use latest flag to do counts\n" }, { "from": "human", "value": "class CertificationCampaign < ActiveRecord::Base\n include Ownership\n validates :name, uniqueness: true, presence: true\n\n has_many :certificate_generators\n belongs_to :user\n\n attr_accessible ...
ruby
chosen
[ { "from": "system", "value": "Fix contact preference lookup in claimant presenter" }, { "from": "human", "value": "class ClaimantPresenter < Presenter\n def subsections\n { personal_details: %i<full_name gender date_of_birth is_disabled>,\n contact_details: %i<address telephone_number m...
ruby
chosen
[ { "from": "system", "value": "Support award-emoji notes only when it a comment for an issue\n" }, { "from": "human", "value": "module Notes\n class CreateService < BaseService\n def execute\n note = project.notes.new(params)\n note.author = current_user\n note.system = false\n...
ruby
chosen
[ { "from": "human", "value": "Add example for creating mention graph\n" }, { "from": "gpt", "value": "require \"bundler\"\nBundler.require\n\nTweetMiner.configure do |config|\n settings = YAML.load_file File.dirname(__FILE__) + \"/mongo.yml\"\n\n config.host = settings[\"host\"]\n config.p...
ruby
chosen
[ { "from": "system", "value": "Change example to ensure no errors are displayed\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'tty-command'\n\ncmd = TTY::Command.new\n\ncmd.run(\"while test 1; do echo 'hello'; sleep 1; done\", timeout: 5, signal: :KILL)\n" }, { "from": "...
ruby
chosen
[ { "from": "system", "value": "Create LaunchBar actions dir before installing actions" }, { "from": "human", "value": "meta :lbaction do\n accepts_value_for :source\n\n def path\n \"~/Library/Application Support/LaunchBar/Actions\" / name\n end\n\n template {\n met? {\n path.p.exis...
ruby
chosen
[ { "from": "system", "value": "Rename role and change case-insensitivity handling\n* Renamed `Luchadors` to `HWCC Expedition`\n* Changed case-insensitivity handling to always downcase both input and search\n" }, { "from": "human", "value": "require 'titleize'\n\nmodule PublicRoles\n extend Disco...
ruby
chosen
[ { "from": "system", "value": "Add methods to determine own role\n" }, { "from": "human", "value": "require \"active_support\"\nrequire \"interest/followable\"\nrequire \"interest/blockable\"\n\nmodule Interest\n module Base\n extend ActiveSupport::Concern\n\n def followable?(other)\n ...
ruby
chosen
[ { "from": "system", "value": "Add attr_reader to name property\n" }, { "from": "human", "value": "require 'nehm/applescripts'\nclass Playlist\n def initialize(name)\n @name = name\n end\n\n def add_track(file_path)\n AppleScripts.add_track_to_playlist(file_path, @name)\n end\nend\n" ...
ruby
chosen
[ { "from": "system", "value": "Make ruby 2.0.0 the minimum required version!\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'boxy/version'\n\nGem::Specification.new do |spec|\n spec....
ruby
chosen
[ { "from": "system", "value": "Fix a test that fails due to timing\n" }, { "from": "human", "value": "require 'helper'\n\nclass ElasticRecord::SearchingTest < MiniTest::Test\n def setup\n super\n Widget.destroy_all\n end\n\n def test_elastic_relation\n relation = Widget.elastic_relati...
ruby
chosen
[ { "from": "system", "value": "Make precision and scale for location bigger\n" }, { "from": "human", "value": "# The Location representing database class\nclass JobLocation\n include DataMapper::Resource\n property :id, Serial\n property :latitude, Float, precision:...
ruby
chosen
[ { "from": "system", "value": "Ruby: Include regex compilation in measuring\n" }, { "from": "human", "value": "require \"benchmark\"\n\nif(ARGV.size != 1)\n puts \"Usage: ruby benchmark.rb <filename>\"\n exit 1\nend\n\ndef measure(data, pattern)\n count = 0\n elapsed = Benchmark.measure {\n ...
ruby
chosen
[ { "from": "human", "value": "Update .chef directory for amazon stuff\n" }, { "from": "gpt", "value": "log_level :info\nlog_location STDOUT\nnode_name 'matt-macbook'\nclient_key '/Users/mstratton/.chef/matt-macbook.pem'\nvalidation_client_na...
ruby
chosen
[ { "from": "system", "value": "Allow any number of tags using for_tag\n" }, { "from": "human", "value": "module Saxerator\n module DSL\n def for_tag(tag)\n for_tags([tag])\n end\n\n def for_tags(tags)\n raise ArgumentError.new('#for_tags requires an Array argument') unless tag...
ruby
chosen
[ { "from": "system", "value": "Upgrade PHP's cookbook to v.1.4.4\n" }, { "from": "human", "value": "name \"cookbook-symfony\"\nmaintainer \"Juan Manuel Lopez\"\nmaintainer_email \"\"\nlicense \"Apache 2.0\"\ndescription \"Setup a Symfony2 environment\"\nversion ...
ruby
chosen
[ { "from": "system", "value": "Add build-essentials for source install.\n" }, { "from": "human", "value": "name 'nrpe-ng'\nmaintainer 'John Bellone'\nmaintainer_email 'jbellone@bloomberg.net'\nlicense 'Apache 2.0'\ndescription 'Application cookbook which installs and configures NRPE.'\nlong_descr...
ruby
chosen
[ { "from": "system", "value": "Add specs for File.size accepting to_str'able or File objects.\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/../../spec_helper'\nrequire File.dirname(__FILE__) + '/../../shared/file/size'\n\ndescribe \"File.size\" do\n before :each do\n @...
ruby
chosen
[ { "from": "system", "value": "Add comments to the tests.\n" }, { "from": "human", "value": "# Standalone tests of Andrews numbers\n#\n# Run this from the directory above,\n# ruby standalone_tests/andrews.rb\n#\nrequire './lib/hand_record_utility.rb'\n\n@board = Hash.new\n@board[:north] = \"SAKQJ...
ruby
chosen
[ { "from": "system", "value": "Add basic framework for continuous input handling\n\nTemporarily uses a regular file instead of actual serial IO.\n" }, { "from": "human", "value": "require 'fox16'\ninclude Fox\n\nclass DashboardWindow < FXMainWindow\n def initialize(app)\n super(app, \"Quadcop...
ruby
chosen
[ { "from": "system", "value": "Add license to the gemspec\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "$LOAD_PATH.push File.expand_path(\"lib\", __dir__)\nrequire \"knife-cloud/version\"\n\nGem::Specification.new do |s|\n s.nam...
ruby
chosen
[ { "from": "system", "value": "Fix Fixnum warning on Ruby 2.4\n\nFixnum and Bignum have been combined into Integer\n\nFixes #35\n" }, { "from": "human", "value": "class String\n def to_bool\n self.blank? || self.match(/^(false|no|0)$/i) ? false : true\n end\nend\n\nclass Fixnum\n def to_boo...
ruby
chosen
[ { "from": "system", "value": "Fix Bug: Facebook MultiJson::Decode error\n" }, { "from": "human", "value": "module NameChecker\n class FacebookChecker\n include HTTParty\n include Logging\n MIN_NAME_LENGTH = 5\n base_uri \"https://graph.facebook.com\"\n @service_name = :facebook\n...
ruby
chosen
[ { "from": "system", "value": "Fix redirect url and api url\n" }, { "from": "human", "value": "require 'omniauth-oauth2'\n\nmodule OmniAuth\n module Strategies\n class Hootsuite < OmniAuth::Strategies::OAuth2\n option :name, :hootsuite\n\n option :client_options, {\n :site =>...
ruby
chosen
[ { "from": "human", "value": "Add spec coverage for Rule\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\nmodule GreenButton\n describe Rule do\n subject { Rule.new(:attr_name, 'xpath', :DateTime) }\n\n its(:attr_name) { is_expected.to eq :attr_name }\n its(:xpath) { is_expecte...
ruby
chosen
[ { "from": "system", "value": "Add API endpoints for orders\n" }, { "from": "human", "value": "module Shopt\n class API < Grape::API\n version 'v1', using: :header, vendor: 'shopt'\n format :json\n\n resource :customers do\n desc 'Returns all customers.'\n get do\n Cust...
ruby
chosen
[ { "from": "system", "value": "Add to sass load paths." }, { "from": "human", "value": "require 'animate/version'\nrequire 'animate/engine' if defined?(::Rails)\n" }, { "from": "gpt", "value": "require 'animate/version'\n\nmodule Animate\n if defined?(Rails)\n require 'animate/eng...
ruby
chosen
[ { "from": "human", "value": "[TAV-346] Add a rake task to delete cancelled runs.\n\nCleans up all cancelled runs.\n" }, { "from": "gpt", "value": "namespace :taverna_player do\n desc \"Delete all cancelled workflow runs.\"\n task :delete_cancelled_runs => :environment do\n\n gone = 0\n T...
ruby
chosen
[ { "from": "system", "value": "Fix migration issue where the settings_changes tables does not exist yet\n" }, { "from": "human", "value": "module Vmdb\n class Settings\n class DatabaseSource\n include Vmdb::Logging\n\n def initialize(resource = nil)\n @resource = resource\n ...
ruby
chosen