conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Use minified version of jQuery for Yandex CDN\n"
},
{
"from": "human",
"value": "require 'jquery-rails'\nrequire 'jquery-rails-cdn/version'\n\nmodule Jquery::Rails::Cdn\n module ActionViewExtensions\n JQUERY_VERSION = Jquery::Rails::JQUERY_VERSION\n OFFLINE =... | ruby | chosen |
[
{
"from": "system",
"value": "Update podspec to version 0.1.0\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = \"DTStorage\"\n s.version = \"0.0.3\"\n s.summary = \"A simple storage layer over SQLite for iOS.\"\n s.homepage = \"https://github.com/diogo... | ruby | chosen |
[
{
"from": "system",
"value": "Add fixed width still image.\n"
},
{
"from": "human",
"value": "module MotionGiphy\n class Gif\n def self.process_batch(data)\n data.map { |gif_hash| new(gif_hash) }\n end\n\n attr_reader :hash\n\n def initialize(hash)\n @hash = hash\n end\... | ruby | chosen |
[
{
"from": "system",
"value": "Remove %i for rubinius support\n"
},
{
"from": "human",
"value": "require 'thread_safe'\nrequire 'rom/http/dataset'\n\nmodule ROM\n module HTTP\n class Gateway < ROM::Gateway\n attr_reader :datasets, :config\n private :datasets, :config\n\n def in... | ruby | chosen |
[
{
"from": "system",
"value": "Support RAILS_ENV to migrate test db\n"
},
{
"from": "human",
"value": "namespace :activeroad do\n namespace :db do\n desc \"Migrate the database (options: VERSION=x, VERBOSE=false).\"\n\n task :migrate do\n require 'active_record'\n\n require 'acti... | ruby | chosen |
[
{
"from": "system",
"value": "Change environment variable for redis\n"
},
{
"from": "human",
"value": "require 'rubygems'\nrequire 'bundler/setup'\nrequire 'haml'\nrequire 'sinatra'\nrequire 'redis'\n\nredis = Redis.new(:url => ENV[\"REDISTOGO_URL\"])\n\nconfigure do\n set :views, File.join(Fil... | ruby | chosen |
[
{
"from": "system",
"value": "Use Sass.load_paths instead of SASS_PATH env\n\nThe SASS_PATH environment variable is not intended to be set by another\nlibrary but rather by consumers of Sass. Since the environment variable\nis only read in once at the first time `load_paths` is called.\n\nThis was causing a... | ruby | chosen |
[
{
"from": "system",
"value": "Add support for Stripe v4.x\n"
},
{
"from": "human",
"value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"stripe_event/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s|\n s... | ruby | chosen |
[
{
"from": "system",
"value": "Add man pages for Riak.\n\nSigned-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>\n"
},
{
"from": "human",
"value": "require 'formula'\n\nclass Riak <Formula\n url 'http://downloads.basho.com/riak/riak-0.14/riak-0.14.0-1.tar.gz'\n home... | ruby | chosen |
[
{
"from": "system",
"value": "Upgrade RSpec to ~> 3.0 to solve rake last_comment issue\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = \"gitable\"\n s.version = \"0.3.1\"\n s.authors = [\"Martin Emde\"]\n s.email = [... | ruby | chosen |
[
{
"from": "human",
"value": "Add code for faster rebel vote caculation.\n"
},
{
"from": "gpt",
"value": "module Hdo\n module Stats\n class Rebels\n include Enumerable\n\n def initialize(votes)\n @votes = votes\n end\n\n def each(&each)\n @votes.each do |vote... | ruby | chosen |
[
{
"from": "system",
"value": "Use stored realm name for API connections.\n"
},
{
"from": "human",
"value": "module Audit\n class Team < Sequel::Model\n many_to_one :guild\n\n class << self\n def refresh(id, refresh_type)\n team = self.type(refresh_type).where(id: id).first\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Update regexp to handle entity contains other components\n"
},
{
"from": "human",
"value": "module VhdlDoctest\n class DUT\n def self.parse(path)\n entity, ports, cases = DoctestParser.new(path).parse\n new(entity, ports, cases)\n end\n\n attr_ac... | ruby | chosen |
[
{
"from": "system",
"value": "Fix bug that accumulate pages data"
},
{
"from": "human",
"value": "#!/usr/bin/env ruby\n# coding: utf-8\n\n# List all callbacks generated by each page\n#\n# WARNING: this will generate a *lot* of output, so you probably want to pipe\n# it through less or t... | ruby | chosen |
[
{
"from": "system",
"value": "Add dependency on JSON gem to gemspec.\n"
},
{
"from": "human",
"value": "Gem::Specification.new do |spec|\n spec.name = 'tfe-broach'\n spec.version = '0.2.0'\n \n spec.authors = [\"Manfred Stienstra\", \"Todd Eichel\"]\n spec.email = [\"manfred@fngtps.com\", \... | ruby | chosen |
[
{
"from": "system",
"value": "Add validations to Dojo model\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nclass Dojo < ApplicationRecord\n NUM_OF_COUNTRIES = \"70\"\n NUM_OF_WHOLE_DOJOS = \"1,200\"\n NUM_OF_JAPAN_DOJOS = \"70\"\n UPDATED_DATE = \"2017年1月\"\n\n serializ... | ruby | chosen |
[
{
"from": "system",
"value": "Update Item name validation with multiple keys\n"
},
{
"from": "human",
"value": "class Item < ApplicationRecord\n validates_presence_of :name, :description, :quantity, :price\nend\n"
},
{
"from": "gpt",
"value": "class Item < ApplicationRecord\n valid... | ruby | chosen |
[
{
"from": "system",
"value": "Undo validation changes, it broke too many tests and should be a different issue at this point\n"
},
{
"from": "human",
"value": "class Plot < ApplicationRecord\n validates :plot_id, presence: true\n validates :latitude, presence: true, numericality: { greater_tha... | ruby | chosen |
[
{
"from": "system",
"value": "Add search method to Post model\n"
},
{
"from": "human",
"value": "class Post < ActiveRecord::Base\n belongs_to :category\nend\n"
},
{
"from": "gpt",
"value": "class Post < ActiveRecord::Base\n belongs_to :category\n\n def self.search(search)\n \twhe... | ruby | chosen |
[
{
"from": "system",
"value": "Add scoped uniqueness at model level\n"
},
{
"from": "human",
"value": "class Favourite < ApplicationRecord\n after_create :cache_favorited_login\n before_destroy :delete_cached_favorited_login\n belongs_to :employer\n belongs_to :developer\n\n private\n\n def... | ruby | chosen |
[
{
"from": "system",
"value": "Add repo name to select gift\n"
},
{
"from": "human",
"value": "class GiftForm\n attr_reader :gift\n\n def initialize(args={})\n @gift = args.fetch(:gift)\n @giftable_dates = args.fetch(:giftable_dates, [])\n @pull_requests = args.fetch(:pull_requests)\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add extra phone number validation\n"
},
{
"from": "human",
"value": "class Recipient < ApplicationRecord\n belongs_to :invoice, optional: true\n validates_presence_of :name, :surname, :address, :phone\nend\n"
},
{
"from": "gpt",
"value": "class Recipie... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor uniqueness validation for emails\n"
},
{
"from": "human",
"value": "class User < ActiveRecord::Base\ninclude ActiveModel::Validations\n\tvalidates :name, :city, :email, presence: true\n\tvalidates :name, length: { minimum: 2 }\n\tvalidates :email, uniquenes... | ruby | chosen |
[
{
"from": "system",
"value": "Use mystery man as default gravatar image\n"
},
{
"from": "human",
"value": "# == Schema Information\n#\n# Table name: users\n#\n# id :integer not null, primary key\n# provider :string(255)\n# uid :string(255)\n# name :string(... | ruby | chosen |
[
{
"from": "system",
"value": "Add faraday and faraday_middleware dependencies\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\n$:.unshift File.expand_path('../lib', __FILE__)\nrequire 'minerva-fetcher/version'\n\nGem::Specification.new do |s|\n s.name = \"minerva_fetcher\"\n s.... | ruby | chosen |
[
{
"from": "human",
"value": "Add a tool for iterating through all experiments\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/ruby\n# Requires ruby2.0+\n\nrequire 'optparse'\n\nclass Experiment\n attr_reader :dir, :name, :branch\n def initialize(dir, name, branch: \"master\")\n @dir = dir\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Sort ConfigurationItem.real_object_classes by class names\n"
},
{
"from": "human",
"value": "class ConfigurationItem < ActiveRecord::Base\n belongs_to :item, :polymorphic => true\n\n validates_presence_of :item\n\n before_validation :update_identifier!\n\n scope... | ruby | chosen |
[
{
"from": "system",
"value": "Add a shift to our soon-to-be-created event\n"
},
{
"from": "human",
"value": "class EventsController < InheritedResources::Base\n before_filter :authenticate_ngo!, only: :new\n\nend\n"
},
{
"from": "gpt",
"value": "class EventsController < ApplicationC... | ruby | chosen |
[
{
"from": "system",
"value": "Save a few bytes on every ping\n"
},
{
"from": "human",
"value": "class StatusController < ApplicationController\n protect_from_forgery :except => [:status_update]\n before_action :check_if_smokedetector, :only => [:status_update]\n\n def index\n @statuses = S... | ruby | chosen |
[
{
"from": "system",
"value": "Set Airbrake as error handler for Sidekiq\n"
},
{
"from": "human",
"value": "require 'sidekiq/testing/inline' if %w(development test).include?(Rails.env)\n\nif Settings.sidekiq?\n Sidekiq::Web.use Rack::Auth::Basic do |username, password|\n username == Settings.... | ruby | chosen |
[
{
"from": "system",
"value": "Use copy/mkdir builtin Builder methods\n"
},
{
"from": "human",
"value": "name 'loom-server'\ndefault_version 'develop'\n\nsource :git => 'git://github.com/continuuity/loom.git'\nrelative_path 'server'\n\nbuild do\n command \"mkdir -p #{install_dir}/server/bin\"\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix integrations tests for release infos\n\nSigned-off-by: Dieter Reuter <554783fc552b5b2a46dd3d7d7b9b2cce9a82c122@me.com>\n"
},
{
"from": "human",
"value": "describe file('/etc/hypriot_release') do\n it { should_not be_file }\nend\n\ndescribe file('/etc/os-release... | ruby | chosen |
[
{
"from": "system",
"value": "Add test for render index template\n"
},
{
"from": "human",
"value": "require 'rails_helper'\n\ndescribe TagsController do\n before(:each) do\n @tag = create(:tag)\n @tag.questions << create(:question)\n end\n\n describe \"#index\" do\n it \"... | ruby | chosen |
[
{
"from": "human",
"value": "Add specs for existing options\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\n\ndescribe OmniAuth::Strategies::Ravelry do\n subject :ravelry do\n OmniAuth::Strategies::Ravelry.new nil, @options || { }\n end\n\n describe '#options' do\n subject(:opti... | ruby | chosen |
[
{
"from": "system",
"value": "Use stock_location's country for stock_location's state in stock_location factory\n\nThis is so that it doesn't create a new country and associate the state with that.\n"
},
{
"from": "human",
"value": "FactoryGirl.define do\n factory :stock_location, class: Spree:... | ruby | chosen |
[
{
"from": "system",
"value": "Fix bad reference in rake task\n"
},
{
"from": "human",
"value": "namespace :cron do\n desc \"Process Cron's 10 minute interval logic\"\n task interval_10_minutes: :environment do\n Cron.interval_10_minutes\n end\n\n desc \"Process Cron's 1 hour interval logi... | ruby | chosen |
[
{
"from": "system",
"value": "Revert \"Apt should not be the concern of the xml cookbook\"\n\nThis reverts commit 1ced9bb6d8b53ad13d66d1ea74573d1ed942d91d.\n"
},
{
"from": "human",
"value": "#\n# Cookbook Name:: xml\n# Recipe:: ruby\n#\n# Author:: Joseph Holsten (<joseph@josephholsten.com>)\n#\n... | ruby | chosen |
[
{
"from": "system",
"value": "Add metric for failed archiving with stale live trace\n"
},
{
"from": "human",
"value": "module Ci\n class RescueStaleLiveTraceWorker\n include ApplicationWorker\n include CronjobQueue\n\n def perform\n # Archive stale live traces which still resides... | ruby | chosen |
[
{
"from": "system",
"value": "Add points and timestamp offset\n"
},
{
"from": "human",
"value": "class HackerNewsRanking\n class Configuration\n @@configuration = {\n timestamp: :created_at,\n gravity: 1.8,\n scope_method: :trending,\n current_rank_method: :rank\n }\n\... | ruby | chosen |
[
{
"from": "system",
"value": "Use Airbrake.notify_sync instead of Airbrake.notify\n\nWhen running in a rake task, Airbrake.notify doesn't properly\nfinish triggering before the rake task ends and therefore the\nmessage never makes it to Airbrake.\n"
},
{
"from": "human",
"value": "require \"data... | ruby | chosen |
[
{
"from": "system",
"value": "Fix deprecation warning from rom-sql\n"
},
{
"from": "human",
"value": "class UpdateUserForm < UserForm\n commands users: :update\n\n input do\n timestamps(:updated_at)\n end\n\n def commit!\n users.try { users.update.by_id(id).set(attributes) }\n end\nen... | ruby | chosen |
[
{
"from": "system",
"value": "Change deps to use masters"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n\nGem::Specification.new do |gem|\n gem.name = \"spree-refinerycms-authentication\"\n gem.version = \"0.0.1\"\n gem.authors = [\"Adrian Macneil\"]\n gem.e... | ruby | chosen |
[
{
"from": "system",
"value": "Add sleep to allow threrad to start up - we were getting flickering tests\n"
},
{
"from": "human",
"value": "require 'rails_helper'\n\nThread.abort_on_exception = true\n\nRSpec.describe PaymentGateway, type: :service do\n describe '.available?' do\n around(:exam... | ruby | chosen |
[
{
"from": "human",
"value": "Add a recipe for the Tokutek package repo\n"
},
{
"from": "gpt",
"value": "#\n# Cookbook Name:: tokumx\n# Recipe:: tokutek_repo\n#\n# Copyright 2014, Tokutek\n# Authors:\n# John Esmet <john.esmest@gmail.com>\n#\n# Licensed under the Apache License, Version 2.0 ... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor - extract temp `keys`\n"
},
{
"from": "human",
"value": "describe 'API configuration (config/api.yml)' do\n let(:api_settings) { Api::ApiConfig }\n\n describe 'collections' do\n let(:collection_settings) { api_settings.collections }\n\n it \"is sort... | ruby | chosen |
[
{
"from": "human",
"value": "Add spec test showing is_pe detection failure\n\nAdd a new spec test providing some initial coverage of\npuppetdb::server demontrating the failure to correctly\ndetect a PE environment.\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\n\ndescribe 'puppetdb::ser... | ruby | chosen |
[
{
"from": "system",
"value": "Move attr_accessor inside dsl file\n"
},
{
"from": "human",
"value": "require 'watir'\nrequire 'nokogiri'\n\nmodule Bandicoot\n module Processor\n def crawl\n # browser = Watir::Browser.new :firefox\n # browser.goto\n # Nokogiri::HTML.parse browse... | ruby | chosen |
[
{
"from": "human",
"value": "Add World of Tanks Latest\n\nCloses #8358.\n"
},
{
"from": "gpt",
"value": "cask :v1 => 'world-of-tanks' do\n version :latest\n sha256 :no_check\n\n # wargaming.net is the official download host per the vendor homepage\n url 'http://redirect.wargaming.net/WoT/lat... | ruby | chosen |
[
{
"from": "system",
"value": "Fix version of bundler for JRuby 1.8\n"
},
{
"from": "human",
"value": "lib = File.expand_path(\"../lib\", __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire \"omniauth-oauth2/version\"\n\nGem::Specification.new do |gem|\n gem.add_dependenc... | ruby | chosen |
[
{
"from": "system",
"value": "Add support for multiple log files per project.\n\nauthor: da39a3ee5e6b4b0d3255bfef95601890afd80709@jthoenes\nauthor: da39a3ee5e6b4b0d3255bfef95601890afd80709@pbadenski\n"
},
{
"from": "human",
"value": "require \"logging\"\ninclude Logging.globally\n\nmodule Datain... | ruby | chosen |
[
{
"from": "system",
"value": "Remove debugging line, change .should_be to a .to\n"
},
{
"from": "human",
"value": "require 'spec_helper'\nrequire 'grocer/newsstand_notification'\nrequire 'grocer/shared_examples_for_notifications'\n\ndescribe Grocer::NewsstandNotification do\n describe 'binary f... | ruby | chosen |
[
{
"from": "human",
"value": "Add a single skipped test\n\nAs a reminder/placeholder\n"
},
{
"from": "gpt",
"value": "require 'minitest/autorun'\nrequire 'overcommit'\nrequire 'overcommit/hook/pre_commit/base'\nrequire './hooks/pre_commit/fear_of_commitment'\n\nclass TestFearOfCommitment < Minite... | ruby | chosen |
[
{
"from": "system",
"value": "Fix rspec warning about ordered stubs\n"
},
{
"from": "human",
"value": "RSpec.describe Mutant::Reporter::CLI::Tput do\n describe '.detect' do\n subject { described_class.detect }\n\n def expect_command(command, stdout, success)\n allow(Open3).to receive... | ruby | chosen |
[
{
"from": "system",
"value": "Switch deployment from Git repo to tarball on S3\n"
},
{
"from": "human",
"value": "app = search(:aws_opsworks_app).first\n\nexecute \"ssh-keyscan -H github.com >> /root/.ssh/known_hosts\"\n\napplication \"/srv/#{app['shortname']}\" do\n javascript \"4\"\n\n file ... | ruby | chosen |
[
{
"from": "system",
"value": "Remove obsolete Fixnum and Bignum\n"
},
{
"from": "human",
"value": "require_relative '../../spec_helper'\n\ndescribe \"Fixnum\" do\n it \"is unified into Integer\" do\n suppress_warning do\n Fixnum.should equal(Integer)\n end\n end\n\n it \"is depreca... | ruby | chosen |
[
{
"from": "system",
"value": "Make sure river notification observer doesn't cancel anything.\n"
},
{
"from": "human",
"value": "require 'pebblebed'\nrequire_relative 'models/post'\n\nclass RiverNotifications < ActiveRecord::Observer\n\n observe Post\n\n def self.river\n @river ||= Pebbles::... | ruby | chosen |
[
{
"from": "system",
"value": "Make new unique storage method the default\n"
},
{
"from": "human",
"value": "# rubocop:disable FileName\nrequire 'yaml' if RUBY_VERSION.include?('2.0.0')\nrequire 'sidekiq_unique_jobs/middleware'\nrequire 'sidekiq_unique_jobs/version'\nrequire 'sidekiq_unique_jobs/... | ruby | chosen |
[
{
"from": "system",
"value": "Set Paperclip S3 host based on ENV\n"
},
{
"from": "human",
"value": "module Paperclip\n class MediaTypeSpoofDetector\n def spoofed?\n false\n end\n end\nend"
},
{
"from": "gpt",
"value": "Paperclip::Attachment.default_options[:s3_host_name]... | ruby | chosen |
[
{
"from": "system",
"value": "Fix dependencies of ruby gem\n"
},
{
"from": "human",
"value": "Gem::Specification.new do |s|\n s.name = 'inwx-domrobot'\n s.version = '3.0'\n s.date = '2019-09-12'\n s.summary = \"INWX Domrobot\"\n s.description = \"Ruby Client ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix deployment target for tvos\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |spec|\n spec.name = 'FastEasyMapping'\n spec.version = '1.0'\n spec.summary = 'Fast mapping from JSON to NSObject / NSManagedObject and back'\n spec.homepage ... | ruby | chosen |
[
{
"from": "system",
"value": "RUBY-839: Add embedded array to test doc\n"
},
{
"from": "human",
"value": "require 'mongo'\nrequire 'benchmark'\n\nMongo::Logger.level = Logger::INFO\n\nclient = Mongo::Client.new(\n [ '127.0.0.1:27017' ],\n database: 'ruby-driver',\n user: 'root-user',\n passw... | ruby | chosen |
[
{
"from": "system",
"value": "Add Google Tag Manager ID configuration"
},
{
"from": "human",
"value": "require_relative 'boot'\n\nrequire 'action_controller/railtie'\nrequire 'action_view/railtie'\nrequire 'active_model/railtie'\nrequire 'sprockets/railtie'\n\nBundler.require(*Rails.groups)\n\nm... | ruby | chosen |
[
{
"from": "human",
"value": "Exit jobs immediately on Heroku restart.\n\nSee https://github.com/collectiveidea/delayed_job/commit/90579c3047099b6a58595d4025ab0f4b7f0aa67a\n"
},
{
"from": "gpt",
"value": "# See https://github.com/collectiveidea/delayed_job/commit/90579c3047099b6a58595d4025ab0f4b7... | ruby | chosen |
[
{
"from": "system",
"value": "Add some simple tests around the CacheDigests::FragmentHelper.fragment_name_with_digest\n"
},
{
"from": "human",
"value": "require 'cache_digests/test_helper'\n\nclass FragmentHelperTest < MiniTest::Unit::TestCase\nend\n"
},
{
"from": "gpt",
"value": "re... | ruby | chosen |
[
{
"from": "system",
"value": "Make the submodule support for inside_copy efficient\n"
},
{
"from": "human",
"value": "class GitRepo\n WORKING_DIR=\"#{Rails.root}/tmp/build-partition\"\n\n class << self\n def inside_copy(cached_repo_name, ref = \"master\", submodules = false)\n # update... | ruby | chosen |
[
{
"from": "system",
"value": "Add failing spec to test CircleCI\n"
},
{
"from": "human",
"value": "module Drs\n describe AuthClient do\n it 'true is true' do\n expect(true).to be true\n end\n end\nend"
},
{
"from": "gpt",
"value": "module Drs\n describe AuthClient do\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix idLabels to string instead of array\n"
},
{
"from": "human",
"value": "module Lita\n # Returns cards that are in the Confirmed column\n class NewCard\n\n def initialize(trello_client, list_id, id_labels, build_url)\n @trello_client = trello_client\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add drop down menu for accepts_new_members.\n"
},
{
"from": "human",
"value": "ActiveAdmin.register Farm do\n form do |f|\n PlaceForm.form(f)\n f.inputs \"Additional Farm Info\" do\n f.input :founded_at_year\n f.input :founded_at_month\n f.inpu... | ruby | chosen |
[
{
"from": "system",
"value": "Remove requires that are no longer required.\n\nMainly due to refactoring and autoloading.\n"
},
{
"from": "human",
"value": "require 'sinatra'\nrequire 'chaindrive/database'\nrequire 'chaindrive/gear'\n\nmodule Chaindrive\n class Web < Sinatra::Application\n ge... | ruby | chosen |
[
{
"from": "system",
"value": "Make final check a comparison\n"
},
{
"from": "human",
"value": "# I worked on this challenge [by myself, with: ].\n# This challenge took me [#] hours.\n\n# Pseudocode\n\n# 1. Create a starter array with 0 and 1\n# 2. Create a method that accepts an integer as an ar... | ruby | chosen |
[
{
"from": "human",
"value": "Add Evaluator, which given a parsed doctest. Evaluates the test and constructs a result for the Formatter\n"
},
{
"from": "gpt",
"value": "module Dest\n\n class Evaluator\n\n def initialize(parsed_attributes)\n @parsed_attributes = parsed_attributes\n end... | ruby | chosen |
[
{
"from": "system",
"value": "Add global initialize template & clear alerts function\n"
},
{
"from": "human",
"value": "require \"ferrety_ferret/version\"\nrequire \"httparty\"\nmodule Ferrety\n\n class Ferret\n attr_accessor :alerts\n def initialize\n @alerts = []\n end\n\n pr... | ruby | chosen |
[
{
"from": "system",
"value": "Make session cookie last for two weeks to work around iOS bug\n\nMobile Safari has a tendency to use cached form values even when the\ncache control headers tell it otherwise. However the session cookie\nhas expired so when the form is submitted the CSRF token is invalid.\n\nSe... | ruby | chosen |
[
{
"from": "system",
"value": "Set session to be alive 20 days by default\n"
},
{
"from": "human",
"value": "# Be sure to restart your server when you modify this file.\n\nRails.application.config.session_store :cookie_store, :key => '_kassi_session', :domain => APP_CONFIG.domain\n\n# Use the dat... | ruby | chosen |
[
{
"from": "system",
"value": "Configure the new bank holiday exclusion\n"
},
{
"from": "human",
"value": "WorkingHours::Config.holidays = %w(\n 2021-12-27\n 2021-12-28\n 2022-01-03\n).map(&:to_date)\n"
},
{
"from": "gpt",
"value": "WorkingHours::Config.holidays = %w(\n 2021-12-27... | ruby | chosen |
[
{
"from": "system",
"value": "Add stale neighbour monitoring in the Arp presence detection\n"
},
{
"from": "human",
"value": "class Arp\n def self.all\n `ip neigh show nud reachable`.split(/\\n/).map do |entry|\n addresses = *entry.scan(/\\A([0-9a-f:.]*?) dev ([a-z0-9.]*?) lladdr ([0-9a... | ruby | chosen |
[
{
"from": "system",
"value": "Fix issue with missing mac addresses\n"
},
{
"from": "human",
"value": "class Arp\n def self.all\n `ip neigh show`.split(/\\n/).map do |entry|\n Arp.new *entry.scan(/\\A([0-9a-f:.]*?) dev ([a-z0-9.]*?) lladdr ([0-9a-f:].*?) .*\\z/i).first\n end\n end\n\... | ruby | chosen |
[
{
"from": "system",
"value": "Use File.join for great justice\n"
},
{
"from": "human",
"value": "require 'pathname'\nrequire 'yaml'\n\nmodule LicenseFinder\n ROOT_PATH = Pathname.new(__FILE__).dirname\n\n class Configuration\n attr_reader :whitelist, :ignore_groups, :dependencies_dir\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Use correct format so tests will pass.\n"
},
{
"from": "human",
"value": "class PostsController < ActionController::Base\n include CancanStrongParameters::Controller\n \n permit_params :title, :content,\n :comments => [\n :body, \n { :tags => [ :name... | ruby | chosen |
[
{
"from": "human",
"value": "Add test file for administrator model class\n"
},
{
"from": "gpt",
"value": "require 'test_helper'\n\ndescribe Kiitos::Administrator do\n\tbefore do\n\t\t@user = User.create name: 'Test User', email: 'test@example.com'\n\t\t@admin = Kiitos::Administrator.create user_... | ruby | chosen |
[
{
"from": "system",
"value": "Allow binding to multiple routing keys.\n"
},
{
"from": "human",
"value": "\nclass Sneakers::Queue\n attr_reader :name, :opts, :exchange\n\n def initialize(name, opts)\n @name = name\n @opts = opts\n @handler_klass = Sneakers::Config[:handler]\n end\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Use cap convention of prefixing console info with ' * '\n"
},
{
"from": "human",
"value": "Capistrano::Configuration.instance(true).load do\n namespace :deploy do\n desc \"Restart Resque Workers\"\n task :restart_workers, :roles => :resque do\n find_ser... | ruby | chosen |
[
{
"from": "system",
"value": "Load mailer in email task\n"
},
{
"from": "human",
"value": "namespace :appfab do\n namespace :emails do\n task :send_notifications_digest => :environment do\n User.with_state(:visible).find_each do |user|\n next unless user.notifications.unread.coun... | ruby | chosen |
[
{
"from": "system",
"value": "Add rake task to view daemon's pid\n"
},
{
"from": "human",
"value": "namespace :stream do\n desc \"Start Twitter stream\"\n task :start => :environment do\n exec('bundle exec rails runner script/tweetstream.rb start')\n end\n\n desc \"Stop Twitter stream\"\n... | ruby | chosen |
[
{
"from": "system",
"value": "Package version is increased from 0.1.1.1 to 0.1.1.2\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'data_aggregation-accumulator'\n s.version = '0.1.1.1'\n s.summary = 'Data aggregation accumulator library'... | ruby | chosen |
[
{
"from": "system",
"value": "Add handling for `postgresql://` in `benizi-urb`\n"
},
{
"from": "human",
"value": "# Minorly-enhanced URI class.\n#\n# Adds:\n# - support for SSH scheme\n# - `#to_h`\nrequire 'uri'\nrequire 'socket'\n\nmodule URI\n class << self\n def add_scheme(name, default_p... | ruby | chosen |
[
{
"from": "human",
"value": "Add a tool that generate data for long posting list\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env ruby\n\nrequire \"json\"\n\nputs(<<-COMMANDS)\ntable_create Data TABLE_NO_KEY\ncolumn_create Data value COLUMN_SCALAR Text\n\ntable_create Terms TABLE_PAT_KEY ShortTex... | ruby | chosen |
[
{
"from": "system",
"value": "Read RSS service URI from env var\n"
},
{
"from": "human",
"value": "require 'open-uri'\n\nget '/' do\n redirect '/index.html'\nend\n\nget '/image' do\n image_url = params[:url]\n file = open(image_url)\n content_type file.content_type\n file\nend\n"
},
{
... | ruby | chosen |
[
{
"from": "system",
"value": "Update Club Factory to Remove Logo\n\nRemove the logo attribute from the Club factory since it is no longer a\nrequired attribute for a Club to be valid.\n"
},
{
"from": "human",
"value": "FactoryGirl.define do\n factory :club do\n user\n\n name { Fake... | ruby | chosen |
[
{
"from": "system",
"value": "Add up field to vote factory\n"
},
{
"from": "human",
"value": "FactoryGirl.define do\n factory :vote do\n up: { [true, false].sample }\n end\nend\n\n"
},
{
"from": "gpt",
"value": "FactoryGirl.define do\n factory :vote do\n up { [true, false].s... | ruby | chosen |
[
{
"from": "system",
"value": "Update bundler requirement from ~> 1.5 to ~> 2.0\n\nUpdates the requirements on [bundler](https://github.com/bundler/bundler) to permit the latest version.\n- [Release notes](https://github.com/bundler/bundler/releases)\n- [Changelog](https://github.com/bundler/bundler/blob/mas... | ruby | chosen |
[
{
"from": "system",
"value": "Upgrade to Rails 4.2. Still just console and Messages/Index working.\n"
},
{
"from": "human",
"value": "module BreakDance\n module SecurityScoping\n extend ActiveSupport::Concern\n\n module ClassMethods\n def scoped(options = nil)\n scope = super(... | ruby | chosen |
[
{
"from": "system",
"value": "Revert \"Change virtualbox DNS address to 10.0.2.3\"\n\nThis reverts commit 1df24371fc98f69f045d054a692be38d2330b32e.\n\nReverting as @hferentschik would like to discuss this further.\n"
},
{
"from": "human",
"value": "module Landrush\n module Action\n class Red... | ruby | chosen |
[
{
"from": "system",
"value": "Add reader method for internal_id\n"
},
{
"from": "human",
"value": "module NetSuite\n module Records\n class CustomList\n include Support::Fields\n include Support::Records\n include Support::Actions\n include Namespaces::SetupCustom\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Synchronize events within a single thread\n"
},
{
"from": "human",
"value": "module Sequent\n module Core\n class EventPublisher\n class PublishEventError < RuntimeError\n attr_reader :event_handler_class, :event\n\n def initialize(event_handl... | ruby | chosen |
[
{
"from": "system",
"value": "Add comment to rake task that defaults are yet to come\n"
},
{
"from": "human",
"value": "namespace :populate_app_content do\n\n desc \"Loads app content for the SB abandoned property deploy\"\n task :abandoned_property_deploy => :environment do\n AppContentSet... | ruby | chosen |
[
{
"from": "system",
"value": "Package version is increased from 2.1.1.0 to 2.1.1.1\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'evt-log'\n s.version = '2.1.1.0'\n s.summary = 'Logging to STD IO with levels, tagging, and coloring'\n s... | ruby | chosen |
[
{
"from": "human",
"value": "Add a small script to search for multi-line regexp patterns\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env ruby\nDir.chdir('../rubyspec') do\n regexp = Regexp.new(ARGV[0])\n Dir.glob('**/*.rb') do |file|\n contents = File.read(file)\n if regexp =~ contents\n... | ruby | chosen |
[
{
"from": "system",
"value": "Add exception rescue for call\n"
},
{
"from": "human",
"value": "require \"rulers/version\"\nrequire 'rulers/array'\nrequire 'rulers/routes'\n\nmodule Rulers\n class Application\n def call(env)\n if env['PATH_INFO'] == '/favicon.ico'\n return [404, {... | ruby | chosen |
[
{
"from": "system",
"value": "Implement the ability to pass a block to encode_io and encode\n\nThis allows a library user to easily customize the representation of an\nemoji (mapping it to a custom image for example)\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nrequire \"rumoji/... | ruby | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.