conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix serialization and deserialization of datamapper objects." }, { "from": "human", "value": "# encoding: utf-8\nif YAML.parser.class.name =~ /syck/i\n DataMapper::Resource.class_eval do\n yaml_as \"tag:ruby.yaml.org,2002:DataMapper\"\n\n def self.yaml_new(kl...
ruby
chosen
[ { "from": "system", "value": "Make a start on parsing the Jawbone data file and figuring out what each value represents (some of the column names are pretty cryptic).\n" }, { "from": "human", "value": "require 'ruby_jawbone/file_readers/base'\n\nmodule RubyJawbone\n module FileReaders\n clas...
ruby
chosen
[ { "from": "system", "value": "Revert \"Used a regexp in the is_capitalised method from the Utility module\"\n\nThis reverts commit 1cd5d83c581bf2a6c3a16b1ced5c4a4a3fb96151.\n" }, { "from": "human", "value": "module Utilities\n\tclass String\n\t def self.is_capitalised_word?(line)\n\t /[^[A-...
ruby
chosen
[ { "from": "system", "value": "Add missing dependency on libedit\n" }, { "from": "human", "value": "class Btag < Formula\n desc \"Command-line based audio file tagger\"\n homepage \"https://github.com/fernandotcl/btag\"\n url \"https://github.com/fernandotcl/btag/archive/release-1.4.0.tar.gz\"...
ruby
chosen
[ { "from": "system", "value": "Revert \"Depend on rake in development\"\n\nThis reverts commit 36ddaa3d3bf6e8307a0e94cae3f86f88e3df4f30.\n" }, { "from": "human", "value": "require File.expand_path(\"lib/cuuid/version\", File.dirname(__FILE__))\n\nGem::Specification.new do |s|\n s.name = \"cuuid\...
ruby
chosen
[ { "from": "system", "value": "Fix licenses in gemspec to Rubygems standard\n\nAccording to [Rubygems](http://guides.rubygems.org/specification-reference/#license=), you should specify your license using an [SPDX ID](https://spdx.org/licenses/). This permits tools like [LicenseFinder](https://github.com/pivo...
ruby
chosen
[ { "from": "system", "value": "Change to relax rspec dev requirement\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'tty/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Allow configuration of individual hooklets\n" }, { "from": "human", "value": "# This code is free software; you can redistribute it and/or modify it under\n# the terms of the new BSD License.\n#\n# Copyright (c) 2013, Sebastian Staudt\n\nmodule Mestral::Hooklet::DSL...
ruby
chosen
[ { "from": "system", "value": "Add `gem.required_ruby_version = \">= 2.0.0\"` explicitly\n\nI had used `String#+@` 48bcac2e in ISUCON10, but it requires Ruby 2.3+.\n\nSince `mysql2` gem supports Ruby 2.0, so I've added the\n`required_ruby_version` explicitly to ease to find the supported\nversion.\n" }, ...
ruby
chosen
[ { "from": "system", "value": "Allow normal users to create polls, clean up abilities model\n" }, { "from": "human", "value": "class Ability\n include CanCan::Ability\n\n def initialize(user)\n user ||= User.new\n\n if user.has_role? :admin\n can :manage, :all\n else\n can :r...
ruby
chosen
[ { "from": "system", "value": "Tweak comment in Celluloid integration\n" }, { "from": "human", "value": "if defined?(::Celluloid)\n Appsignal.logger.info('Loading Celluloid integration')\n\n # Some versions of Celluloid have race conditions while exiting\n # that can result in a dead lock. We ...
ruby
chosen
[ { "from": "system", "value": "Make activesupport as runtime dependency\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'poisol'\n s.version = '0.1.9'\n s.date = '2015-09-16'\n s.summary = 'HTTP stub as DSL'\n s.description = 'HTTP stub as DSL'\n s.authors = [\"D...
ruby
chosen
[ { "from": "system", "value": "Remove not_supported_on which can be replaced by tags\n" }, { "from": "human", "value": "require File.expand_path('../../../spec_helper', __FILE__)\nrequire File.expand_path('../fixtures/common', __FILE__)\nrequire File.expand_path('../shared/chroot', __FILE__)\n\np...
ruby
chosen
[ { "from": "system", "value": "Use first valid semver word for gcloud_version fact, rather than 4th word in version string\n" }, { "from": "human", "value": "# XXX This facter code is not tested; I couldn't figure out how to get it into\n# a reasonable test harness.\n\nmodule GcloudVersion\n MIN...
ruby
chosen
[ { "from": "system", "value": "Make sure Emacs and zsh are always installed\n" }, { "from": "human", "value": "default.admin_essentials.additional_packages = %w()\ndefault.admin_essentials.default_packages = %w(\n mc\n htop\n strace\n screen\n inotify-tools\n debconf-utils\n rlwrap\n mult...
ruby
chosen
[ { "from": "system", "value": "fix: Update URL for Golang itself\n\nPer the curent website. Example URL provided for illustration.\n" }, { "from": "human", "value": "default['golang']['version'] = '1.5'\ndefault['golang']['platform'] = node['kernel']['machine'] =~ /i.86/ ? '386' : 'amd64'\ndefaul...
ruby
chosen
[ { "from": "human", "value": "Add a package for KSP Interstellar.\n" }, { "from": "gpt", "value": "class KSPInterstellar < Kosmos::Package\n title 'KSP Interstellar'\n aliases 'interstellar'\n\n url 'https://bitbucket.org/FractalUK/kspinstellar/downloads/KSPInterstellar-v0.11.zip'\n\n def ins...
ruby
chosen
[ { "from": "system", "value": "Put authorize_resource in the Authorization module\n" }, { "from": "human", "value": "##\n# Authorization\n#\n# Basic authorization methods for controllers\nmodule Outpost\n module Controller\n module Authorization\n # Make sure the user can authorize the c...
ruby
chosen
[ { "from": "system", "value": "Declare missing field in Stratify::Garmin::Activity\n\nMissing field was detected by test failure after upgrading to Mongoid 4:\n\n stratify-garmin collects and stores data from Garmin Connect\n Failure/Error: collector.run\n Mongoid::Errors::UnknownAttribute:\n\n Prob...
ruby
chosen
[ { "from": "system", "value": "Fix bad placement of comma\n" }, { "from": "human", "value": "# Encapsulates a user's indirect membership (through spaces) of an organization.\nclass Podio::OrganizationMember < ActivePodio::Base\n property :profile, :hash\n property :admin, :boolean\n\n has_one ...
ruby
chosen
[ { "from": "system", "value": "Add support for rendering Smartdown outcomes in govspeak\n\nThis is currently the default format for generating regression test artefacts.\nAdd support for rendering smartdown outcomes in govspeak so we can add\nregression tests to them.\n" }, { "from": "human", "va...
ruby
chosen
[ { "from": "system", "value": "Fix for SQL injections, use ActiveRecord querying" }, { "from": "human", "value": "Spree::Core::Search::Base.class_eval do\n def get_products_conditions_for(base_scope, query)\n if query.blank?\n base_scope\n else\n conditions = []\n query.spli...
ruby
chosen
[ { "from": "system", "value": "Add total_entries attribute to FacetCollection hash.\n\nWhen Foo.facets results are collated, build a Hash of total_entries values as returned by Sphinx and then make it available on the FacetCollection. If we then call f = Asset.facets :limit => 100 then f.total_entries is a H...
ruby
chosen
[ { "from": "human", "value": "Add class for generating HOTPs\n\nThis is a very, very, very naive implementation of the algorithm\ndescribed in RFC 4226[1].\n\nIt still contains lots of debug code that I found useful in trying to\nunderstand what was going on.\n\nIt contains a single test which uses the examp...
ruby
chosen
[ { "from": "system", "value": "Fix load_specs so that broken specs aren't silently skipped\n\nPreviously if a language/feature spec contained a broken import, the\nresultant `LoadError` would be ignored and the test skipped. Now the\n`LoadError` filename is checked to ensure it's not from a nested\n`require`...
ruby
chosen
[ { "from": "system", "value": "Add yard to dependencies [ci skip]\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire File.expand_path('../lib/greeb/version', __FILE__)\n\nGem::Specification.new do |s|\n s.name = 'greeb'\n s.version = Greeb::VERSION\n s.platform = Gem...
ruby
chosen
[ { "from": "system", "value": "Extend permited params in checkout_controller\n" }, { "from": "human", "value": "module Spree\n CheckoutController.class_eval do\n before_action :permit_line_items_attributes, only: :update\n\n private\n def permit_line_items_attributes\n line_item_at...
ruby
chosen
[ { "from": "system", "value": "Change User Migration to Allow Different Access\n" }, { "from": "human", "value": "class CreateUsers < ActiveRecord::Migration\n def change\n end\nend\n" }, { "from": "gpt", "value": "class CreateUsers < ActiveRecord::Migration\n def change\n creat...
ruby
chosen
[ { "from": "system", "value": "Remove dead code in tests\n\nSigned-off-by: Rob Day-Reynolds <904086f049d807ae99640dbdfde98536a5822f56@pivotallabs.com>\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe VSphereCloud::Cloud do\n let(:client_stub) { double(cookie: nil) }\n let(:c...
ruby
chosen
[ { "from": "system", "value": "Make the required ruby version >= 1.9 for named regex match groups\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'wptemplates/version'\n\nGem::Specific...
ruby
chosen
[ { "from": "system", "value": "Fix bug with LinuxComputer controller xrandr command builder\n" }, { "from": "human", "value": "require_relative \"generic_ssh\"\n\nmodule HackyHAL\n module DeviceControllers\n class LinuxComputer < GenericSsh\n def mirror_screens(source_screen, dest_screen...
ruby
chosen
[ { "from": "system", "value": "Fix google fit strength training length calculation\n" }, { "from": "human", "value": "ProviderRepo.find!(:googlefit).register_metric :strength_training do |metric|\n metric.title = \"Strength training\"\n metric.description = \"Minutes of strength training\"\n\n ...
ruby
chosen
[ { "from": "system", "value": "Update Anki to version 2.0.18\n" }, { "from": "human", "value": "class Anki < Cask\n url 'http://ankisrs.net/download/mirror/anki-2.0.17.dmg'\n homepage 'http://ankisrs.net/'\n version '2.0.17'\n sha1 '58cd3fa4ba568f380a4c8382ac878553e70f3a46'\n link 'Anki.app'...
ruby
chosen
[ { "from": "system", "value": "Refresh an event's responses after saving a new one\n\n* BUG was introduced by 67d686\n" }, { "from": "human", "value": "class ResponseController < ApplicationController\n\n layout \"application\", :except => :feed\n\n def post\n @event = Event.find_by_permalin...
ruby
chosen
[ { "from": "system", "value": "Add redirection to dashboard on session create\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n def new\n redirect_to auth_path('spotify')\n end\n\n def create\n user = User.find_or_create_by_auth(request.env['omniauth.a...
ruby
chosen
[ { "from": "system", "value": "Refactor session creation to handle non-administrators\n" }, { "from": "human", "value": "class SessionsController < JsonController\n\n\tdef new\n\n\tend\n\n\tdef create\n\t\t@user = User.find_by(username: params[:username].strip)\n\t\tif @user && !@user.banned? && ...
ruby
chosen
[ { "from": "system", "value": "Allow client options to take an environment variable settable by the application or anything\n" }, { "from": "human", "value": "module OmniAuth\n module Strategies\n require 'omniauth-oauth2'\n class Nyulibraries < OmniAuth::Strategies::OAuth2\n if defin...
ruby
chosen
[ { "from": "human", "value": "Add custom error class SalesforceError to internally handle parsing an error response.\n" }, { "from": "gpt", "value": "module SalesforceBulk\n # An exception raised when any non successful request is made through the Salesforce Bulk API.\n class SalesforceError < ...
ruby
chosen
[ { "from": "system", "value": "Remove non-rails dependencies from gem spec\n\nWe only need to include deps for rails engine functionality." }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\nrequire \"ydtd_frontend/version\"\n\nGem::Specification.new do |s|\n s.nam...
ruby
chosen
[ { "from": "system", "value": "Remove unused code now that the deprecated file was removed\n" }, { "from": "human", "value": "DEPRECATED_FILES = [\"#{File.dirname(__FILE__)}/core_ext/struct.rb\"]\n(Dir[\"#{File.dirname(__FILE__)}/core_ext/*.rb\"] - DEPRECATED_FILES).each do |path|\n require path...
ruby
chosen
[ { "from": "system", "value": "Update CORS to make reports work with new domain\n" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\n\nrequire 'rails/all'\n\n# Require the gems listed in Gemfile, including any gems\n# you've limited to :test, :development, or :product...
ruby
chosen
[ { "from": "system", "value": "Fix `url` stanza comment for Dymo Stamps.\n" }, { "from": "human", "value": "cask 'dymo-stamps' do\n version :latest\n sha256 :no_check\n\n url 'http://download.endicia.com/dymostamps/dymostamps.dmg'\n name 'Dymo Stamps'\n homepage 'https://www.dymo.com/en-US/o...
ruby
chosen
[ { "from": "system", "value": "Load local environment variables from congif/local_env.yml.\n" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\n\nrequire 'rails/all'\n\n# Require the gems listed in Gemfile, including any gems\n# you've limited to :test, :development, ...
ruby
chosen
[ { "from": "system", "value": "Allow :en locale, for admin pages. Rails 4.0.4 is more strict about this\n" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\n\nrequire 'rails/all'\n\nrequire 'actionpack/action_caching'\n\n# Require the gems listed in Gemfile, including...
ruby
chosen
[ { "from": "human", "value": "Add PDF Element Pro v6.6.1\n" }, { "from": "gpt", "value": "cask \"pdfelementpro\" do\n version \"6.6.1,2992\"\n sha256 \"1b4ea505e82cd01f5aacb0e7501d0999cbdf28159eb3874f1710041b5523a40b\"\n\n url \"http://download.wondershare.com/cbs_down/mac-pdfelement#{version....
ruby
chosen
[ { "from": "system", "value": "Add create? and index? to entity policy\n" }, { "from": "human", "value": "module BeachApiCore\n class EntityPolicy < ApplicationPolicy\n def show?\n record.user == user\n end\n\n def destroy?\n record.user == user\n end\n\n def lookup?\n ...
ruby
chosen
[ { "from": "system", "value": "Revert html formatting, still stuck at pretty format.\n" }, { "from": "human", "value": "require './lib/dtext.rb'\nrequire 'nokogiri'\n\ninclude DText\n\nTestDir = \"./tests\"\n\ndef p(str)\n DText.parse(str).gsub! /[\\n\\s]+/, \"\"\nend\n\ndef find_test()\n begin...
ruby
chosen
[ { "from": "system", "value": "Make sure the deep merge always works.\n" }, { "from": "human", "value": "require \"#{File.dirname(__FILE__)}/../../../moonshine/lib/moonshine\"\n\nrequire 'sevenscale_deploy/bundler_support'\nrequire 'sevenscale_deploy/source_package'\nrequire 'sevenscale_deploy/fa...
ruby
chosen
[ { "from": "system", "value": "Stop Report from using type from Reports::Base.\n\nSigned-off-by: James McCarthy <474ba67bdb289c6263b36dfd8a7bed6c85b04943@thisishatch.co.uk>\n" }, { "from": "human", "value": "class Report\n\n include ActiveModel::Model\n\n delegate :type, :title, :from, :to, :pe...
ruby
chosen
[ { "from": "system", "value": "Use a temporary directory for cucumber tests to silence Travis\n" }, { "from": "human", "value": "require 'aruba'\nrequire 'aruba/cucumber'\nrequire 'aruba/in_process'\n\nrequire 'rspec'\nrequire 'chefspec'\n\nrequire_relative 'executor'\nAruba::InProcess.main_class...
ruby
chosen
[ { "from": "human", "value": "Verify tests are running in supported Ruby version\n" }, { "from": "gpt", "value": "require 'rspec'\nrequire 'yaml'\n\ndescribe 'ruby version' do\n it 'tests are running with the Ruby version that is included in release' do\n ruby_spec = YAML.load_file(File.join(...
ruby
chosen
[ { "from": "system", "value": "Remove src directory from gem\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'henge/version'\n\nGem::Specification.new do |spec|\n spec.name =...
ruby
chosen
[ { "from": "system", "value": "Remove AWS credentials from s3 object metadata\n" }, { "from": "human", "value": "module ElectricSheep\n module Resources\n class S3Object < Resource\n\n option :key, required: true\n option :bucket, required: true\n option :access_key, required: ...
ruby
chosen
[ { "from": "system", "value": "Add tests for MP4 audio properties\n" }, { "from": "human", "value": "require File.join(File.dirname(__FILE__), 'helper')\n\nclass MP4FileTest < Test::Unit::TestCase\n context \"TagLib::MP4::File\" do\n setup do\n @file = TagLib::MP4::File.new(\"test/data/m...
ruby
chosen
[ { "from": "system", "value": "Update reference to Minitest test case\n" }, { "from": "human", "value": "## ------------------------------------------------------------------- \n## \n## Copyright (c) \"2014\" Dmitri Zagidulin and Basho Technologies, Inc.\n##\n## This file is provided to you under...
ruby
chosen
[ { "from": "system", "value": "Update demo and podspec commit\n" }, { "from": "human", "value": "\nPod::Spec.new do |s|\n s.name = \"SPMJPGStream\"\n s.version = \"0.0.1\"\n s.summary = \"Fetch a MJPG stream from an Axis camera. For iOS and OS X.\"\n s.description = <<-DESC...
ruby
chosen
[ { "from": "system", "value": "Make sure env values are integers.\n" }, { "from": "human", "value": "require 'app_perf_rpm'\n\nAppPerfRpm.configure do |rpm|\n rpm.application_name = \"App Perf\"\n rpm.license_key = ENV[\"APP_PERF_LICENSE_KEY\"]\n rpm.ssl = ENV[\"APP_PERF_SSL\"] == \"true\"\n ...
ruby
chosen
[ { "from": "system", "value": "Print a fatal log message if Punchblock fails to connect in time" }, { "from": "human", "value": "require 'timeout'\n\nmodule Adhearsion\n class Initializer\n class Punchblock\n cattr_accessor :config, :client, :dispatcher\n\n class << self\n de...
ruby
chosen
[ { "from": "system", "value": "Fix the app builder the generator is using.\n\nMake AppBuilder.banner a protected method.\nClean up syntax.\n" }, { "from": "human", "value": "require 'rails/generators'\nrequire 'rails/generators/rails/app/app_generator'\n\nmodule Hightail\n class Generator < Rail...
ruby
chosen
[ { "from": "system", "value": "Update template list to only show existing data\n" }, { "from": "human", "value": "require \"chef/knife/glesys_base\"\n\nclass Chef\n class Knife\n class GlesysTemplateList < Knife\n include Knife::GlesysBase\n\n banner \"knife glesys template list (op...
ruby
chosen
[ { "from": "system", "value": "Add necessary gems for dev and live\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'duck_duck_go_api/version'\n\nGem::Specification.new do |spec|\n spe...
ruby
chosen
[ { "from": "human", "value": "Add spec for items DSL\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nrequire 'spec_helper'\nrequire 'nokogiri'\n\nRSpec.describe Juknife::Scraping::DSL::Items do\n let(:owner) { nil }\n let(:html_source) { File.read('./spec/fixtures/test.html') ...
ruby
chosen
[ { "from": "system", "value": "Change the Milestone model to use project based permissions\n" }, { "from": "human", "value": "class Milestone < ActiveRecord::Base\n\n hobo_model # Don't put anything above this\n\n fields do\n name :string\n date :date\n background_color :string\n co...
ruby
chosen
[ { "from": "system", "value": "Update gem summary to match README.\n" }, { "from": "human", "value": "require File.expand_path('../lib/hash_builder', __FILE__)\n\nGem::Specification.new do |spec|\n spec.name = 'hash_builder'\n spec.version = HashBuilder::VERSION\n spec.authors = ['Dray Lacy']\...
ruby
chosen
[ { "from": "system", "value": "Extend active player test to do multiple moves\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe TicTacToe::Game do\n let(:console) { mock_console }\n let(:board) { mock_board }\n let(:game) { TicTacToe::Game.new(console, board) }\n\n def mock...
ruby
chosen
[ { "from": "system", "value": "Simplify dependency rule for yard.\n" }, { "from": "human", "value": "require 'rubygems/package_task'\nrequire_relative '../lib/letscert.rb'\n\nspec = Gem::Specification.new do |s|\n s.name = 'letscert'\n s.version = LetsCert::VERSION\n s.license = 'MIT'\n s.sum...
ruby
chosen
[ { "from": "system", "value": "Use base instead of central in login pages\n" }, { "from": "human", "value": "require 'mumukit/core'\n\nI18n.load_translations_path File.join(__dir__, 'laboratory', 'locales', '*.yml')\n\n\nmodule Mumuki\n module Laboratory\n end\nend\n\nrequire 'mumuki/domain'\nr...
ruby
chosen
[ { "from": "system", "value": "Add views to the auto load path during init\n" }, { "from": "human", "value": "require 'prospecto/controller'\n\nmodule Prospecto\n class Railtie < Rails::Railtie\n initializer \"prospecto.initialize\" do |app|\n ActionController::Base.extend(ProspectoContr...
ruby
chosen
[ { "from": "human", "value": "Add specs to check how paranoia and globalize work together\n\nCreate shared model spec to test paranoia and globalize behavior on\nglobalizable and paranoid models.\n" }, { "from": "gpt", "value": "shared_examples \"acts as paranoid\" do |factory_name|\n let!(:reso...
ruby
chosen
[ { "from": "system", "value": "Update google-api-client requirement from >= 0.23.9, < 0.35.0 to >= 0.23.9, < 0.37.0\n\nUpdates the requirements on [google-api-client](https://github.com/google/google-api-ruby-client) to permit the latest version.\n- [Release notes](https://github.com/google/google-api-ruby-c...
ruby
chosen
[ { "from": "system", "value": "Use the xcode when executing steps\n" }, { "from": "human", "value": "require 'cocoapods-regression/cocoapods'\nrequire 'cocoapods-regression/xcode'\n\nmodule CocoaPods\n module Regression\n class Builder\n attr_accessor :working_directory\n\n def init...
ruby
chosen
[ { "from": "system", "value": "Add hets error handling to ProveCaller.\n" }, { "from": "human", "value": "module Hets\n class ProveCaller < ActionCaller\n CMD = 'prove'\n METHOD = :post\n COMMAND_LIST = %w(auto)\n\n PROVE_OPTIONS = {format: 'json', include: 'true'}\n\n def call(ir...
ruby
chosen
[ { "from": "system", "value": "Add Character Count & color\n\nModified ReadMe" }, { "from": "human", "value": "require 'json'\n\nmodule InitialjsRails\n module ViewHelpers\n def avatar_image(avatarable, options = {})\n size = options.fetch(:size) { 100 }\n klass ...
ruby
chosen
[ { "from": "system", "value": "Make rack reponse bodies arrays\n\nCompliance! :beer:\n" }, { "from": "human", "value": "module Pannier\n class Responder\n\n def initialize(manifest)\n @manifest = manifest\n end\n\n def response(request)\n case request.path\n when /^\\/man...
ruby
chosen
[ { "from": "system", "value": "Include association method in fields automatically." }, { "from": "human", "value": "module Faceted\n\n module Model\n\n require 'json'\n require 'active_support/core_ext/hash'\n\n # Class methods ===========================================================...
ruby
chosen
[ { "from": "system", "value": "Adjust version specifiers for development dependencies\n" }, { "from": "human", "value": "require File.expand_path('lib/nexmo/version', File.dirname(__FILE__))\n\nGem::Specification.new do |s|\n s.name = 'nexmo'\n s.version = Nexmo::VERSION\n s.license = 'MIT'\n ...
ruby
chosen
[ { "from": "system", "value": "Fix specs after rebase with translations branch\n\n- Fix spec spec/features/management/proposals_spec.rb:24 adding single quotes.\n- Remove spec related with 'proposal improvement info link' as master branch.\n- Fix proposal rake task (now proposals have translations). We put t...
ruby
chosen
[ { "from": "system", "value": "Test that properties do get converted form command line options." }, { "from": "human", "value": "require 'yacl/define/cli/parser'\n\nmodule Yacl::Spec::Define\n class OptionsForParserTest < ::Yacl::Define::Cli::Options\n opt 'pipeline.dir', :long => 'pipeline-d...
ruby
chosen
[ { "from": "system", "value": "Update for v4.7.3 and v6.9.5\n" }, { "from": "human", "value": "require 'spec_helper'\n\n# Node 12.x\nif property[:name] =~ /v0.12./\n describe command('node -v') do\n its(:stdout) { should contain('v0.12.17') }\n end\nend\n\n# Node 4.x\nif property[:name] =~ /...
ruby
chosen
[ { "from": "system", "value": "Add an API call to return subscribed threads for a user.\n" }, { "from": "human", "value": "get \"#{APIPREFIX}/users/:user_id/notifications\" do |user_id|\n user.notifications.map(&:to_hash).to_json\nend\n\npost \"#{APIPREFIX}/users/:user_id/subscriptions\" do |use...
ruby
chosen
[ { "from": "system", "value": "Discard upcoming races when adding contestants\n\nall except the first.\n" }, { "from": "human", "value": "class AnnounceController < FayeRails::Controller\n def self.update\n Heat.fill_lineup\n publish '/announce', Dashboard.to_json\n end\n\n faye = self\n...
ruby
chosen
[ { "from": "system", "value": "Change user to instance variable\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n\n def create\n user = User.find_by_username(params[:username])\n if user && user.authenticate(params[:password])\n session[:user_id] = ...
ruby
chosen
[ { "from": "system", "value": "Fix order cycle selection on products page\n" }, { "from": "human", "value": "Deface::Override.new(:virtual_path => \"spree/home/index\",\n :insert_before => \"[data-hook='homepage_products']\",\n :partial => \"order_cycl...
ruby
chosen
[ { "from": "system", "value": "Add class documentation for SubscriptionEstimator\n" }, { "from": "human", "value": "class SubscriptionEstimator\n def initialize(subscription)\n @subscription = subscription\n end\n\n def estimate!\n assign_price_estimates\n assign_fee_estimates\n end\...
ruby
chosen
[ { "from": "system", "value": "Move hets_workers_count method up, read settings.yml\n\nFirst, the method `hets_workers_count` was not visible in the configure\nblock. Moving it up fixes this.\n\nSecond, the Rails environment is not available. Loading the yml file\nmanually fixes this.\n" }, { "from":...
ruby
chosen
[ { "from": "system", "value": "Fix name and gem dependencies\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'omniauth_tictail/version'\n\nGem::Specification.new do |spec|\n spec.auth...
ruby
chosen
[ { "from": "system", "value": "Remove Rails 2.1 handling code from noosfero HTTP caching code\n" }, { "from": "human", "value": "module NoosferoHttpCaching\n\n def self.included(c)\n c.send(:after_filter, :noosfero_set_cache)\n c.send(:before_filter, :noosfero_session_check_before)\n c....
ruby
chosen
[ { "from": "system", "value": "Use class name instead of to_s for resource names\n" }, { "from": "human", "value": "require 'wright/util/stolen_from_activesupport'\n\nmodule Wright\n module Util\n def self.class_to_resource_name(klass)\n underscore(klass.to_s).split('/').last\n end\n ...
ruby
chosen
[ { "from": "system", "value": "Update to simple substrings solution\n" }, { "from": "human", "value": "# Simple Substrings\n\n# I worked on this challenge by myself.\n\n\n# Your Solution Below\n\ndef welcome(address)\n if address.include?('CA') == true\n return 'Welcome to California'\n else...
ruby
chosen
[ { "from": "system", "value": "Improve preloading of order query to avoid N+1 queries\n" }, { "from": "human", "value": "module Api\n class OrdersController < BaseController\n def show\n authorize! :read, order\n render json: order, serializer: Api::OrderDetailedSerializer\n end\...
ruby
chosen
[ { "from": "system", "value": "Remove ivars, don't need em\n" }, { "from": "human", "value": "class Api::ScriptController < ApplicationController\n def show\n @script = Rails.cache.fetch ['script', 'to-json'] do\n @lines = Line.includes(:character, :quote).order('id ASC').map do |l|\n ...
ruby
chosen
[ { "from": "system", "value": "Split status check queries into groups of 500 to avoid timeouts\n" }, { "from": "human", "value": "class Api::StatusController < Api::ApplicationController\n before_action :require_api_key\n\n def check\n if params[:projects].any?\n @projects = params[:pro...
ruby
chosen
[ { "from": "system", "value": "Change error message on missing timestamp\n" }, { "from": "human", "value": "require 'rake/task.rb'\nrequire 'rake/early_time'\nrequire_relative './table.rb'\n\nmodule Rake\n # #########################################################################\n # A TableTa...
ruby
chosen
[ { "from": "system", "value": "Fix applied from Michael Guterl.\n" }, { "from": "human", "value": "require \"xml\"\nrequire 'test/unit'\n\nclass TestNS < Test::Unit::TestCase\n def test_ns\n node = XML::Node.new('foo')\n ns = XML::NS.new(node, 'http://www.mynamespace.com', 'my_namepace')\n...
ruby
chosen
[ { "from": "human", "value": "Add Lunchy (golang version) v0.1.4\n" }, { "from": "gpt", "value": "cask :v1 => 'lunchy' do\n version '0.1.4'\n sha256 'b6f7d1efa33fe651ad2efba8ab24f8ba618f369bef872afa3ab6ae78a003b39a'\n\n url \"https://github.com/sosedoff/lunchy-go/releases/download/v#{version}/...
ruby
chosen
[ { "from": "system", "value": "Add PATH caveats to MacTeX Cask\n\nWarns user that they may need to add the mactex `/usr/texbin` directory to their\nPATH manually, as the package does not seem to do this or symlink automatically.\n\nFixes #2277.\n\nSee also [this comment](https://github.com/phinze/homebrew-ca...
ruby
chosen
[ { "from": "system", "value": "Fix `url` stanza comment for QtPass.\n" }, { "from": "human", "value": "cask 'qtpass' do\n version '1.1.3'\n sha256 'd2488cf342a7b470564481423dbf6b5a07789c41e7a39c7a44a027b6c2b0b054'\n\n url \"https://github.com/IJHack/qtpass/releases/download/v#{version}/qtpass-...
ruby
chosen
[ { "from": "human", "value": "Add Raptor Chess Interface v98u3f5\n" }, { "from": "gpt", "value": "cask :v1 => 'raptor' do\n version '98u3f5'\n sha256 'e19dc03ab5e0f7bb17179ce4bcf364211cee3928d7182d3db1dd0c4cf7ee87e0'\n\n url \"http://raptor-chess-interface.googlecode.com/files/Raptor_v#{versio...
ruby
chosen
[ { "from": "system", "value": "Update minitest requirement from ~> 4 to ~> 5\n\nUpdates the requirements on [minitest](https://github.com/seattlerb/minitest) to permit the latest version.\n- [Release notes](https://github.com/seattlerb/minitest/releases)\n- [Changelog](https://github.com/seattlerb/minitest/b...
ruby
chosen
[ { "from": "system", "value": "Change dependency to < Rails 4.2" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire 'rubygems' unless defined? Gem\nrequire File.dirname(__FILE__) + \"/lib/polymorpheus/version\"\n\nGem::Specification.new do |s|\n s.name = \"polymorpheus\"\n...
ruby
chosen