conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Switch DatabaseCleaner strategy to :deletion.\n\nThis greatly improves the speed of the test suite.\n\n`DatabaseCleaner.strategy = :transaction`:\n\n docker-compose exec web bin/rspec 0,56s user 0,21s system 0% cpu 24:25,34 total\n\n`DatabaseCleaner.strategy = :deletion`:\n...
ruby
chosen
[ { "from": "system", "value": "Improve error message when `snappy` is not available\n" }, { "from": "human", "value": "module Kafka\n class SnappyCodec\n def initialize\n require \"snappy\"\n end\n\n def codec_id\n 2\n end\n\n def compress(data)\n Snappy.deflate(dat...
ruby
chosen
[ { "from": "system", "value": "Remove any `data-` attributes too.\n" }, { "from": "human", "value": "# Original source: http://www.slightlytallerthanaverageman.com/2010/02/22/jekyll-feedburner-and-global-urls/#comment-599796216\n\nmodule Jekyll\n module FixRSS\n\n def fix_rss(input)\n in...
ruby
chosen
[ { "from": "system", "value": "Remove brackets for consistent style\n" }, { "from": "human", "value": "module Mailman\n class Middleware\n attr_reader :entries\n\n def initialize\n @entries = []\n yield self if block_given?\n end\n\n def add(klass)\n entries << klass\n...
ruby
chosen
[ { "from": "system", "value": "Stop using a magic number for MOD's ID\n" }, { "from": "human", "value": "count = 0\n# for each document that is a news article in MOD\nDocument.find_by_sql(\"SELECT d.* FROM documents d left join editions e on d.id = e.document_id left join edition_organisations eo...
ruby
chosen
[ { "from": "system", "value": "Make the function dumber so that it doesn't try to guess.\n" }, { "from": "human", "value": "module Refinery\n module Helpers\n module SiteBarHelper\n\n # Generates the link to determine where the site bar switch button returns to.\n def site_bar_switc...
ruby
chosen
[ { "from": "system", "value": "Fix matcher deprecation warning on time specs.\n" }, { "from": "human", "value": "require 'spec_helper'\ndescribe Likeable::Like do\n before do\n @time = Time.now\n end\n describe 'attributes' do\n it 'stores target, user, and created_at' do\n like = L...
ruby
chosen
[ { "from": "system", "value": "Remove extraneous code from Optional combinator\n" }, { "from": "human", "value": "require_relative 'combinator'\n\nmodule Saxinator\n class Optional < ::Saxinator::Combinator\n def initialize(child, return_result: false, &block)\n super\n @child = chi...
ruby
chosen
[ { "from": "system", "value": "Fix bug when a flag/option doesn’t have a value\n" }, { "from": "human", "value": "require 'yaml'\n\nclass Divide::Extractor\n def initialize(options=[])\n @procfile_content = File.read('./Procfile') rescue ''\n @options = options\n\n overwrite_options\n ...
ruby
chosen
[ { "from": "system", "value": "Fix issue with using wrong method in migration command\n" }, { "from": "human", "value": "module Weighable\n module ActiveRecord\n module MigrationExtensions\n module Table\n def weighable(column)\n column \"#{column}_value\", :decimal, prec...
ruby
chosen
[ { "from": "system", "value": "Remove call to non-existant before_update hook in Admin::VariantsController decorator\n" }, { "from": "human", "value": "Spree::Admin::VariantsController.class_eval do\n update.before :before_update\n\n respond_override :update => {:html => {\n :success => lamb...
ruby
chosen
[ { "from": "system", "value": "Update package specs to pass on Amazon Linux\n\nThe version is updated all the time here so we can't rely on anything in the tests\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "\ndescribe command('/...
ruby
chosen
[ { "from": "system", "value": "Use start_with? instead of regexp match\n" }, { "from": "human", "value": "module Dnsimple\n\n class Error < StandardError\n end\n\n # RequestError is raised when an API request fails for an client, a server error or invalid request information.\n class RequestE...
ruby
chosen
[ { "from": "system", "value": "Use OpenSSL::Digest instead of deprecated OpenSSL::Digest::Digest\n" }, { "from": "human", "value": "require 'fog/core'\nrequire 'uri'\n\nmodule Fog\n module Cloudstack\n\n extend Fog::Provider\n\n service(:compute, 'cloudstack/compute','Compute')\n\n @@di...
ruby
chosen
[ { "from": "system", "value": "Change :single_access_token :null to true\n\nThis prevents blank api_key values from being valid.\n" }, { "from": "human", "value": "class AddSingleAccessTokenToInvisionUser < ActiveRecord::Migration\n def self.up\n add_column :ibf_members, :single_access_token,...
ruby
chosen
[ { "from": "system", "value": "Fix gemspec to point to correct test files\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\n\nrequire \"minitest-fastfail/version\"\n\nGem::Specificat...
ruby
chosen
[ { "from": "system", "value": "Add method for displaying date in words\n" }, { "from": "human", "value": "class Transaction < ActiveRecord::Base\n belongs_to :request\n\n validates :transaction_type, inclusion: { in: ['request', 'response', 'fulfillment'] }\n\n def self.sort_by_group(group)\n ...
ruby
chosen
[ { "from": "system", "value": "Fix an misuse of regex\n" }, { "from": "human", "value": "module MIPS\n SYNTAX = /^\\s*((?<tag>[a-zA-Z]\\w*)\\s*:\\s*)?((?<cmd>[a-z]+)\\s*((?<arg1>\\$?\\w+)\\s*(,\\s*((?<arg2>\\$?\\w+)|((?<offset>\\d+)\\(\\s*(?<arg2>\\$\\w+)\\s*\\)))\\s*(,\\s*(?<arg3>\\$?\\w+)\\s*)...
ruby
chosen
[ { "from": "system", "value": "Test for document key & attributes\n" }, { "from": "human", "value": "## ------------------------------------------------------------------- \n## \n## Copyright (c) \"2014\" Dmitri Zagidulin and Basho Technologies, Inc.\n##\n## This file is provided to you under the...
ruby
chosen
[ { "from": "system", "value": "Add spec for new PropertyWithMixin ignore option\n\nChange-Id: Ifc7d552844e8bdc9c117c2719b53ef9f76d6bb40\nReviewed-on: http://gerrit.causes.com/40956\nTested-by: jenkins <d95b56ce41a2e1ac4cecdd398defd7414407cc08@causes.com>\nReviewed-by: Shane da Silva <67fb7bfe39f841b16a1f86d3...
ruby
chosen
[ { "from": "system", "value": "Fix work to pass the message\n" }, { "from": "human", "value": "require 'messenger/version'\nrequire 'messenger/listeners'\nrequire 'messenger/workers'\nrequire 'messenger/railtie' if defined?(Rails)\n\nclass Messenger\n\n attr_accessor :listener, :worker\n\n clas...
ruby
chosen
[ { "from": "system", "value": "Add check for unset up options\n" }, { "from": "human", "value": "# Configure module responds to 'nehm configure' command\nmodule Configure\n def self.menu\n loop do\n puts 'Download path: ' + Paint[PathControl.dl_path, :magenta] if PathControl.dl_path\n ...
ruby
chosen
[ { "from": "system", "value": "Use ActiveSupport::Autoload so that we don't even load the PostmarkRails::DeliveryMethod module in newer versions.\n" }, { "from": "human", "value": "require 'action_mailer'\nrequire 'postmark'\nrequire 'postmark-rails/delivery_method'\n\nmodule PostmarkRails\n ext...
ruby
chosen
[ { "from": "system", "value": "Refactor render code into callable module function\n" }, { "from": "human", "value": "require 'action_controller'\nrequire 'rqrcode'\nrequire 'rqrcode-rails3/size_calculator.rb'\nrequire 'rqrcode-rails3/renderers/svg.rb'\n\nmodule RQRCode\n Mime::Type.register \"im...
ruby
chosen
[ { "from": "system", "value": "Revert \"Get rid of method for field name constant\"\n\n* This reverts commit d3e4d699f1838a5945fcdc455dea4b80786fc93f.\n* I was wrong, this method is used in specs and that is probably a good\n thing...\n" }, { "from": "human", "value": "require 'curb'\n\nmodule S...
ruby
chosen
[ { "from": "system", "value": "Add environment scope to the rake tasks\n" }, { "from": "human", "value": "namespace :deploy do\n task :create_rails_directories do\n puts \"creating log/ and tmp/ directories\"\n Dir.chdir(Rails.root)\n system(\"mkdir -p log tmp\")\n end\n\n task :bundl...
ruby
chosen
[ { "from": "system", "value": "Deploy to staging by default\n" }, { "from": "human", "value": "require 'package_builder'\n\nnamespace :deploy do\n desc \"Build an application package\"\n task :build do\n PackageBuilder.build!\n end\n\n desc \"Build and deploy the website to the staging sta...
ruby
chosen
[ { "from": "system", "value": "Revert \"Removes jasmine tests from running on Travis for now.\"\n\nThis reverts commit af68f7b4c258f5908f57b14e4047c2240c8b2a0b.\n" }, { "from": "human", "value": "namespace :travis do\n\n desc \"Runs rspec specs on travis\"\n task :run_specs do\n [\"rspec spe...
ruby
chosen
[ { "from": "system", "value": "Fix deprecation warning for Enumerable.sum\n\nCampaignCsvBuilder#sum_wiki_columns was throwing warnings whenever it would sum a column that included non-numeric values, since Rails has deprecated the Rails implementation of Enumerable.sum in favor of the native Ruby version.\n\...
ruby
chosen
[ { "from": "system", "value": "Switch schema when switching tenant\n" }, { "from": "human", "value": "module Tenanted\n module Model\n def postgresql?\n connection.adapter_name == 'PostgreSQL'\n end\n\n def tenanted\n self.table_name = \"public.#{self.table_name}\" if postgres...
ruby
chosen
[ { "from": "system", "value": "Test better expression building for solver [skip ci]\n" }, { "from": "human", "value": "require_relative \"test_helper\"\n\nclass LinearTest < Minitest::Test\n # https://developers.google.com/optimization/lp/glop\n def test_solver\n solver = ORTools::Solver.new...
ruby
chosen
[ { "from": "human", "value": "Add a scraper for the the howard theatre website\n" }, { "from": "gpt", "value": "require_relative 'grabber'\n\nclass GrabTheHowardTheatre < Grabber\n # get the array of urls to grab from\n def grab_urls\n # The url that list all the shows\n [\n \"http:/...
ruby
chosen
[ { "from": "system", "value": "Add @api private to toplevel namespace\n" }, { "from": "human", "value": "# frozen_string_literal: true\nrequire 'timetrack/version'\nrequire 'timetrack/parser'\n\n# Entrypoint for gem\nmodule Timetrack\nend\n" }, { "from": "gpt", "value": "# frozen_stri...
ruby
chosen
[ { "from": "system", "value": "Fix Faraday test adapter to actually use Faraday for POSTing\n" }, { "from": "human", "value": "require 'faraday'\nclass FaradayAdapter < HTTPBaseAdapter\n def send_get_request\n conn = Faraday.new(:url => \"#{@protocol}://#{@host}:#{@port}\") do |faraday|\n ...
ruby
chosen
[ { "from": "system", "value": "Add Spec to Check for Login (Clients)\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe ClientsController, :type => :controller do\n before do\n login\n @client = Client.make!\n end\n \n it \"#index is 200\" do\n get :index\n expe...
ruby
chosen
[ { "from": "system", "value": "Modify Float multiply spec to be_close with a TOLERANCE multiplied by a similar scale as the value under test.\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/../../spec_helper'\n\ndescribe \"Float#*\" do\n it \"returns self multiplied by othe...
ruby
chosen
[ { "from": "system", "value": "Use .my.cnf to connect to the database\n" }, { "from": "human", "value": "\nENV[\"RAILS_ENV\"] = \"test\"\n\n# Boot rails application and testing parts ...\nrequire \"fixtures/rails_app/config/environment\"\nrequire \"rails/test_help\"\n\n# As we are simulating the ...
ruby
chosen
[ { "from": "system", "value": "Refactor Organisation spec to test methods\n\nAs per:\nhttps://github.com/alphagov/hmrc-contacts/pull/113#commitcomment-5908997\nI've refactored this test to test the actual methods in Organisation.rb\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndes...
ruby
chosen
[ { "from": "system", "value": "Change bin spec describes to contexts\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'open3'\n\nRSpec.describe 'bin/toy_robot' do\n subject do\n Open3.popen3('bin/toy_robot') do |i, o|\n commands.each { |command| i.puts command }\n i...
ruby
chosen
[ { "from": "system", "value": "Add Errno::ENETUNREACH to exception list in BasicNetworkResolver\n\nFixes #1621" }, { "from": "human", "value": "module Middleman\n class DnsResolver\n # Use network name server to resolve ips and names\n class BasicNetworkResolver\n private\n\n att...
ruby
chosen
[ { "from": "system", "value": "Replace Pending with a valid example\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Customer do\n pending \"add some examples to (or delete) #{__FILE__}\"\nend\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Cust...
ruby
chosen
[ { "from": "human", "value": "Test boilerplate for company contact match routine\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\n# TODO https://github.com/NetSweet/netsuite_rails/issues/16\n# there are still some unresolved issues with NS datetime/date conversions\n# the tests + impleme...
ruby
chosen
[ { "from": "system", "value": "Test for network errors when retrieving comments\n" }, { "from": "human", "value": "require 'spec_helper'\n\nmodule USaidWat\n module Client\n describe Client do\n before(:each) do\n WebMock.disable_net_connect!\n WebMock.reset!\n root ...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 2.5.4.0 to 2.5.5.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'evt-messaging'\n s.version = '2.5.4.0'\n s.summary = 'Common primitives for platform-specific messaging im...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.13.0.0 to 0.14.0.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'evt-messaging'\n s.version = '0.13.0.0'\n s.summary = 'Messaging primitives for Eventide'\n s.descripti...
ruby
chosen
[ { "from": "system", "value": "Revert \"Moving Rackspace logic to fog-rackspace\"\n\nThis reverts commit d6ecb19d24503d432d84042753afa1304648d055.\n\nConflicts:\n\tfog.gemspec\n" }, { "from": "human", "value": "def dns_providers\n {\n :aws => {\n :mocked => false\n },\n :b...
ruby
chosen
[ { "from": "system", "value": "Load from yaml file on require\n" }, { "from": "human", "value": "require 'forwardable'\nrequire 'pathname'\nrequire 'rubygems'\nrequire 'singleton'\nrequire 'yaml'\n\nrequire 'axe/hooks'\nrequire 'webdriver_script_adapter/execute_async_script_adapter'\n\nmodule Axe...
ruby
chosen
[ { "from": "system", "value": "Use Dir.pwd instead of File.absolute_path\n" }, { "from": "human", "value": "require \"dotenv\"\nrequire \"dotenv/deployment/version\"\n\nrails_root = File.absolute_path(\"./\")\n\n# Load defaults from .env or *.env in config\nDotenv.load('.env')\nDotenv.load(*Dir.g...
ruby
chosen
[ { "from": "system", "value": "Change the msgpack_object_type values for msgpack-0.5.0.\n" }, { "from": "human", "value": "require 'ffi'\n\nmodule FFI\n module MsgPack\n extend FFI::Library\n\n typedef :pointer, :FILE\n\n enum :msgpack_unpack_return, [\n :success, 2,\n :extra_...
ruby
chosen
[ { "from": "system", "value": "Add wrong formatter custom error.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule GithubCLI\n\n class GithubCLIError < StandardError\n def self.status_code(code)\n define_method(:status_code) { code }\n end\n end\n\n # Raised when a conf...
ruby
chosen
[ { "from": "system", "value": "Add some seed data for the demo\n" }, { "from": "human", "value": "# This file should contain all the record creation needed to seed the database with its default values.\n# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup...
ruby
chosen
[ { "from": "system", "value": "Fix typo, &:sym -> &sym\n" }, { "from": "human", "value": "require \"max_value/version\"\n\nmodule MaxValue\nend\n\nmodule Enumerable\n def max_value(sym, &block)\n sorter = block ? block : sym\n max_by(&sorter).send(sym)\n end\n\n def min_value(sym, &block...
ruby
chosen
[ { "from": "system", "value": "Sort table entries by id\n" }, { "from": "human", "value": "module ActiveCucumber\n\n class Cucumparer\n\n def initialize clazz, cucumber_table\n @clazz = clazz\n @cucumber_table = cucumber_table\n end\n\n # Returns all entries in the database as...
ruby
chosen
[ { "from": "system", "value": "Put base_url into a constant\n" }, { "from": "human", "value": "require 'oauth'\nrequire 'flexirest'\nrequire 'addressable'\n\nmodule Oneroster\n class ApiBase < Flexirest::Base\n cattr_accessor :consumer_key, :consumer_secret\n\n def self.api_auth_credential...
ruby
chosen
[ { "from": "system", "value": "Allow setting components_paths as an array\n" }, { "from": "human", "value": "require \"pathname\"\n\n# Toplevel module for all things concerning RogerStyleGuide\nmodule RogerStyleGuide\n # The path within project.html_path where the components reside\n def self.c...
ruby
chosen
[ { "from": "system", "value": "Set ivars instead of calling attr writers\n\nrefs #2\n" }, { "from": "human", "value": "module ROM\n class Mapper\n\n class Loader\n include Concord.new(:header, :model), Adamantium\n\n def call(tuple)\n header.each_with_object(model.allocate) {...
ruby
chosen
[ { "from": "system", "value": "Update capybara header customize method\n" }, { "from": "human", "value": "require 'trice/errors'\n\nmodule Trice\n module SpecHelper\n def self.extract_time(runtime, static_time, block)\n block ? runtime.instance_eval(&block) : static_time\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Fix indentation in logs controller\n" }, { "from": "human", "value": "class LogsController < ApplicationController\n \n before_filter :authenticate\n \n def index\n @logs = Log.all\n end\n\n def show\n @log = Log.find(params[:id])\n end\n\n def new\n ...
ruby
chosen
[ { "from": "system", "value": "Set up Oil controller actions\n" }, { "from": "human", "value": "class OilsController < ApplicationController\nend\n" }, { "from": "gpt", "value": "class OilsController < ApplicationController\n before_action :set_oil, only: [:show, :edit, :update, :des...
ruby
chosen
[ { "from": "system", "value": "Set retries option for SlackJobs\n" }, { "from": "human", "value": "class SlackJobs\n class InviterJob < SlackJobs\n include Sidekiq::Worker\n\n def perform(email)\n Raven.user_context email: email\n Raven.tags_context slack_invite: 'yes'\n\n S...
ruby
chosen
[ { "from": "system", "value": "Update seed file to create admin user\n" }, { "from": "human", "value": "# This file should contain all the record creation needed to seed the database with its default values.\n# The data can then be loaded with the rake db:seed (or created alongside the db with db...
ruby
chosen
[ { "from": "human", "value": "Add a minimal gemspec file\n" }, { "from": "gpt", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire 'dbt/version'\n\nGem::Specification.new do |s|\n s.name = %q{dbt}\n s.version = Dbt::VERSION\n s...
ruby
chosen
[ { "from": "system", "value": "Check registration email in feature test\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'Registration', :type => :feature, feature: true, js: true do\n let(:email){ \"sergey#{rnd}@makridenkov.com\" }\n\n it 'shows errors when invalid data' d...
ruby
chosen
[ { "from": "system", "value": "Remove dependency to test recipe\n" }, { "from": "human", "value": "name 'varnish'\nmaintainer 'Opscode, Inc.'\nmaintainer_email 'cookbooks@opscode.com'\nlicense 'Apache 2.0'\ndescription 'Installs and configures varnish'\nversion '1.0.0'\n\nrecipe 'varnish', 'Insta...
ruby
chosen
[ { "from": "human", "value": "Add migration to merge task_owners and notifications tables into task_users.\n" }, { "from": "gpt", "value": "class MigrateToTaskUsers < ActiveRecord::Migration\n def self.up\n say_with_time \"Copying task watchers and owners to task_user\" do\n Task.all.eac...
ruby
chosen
[ { "from": "system", "value": "Switch back to pessimistic version constraint\n\nChange-Id: Ie7038d8d971cedc0bc487c9b9373b444b66ed66d\nPartial-Bug: #1425192\n" }, { "from": "human", "value": "name 'openstack-common'\nmaintainer 'openstack-chef'\nmaintainer_email 'opscode-chef-ope...
ruby
chosen
[ { "from": "system", "value": "Remove last piece of mock Rails\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe DataTiering::Sync do\n\n subject { described_class }\n\n before do\n Rails = double(:env => double(:test? => true))\n subject::SyncLog.delete_all\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Convert specs to RSpec 3.0.0 syntax with Transpec\n\nThis conversion is done by Transpec 2.2.4 with the following command:\n transpec\n\n* 2 conversions\n from: obj.stub(:message)\n to: allow(obj).to receive(:message)\n\n* 1 conversion\n from: obj.should_receive(:...
ruby
chosen
[ { "from": "system", "value": "Update wrapper cookbook name to opsworks_kibana\n" }, { "from": "human", "value": "name 'kibana'\nmaintainer 'Andrew Jo'\nmaintainer_email 'andrew@verdigris.co'\nlicense 'Simplified BSD'\ndescription 'Installs and configures Kibana'\n...
ruby
chosen
[ { "from": "system", "value": "Fix to run under Chef <12\n" }, { "from": "human", "value": "name 'redisio'\nmaintainer 'Brian Bianco'\nmaintainer_email 'brian.bianco@gmail.com'\nlicense 'Apache 2.0'\ndescription 'Installs/Configures redis'\nlong_description IO.read...
ruby
chosen
[ { "from": "system", "value": "Drop apt version pin to avoid conflicts\n\napt is often pinned in many places, and is generally safe to leave\nunpinned. To avoid transistive depsolving pain, this will be unpinned\nfor now\n" }, { "from": "human", "value": "name 'zookeeper'\nmaintainer ...
ruby
chosen
[ { "from": "system", "value": "Update depency for apache2 rather than httpd\n" }, { "from": "human", "value": "name \"tideways\"\nversion \"0.2.0\"\nmaintainer \"Rupert Jones\"\nmaintainer_email \"rjones@inviqa.com\"\nlicense \"Apache 2.0\"\ndescription \"Install and configure tideways daemon and...
ruby
chosen
[ { "from": "system", "value": "Update platform versio in podspec\n" }, { "from": "human", "value": "Pod::Spec.new do |spec|\n spec.name = 'ConstructorAutocomplete'\n spec.version = '2.5.2'\n spec.license = { :type => 'MIT', :file => 'LICENSE' }\n spec.homepage = 'https:/...
ruby
chosen
[ { "from": "system", "value": "Add description and summary to gemspec.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'tokaido/dns/version'\n\nGem::Specification.new do |gem...
ruby
chosen
[ { "from": "system", "value": "Change Shop to a singlton class to clean up the current call.\n" }, { "from": "human", "value": "module ShopifyAPI\n # Shop object. Use Shop.current to receive\n # the shop.\n class Shop < Base\n def self.current(options={})\n find(:one, options.merge({fr...
ruby
chosen
[ { "from": "system", "value": "Add minitest as development dependency.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"fpm/cookery/version\"\n\nGem::Specification.new do |s|\n s.name = \"fpm-cookery\"\n s.version ...
ruby
chosen
[ { "from": "system", "value": "Add temporary key param to api/map/ to access kool_woodtory records.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass Api::ScoresApiController < Api::ApiController\n resource_description do\n resource_id 'records'\n end\n\n def_param_g...
ruby
chosen
[ { "from": "system", "value": "Upgrade Rake version from \"~> 11.3\" to \"~> 12.0\"\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'rubicure_fuzzy_match/version'\n\nGem::Specification...
ruby
chosen
[ { "from": "system", "value": "Handle log file location for centos and rhel where runit isnt used\n" }, { "from": "human", "value": "#\n# Author:: Joshua Timberman <joshua@opscode.com>\n# Author:: Joshua Sierles <joshua@37signals.com>\n# Cookbook Name:: chef\n# Attributes:: client\n#\n# Copyright...
ruby
chosen
[ { "from": "system", "value": "Make Rails Dependency Less Specific\n\nThe current version that the rails dependency is locked to is restricting apps from updating for security patches. Locking to `~> 4.2.0` should allow for any non-breaking rails updates to be applied." }, { "from": "human", "val...
ruby
chosen
[ { "from": "human", "value": "Add script to make frontend command\n" }, { "from": "gpt", "value": "# Make executable file to be located as ${PREFIX}/bin/nullarihyon\n# make_frontend.rb [bin dir path] [tool path] [lib prefix for clang (prefix/lib/nullarihyon/1.2.3/clang)] [frontend dir path])\")\n...
ruby
chosen
[ { "from": "system", "value": "Fix Van Ness parse error\n\n(We had elevator (99, \"Muni: Van Ness street elevator Out of Service\")\n" }, { "from": "human", "value": "require 'faraday'\nrequire 'nokogiri'\n\nrequire 'models'\n\nclass MuniApiError < StandardError; end\n\nclass MuniApi # SF Muni\n ...
ruby
chosen
[ { "from": "system", "value": "Correct RegEx for assertion for mcrouter config\n\nDamned whitespace\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'mcrouter::default' do\n context 'installs mcrouter to the $PATH' do\n describe command 'which mcrouter' do\n its(:stdo...
ruby
chosen
[ { "from": "system", "value": "[aphrodite] Update status history and percentage\n" }, { "from": "human", "value": "class Base\n def self.before_perform(*args)\n logging('start', args)\n store_status('start', args.first)\n end\n\n def self.after_perform(*args)\n logging('end', args)\n ...
ruby
chosen
[ { "from": "system", "value": "Update spec to use environment file\n" }, { "from": "human", "value": "require_relative 'spec_helper.rb'\n\ndescribe 'timevalue' do\n it 'should be initialized with 0 as defaults' do\n time_value = TimeValue.new()\n expect(time_value.n).to eq(0)\n \n end\...
ruby
chosen
[ { "from": "system", "value": "Package version increased from 0.1.0.0 to 0.1.1.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'serialize'\n s.version = '0.1.0.0'\n s.summary = 'Common interface for serialization and deserialization, and...
ruby
chosen
[ { "from": "system", "value": "Remove item from purchased items instead of items\n" }, { "from": "human", "value": "require_relative './db.rb'\nrequire_relative './item.rb'\n\n# User information including purchase history\nclass User\n extend DB\n attr_accessor :id, :name\n\n # Many-to-many re...
ruby
chosen
[ { "from": "system", "value": "Remove missing file from gemspec\n\nSo that bundle does not complain each time.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"capistrano-scrip/version\"\n\nGem::Specification.new do |s|\n s.n...
ruby
chosen
[ { "from": "system", "value": "Use a datestamp so each build has a different version\n" }, { "from": "human", "value": "\nname 'ganeti'\nmaintainer 'Lance Albertson'\nhomepage 'https://code.google.com/p/ganeti/'\n\ninstall_path '/opt/ganeti'\n#build_version Omnibus::BuildVersion.new.semver\n...
ruby
chosen
[ { "from": "system", "value": "Move hive package check into its own section and do symlink test for CentOS\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'hadoop::hive' do\n context 'on Centos 6.4 x86_64' do\n let(:chef_run) do\n ChefSpec::Runner.new(platform: 'cent...
ruby
chosen
[ { "from": "human", "value": "Add code wars (7) - number pairs\n" }, { "from": "gpt", "value": "# http://www.codewars.com/kata/563b1f55a5f2079dc100008a\n# --- iteration 1 ---\ndef get_larger_numbers(a, b)\n a.zip(b).map(&:max)\nend\n" } ]
ruby
chosen
[ { "from": "system", "value": "Use the all_verbs roda plugin so we can use additional HTTP verbs\n" }, { "from": "human", "value": "require \"bugsnag\"\nrequire \"rack/csrf\"\nrequire \"dry-web-roda\"\nrequire \"main/container\"\nrequire \"roda_plugins\"\n\nmodule Main\n class Application < Dry:...
ruby
chosen
[ { "from": "system", "value": "Change port also in app.js\n" }, { "from": "human", "value": "def import_config\n\tconfig_file_lines = File.readlines \"./moscow_mule.config\"\n\tconfig_file_lines.each do |config_line|\n\t\tif config_line.index(\"location_features\")\n\t\t\t@location_features = con...
ruby
chosen
[ { "from": "system", "value": "Declare our compatibility with iOS 6 to cocoapods\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n\n s.name = \"SmartDeviceLink-iOS\"\n s.version = \"4.0.0-alpha.3\"\n s.summary = \"Connect your app with cars!\"\n s.homepage = \"ht...
ruby
chosen
[ { "from": "system", "value": "Remove layout on user mailer\n" }, { "from": "human", "value": "class UserMailer < ApplicationMailer\n default from: \"welcome@holyimage.baidu.com\"\n layout \"mailer\"\n\n def welcome(user, url)\n @user = user\n @url = url\n mail(to: @user.email, subjec...
ruby
chosen
[ { "from": "system", "value": "Change connection in HousingData model\n" }, { "from": "human", "value": "class HousingData < ActiveRecord::Base\n establish_connection :housing_data\n self.table_name = 'hpp_view'\n self.primary_key = :muni_id\n\n belongs_to :municipality, foreign_key: 'mu...
ruby
chosen
[ { "from": "system", "value": "Make kWh produced and kWh consumed available\n" }, { "from": "human", "value": "class MarketModel < ActiveRecord::Base\n include Privacy\n\n FOUNDATIONS = %w(\n connections kWh kW_connection kW_max kW_contracted\n flex_realised flex_potential\n )\n\n PRESE...
ruby
chosen
[ { "from": "system", "value": "Add support for pre_condition with functions\n\nThis commit adds support for using the pre_condition\nhook to specify the source code that should be used to\ncompile a catalog that can be introspected by functions for\ntesting purposes.\n\nThis allows users to test functions th...
ruby
chosen
[ { "from": "human", "value": "Add rake task to register a taxonomy email signup page\n\nCreate a content item at the base path /taxonomy-email-signup. The\nemail-alert-frontend app will be updated to serve signup pages at this\nendpoint, allowing users to subscribe to content changes in the\ntaxonomy.\n" }...
ruby
chosen
[ { "from": "system", "value": "Add uninstall stanza to LastPass Universal\n" }, { "from": "human", "value": "class LastpassUniversal < Cask\n url 'https://lastpass.com/lpmacosx.dmg'\n homepage 'https://lastpass.com/'\n version 'latest'\n no_checksum\n install 'lpmacosx.pkg'\nend\n" }, { ...
ruby
chosen