conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Upgrade activemodel to 4.x series\n\nThis is needed to be able to upgrade PlanningAlerts to Rails 4.x since\nthis gem is included in the PlanningAlerts bundle.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH...
ruby
chosen
[ { "from": "human", "value": "Add config for historic highlands\n" }, { "from": "gpt", "value": "namespace :after_party do\n desc 'Deployment task: add_historic_highlands'\n task add_historic_highlands: :environment do\n puts \"Running deploy task 'add_historic_highlands'\"\n\n reading_fi...
ruby
chosen
[ { "from": "system", "value": "Refactor extended hook to be simpler\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule Axiom\n module Types\n\n # Add a minimum and maximum value constraint to a type\n module ValueComparable\n\n # Hook called when module is extended\n ...
ruby
chosen
[ { "from": "system", "value": "Improve test to ensure records are successfully created\n" }, { "from": "human", "value": "require File.expand_path(File.join(File.dirname(__FILE__),'..','test_helper'))\nrequire File.expand_path(File.join(File.dirname(__FILE__),'..','support/active_record'))\n\ncla...
ruby
chosen
[ { "from": "system", "value": "Set Norwegian snowball as the default analyzer.\n" }, { "from": "human", "value": "#\n# Module used to share config among model (indeces)\n#\n\nmodule TireSettings\n module_function\n\n def default\n {\n analysis: {\n analyzer: {\n norwegia...
ruby
chosen
[ { "from": "system", "value": "Make AM work out of the box on Rails.\n" }, { "from": "human", "value": "require 'rails/generators'\nrequire 'rails/generators/actions'\n\nclass PrequelGenerator < Rails::Generators::Base\n\n def create_files\n initializer(\"prequel.rb\") do\n <<-EOI\nrequi...
ruby
chosen
[ { "from": "system", "value": "Allow compilation on platforms besides JRuby\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/pdf_ravager/version', __FILE__)\n\nGem::Specification.new do |s|\n s.name = \"pdf_ravager\"\n s.version = PDFRava...
ruby
chosen
[ { "from": "system", "value": "Resolve duplication reported by reek\n\noptions[:omission] was being retrieved twice causing \"duplication\"\n" }, { "from": "human", "value": "module TruncateHtml\n class HtmlTruncator\n\n def initialize(original_html)\n @original_html = original_html\n ...
ruby
chosen
[ { "from": "human", "value": "Add Zest.app v0.1.0-alpha2 (latest, no stable available)\n" }, { "from": "gpt", "value": "cask 'zest' do\n version '0.1.0-alpha2'\n sha256 '04bbe71994c7f14d4efcdfa81aac382cc75da75a98aaa875a5ccf964837daf7c'\n\n url \"https://github.com/zestdocs/zest/releases/downlo...
ruby
chosen
[ { "from": "system", "value": "Use multi (which also makes an implicit pipeline) instead of an explicit pipeline. c/o @cyx\n" }, { "from": "human", "value": "require 'later/version'\nrequire 'redis'\nrequire 'nest'\n\nmodule Later\n class Schedule\n def key\n @key\n end\n\n def ini...
ruby
chosen
[ { "from": "system", "value": "Fix for minor bug that caused GFF3ParseFile to classify some comment lines as records\n" }, { "from": "human", "value": "\n\nmodule Bio\n\n module GFFbrowser\n\n class GFF3ParseFile\n attr_reader :records, :sequences\n\n include FastLineParser\n \...
ruby
chosen
[ { "from": "human", "value": "Allow places front end app to be run as its own standalone app\n" }, { "from": "gpt", "value": "# This file is used by Rack-based servers to start the application.\n\nrequire ::File.expand_path('../config/environment', __FILE__)\nrequire 'places_front_end/app'\n\nap...
ruby
chosen
[ { "from": "system", "value": "Make sure state is cloned with an element\n" }, { "from": "human", "value": "\nmodule Bio\n module BioAlignment\n\n # Simple element that can be queried\n class Element\n GAP = '-'\n UNDEFINED = 'X'\n include State\n\n def initialize c\n ...
ruby
chosen
[ { "from": "human", "value": "Add Thor tasks for dealing with TM bundles\n" }, { "from": "gpt", "value": "class Tm < Thor\n desc 'update', 'Update all installed TextMate user bundles'\n def update\n bundles_path = File.expand_path('~/Library/Application Support/TextMate/Bundles')\n if Fil...
ruby
chosen
[ { "from": "system", "value": "Remove inheritance from ternary class\n" }, { "from": "human", "value": "Dir[File.dirname(__FILE__) + '/lib/**/*.rb'].each {|file| require file }\n\nclass TernaryExpression < Expression::Base\n def initialize(variable_terminals, depth)\n super\n @operand_2 = ...
ruby
chosen
[ { "from": "system", "value": "Update command updated (all by myself!)\nadded the ability to request the inventory to be listed again _during_ the update loop.\n" }, { "from": "human", "value": "require_relative 'lib/inventory'\n\nputs \"Welcome, entrepreneur! Below is a list of your starting inv...
ruby
chosen
[ { "from": "system", "value": "Add in chimpdoc configuration template.\n" }, { "from": "human", "value": "require \"dropbox_sdk\"\n\nclass DropboxSetup\n\n attr_accessor :app_key, :app_secret, :access_token_key, :access_token_secret\n\n def initialize\n @app_key = nil\n @app_secret = nil\...
ruby
chosen
[ { "from": "system", "value": "Use absolute values in if statements\n" }, { "from": "human", "value": "solution = 1 + rand(1000)\nguesses = []\nputs solution # This statement is temporary while I test the game.\nputs \"Guess what number I'm thinking of. It's between 1 and 1000\"\nguess = gets.to_...
ruby
chosen
[ { "from": "system", "value": "Fix Duet recipe: Do not delete apple provided file when uninstalling\n" }, { "from": "human", "value": "cask :v1 => 'duet' do\n version '1.2.9'\n sha256 'de45914dd00923e372a1d2aa205f4d14e27dd005c228af093a8e9a95d7516951'\n\n # devmate.com is the official download ...
ruby
chosen
[ { "from": "system", "value": "Update MAMP & MAMP PRO to v3.1" }, { "from": "human", "value": "cask :v1 => 'mamp' do\n version '3.0.7.3'\n sha256 '840877041af7a06d50a3ddc67030ae4f193f70add473ebad0f7418daf80cd553'\n\n url \"http://downloads4.mamp.info/MAMP-PRO/releases/#{version}/MAMP_MAMP_PRO_...
ruby
chosen
[ { "from": "system", "value": "Add acceptance test to check for idempotency for memory plugin\n" }, { "from": "human", "value": "require 'spec_helper_acceptance'\n\ndescribe 'collectd class' do\n context 'default parameters' do\n # Using puppet_apply as a helper\n it 'works idempotently wi...
ruby
chosen
[ { "from": "system", "value": "Update require spec to reflect normal use of Model.append_extensions.\n" }, { "from": "human", "value": "shared_examples_for \"require 'dm-constraints'\" do\n\n it \"should include the constraint api in the DataMapper namespace\" do\n DataMapper::Model.respond_t...
ruby
chosen
[ { "from": "system", "value": "Add tests for break out methods\n" }, { "from": "human", "value": "require \"nokogiri\"\nrequire \"spec_helper\"\n\ndescribe \"html output\" do \n before :all do\n newsletter = TrelloNewsletter.new\n VCR.use_cassette(\"Newsletter generate\", :allow_playback_r...
ruby
chosen
[ { "from": "system", "value": "Fix Red Herring having color indicator and P/T due to collision with uncard\n" }, { "from": "human", "value": "class PatchReconcileOnSetPriority < Patch\n # If something is missing, it will fail validation later on,\n # only pass what you'd like to see reconciled ...
ruby
chosen
[ { "from": "system", "value": "Use more human-friendly CSV headers\n" }, { "from": "human", "value": "class Record\n attr_accessor :created_at, :meeting_date, :club_name, :leaders, :attendance,\n :notes\n\n def initialize(created_at, meeting_date, club_name, leaders, attendance,\...
ruby
chosen
[ { "from": "system", "value": "Use case-when to be rubyish\n" }, { "from": "human", "value": "require 'active_support/core_ext/hash/indifferent_access'\nrequire 'active_support/string_inquirer'\n\nmodule ParamsInquirer\n class Parameters < ActiveSupport::HashWithIndifferentAccess\n def initia...
ruby
chosen
[ { "from": "system", "value": "Remove integration spec for will_paginate\n" }, { "from": "human", "value": "require 'spec_helper'\n\n#describe \"will_paginate\" do\n# it \"should give translations for will_paginate\" do\n# I18n.t(\"will_paginate.next_label\").should == \"Next &#8594;\"\n# en...
ruby
chosen
[ { "from": "system", "value": "Add implicit? to role entity\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Shamu\n module Security\n class RoleEntity < ::Shamu::Entities::Entity\n model :role\n\n # @!attribute\n # @return [Symbol]\n attribute :i...
ruby
chosen
[ { "from": "system", "value": "Fix compatibility with rails 4.2.3\n" }, { "from": "human", "value": "require \"ar_transaction_changes/version\"\n\nmodule ArTransactionChanges\n if (ActiveRecord::VERSION::MAJOR == 4 && ActiveRecord::VERSION::MINOR >= 2) || ActiveRecord::VERSION::MAJOR > 4\n de...
ruby
chosen
[ { "from": "system", "value": "Add a disconnected event to TransportManager\n" }, { "from": "human", "value": "require 'lifx/observable'\n\nmodule LIFX\n # @api private\n module TransportManager\n class Base\n include Logging\n include Observable\n attr_accessor :context\n\n ...
ruby
chosen
[ { "from": "system", "value": "Allow browser-specific fullscreen tags on iframes\n" }, { "from": "human", "value": "require 'govspeak/html_sanitizer'\n\nclass Govspeak::HtmlSanitizer\n def sanitize_config\n # Original code\n config = Sanitize::Config::RELAXED.dup\n config[:attributes][:...
ruby
chosen
[ { "from": "system", "value": "Add GitHub homepage to gemspec\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'agate/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Add rake task to copy angular templates to public directory\n" }, { "from": "human", "value": "# desc \"Explaining what the task does\"\n# task :sapphire_cms do\n# # Task goes here\n# end\n" }, { "from": "gpt", "value": "# desc \"Copies angular templat...
ruby
chosen
[ { "from": "human", "value": "rpearce: Add missing spec test for name_server\n" }, { "from": "gpt", "value": "require 'stacks/test_framework'\n\ndescribe_stack 'nameserver' do\n given do\n stack \"nameserver\" do\n virtual_nameserver 'ns'\n end\n\n env \"e1\", :primary_site=>\"spac...
ruby
chosen
[ { "from": "system", "value": "Fix matcher and add one for property\n" }, { "from": "human", "value": "hash_like_named = proc do |name|\n match do |actual|\n actual.respond_to?(:name) ? actual.name : actual['name']\n end\n\n diffable\nend\n\nRSpec::Matchers.define(:a_parameter_named, &hash_...
ruby
chosen
[ { "from": "system", "value": "Fix bad variable name in tests\n" }, { "from": "human", "value": "require 'spec_helper'\n\nclass MockDisplay\nend\n\ndescribe TicTacToe do\n\n it 'has a version number' do\n expect(TicTacToe::VERSION).not_to be nil\n end\n\n describe TicTacToe::Game do\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add a suitable middleman for lookup tests\n" }, { "from": "human", "value": "require 'spec_helper'\n\nclass LookupSpec < MiniTest::Spec\n describe \"Realtime::Lookup\" do\n it \"collects updates based on an entry\" do\n entry = {\n \"uid\" ...
ruby
chosen
[ { "from": "system", "value": "Index should be a symbol\n" }, { "from": "human", "value": "class <%= migration_name %> < ActiveRecord::Migration\n\n def self.up\n create_table :<%= admin_users_table_name %> do |t|\n t.string :first_name, :default => \"\", :null => false\n t.string :...
ruby
chosen
[ { "from": "human", "value": "Add italian mobile and home phone numbers\n" }, { "from": "gpt", "value": "# encoding: utf-8\n\nmodule Faker\n module PhoneNumberIT\n extend ModuleUtils\n extend self\n\n def phone_number\n if rand(0..1) == 1\n home_phone_number\n else\n ...
ruby
chosen
[ { "from": "system", "value": "Rename symKeys to sym_keys for style.\n" }, { "from": "human", "value": "module NetAppManageability\n class NAMHash < Hash\n undef_method :id if self.method_defined? :id\n undef_method :type if self.method_defined? :type\n undef_method :size if self.m...
ruby
chosen
[ { "from": "human", "value": "Add facter fact to determine DR node\n\nThis fact will return true if the machine is a DR node.\n" }, { "from": "gpt", "value": "# Boolean fact which is true if node is part of the\n# DR cluster\n\ndef dr_node?\n env_octet = Facter.value(:ipaddress).split('.')[2].to...
ruby
chosen
[ { "from": "human", "value": "Create rspec test of user instance\n" }, { "from": "gpt", "value": "require \"spec_helper\"\nrequire \"rails_helper\"\nrequire \"usuario\"\nrequire \"usuarios_controller\"\n\ndescribe UsuariosController do\n\tdescribe \"POST\" do\n\t\tit \"Create User\" do\n\t\t\t@us...
ruby
chosen
[ { "from": "system", "value": "Update Coda to latest version" }, { "from": "human", "value": "class Coda < Cask\n url 'https://panic.com/coda/d/Coda%202.0.12.zip'\n homepage 'https://panic.com/Coda/'\n version '2.0.12'\n sha1 '7157f0213edf39aca296c8bc4cb5a0e6f5ca6f75'\n link 'Coda 2.app'\nen...
ruby
chosen
[ { "from": "system", "value": "Use the string value in the serialized version\n" }, { "from": "human", "value": "require 'json'\nmodule Perpetuity\n class Postgres\n class Serializer\n attr_reader :mapper\n\n def initialize mapper\n @mapper = mapper\n end\n\n def se...
ruby
chosen
[ { "from": "system", "value": "Simplify the test and make sure Ruby 1.9x stop complaining\n" }, { "from": "human", "value": "require 'test_helper'\n\n# ActiveValidators relies on another gem called \"date_validator\" edited\n# by the fine folks at Codegram.\n#\n# If you wanna see tests for this g...
ruby
chosen
[ { "from": "system", "value": "Update filter by date in refscore to use ranges\n" }, { "from": "human", "value": "class BtsAccount < ActiveRecord::Base\n DATE_SCOPES = ['Today', 'Yesterday', 'This week', 'Last week', 'This month', 'Last month', 'All']\n\n belongs_to :user\n\n validates :name, ...
ruby
chosen
[ { "from": "human", "value": "Add rake task to Publish Finders to content store\n" }, { "from": "gpt", "value": "namespace :publishing_api do\n desc \"Publish all Finders to the Publishing API\"\n task :publish_finders do\n require \"publishing_api_finder_publisher\"\n\n require \"multi_j...
ruby
chosen
[ { "from": "human", "value": "Add rake task to encrypt branch names\n" }, { "from": "gpt", "value": "require 'knapsack_pro'\n\nnamespace :knapsack_pro do\n task :encrypted_branch_names, [:branch] do |_, args|\n branch = args[:branch]\n\n branches =\n if branch\n [branch]\n ...
ruby
chosen
[ { "from": "system", "value": "Allow passing as a param\n" }, { "from": "human", "value": "module Tito\n class OAuth2Middleware < FaradayMiddleware::OAuth2\n def call(env)\n token = if @token.is_a?(Proc)\n @token.call(env)\n else\n @token\n end\n\n token ||=...
ruby
chosen
[ { "from": "system", "value": "Use the data_migration template instead of the standard table_migration\n" }, { "from": "human", "value": "require 'rails/generators/active_record/migration/migration_generator'\n\nclass DataMigrationGenerator < ActiveRecord::Generators::MigrationGenerator\n source...
ruby
chosen
[ { "from": "system", "value": "Fix bug with multiple arguments in attach_channel\n" }, { "from": "human", "value": "# TextConversation is an interaction that only consists of messages and is\n# limited to a single channel on Slack.\nmodule Hackbot\n module Interactions\n class TextConversatio...
ruby
chosen
[ { "from": "human", "value": "Add spec for file fetcher\n" }, { "from": "gpt", "value": "require 'resume/file_fetcher'\n\nmodule Resume\n RSpec.describe FileFetcher do\n describe '.fetch' do\n let(:file) { 'filename' }\n let(:block) { Proc.new { } }\n let(:fetch_file) { describ...
ruby
chosen
[ { "from": "system", "value": "Load rails first then require anything extra - otherwise we may get\nerrors regarding the expected version of rails (especially if you have\nmultiple and later versions of rails installed via gems).\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'act...
ruby
chosen
[ { "from": "system", "value": "Switch from test/spec to peck. Ditch mocha.\n" }, { "from": "human", "value": "# encoding: utf-8\n\n$:.unshift(File.expand_path('../../ext/glib', __FILE__))\n$:.unshift(File.expand_path('../../lib', __FILE__))\n\n$KCODE = 'UTF8' unless 'string'.respond_to?(:encoding...
ruby
chosen
[ { "from": "system", "value": "Raise unless the config is in database.yml\n" }, { "from": "human", "value": "$:.unshift(File.dirname(__FILE__))\n\nrequire 'test/unit'\nrequire 'flexmock/test_unit'\nrequire 'pp'\n\nrequire File.dirname(__FILE__) + '/../lib/adapter_extensions'\n\n############## TOD...
ruby
chosen
[ { "from": "system", "value": "Remove rubyforge project specification reference\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'fakes'\n s.version = '1.1.6'\n s.platform = Gem::Platform::RUBY\n s.authors = ['Develop Wit...
ruby
chosen
[ { "from": "system", "value": "Use 2.0 instead of latest for Semulov.app\n" }, { "from": "human", "value": "class Semulov < Cask\n version 'latest'\n sha256 :no_check\n\n url 'http://www.kainjow.com/downloads/Semulov.zip'\n homepage 'http://www.kainjow.com'\n\n link 'Semulov.app'\nend\n" }...
ruby
chosen
[ { "from": "system", "value": "Use hard-links when copying into cache.\n\n2.0.0 causes disk to fill\n\n[#145211249]\n\nSigned-off-by: Dave Goddard <bfcdf3e6ca6cef45543bfbb57509c92aec9a39fb@goddard.id.au>\n" }, { "from": "human", "value": "# Encoding: utf-8\n# ASP.NET Core Buildpack\n# Copyright 2...
ruby
chosen
[ { "from": "system", "value": "Exclude macos files on tvOS\n" }, { "from": "human", "value": "require 'json'\n\npackage = JSON.parse(File.read(File.join(__dir__, 'package.json')))\n\nPod::Spec.new do |s|\n s.name = 'RNSVG'\n s.version = package['version']\n s.summary ...
ruby
chosen
[ { "from": "system", "value": "Change service provider file suffix\n" }, { "from": "human", "value": "module Dee\n module Rails\n class Loader\n class << self\n def load!\n Dir.glob(providers_glob_path).each do |file|\n require file\n end\n end\...
ruby
chosen
[ { "from": "system", "value": "Handle nil variable in check_passes. This wouldn't have compiled in Scala\n" }, { "from": "human", "value": "class Card < ActiveRecord::Base\n attr_accessible :mirror_id, :pass_id\n belongs_to :pass\n\n before_destroy :remove_from_timeline\n\n def remove_from_ti...
ruby
chosen
[ { "from": "system", "value": "Remove require for nonexistent file\n" }, { "from": "human", "value": "# frozen_string_literal: true\nrequire \"graphql/language/block_string\"\nrequire \"graphql/language/printer\"\nrequire \"graphql/language/definition_slice\"\nrequire \"graphql/language/document_...
ruby
chosen
[ { "from": "system", "value": "Remove unneeded lambda in User model validation" }, { "from": "human", "value": "class User < ActiveRecord::Base\n has_many :assignments\n\n validates :first_name, :last_name, :spire, :email, :phone,\n presence: true\n validates :spire, :email, :phone,...
ruby
chosen
[ { "from": "system", "value": "Update copyright year to 2013\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule Nanoc\n\n # The current nanoc version.\n VERSION = '3.4.4'\n\n # @return [String] A string containing information about this nanoc version\n # and its environment (Rub...
ruby
chosen
[ { "from": "system", "value": "Simplify lag node and fix old module name in fdiff\n" }, { "from": "human", "value": "require 'nodus/version'\nmodule Nodus\n module Node\n class Lag\n def initialize(size)\n @size = size\n @buff = @size > 1 ? Array.new(@size, nil) : nil\n ...
ruby
chosen
[ { "from": "system", "value": "Add missing files to gemspec.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nGem::Specification.new do |gem|\n gem.authors = [\"Chris Lowder\"]\n gem.email = [\"clowder@gmail.com\"]\n gem.description = %q{AES encrypted attributes ...
ruby
chosen
[ { "from": "system", "value": "Remove v from tag to support spm\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n\n s.name = 'Verso'\n s.version = '1.0.4'\n s.summary = 'A multi-paged image viewer for iOS'\n s.description = <<-DESC\n Verso makes i...
ruby
chosen
[ { "from": "system", "value": "Include logic to render form for ajax request\n" }, { "from": "human", "value": "class CommentsController < ApplicationController\n\n def new\n @trail = Trail.find(params[:trail_id])\n @comment = Comment.new\n render :new\n end\n\n def create\n @comme...
ruby
chosen
[ { "from": "system", "value": "Handle signup with invalid email/password\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n\n def new\n end\n\n def create\n render 'new'\n end\n\n def delete\n end\nend\n" }, { "from": "gpt", "value": "class ...
ruby
chosen
[ { "from": "human", "value": "Create sessions controller with all actions\n" }, { "from": "gpt", "value": "class SessionsController < ApplicationController\n\n def new\n\n end\n\n def create\n @user = User.find_by(username: session_params[:username])\n\n if @user && @user.authenticate(se...
ruby
chosen
[ { "from": "system", "value": "Add a post install message\n" }, { "from": "human", "value": "Gem::Specification.new do |spec|\n spec.name = 'buildr-iidea'\n spec.version = `git describe`.strip.split('-').first\n spec.authors = ['Rhett Sutphin', 'Peter Donald']\n spec.e...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary subject on spec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Neighborly::Balanced::Creditcard::Interface do\n subject { Neighborly::Balanced::Creditcard::Interface.new }\n let(:contribution) { double('Contribution', id: 4...
ruby
chosen
[ { "from": "system", "value": "Use images to get registry pods instead of [internal-]services\n" }, { "from": "human", "value": "class ContainerImageRegistry < ApplicationRecord\n belongs_to :ext_management_system, :foreign_key => \"ems_id\"\n has_many :container_images, :dependent => :nullify\...
ruby
chosen
[ { "from": "system", "value": "Add comment for include module after function definitions.\n" }, { "from": "human", "value": "module Embeddable\n class OpenResponse < ActiveRecord::Base\n include Embeddable\n \n\n attr_accessible :name, :prompt, :is_prediction, :give_prediction_feedback,...
ruby
chosen
[ { "from": "system", "value": "Use map + inject for average degree\n" }, { "from": "human", "value": "module Zxcvbn\n module Math\n def bruteforce_cardinality(password)\n is_type_of = {}\n\n password.each_byte do |ordinal|\n case ordinal\n when (48..57)\n is_t...
ruby
chosen
[ { "from": "system", "value": "Check SSL certificates when loading from a website\n" }, { "from": "human", "value": "require \"net/http\"\nrequire \"uri\"\n\nclass LicenceIdentifierMigrator\n LICENCE_MAPPING_URL = \"https://raw.github.com/alphagov/licence-finder/correlation_id_migration/data/lic...
ruby
chosen
[ { "from": "human", "value": "Add SecuritySensor to list of supported devices\n" }, { "from": "gpt", "value": "class MiOS::Device::SecuritySensor < MiOS::Device::Generic\n ServiceId = \"urn:micasaverde-com:serviceId:SecuritySensor\"\n\n def armed\n @attributes['armed'].to_i == 1\n end\n al...
ruby
chosen
[ { "from": "system", "value": "Add useful error message to bad config exception" }, { "from": "human", "value": "module RailsMysql\n class ConfigurationError < StandardError; end\n class DatabaseConfig\n\n def self.from_yaml(env, file='config/database.yml')\n self.new(YAML.load_file(fil...
ruby
chosen
[ { "from": "system", "value": "Support query params in call to /corpora\n" }, { "from": "human", "value": "module Rglossa\n class CorporaController < ApplicationController\n respond_to :json, :xml\n\n def index\n @corpora = Corpus.all\n respond_with @corpora\n end\n\n\n def...
ruby
chosen
[ { "from": "system", "value": "Add alias for display_price to display_cost for ShippingRate\n" }, { "from": "human", "value": "module Spree\n class ShippingRate < ActiveRecord::Base\n belongs_to :shipment, class_name: 'Spree::Shipment'\n belongs_to :shipping_method, class_name: 'Spree::Shi...
ruby
chosen
[ { "from": "system", "value": "Add homepage URL to gemspec.\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"luhnmod10\"\n s.version = \"1.0.0\"\n s.platform = Gem::Platform::RUBY\n s.authors = \"Leigh McCulloch\"\n s.licenses = \"M...
ruby
chosen
[ { "from": "system", "value": "Add CompCert 3.5 to the list of flaky Makefiles\n" }, { "from": "human", "value": "# A list of packages with errors which we chose to ignore (for now). It\n# contains an exact package name together with a string which should be\n# included in the error message.\n\nB...
ruby
chosen
[ { "from": "system", "value": "Add support for extra_attributes under options" }, { "from": "human", "value": "require 'casino/authenticator'\nrequire 'faker'\n\nclass CASino::TestAuthenticator\n # @param [Hash] options\n def initialize(options)\n @options = options\n end\n\n def validate(...
ruby
chosen
[ { "from": "system", "value": "Send status information for processes.\n" }, { "from": "human", "value": "module Cognizant\n module Server\n module Commands\n def self.load(config_file)\n Cognizant::Server.daemon.load(config_file)\n yield(\"OK\")\n end\n\n def self...
ruby
chosen
[ { "from": "system", "value": "Add a new load command from client.\n" }, { "from": "human", "value": "module Cognizant\n module Server\n module Commands\n def self.status(*args)\n if process = args.shift\n Cognizant::Server.daemon.processes.each do |name, p|\n ...
ruby
chosen
[ { "from": "system", "value": "Remove the qpid require. Simplify callback.\n" }, { "from": "human", "value": "# @abstract Poor Man's version of a FlightAware client\n#\n# @author Ollivier Robert <ollivier.robert@eurocontrol.int>\n# @copyright 2015 by Ollivier Robert for ECTL\n\n# External modules...
ruby
chosen
[ { "from": "system", "value": "Add helper for CircleCI detection\n" }, { "from": "human", "value": "require 'inch_ci/worker/build_json/task'\n\nmodule InchCI\n module Worker\n module BuildJSON\n def self.json(filename)\n JSONDump.new(filename)\n end\n\n class JSONDump\n ...
ruby
chosen
[ { "from": "system", "value": "Delete old, invalid labels during the migration to fix them\n" }, { "from": "human", "value": "class AddGithubIdToLabels < ActiveRecord::Migration[5.1]\n def change\n add_column :labels, :github_id, :integer\n end\nend\n" }, { "from": "gpt", "value"...
ruby
chosen
[ { "from": "system", "value": "Add controller action to delete the email with given id." }, { "from": "human", "value": "require_dependency \"letter_opener_web/application_controller\"\n\nmodule LetterOpenerWeb\n class LettersController < ApplicationController\n def index\n @letters = Le...
ruby
chosen
[ { "from": "system", "value": "Update GPCM race minimum and maximum\n" }, { "from": "human", "value": "module Competitions\n module GrandPrixBradRoss\n class Overall < Competitions::Overall\n include GrandPrixBradRoss::Common\n\n before_create :set_name\n\n def minimum_events\n...
ruby
chosen
[ { "from": "system", "value": "Update gemspec for 0.0.5 release\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'hocon'\n s.version = '0.0.4'\n s.date = '2014-07-23'\n s.summary = \"HOCON Config Library\"\n s.description = \"== A port of the ...
ruby
chosen
[ { "from": "human", "value": "Update member_id primary and foreign keys to bigint\n" }, { "from": "gpt", "value": "class ChangeMemberIdToBigint < ActiveRecord::Migration[6.0]\n def up\n change_column :members, :id, :bigint\n\n change_column :committee_members, :member_id, :bigint\n end\n\...
ruby
chosen
[ { "from": "human", "value": "NEW: Add tutorial enrolments to db\n" }, { "from": "gpt", "value": "class CreateTutorialEnrolments < ActiveRecord::Migration\n def change\n create_table :tutorial_enrolments do |t|\n\n t.timestamps null: false\n end\n add_reference :tutorial_enrolments...
ruby
chosen
[ { "from": "system", "value": "Use operation pool for aggregates.\n" }, { "from": "human", "value": "module Aggro\n # Private: Provides an interface to communicate with an aggregate or saga.\n # Only loads the target object when needed.\n class Channel < Struct.new(:id, :type)\n de...
ruby
chosen
[ { "from": "system", "value": "Move coercion logic to Action::Request.new" }, { "from": "human", "value": "module Substation\n class Action\n\n class Request\n\n extend Forwardable\n\n attr_reader :action\n attr_reader :session\n attr_reader :params\n\n def_delegator ...
ruby
chosen
[ { "from": "system", "value": "Allow new call to RemoteCensusApi on CensusCaller\n\nWhen Setting[\"feature.remote_census\"] is active, we allow and\nability the calls to new RemoteCensusAPI througth CensusCaller\n" }, { "from": "human", "value": "class CensusCaller\n\n def call(document_type, do...
ruby
chosen
[ { "from": "system", "value": "Remove dependence on curriculum from Work\n" }, { "from": "human", "value": "class Work\n attr_reader :user\n\n def initialize(user)\n @user = user\n end\n\n def random\n shuffled.reduce(nil) do |acc, (language, slug)|\n acc || Pick.new(user, language...
ruby
chosen
[ { "from": "human", "value": "Add a class for cleaning up old post.issues.\n" }, { "from": "gpt", "value": "# This is a one-off class which does closes all unresolved Velkomat issues of 2012\n# The reason for this cleanup is that we wrongly included year in the post.issue external_id.\n# If you r...
ruby
chosen
[ { "from": "system", "value": "Fix up some stuff so we write correct YAML\n" }, { "from": "human", "value": "# Adventures in word wrapping. I found this code online but it's not working\n# Don't use for now\n# class String\n# def wrap(width=78)\n# self.gsub(/(.{1,#{width}})(\\s+|\\Z)/, \"\\...
ruby
chosen
[ { "from": "system", "value": "Fix missing i, tests passing.\n" }, { "from": "human", "value": "\nclass Conway\n attr_reader :grid\n\n def initialize\n @grid = Grid.new 53, 7\n end\nend\n\nclass Grid\n attr_reader :width, :heigth, :fields\n\n def initalize(width, heigth)\n @width, @hei...
ruby
chosen