conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Remove old Tag creation helper method\n\nTag creation used a private method to find tags if they existed and\ncreate new records when one could not be found. This is now handled\nentrirely in the 'from_string' method with Rails' 'find_or_create_by'.\n" }, { "from": "hum...
ruby
chosen
[ { "from": "human", "value": "Add tests for CalculatingAugmentedRecords class\n" }, { "from": "gpt", "value": "require 'test_helper'\nclass CalculatingAugmentedRecordsTest < ActiveSupport::TestCase\n include ::Validators\n\n def setup\n @product_test = FactoryBot.create(:product_test_static_...
ruby
chosen
[ { "from": "system", "value": "Create the directories before we try to download the tar and CD into a\ndirectory that might not exist\n\n\nFormer-commit-id: 9adbfba33e9f8ddeeb5eb2c28b58911e56fa92d4 [formerly 57554f6e8a52c05e1060ca88daecbcb79c87f5fe] [formerly 8b8359aacd9cdc7fc214713b5a54ab86d907eed4 [formerl...
ruby
chosen
[ { "from": "system", "value": "Add missing migration to down\n" }, { "from": "human", "value": "class AddColumnsForHumanlyTimes < ActiveRecord::Migration\n def self.up\n add_column :shops, :weekday, :string\n add_column :shops, :saturday, :string\n add_column :shops, :sunday, :string\n ...
ruby
chosen
[ { "from": "human", "value": "Add a test for dynamic created_at serialization\n" }, { "from": "gpt", "value": "require 'test_helper'\n\ndescribe CheckinSerializer do\n let(:checkin) { create :checkin }\n\n describe '#created_at' do\n subject do\n serializer = CheckinSerializer.new check...
ruby
chosen
[ { "from": "system", "value": "Make `Radiant.detail do |config| config.define ...; end` work again\n" }, { "from": "human", "value": "RADIANT_ROOT = File.expand_path(File.join(File.dirname(__FILE__), \"..\")) unless defined? RADIANT_ROOT\n\nmodule Radiant\n class << self\n def detail\n R...
ruby
chosen
[ { "from": "human", "value": "Create new image controller for deleting image attachments\n" }, { "from": "gpt", "value": "class ImageAttachmentsController < ApplicationController\n\n def delete\n @photo = ActiveStorage::Attachment.find(params[:id])\n @photo.purge\n redirect_back fallbac...
ruby
chosen
[ { "from": "human", "value": "Add script to dump header file ( not complete )\n" }, { "from": "gpt", "value": "#!/usr/bin/ruby\n\nXcodePath = \"/Developer/Applications/Xcode.app\"\nLibraryPaths = [\"/Contents/Frameworks/IDEFoundation.framework\",\n\t\t\t\t\"/Contents/Frameworks/IDEKit.framework\"...
ruby
chosen
[ { "from": "system", "value": "Allow the `id` attribute in the prefs controller\n" }, { "from": "human", "value": "# frozen_string_literal: true\nmodule Thredded\n class PreferencesController < Thredded::ApplicationController\n before_action :thredded_require_login!,\n :init_...
ruby
chosen
[ { "from": "system", "value": "Use AWS installer for installing CodeDeploy agent\n" }, { "from": "human", "value": "remote_file \"#{Chef::Config[:file_cache_path]}/codedeploy-agent.rpm\" do\n source \"https://s3.amazonaws.com/aws-codedeploy-us-east-1/latest/codedeploy-agent.noarch.rpm\"\nend\n...
ruby
chosen
[ { "from": "human", "value": "Add additional fields to person\n" }, { "from": "gpt", "value": "class AddDetailsToPerson < ActiveRecord::Migration\n def change\n add_column :people, :is_member, :boolean\n add_column :people, :congregation, :string\n add_column :people, :baptism_date, :da...
ruby
chosen
[ { "from": "system", "value": "Test that the scope is stored\n" }, { "from": "human", "value": "require \"hiera/backend/aws/base\"\n\nclass Hiera\n module Backend\n describe Aws::Base do\n let(:service) { Aws::Base.new }\n\n describe \"#lookup\" do\n it \"raises an exception...
ruby
chosen
[ { "from": "human", "value": "Add specs for resolving promises and loaded state in ModelController." }, { "from": "gpt", "value": "require 'spec_helper'\n\nif RUBY_PLATFORM != 'opal'\n describe Volt::ModelController do\n it 'should accept a promise as a model and resolve it' do\n control...
ruby
chosen
[ { "from": "human", "value": "Add unit test for MedlineplusRuby::Client.\n" }, { "from": "gpt", "value": "RSpec.describe MedlineplusRuby::Client do\n\n describe 'instance methods' do\n\n describe '#description_data_for_code' do\n\n let(:formatted_response) { 'you win' }\n let(:medli...
ruby
chosen
[ { "from": "system", "value": "Add personal & project info to gemspec." }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'son_jay/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Add entities to the seed\n" }, { "from": "human", "value": "i = 0\n5.times do |x|\n 5.times do |y|\n MapPoint.create!(x: x, y: y, zone: \"Zone#{i}\")\n i += 1\n end\nend\n" }, { "from": "gpt", "value": "i = 0\n5.times do |x|\n 5.times do |y|\n ...
ruby
chosen
[ { "from": "system", "value": "Clarify that the other option for name_or_adapter is to be a class (the Adapter class)\n" }, { "from": "human", "value": "require 'active_job/queue_adapters/inline_adapter'\nrequire 'active_support/core_ext/string/inflections'\n\nmodule ActiveJob\n module QueueAdap...
ruby
chosen
[ { "from": "system", "value": "Make it possible to programatically configure additional timers to expect\n" }, { "from": "human", "value": "#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain ...
ruby
chosen
[ { "from": "system", "value": "Fix bug when no match was found on change." }, { "from": "human", "value": "module LivereloadRails\n class Watcher\n def initialize(paths, matchers:, &update)\n LivereloadRails.logger.debug \"Watching #{paths} for changes.\"\n @watcher = FileWatcher.ne...
ruby
chosen
[ { "from": "system", "value": "Revert \"MongoDB 2.2 has a number of interesting features, one of which is the ability to expire data from a collection based on timestamp (TTL). This feature however only works if the field is of datatime type.\"\n\nThis reverts commit 6e3d200e1d0f299eef6745439029f30f146745f5...
ruby
chosen
[ { "from": "human", "value": "Add LogFormater to be used in non rails projects\n" }, { "from": "gpt", "value": "module LogStasher\n class LogFormatter\n def initialize(tags = [])\n @tags = Array(tags)\n end\n\n def call(severity, datetime, _, data)\n { '@timestamp' => datetime...
ruby
chosen
[ { "from": "system", "value": "Add public header to podspec\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n\n s.name = \"CSSystemInfoHelper\"\n s.version = \"1.4.2\"\n s.license = \"MIT\"\n\n s.summary ...
ruby
chosen
[ { "from": "system", "value": "Remove null bytes from response\n" }, { "from": "human", "value": "class Api::HttpRequestsController < ApplicationController\n skip_before_action :verify_authenticity_token\n def create\n body = Oj.load(request.body.read)\n headers = body['headers'].map{|x| ...
ruby
chosen
[ { "from": "system", "value": "Handle licenses with nonexistent keys\n" }, { "from": "human", "value": "class ExtractExtensionLicenseWorker\n include Sidekiq::Worker\n\n def perform(extension_id)\n @extension = Extension.find(extension_id)\n\n @repo = octokit.repo(@extension.github_repo, ...
ruby
chosen
[ { "from": "human", "value": "Add some examples for mixins\n" }, { "from": "gpt", "value": "module MyMixin\n def say_hello\n puts \"Hello #{name}\"\n end\nend\n\nclass MyClass\n include MyMixin\n\n def name\n \"Dan\"\n end\nend\n\ndescribe \"Mixins\" do\n example \"they can be detecte...
ruby
chosen
[ { "from": "human", "value": "Add rake for encrypting columns in the DB\n" }, { "from": "gpt", "value": "namespace :db do\n task :encrypt_all_columns do\n require 'travis'\n Travis::Database.connect\n\n to_encrypt = {\n Request => [:token],\n SslKey => [:private_key],\n ...
ruby
chosen
[ { "from": "human", "value": "Add API::WSOccupationClient that talks to AMS WSOccupation API\n" }, { "from": "gpt", "value": "require 'arbetsformedlingen/soap_builder'\nrequire 'arbetsformedlingen/api/soap_request'\n\nmodule Arbetsformedlingen\n module API\n class WSOccupationClient\n at...
ruby
chosen
[ { "from": "system", "value": "Write routing tests for edit and update routes\n" }, { "from": "human", "value": "require \"rails_helper\"\n\nRSpec.describe \"Routing to users\", :type => :routing do\n\n it \"routes GET /users/new to users#new\" do\n expect(:get => \"/users/new\").to route_to(...
ruby
chosen
[ { "from": "system", "value": "Update the GCM example file\n" }, { "from": "human", "value": "#!/usr/bin/env bundle exec ruby\n\n$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))\n\nrequire 'ruby-push-notifications'\n\nregistration_ids = [\n 'First registration id here',\n 'Second regi...
ruby
chosen
[ { "from": "system", "value": "Create instance variable that finds current item based on url params\n" }, { "from": "human", "value": "class ItemsController < ApplicationController\n def index\n @items = Item.all\n end\n\n def show\n \n end\n\nend\n" }, { "from": "gpt", "val...
ruby
chosen
[ { "from": "system", "value": "Copy changes from another branch\n" }, { "from": "human", "value": "class UsersController < ApplicationController\n\n def new\n @user = User.new\n render 'new'\n end\n\n def create\n @user = User.new(user_params)\n\n if @user.save\n session[:user...
ruby
chosen
[ { "from": "system", "value": "Change redirect destination after user creation from '@user' to 'new'\n" }, { "from": "human", "value": "class UsersController < ApplicationController\n\n def show\n @user = User.find(params[:id])\n end\n\n def new\n @user = User.new\n end\n\n def create\...
ruby
chosen
[ { "from": "system", "value": "Include number_of_inhabitants with sparse area data\n\nCloses quintel/etmodel#3043\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Api\n module V3\n class AreaPresenter\n # These attributes will be kept as part of the JSON represe...
ruby
chosen
[ { "from": "system", "value": "Improve method and variable names in SectionPresenter\n" }, { "from": "human", "value": "require \"markdown_attachment_processor\"\n\nclass SectionPresenter\n def initialize(section)\n @section = section\n end\n\n delegate :slug, to: :@section\n delegate :tit...
ruby
chosen
[ { "from": "system", "value": "Remove some tests which were making the suite brittle.\n" }, { "from": "human", "value": "describe 'integration' do\n describe Rubyflare, order: :defined do\n context 'given I have valid Cloudflare credentials' do\n let(:email) { ENV['CLOUDFLARE_EMAIL'] }...
ruby
chosen
[ { "from": "system", "value": "Simplify StubbedRepository after GitHost changes from master\n" }, { "from": "human", "value": "# Stubs out all Git repository access done by models so that specs can run\n# against fake repositories without Grit complaining that they don't exist.\nmodule StubbedRep...
ruby
chosen
[ { "from": "system", "value": "Update custom time diff matcher to latest protocol\n\nAdjusted to the updated RSpec 3 MatcherProtocol:\nhttp://www.rubydoc.info/github/rspec/rspec-expectations/RSpec/Matchers/MatcherProtocol\n" }, { "from": "human", "value": "module TimeDiff\n module Matchers\n ...
ruby
chosen
[ { "from": "system", "value": "Update pod version after warning fix.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'POSInputStreamLibrary'\n s.version = '1.0.0'\n s.license = 'MIT'\n s.summary = 'NSInputStream implementation for ALAsset and other ki...
ruby
chosen
[ { "from": "system", "value": "Fix bug in pixi_client gem\n" }, { "from": "human", "value": "module PixiClient\n module Requests\n class GetChangedItemStock < Base\n\n attr_accessor :since, :row_count, :offset, :location_id\n\n def initialize(opts)\n self.since = opts[:since]...
ruby
chosen
[ { "from": "system", "value": "Remove unique validations from model so rspec tests pass\n" }, { "from": "human", "value": "class User < ActiveRecord::Base\n has_many :questions, foreign_key: :asker_id\n has_many :answers, foreign_key: :answerer_id\n has_many :votes, foreign_key: :voter_id\n h...
ruby
chosen
[ { "from": "system", "value": "Add 'belongs_to' association to UserGroup\n" }, { "from": "human", "value": "require_relative '../../config/environment'\n\nclass User < ActiveRecord::Base\n\tinclude BCrypt\n\n\tvalidates\t\t:user_name, uniqueness: true\n\tvalidates \t:password_hash, presence: true...
ruby
chosen
[ { "from": "system", "value": "Add Method User's Full Name To User Model\n\nAdd in a method to display the user's full name to the user model as\nthere will be times that the full name will be used and this will make\nit easier to access it.\n" }, { "from": "human", "value": "class User < ActiveR...
ruby
chosen
[ { "from": "system", "value": "Refactor reminder email spec to use shared examples\n\nWe'll make use of these shared examples when adding next\nreminder email type.\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe ReminderMailer do\n include PermittedDomainHelper\n\n ...
ruby
chosen
[ { "from": "human", "value": "Add completed challenge for accountabilit groups with reflection.\n" }, { "from": "gpt", "value": "# 1) Define a method that take an array.\n# 2) Shuffle the given array.\n# 3) Check length of array.\n# 4) Check if array is divisible by 3, 4, or 5.\n# 5) Return an ar...
ruby
chosen
[ { "from": "system", "value": "Add license field to gemspec.\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.platform = Gem::Platform::RUBY\n\n s.name = \"ffi_gen\"\n s.version = \"1.1.0\"\n s.summary = \"A generator for Ruby FFI bindings\"\n s.description = \"A generato...
ruby
chosen
[ { "from": "system", "value": "Update Code2000 to sha256 checksums\n" }, { "from": "human", "value": "class FontCode2000 < Cask\n url 'http://ftp.freebsd.org/pub/FreeBSD/ports/local-distfiles/thierry/code2000-1.171/CODE2000.ZIP'\n homepage 'http://ftp.freebsd.org/pub/FreeBSD/ports/local-distfil...
ruby
chosen
[ { "from": "human", "value": "Backup of metasploit 4 formula\n" }, { "from": "gpt", "value": "require 'formula'\n\nclass Metasploit < Formula\n homepage 'http://www.metasploit.com/framework/'\n head 'https://github.com/rapid7/metasploit-framework.git'\n url 'https://github.com/rapid7/metasploi...
ruby
chosen
[ { "from": "system", "value": "Call FS commands with sudo" }, { "from": "human", "value": "require 'capistrano/cli'\n\nmodule Elasticsnap\n class FreezeFs\n attr_accessor :mount\n attr_accessor :security_group\n attr_accessor :ssh_user\n\n def initialize(mount: nil, security_group: n...
ruby
chosen
[ { "from": "system", "value": "Add additional logging to clone\n" }, { "from": "human", "value": "module FightClub\n class Repository\n def update(uri, name)\n system(\"mkdir -p #{FightClub.working_dir}/#{name}\") unless Dir.exists? \"#{FightClub.working_dir}/#{name}\"\n\n unless Fi...
ruby
chosen
[ { "from": "system", "value": "Clean up formatting of InvocationChain documentation\n" }, { "from": "human", "value": "module Rake\n\n ####################################################################\n # InvocationChain tracks the chain of task invocations to detect\n # circular dependenci...
ruby
chosen
[ { "from": "system", "value": "Fix randomization of cron intervals\n" }, { "from": "human", "value": "require 'parse-cron'\n\nmodule Sidekiq\n module Dejavu\n module Helper\n def next_timestamp(interval, time = Time.now)\n CronParser.new(interval).next(time).to_f\n rescue Arg...
ruby
chosen
[ { "from": "system", "value": "Refactor listing mailer for a drier, more Railsy solution\n" }, { "from": "human", "value": "class ListingMailer < ApplicationMailer\n\n # donor and donee are the corresponding Users\n def confirm_follow_listing(donor, donee, listing)\n @donor = donor\n @don...
ruby
chosen
[ { "from": "system", "value": "Remove hardcoded date from gemspec\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path(\"../lib\", __FILE__)\nrequire \"penkit/version\"\n\nGem::Specification.new do |s|\n s.name = \"penkit\"\n s.version = Penkit::VERSION\n s.date = \"2017-03-0...
ruby
chosen
[ { "from": "system", "value": "Fix a bug with lambda syntax\n\nRubocop informed me that the lambda method was preferred to -> for\nmultiline lambdas, I fixed this incorrectly by attempting to pass args\nto `lambda`. This fixes that by using block args like you're supposed\nto.\n" }, { "from": "human"...
ruby
chosen
[ { "from": "system", "value": "Use persisted ranking attributes in EffortShowView\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass EffortShowView < EffortWithLapSplitRows\n delegate :event_name, :person, :start_time, :has_start_time?, :stopped?, to: :loaded_effort\n del...
ruby
chosen
[ { "from": "system", "value": "Use a SPDX standard license string\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "name 'chef_handler'\nmaintainer 'Chef Software, Inc.'\nmaintainer_email 'cookbooks@chef.io'\nlicense 'Apache 2.0'\nde...
ruby
chosen
[ { "from": "system", "value": "Read from README.md for long description\n" }, { "from": "human", "value": "#-*- encoding : utf-8 -*-\nmaintainer \"Andrew Jo\"\nmaintainer_email \"andrew@verdigris.co\"\nlicense \"BSD\"\ndescription 'Installs/Configures elasticsearch'\nlong_desc...
ruby
chosen
[ { "from": "system", "value": "Put this in `/usr/bin` because the test box has a weird PATH var\n\n\nFormer-commit-id: 74bf92c9d52527f5736aad44cbe46606f10f329f" }, { "from": "human", "value": "package \"unzip\"\n\nremote_file \"/tmp/awscli-bundle.zip\" do\n source \"https://s3.amazonaws.com/aws-...
ruby
chosen
[ { "from": "system", "value": "Clarify our reason for Monkey Patching\n" }, { "from": "human", "value": "# Loading serverspec first causes a weird error - stack level too deep\n# Requiring rspec first fixes that *shrug*\nrequire 'rspec'\nrequire 'serverspec'\n\n# I hate Monkeys\nclass Specinfra::...
ruby
chosen
[ { "from": "system", "value": "Move stub in Solicitor spec\n" }, { "from": "human", "value": "require \"spec_helper\"\nrequire_relative \"../../app/models/api_model\"\nrequire_relative \"../../app/models/solicitor\"\n\nRSpec.describe Solicitor, \".all\" do\n it \"creates solicitor objects from t...
ruby
chosen
[ { "from": "human", "value": "Add specs for Utils module\n\nChange-Id: I9e7326e3622dba1af4addd7554ca4ce243cd0fc8\nReviewed-on: http://gerrit.causes.com/35579\nReviewed-by: Shane da Silva <6f6e68d1df92f30cb4b3ce35260ddf94a402f33d@causes.com>\nTested-by: Shane da Silva <6f6e68d1df92f30cb4b3ce35260ddf94a402f33d...
ruby
chosen
[ { "from": "system", "value": "Update the list of files in the gemspec\n\n[Fixes #4]\n" }, { "from": "human", "value": "require \"./lib/granola/version\"\n\nGem::Specification.new do |s|\n s.name = \"granola\"\n s.licenses = [\"MIT\"]\n s.version = Granola::VERSION\n s.summary ...
ruby
chosen
[ { "from": "human", "value": "Create a gretting and number increaser program\n" }, { "from": "gpt", "value": "#Full name greeting\nputs \"What is your first name?\"\n\nfirst_name = gets.chomp\n\nputs \"What is your middle name?\"\n\nsecond_name = gets.chomp\n\nputs \"What is your last name?\"\n\n...
ruby
chosen
[ { "from": "system", "value": "Load all of our lib files\n" }, { "from": "human", "value": "$LOAD_PATH.unshift(File.dirname(__FILE__))\nrequire 'elasticsearch_update/version'\nrequire 'elasticsearch_update/downloader'\n\n# This module updates a debian Elasticsearch instance\nmodule ElasticsearchU...
ruby
chosen
[ { "from": "system", "value": "Add thor as a runtime dependency\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\n\nrequire 'runoff/version'\n\nGem::Specification.new do |gem|\n gem.n...
ruby
chosen
[ { "from": "system", "value": "Update paths. Skip files already loaded\n" }, { "from": "human", "value": "module JqGridRails\n class Railtie < Rails::Railtie\n\n rake_tasks do\n require 'jqgrid_rails/tasks'\n end\n\n # We do all our setup in here\n config.to_prepare do\n Ac...
ruby
chosen
[ { "from": "system", "value": "Fix undefined method on NullLogger\n" }, { "from": "human", "value": "require 'roku-packager/key_gen'\nrequire 'roku-packager/uploader'\nrequire 'roku-packager/packager'\n\nmodule RokuPackager\n class Client\n def initialize(development_roku_ip, logger = NullLog...
ruby
chosen
[ { "from": "system", "value": "Add some output to reason codes task\n" }, { "from": "human", "value": "require 'nokogiri'\n\nnamespace :reason_codes do\n # Example invocation: rails reason_codes:import contrib/Reason\\ codes.xml\n task import: :environment do\n file = File.open ARGV[1]\n ...
ruby
chosen
[ { "from": "system", "value": "Expand path so tests can be run in 1.9.2\n" }, { "from": "human", "value": "require 'fog'\nrequire 'fog/bin'\n\nrequire File.join(File.dirname(__FILE__), 'helpers', 'mock_helper')\n\ndef lorem_file\n File.open(File.dirname(__FILE__) + '/lorem.txt', 'r')\nend\n\n# c...
ruby
chosen
[ { "from": "system", "value": "Disable Sourcemap Generation for Tests\n" }, { "from": "human", "value": "# Require any additional compass plugins here.]\nrequire 'sassy-maps'\n\n# File system locations\nsass_dir = 'tests'\ncss_dir = 'output'\n# Import latest breakpoint ...
ruby
chosen
[ { "from": "system", "value": "Add power_down and hero_info tests\n" }, { "from": "human", "value": "require './hero'\r\n\r\ndescribe Hero do\r\n \r\n it \"has a capitalized name\" do\r\n hero = Hero.new 'mike'\r\n\r\n expect(hero.name).to eq 'Mike' # hero.name == 'Mike'\r\n end\r\n\r\n ...
ruby
chosen
[ { "from": "system", "value": "Fix rename of govuk_personalisation concern\n" }, { "from": "human", "value": "class BrexitLandingPageController < ApplicationController\n include GovukPersonalisation::AccountConcern\n include Slimmer::Headers\n\n skip_before_action :set_expiry\n before_action ...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.4.0.1 to 0.4.1.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'schema'\n s.summary = \"Primitives for schema and structure\"\n s.version = '0.4.0.1'\n s.description = '...
ruby
chosen
[ { "from": "human", "value": "Add performance test for poller enqueue\n" }, { "from": "gpt", "value": "# -*- encoding : utf-8 -*-\nrequire './test/test_helper'\nrequire 'benchmark'\n\ndescribe 'Perfromance Poller' do\n X = 10000\n before do\n Sidekiq.redis = REDIS\n Sidekiq.redis do |conn...
ruby
chosen
[ { "from": "system", "value": "Add rake as a development dependency so we get the gem task to release to rubygems.org" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path('../lib', __FILE__)\nrequire 'sunspot/rails/tester'\n\nGem::Specification.new do |s|\n s.name...
ruby
chosen
[ { "from": "system", "value": "Remove `solution_lemma` validation in TextResponseComprehensionSolution\n" }, { "from": "human", "value": "# frozen_string_literal: true\nrequire 'rails_helper'\n\nRSpec.describe Course::Assessment::Question::TextResponseComprehensionSolution, type: :model do\n it ...
ruby
chosen
[ { "from": "system", "value": "Refresh republica data on startup\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"TKCoreDataController\"\n s.version = \"0.0.7\"\n s.summary = \"Controller to simpify settin up a Core Data stack. E.g. asynchronous adding of ...
ruby
chosen
[ { "from": "system", "value": "Add additional patient ids and rpv/renal_reg status to api\n" }, { "from": "human", "value": "def modify_query(url, options={})\n uri = URI(url)\n query_hash = Rack::Utils.parse_query(uri.query)\n query_hash.merge!(options)\n uri.query = Rack::Utils.build_query(...
ruby
chosen
[ { "from": "system", "value": "Add caching of select filters' collections\n" }, { "from": "human", "value": "module ActiveAdmin\n module Inputs\n module Filters\n class SelectInput < ::Formtastic::Inputs::SelectInput\n include Base\n\n def input_name\n return metho...
ruby
chosen
[ { "from": "system", "value": "Refactor Resque adapter to be more consistent with others" }, { "from": "human", "value": "require 'resque'\nrequire 'active_support/core_ext/enumerable'\nrequire 'active_support/core_ext/array/access'\n\nmodule ActiveJob\n module QueueAdapters\n class ResqueAda...
ruby
chosen
[ { "from": "system", "value": "Check if callback url param is valid\n" }, { "from": "human", "value": "module Parametrizer\n module Parsers\n class CallbackUrlParser\n attr_accessor :call_back_url\n\n def initialize(request_params)\n @call_back_url = request_params['call_back...
ruby
chosen
[ { "from": "system", "value": "Remove user resources when removing user\n" }, { "from": "human", "value": "User.class_eval do\n attr_accessible :tag_list, :occupation, :description, :organization, :city, :country, :birthday, :website\n\n delegate :description, :description=,\n :orga...
ruby
chosen
[ { "from": "system", "value": "Remove ability to specify multiple options\n\nI hadn't noticed that this was even possible until removing the ability to pass\na hash of options and next nodes. Irrespective, we're not using this ability so\nI'm removing it.\n" }, { "from": "human", "value": "module...
ruby
chosen
[ { "from": "system", "value": "Create database and user(admin, app).\n" }, { "from": "human", "value": "#\n# Cookbook Name:: migrate\n# Recipe:: default\n#\n# Copyright 2014, YOUR_COMPANY_NAME\n#\n# All rights reserved - Do Not Redistribute\n#\ninclude_recipe 'database::mysql'\n\nmysql_connection...
ruby
chosen
[ { "from": "system", "value": "Fix bug due to frozen non-constant\n\nThis isn't ideal, but avoids changing the behaviour in the test.\n" }, { "from": "human", "value": "# If an env var isn't to specify showing drafts we'll decide it based on Rails\n# environment\nshow_drafts = ENV[\"SHOW_DRAFT_FL...
ruby
chosen
[ { "from": "system", "value": "Allow nulls in widget style\n" }, { "from": "human", "value": "require 'carto/db/migration_helper'\n\ninclude Carto::Db::MigrationHelper\n\nmigration(\n Proc.new do\n alter_table :widgets do\n add_column :style, :json, null: false, default: '{}'\n end\n ...
ruby
chosen
[ { "from": "system", "value": "Remove default_executable, it is deprecated in latest Rubygems with no replacement." }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"sprite\"\n s.version = \"0.2.2\"\n\n s.default_executable = \"sprite\"\n s.executables = [\"sprite\"]\...
ruby
chosen
[ { "from": "system", "value": "Update rake requirement from ~> 12.0 to ~> 13.0\n\nUpdates the requirements on [rake](https://github.com/ruby/rake) to permit the latest version.\n- [Release notes](https://github.com/ruby/rake/releases)\n- [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc)\n- [...
ruby
chosen
[ { "from": "system", "value": "Fix variable definition error in hours controller\n" }, { "from": "human", "value": "class HoursController < ApplicationController\n before_action :authenticate_user!\n def new\n end\n\n def create\n hours = []\n month = Time.now.month\n 7.times do |num...
ruby
chosen
[ { "from": "system", "value": "Modify number of user per_page in pagination\n\n" }, { "from": "human", "value": "class UsersController < ApplicationController\n\n before_action :set_user, only: [:edit, :update, :destroy, :show]\n\n # GET /users\n def index\n # @users = User.all\n ...
ruby
chosen
[ { "from": "system", "value": "Fix bug trying to delete figure\n" }, { "from": "human", "value": "class FiguresController < ApplicationController\n rescue_from ActiveRecord::RecordNotFound, with: :render_404\n\n before_action :authenticate_user!\n\n def create\n figures = Array.wrap(figure_...
ruby
chosen
[ { "from": "system", "value": "Add low-level code to tweet a directory of images.\n" }, { "from": "human", "value": "require 'dropbox_sdk'\nrequire 'twitter'\nrequire 'open-uri'\n\nget '/sources/new' do \n @user = current_user \n erb :'sources/new'\nend\n\nget '/sources/add-image' do\n @user =...
ruby
chosen
[ { "from": "system", "value": "Fix \"dangerous query method\" warning\n\nDEPRECATION WARNING: Dangerous query method (method whose arguments are\nused as raw SQL) called with non-attribute argument(s):\n\"date_format(created_at, \\\"%Y-%m-%d %H:00:00\\\")\". Non-attribute\narguments will be disallowed in Rai...
ruby
chosen
[ { "from": "system", "value": "Use @all_events to build XML results\n" }, { "from": "human", "value": "xml.instruct!\nxml.events do\n (@weekly_series + @events + @competitions).each do |event|\n xml.event do\n xml.id event.id\n xml.name event.full_name\n xml.date event.date\n ...
ruby
chosen
[ { "from": "system", "value": "Reduce user picture thumbnail size.\n" }, { "from": "human", "value": "class UserProfile < ActiveRecord::Base\n image_accessor :picture do\n storage_path :generate_picture_path\n end\n\n belongs_to :user\n\n validates_property :mime_type, of: :picture, in: %w...
ruby
chosen
[ { "from": "system", "value": "Enable input capabilities for terminal shifter\n" }, { "from": "human", "value": "require 'curses'\n\nmodule BlinkenWindow::Shifters\n\n class TerminalShifter\n include Curses\n\n attr_reader :maxx, :maxy, :width, :height\n\n def initialize(maxx, maxy, wid...
ruby
chosen
[ { "from": "system", "value": "Fix bug in install action\n" }, { "from": "human", "value": "require 'rails'\n\nmodule Awe\n module Generators\n class InstallGenerator < ::Rails::Generators::Base\n\n desc \"This generator installs AWE (Artefact Web Extensions) into rails\"\n source_r...
ruby
chosen
[ { "from": "system", "value": "Make scope calls return shallower but more relevant, Milord.\n" }, { "from": "human", "value": "module Bnet\n class WOW < Bnet::API\n def url\n super + \"wow/\"\n end\n\n def scoped(scope, args ={})\n api_key = args[:api_key] || Bnet.configuratio...
ruby
chosen
[ { "from": "system", "value": "Move to the Hackathon channel\n" }, { "from": "human", "value": "require 'cinch'\nrequire 'tinder'\nrequire 'celluloid'\nrequire 'cellulon/version'\n\nrequire 'cellulon/campfire_message'\nrequire 'cellulon/worker'\n\nmodule Cellulon\n # Start the bot\n def self.ru...
ruby
chosen
[ { "from": "system", "value": "Fix bug that read blank request.body on github callback\n" }, { "from": "human", "value": "class Api::WebhooksController < Api::ApplicationController\n before_action :authenticate\n\n def github_callback\n event_name = request.headers.fetch('X-GitHub-Event')\n ...
ruby
chosen