conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add a short comment on the ObjectiveRollupUsingDefaultRule class.\n" }, { "from": "human", "value": "require 'scorm2004/sequencing'\nrequire 'ostruct'\n\nmodule Scorm2004\n module Sequencing\n class ObjectiveRollupUsingDefaultRule\n def call(activity)\n ...
ruby
chosen
[ { "from": "system", "value": "Update examples to persist for tests\n\nGenerated examples did not persist in the tests and would cause an error\ndue to not being registered objects.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire \"spec_helper.rb\"\n\ndescribe SolidusK...
ruby
chosen
[ { "from": "system", "value": "Allow reading of private key from a string instead of a file\n" }, { "from": "human", "value": "require 'oauth/signature/base'\nrequire 'openssl'\n\nmodule OAuth::Signature::RSA\n class SHA1 < OAuth::Signature::Base\n implements 'rsa-sha1'\n hash_class ::Dige...
ruby
chosen
[ { "from": "system", "value": "Add session_handle and authorization_expires_at credentials\n" }, { "from": "human", "value": "require \"omniauth/strategies/oauth\"\n\nmodule OmniAuth\n module Strategies\n class Xero < OmniAuth::Strategies::OAuth\n\n args [:consumer_key, :consumer_secret]...
ruby
chosen
[ { "from": "system", "value": "Add unf gem to silence warnings from Fog\n" }, { "from": "human", "value": "require File.expand_path(\"../lib/conjure\", __FILE__)\n\nGem::Specification.new do |s|\n s.name = \"conjure\"\n s.version = Conjure::VERSION\n s.platform = Gem::Platform::RUBY\n s.autho...
ruby
chosen
[ { "from": "system", "value": "Resolve the course instance variable problem\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe SitemapController do\n\n describe 'GET #index' do\n\n let :static_pages_urls do\n [root_url, about_url, contact_url, faq_url, login_url, signup...
ruby
chosen
[ { "from": "system", "value": "Fix issue created by Rubocop?\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'spec_helpers/client'\nrequire 'rest/api_request'\n\nRSpec.describe FinApps::REST::VerixPdfDocuments do\n include SpecHelpers::Client\n\n let(:api_client) { c...
ruby
chosen
[ { "from": "system", "value": "Add access field to user project\n" }, { "from": "human", "value": "class CreateUserProjects < ActiveRecord::Migration\n def change\n create_table :user_projects do |t|\n t.integer :user_id, null: false\n t.integer :project_id, null: false\n\n t.t...
ruby
chosen
[ { "from": "system", "value": "Use all instead of all_stars\n" }, { "from": "human", "value": "require_relative \"./bot\"\n\nclass BirthdayBot < Bot\n def initialize\n Time.zone = \"Tokyo\"\n end\n\n def perform\n today = Time.current.to_date\n\n birthday_girls = Precure.all_stars.sel...
ruby
chosen
[ { "from": "system", "value": "Remove reference to deleted file\n" }, { "from": "human", "value": "#Ruby stdlib\nrequire \"pathname\"\nrequire \"fileutils\"\nrequire \"uri\"\nrequire \"json\"\nrequire \"digest\"\n\n#Gems\nrequire \"addressable/uri\"\nrequire \"naturally\"\nrequire \"RMagick\"\n\n...
ruby
chosen
[ { "from": "system", "value": "Add tests for category percentage information\n\nTests to check current_percentage and total_percentage methods\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe Category do\n\n before do\n @budget = FactoryGirl.create(:budget)\n @category...
ruby
chosen
[ { "from": "human", "value": "Add the latest beta of Saleae Logic Analyzer 1.2.5.\n\nThis version is recommended for certain hardware versions by Saleae.\n" }, { "from": "gpt", "value": "cask :v1 => 'logic-beta' do\n version '1.2.5'\n sha256 '6699a0da5b14c85da662d2df3b8c6453459a49c1be7e833854bb...
ruby
chosen
[ { "from": "system", "value": "Configure excluded directories for codeclimate and simplecov test coverage\n" }, { "from": "human", "value": "module Spec\n module CodeClimate\n def self.setup\n require \"codeclimate-test-reporter\"\n ::CodeClimate::TestReporter.start\n rescue Load...
ruby
chosen
[ { "from": "system", "value": "Update Sequel Pro to 1.1.0.1\n\nSequel Pro download url structure changed\n" }, { "from": "human", "value": "cask 'sequel-pro' do\n version '1.1'\n sha256 'dfefd39b64a78084db88210e2ea365effbaeb8903173f3dfd55b60421ee461fa'\n\n # github.com is the official download...
ruby
chosen
[ { "from": "system", "value": "Fix migration for adding attachment to experiment\n" }, { "from": "human", "value": "class AddAttachmentWorkflowimgToExperiments < ActiveRecord::Migration\n def self.up\n change_table :experiments do |t|\n t.attachment :workflowimg\n end\n end\n\n def ...
ruby
chosen
[ { "from": "system", "value": "Remove users namespace from login path\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n devise_for :users, path_names: {\n sign_in: 'login',\n sign_out: 'logout',\n }\n\n root 'patients#index'\n\n resources :users\n get 'profile' => '...
ruby
chosen
[ { "from": "system", "value": "Revert \"Minor fix to routing\"\n\nThis reverts commit bf02845a3847615e1491274c310fa98814510c32.\n" }, { "from": "human", "value": "Mall::Engine.routes.draw do\n\n devise_for :users, controllers: {confirmations: 'confirmations'}\n\n devise_scope :user do\n patc...
ruby
chosen
[ { "from": "system", "value": "Fix suggested next reading issue\n\nThe \"next\" method in the \"article\" model was set to return the less-hot\narticle than the current, that wasn't work with the least-hottest article\nin the list. I modified the method to return the hottest-article as the next\nof the very ...
ruby
chosen
[ { "from": "system", "value": "Add FuzzyStringMatcher to the default set of required files.\n" }, { "from": "human", "value": "# encoding: UTF-8\n#\n# = perobs.rb -- Persistent Ruby Object Store\n#\n# Copyright (c) 2015 by Chris Schlaeger <chris@taskjuggler.org>\n#\n# MIT License\n#\n# Permission...
ruby
chosen
[ { "from": "system", "value": "Update repositories owner instead of permissions\n\nThe old code would update every single repository the user has\npermissions for.\n" }, { "from": "human", "value": "module Travis\n module Github\n module Services\n class FindOrCreateUser < Travis::Servic...
ruby
chosen
[ { "from": "system", "value": "Copy and paste fail on DSU attachment controller\n" }, { "from": "human", "value": "class DrugSafetyUpdateAttachmentsController < AbstractAttachmentsController\n\nprivate\n def view_adapter(document)\n DrugSafetyUpdateViewAdapter.new(document)\n end\n\n def do...
ruby
chosen
[ { "from": "system", "value": "Update json dependency to later version (CVE-2013-0269)\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'nexmo'\n s.version = '1.2.0'\n s.platform = Gem::Platform::RUBY\n s.authors = ['Tim Craft']\n s.email = ['mail@timcraft.com']\n ...
ruby
chosen
[ { "from": "system", "value": "Use more entropy in the ApiToken token" }, { "from": "human", "value": "class ApiToken < ApplicationRecord\n attr_encrypted :token, key: Rails.application.secrets.encryption_key, mode: :per_attribute_iv_and_salt\n\n before_save :ensure_token\n\n validates :name, ...
ruby
chosen
[ { "from": "system", "value": "aact-348: Fix bug in MeshTerm - if the term was more than one word, it was only getting the last word and saving that to the table. Changed it so that it saves the entire term." }, { "from": "human", "value": "class MeshTerm < ActiveRecord::Base\n def self.popula...
ruby
chosen
[ { "from": "system", "value": "Use later version of mocha for compatibility with minitest\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'nexmo'\n s.version = '0.5.0'\n s.platform = Gem::Platform::RUBY\n s.authors = ['Tim Craft']\n s.email = ['mail@timcraft.com']...
ruby
chosen
[ { "from": "human", "value": "Add Stack Exchange Notifier 1.1\n" }, { "from": "gpt", "value": "cask :v1 => 'stack-exchange-notifier' do\n version '1.1'\n sha256 '849b543bc724e735e9a951721159b45a5284fde44c4cd8caa74c0e7eefb7e30c'\n\n url 'http://hewgill.com/senotifier/stack-exchange-notifier-1.1...
ruby
chosen
[ { "from": "system", "value": "Fix version requirements of paperclip\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'paperclip-wav-mp3'\n s.version = '0.0.2'\n s.author = 'Jon Pascoe'\n s.email = 'jon.pascoe@me.com'\n s.homepage ...
ruby
chosen
[ { "from": "system", "value": "Check version only if the gem was actually required\n" }, { "from": "human", "value": "$:.push File.expand_path('../lib', __FILE__)\n\nrequire 'ruby_event_store/outbox/version'\n\nGem::Specification.new do |spec|\n spec.name = 'ruby_event_store-outbox'\n ...
ruby
chosen
[ { "from": "human", "value": "Add migration for payment methods\n\nPaymentMethod.display_on column is split in to two boolean columns\navailable_to_users, and available_to_admin. Each value is set\nbased on the value in the display_on column. Finally, the display_on\ncolumn is removed.\n" }, { "from"...
ruby
chosen
[ { "from": "human", "value": "Create tests for register user feature\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\nRSpec.describe GraphqlController, type: :controller do\n context 'create' do\n let(:user) do\n { name: 'test', email: 'test@test.com', password: '123456', passw...
ruby
chosen
[ { "from": "system", "value": "Make feature spec login accept a specific password\n" }, { "from": "human", "value": "module SpecFeatureHelper\n def login\n user = create(:user, password: 'known')\n visit root_path\n fill_in \"username\", with: user.username\n fill_in \"password\", wi...
ruby
chosen
[ { "from": "system", "value": "Reduce minimum OS requirement to 10.8" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"NSURL+QueryDictionary\"\n s.version = \"0.0.7\"\n s.summary = \"Make working with NSURL queries more pleasant.\"\n s.description = \"E...
ruby
chosen
[ { "from": "human", "value": "Add solution to problem 2" }, { "from": "gpt", "value": "def fibonacci\n \n f = [1,2]\n s = 0\n \n while f[-1] + f[-2] < 4000000\n f << f[-1] + f[-2]\n end\n \n f.each do |x|\n s += x if x.even?\n end\n \n p s\nend\n" } ]
ruby
chosen
[ { "from": "system", "value": "Add swig as osmand dependency\n" }, { "from": "human", "value": "\nuser = node[:settings][:user]\n\nexecute \"apt-get-update\" do\n command \"apt-get update\"\nend\n\n%w{ant ant-contrib autoconf autopoint bison cmake expect libtool libsaxonb-java libssl1.0.0 libssl...
ruby
chosen
[ { "from": "system", "value": "Update gemspec summary and description\n\n* Fix typos\n* Make summary and description more specific\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path(\"../lib\", __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire \"s...
ruby
chosen
[ { "from": "system", "value": "Add 'null: false' to Action Mailbox table\ncreated_at and updated_at columns in Action Mailbox table aren't intended nullable.\n" }, { "from": "human", "value": "class CreateActionMailboxTables < ActiveRecord::Migration[6.0]\n def change\n create_table :action_m...
ruby
chosen
[ { "from": "system", "value": "Upgrade dependency gems, bootstrap3-datetimepicker-rails to 4.17.47 and momentjs-rails to 2.17.1.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path(\"../lib\", __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire \"dat...
ruby
chosen
[ { "from": "system", "value": "Add the mail gem as a runtime dependency\n\nThis actually doesn't appear to be installing right now. I suspect\neither I have a configuration problem on my end, or there is something\nwrong in our .gemspec file.\n" }, { "from": "human", "value": "# coding: utf-8\nli...
ruby
chosen
[ { "from": "system", "value": "Fix s.files in gemspec, bump to 0.1.1.\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'rightscale-cli'\n s.version = '0.1.0'\n s.date = '2013-11-15'\n s.summary = \"rightscale-cli\"\n s.description = \"RightSca...
ruby
chosen
[ { "from": "system", "value": "Update podspec to version 1.3\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"MendeleySDK\"\n s.version = \"1.2\"\n s.summary = \"Objective-C client for the Mendeley Open API.\"\n s.homepage = \"https://github.com/shazi...
ruby
chosen
[ { "from": "system", "value": "Use Money.new in Spree::Money, as Money.parse is being deprecated\n\nMoney.new will (probably) serve all the purposes we care about\n" }, { "from": "human", "value": "require 'money'\n\nmodule Spree\n class Money\n attr_reader :money\n\n delegate :cents, :to ...
ruby
chosen
[ { "from": "system", "value": "Fix variable evaluation to unbreak Rubinius.\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\nrequire \"./ruler\"\n\n#-----------------------------------------------------------------------------\nR(\"\")\n\nclass Thing\n\tattr_accessor :name\n\tdef initial...
ruby
chosen
[ { "from": "system", "value": "Fix the install generator for rails 3.0.x --> we need to js code, not the manifest (for rails 3.1)." }, { "from": "human", "value": "module OnTheSpot\n module Generators\n class InstallGenerator < ::Rails::Generators::Base\n source_root File.expand_path('.....
ruby
chosen
[ { "from": "system", "value": "Remove paragraph spacing in method." }, { "from": "human", "value": "require 'rails/generators'\nrequire 'rails/generators/active_record'\nrequire 'rails/generators/active_record/migration/migration_generator'\n\nmodule SecondBase\n class MigrationGenerator < Activ...
ruby
chosen
[ { "from": "system", "value": "Add spree_notifications migrations to generator\n\nSince this gem requires spree_notifications internally, we should\ninstall migrations that are from spree_notifications as well.\n" }, { "from": "human", "value": "module SpreeQueueLine\n module Generators\n cla...
ruby
chosen
[ { "from": "system", "value": "Fix typo in podspec version quoting characters.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'ResearchKit'\n s.version = ‘1.4.1’\n s.summary = 'ResearchKit is an open source software framework that makes it easy to create a...
ruby
chosen
[ { "from": "system", "value": "Convert straight apostrophes to curlies\n" }, { "from": "human", "value": "require_relative 'preprocessor.rb'\nrequire 'redcarpet'\n\nif ARGV.length < 1\n puts \"usage: ruby preprocessor.rb filename\"\n puts \"(processes <filename>.md and writes output to ../sinda...
ruby
chosen
[ { "from": "human", "value": "Add a spec for diff\n" }, { "from": "gpt", "value": "require File.dirname(__FILE__) + '/integration_helper'\n\ndescribe 'Running braid diff on a mirror' do\n before do\n FileUtils.rm_rf(TMP_PATH)\n FileUtils.mkdir_p(TMP_PATH)\n @repository_dir = create_git_...
ruby
chosen
[ { "from": "system", "value": "test(helpers): Make specs contingent on abilities\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe StubEnv::Helpers do\n include described_class\n \n before :each do\n ENV['UNSTUBBED'] = 'unstubbed'\n end\n\n describe \"#stub_env\" do\n...
ruby
chosen
[ { "from": "system", "value": "Add helper method for customer name\n" }, { "from": "human", "value": "class HomeController < ApplicationController\n \n around_filter :shopify_session, :except => 'welcome'\n \n def welcome\n current_host = \"#{request.host}#{':' + request.port.to_s if reque...
ruby
chosen
[ { "from": "system", "value": "Set :send_checked => true in order to have miq_grid_checks defined\n" }, { "from": "human", "value": "class ApplicationHelper::Toolbar::GenericObjectsCenter < ApplicationHelper::Toolbar::Basic\n button_group('generic_object_policy', [\n select(\n :generic_o...
ruby
chosen
[ { "from": "system", "value": "Remove open-ended dependency on bundler\n" }, { "from": "human", "value": "# encoding: utf-8\n\nGem::Specification.new do |spec|\n spec.name = 'codequest_pipes'\n spec.version = '0.2.0'\n\n spec.author = 'codequest'\n spec.email = 'hello@codequest....
ruby
chosen
[ { "from": "human", "value": "Create migration to rename an AE match index\n\nMSP-12593\n\n* Fixes structure.sql diffs\n* Used to be ref_id but new naming convention for AE is module_detail_id\n" }, { "from": "gpt", "value": "class RenameAutomaticExploitationIndex < ActiveRecord::Migration\n def...
ruby
chosen
[ { "from": "system", "value": "Add 'back' and 'start' message\n" }, { "from": "human", "value": "\n# Responsible for creating the dictionary of user messages in english.\nmodule English\n\n\t# Returns a Hash with all user messages in english.\n\t#\n\t# * *Returns* :\n\t# - Hash containing the u...
ruby
chosen
[ { "from": "system", "value": "Fix an XSS attack on spellchecked titles\n" }, { "from": "human", "value": "# encoding: utf-8\nmodule ContentHelper\n\n def spellcheck(html)\n HTML_Spellchecker.french.spellcheck(html).html_safe\n end\n\n def htmldiff(was, new)\n dmp = DiffPatchMatch.new\n ...
ruby
chosen
[ { "from": "system", "value": "Add permission check for DSU\n" }, { "from": "human", "value": "class PermissionChecker\n GDS_EDITOR_PERMISSION = \"gds_editor\"\n EDITOR_PERMISSION = \"editor\"\n\n def initialize(user)\n @user = user\n end\n\n def can_edit?(format)\n is_gds_editor? || c...
ruby
chosen
[ { "from": "system", "value": "Exclude configured bundler path in addition to '/vendor'\n" }, { "from": "human", "value": "module Bullet\n module StackTraceFilter\n VENDOR_PATH = '/vendor'.freeze\n\n def caller_in_project\n app_root = rails? ? Rails.root.to_s : Dir.pwd\n vendor_r...
ruby
chosen
[ { "from": "system", "value": "Fix caller_path in the case of nil\n\n`Thread::Backtrace::Location#absolute_path` can return nil so it would\nraise exception NoMethodError with `include?` when it returns nil.\n" }, { "from": "human", "value": "module Bullet\n module StackTraceFilter\n VENDOR_P...
ruby
chosen
[ { "from": "human", "value": "Add specs on short formatter\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Npmdc::Formatters::Short do\n let(:path) { './spec/files/case_2/' }\n let(:options) { { 'color' => false, 'format' => 'short', 'path' => path } }\n\n subject { Npmdc.ca...
ruby
chosen
[ { "from": "system", "value": "Update FC009 tests for Chef 15\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe \"FC009\" do\n context \"on chef 14.2.0 with a cookbook that uses ifconfig attribute...
ruby
chosen
[ { "from": "human", "value": "Add rspec test for project router\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\nRSpec.describe 'routes for projects', type: :routing do\n it 'routes all projects' do\n expect(get: '/gorums/my_space/projects').\n to route_to(controller: 'projec...
ruby
chosen
[ { "from": "human", "value": "Add validation on cloud model\n" }, { "from": "gpt", "value": "# -*- coding: utf-8 -*-\n# Copyright 2014 TIS Inc.\n#\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 ob...
ruby
chosen
[ { "from": "system", "value": "Make remote options work with multiselect\n" }, { "from": "human", "value": "module ChosenSelect\n def chosen_select(item_text, options)\n field = find_field(options[:from], visible: false)\n find(\"##{field[:id]}_chosen\") # Throws an exception if the chosen...
ruby
chosen
[ { "from": "system", "value": "Add the example for `scope` matcher\n" }, { "from": "human", "value": "# Based on http://stackoverflow.com/questions/6853744/how-can-i-have-rspec-test-for-my-default-scope/6853925#6853925\nRSpec::Matchers.define :scope do |scope|\n define_method :actual_for do |sub...
ruby
chosen
[ { "from": "system", "value": "Tweak the location of the version\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'heroku/request/id/version'\n\nGem::Specification.new do |spec|\n spec...
ruby
chosen
[ { "from": "system", "value": "Use persistent browser for WatirSpec.\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path(\"/../lib\", File.dirname(__FILE__))\nrequire \"watir-classic\"\n\nWatirSpec.implementation do |imp|\n imp.name = :watir_classic\n\n WatirSpec.persistent_b...
ruby
chosen
[ { "from": "system", "value": "Refactor spec for :min and :max\n" }, { "from": "human", "value": "require File.expand_path('../spec_helper', __FILE__)\ndescribe Summarize do\n \n it \"should have a version number\" do\n Summarize.const_defined?(:VERSION).should be_true\n end\n\n let(:numbe...
ruby
chosen
[ { "from": "system", "value": "Fix casing in table selection\n\nThis fixes 7d2dc7862eb43d38c069d04072bb721eaddca6a5.\n" }, { "from": "human", "value": "namespace :attachments do\n desc \"Repair attachments that have double extensions, e.g. filename.pdf.pdf\"\n task repair: :environment do\n ...
ruby
chosen
[ { "from": "system", "value": "Remove progname override from audit log\n" }, { "from": "human", "value": "module Vmdb::Loggers\n class AuditLogger < VMDBLogger\n def success(msg)\n info(\"Success\") { msg }\n $log.info(\"<AuditSuccess> #{msg}\") if $log\n end\n\n def failure(m...
ruby
chosen
[ { "from": "system", "value": "Add hooks for actions that defined in TasksController, but unused in TaskTemplatesController. Now they just raise exception. This is only for developmnent and must be cleaned when we put task templates in production.\n" }, { "from": "human", "value": "class TaskTemp...
ruby
chosen
[ { "from": "system", "value": "Update taxonomy email alert base path\n\nOpt for simply '/email-alert' - clearer and less cumbersome than\n'/taxonomy-email-alert'.\n" }, { "from": "human", "value": "module Taxonomy\n class EmailSignupPage\n def payload\n # The base_path and routes specifi...
ruby
chosen
[ { "from": "system", "value": "Work around rspec-2 not yet being ORM agnostic\n\nThx myabc for pointing this out " }, { "from": "human", "value": "remove_file 'spec/spec_helper.rb'\ncreate_file 'spec/spec_helper.rb' do\n<<-RUBY\n# This file is copied to ~/spec when you run 'ruby script/generate r...
ruby
chosen
[ { "from": "system", "value": "Fix Officer final recount access without voting shift\n" }, { "from": "human", "value": "class Officing::BaseController < ApplicationController\n layout \"admin\"\n helper_method :current_booth\n\n before_action :authenticate_user!\n before_action :verify_office...
ruby
chosen
[ { "from": "system", "value": "Add missing dependencies to gemspec\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)\nrequire 'encrypted_attributes/version'\n\nGem::Specification.new do |s|\n s.name = \"encrypted_attributes\"\n s.version ...
ruby
chosen
[ { "from": "system", "value": "Handle case where no site is attached to the work log\n" }, { "from": "human", "value": "json.extract! work_log, :id, :date, :hours, :approved\r\njson.site work_log.site.slug\r\n" }, { "from": "gpt", "value": "json.extract! work_log, :id, :date, :hours, ...
ruby
chosen
[ { "from": "system", "value": "Add suggestions from exercism, and get rid of unused methods.\n" }, { "from": "human", "value": "class Phrase \n def initialize words\n @words_map = map_words words\n end\n\n def word_count\n return @words_map\n end\n\n private\n def ...
ruby
chosen
[ { "from": "system", "value": "Fix powershell environment variable syntax\n" }, { "from": "human", "value": "powershell_script 'install eventstore' do\n code <<-EOH\n Add-Type -assembly \"system.io.compression.filesystem\"\n wget \"#{node[:eventstore][:url]}\" -OutFile \"%TEMP%\\\\eventstore.z...
ruby
chosen
[ { "from": "human", "value": "Add long url check test\n\nadd test to check long url query. if url size < 4096, returns HTTP Status code 200, or returns 400.\n" }, { "from": "gpt", "value": "require_relative '../lib/bossan'\nrequire 'test/unit'\nrequire 'uri'\nrequire 'net/http'\n\nclass RackSpecT...
ruby
chosen
[ { "from": "system", "value": "Update pod version because of tag problem\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n\n s.name = \"LogCentral\"\n s.version = \"1.0.1\"\n s.summary = \"A modern swift logging utility made for the real needs.\"\n s.license = \...
ruby
chosen
[ { "from": "human", "value": "Add unit tests for Configuration::ForeignColumn\n" }, { "from": "gpt", "value": "require \"spec_helper\"\n\ndescribe PgSearch::Configuration::ForeignColumn do\n describe \"#alias\" do\n with_model :AssociatedModel do\n table do |t|\n t.string \"title\...
ruby
chosen
[ { "from": "system", "value": "Fix loading EVM after multiple endpoints support patch\n\nFix loading EVM after multiple endpoints support patch\n" }, { "from": "human", "value": "module Openstack\n module HelperMethods\n def base_dir\n Rails.root.to_s\n end\n\n def vcr_base_dir\n ...
ruby
chosen
[ { "from": "system", "value": "Remove temp directory after tests.\n" }, { "from": "human", "value": "require File.expand_path('../lib/boutique', File.dirname(__FILE__))\nrequire 'dm-migrations'\nrequire 'minitest/autorun'\nrequire 'rack'\nrequire 'rack/test'\nrequire 'rack/server'\n\nDataMapper.s...
ruby
chosen
[ { "from": "system", "value": "Allow higher timeout values for tests\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'test/unit'\nrequire 'mosquitto'\nrequire 'stringio'\nrequire 'thread'\nrequire 'io/wait'\n\nThread.abort_on_exception = true\n\nclass Mosquitto::Client\nif RUBY_VE...
ruby
chosen
[ { "from": "human", "value": "Add missing timestamps to `spree_prices` table\n" }, { "from": "gpt", "value": "class AddTimestampsToSpreePrices < ActiveRecord::Migration[5.2]\n def up\n add_timestamps :spree_prices, default: Time.current\n change_column_default :spree_prices, :created_at, n...
ruby
chosen
[ { "from": "system", "value": "Modify gemspec to not fail\n" }, { "from": "human", "value": "# encoding: utf-8\n\nGem::Specification.new do |gem|\n gem.add_dependency 'faraday', '~> 0.7'\n gem.add_dependency 'simple_oauth', '~> 0.1'\n gem.add_dependency 'json'\n gem.add_development_de...
ruby
chosen
[ { "from": "system", "value": "Add helper functions to compiler\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\n# Version of your assets, change this if you want to expire all your assets.\nRails.application.config.assets.version = '1.0'\n\n# Add ...
ruby
chosen
[ { "from": "system", "value": "Set Pusher stuff in test too\n" }, { "from": "human", "value": "require 'pusher'\n\n# This is handled automatically in Heroku\nif Rails.env.development?\n Pusher.app_id = ENV['PUSHER_APP_ID']\n Pusher.key = ENV['PUSHER_KEY']\n Pusher.secret = ENV['PUSHER_SECRET']...
ruby
chosen
[ { "from": "system", "value": "Use ignored password_data as data to hash for PasswordHash factory\n\nMSP-9605\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :metasploit_credential_password_hash,\n # no need to declare metasploit_credential_private as the :parent beca...
ruby
chosen
[ { "from": "system", "value": "Add a test case for the scope enum adds\n" }, { "from": "human", "value": "require 'cases/helper'\nrequire 'models/book'\n\nclass StoreTest < ActiveRecord::TestCase\n fixtures :books\n\n setup do\n @book = books(:awdr)\n end\n\n test \"query state by predicat...
ruby
chosen
[ { "from": "human", "value": "Add janky script to make fake reports\n\nUsage: create_nodes.rb [ list, of, nodenames, to, create | remove ]\n\nThis script will accept any number of nodenames on the commandline and will\nrun Puppet in a temporary ssldir for each nodename. This has the effect of\ngenerating an ...
ruby
chosen
[ { "from": "system", "value": "Remove extra empty line detected at class body end\n" }, { "from": "human", "value": "class ArticleRepository\n class ArticleNotFound < StandardError; end\n\n REPOSITORY = Rails.root.join('content')\n\n def initialize(repository = REPOSITORY)\n @repository = P...
ruby
chosen
[ { "from": "system", "value": "Add /out/payloads as primary route and alias /payloads\n" }, { "from": "human", "value": "require 'sinatra/base'\nrequire 'sinatra/json'\nrequire 'casa/publisher/persistence/memory_storage_handler'\n\nmodule CASA\n module Publisher\n class App < Sinatra::Base\n\...
ruby
chosen
[ { "from": "system", "value": "Change gem dependencies to match minor versions and anything lesser than minor versions" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'echowrap...
ruby
chosen
[ { "from": "system", "value": "Make RSpec emit profiling information\n" }, { "from": "human", "value": "require 'rspec/core'\nrequire 'aruba/api'\n\nRSpec.configure do |config|\n config.filter_run focus: true\n\n config.run_all_when_everything_filtered = true\n\n config.example_status_persiste...
ruby
chosen
[ { "from": "system", "value": "Add more test cases to ensure correct behaviour\n" }, { "from": "human", "value": "# encoding: utf-8\n\nRSpec.describe RSpec::Benchmark, '#format_time' do\n {\n 1e-10 => \"0 ns\",\n 0.42e-6 => \"420 ns\",\n 3.4e-6 => \"3.4 μs\",\n 34e-6 => \"34 μs\...
ruby
chosen
[ { "from": "human", "value": "Rename gemspec so that bundler can reference it\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby -rubygems\n# -*- encoding: utf-8 -*-\n\nGEMSPEC = Gem::Specification.new do |gem|\n gem.version = File.read('VERSION').chomp\n gem.date = F...
ruby
chosen
[ { "from": "system", "value": "Make a single request for instances.json\n" }, { "from": "human", "value": "#!/usr/bin/ruby\nrequire 'net/https'\nrequire 'json'\n\n\nuri = URI.parse(\"https://raw.githubusercontent.com/powdahound/ec2instances.info/master/www/instances.json\")\nhttp = Net::HTTP.new(...
ruby
chosen
[ { "from": "system", "value": "Fix home spec test by updating action name\n" }, { "from": "human", "value": "require 'minitest/spec'\nrequire 'minitest/autorun'\nrequire_relative '../../app/controllers/home'\n\ndescribe Home do\n\n describe 'Index Action' do\n\n before do\n @action = Hom...
ruby
chosen
[ { "from": "system", "value": "Remove cat option that never worked very well\n" }, { "from": "human", "value": "require 'sinatra'\nrequire 'json'\n\nget \"/\" do \n \"Avaliable API's <br/> \n /env <br/> \n /ls/:dir\"\nend\n\nget \"/env\" do\n output = \"<pre>\"\n output += JSON.pretty_genera...
ruby
chosen
[ { "from": "system", "value": "Mark a news as read when posting on its board\n" }, { "from": "human", "value": "# encoding: utf-8\nclass BoardsController < ApplicationController\n skip_before_filter :verify_authenticity_token\n before_filter :verify_referer_or_authenticity_token, :only => [:cre...
ruby
chosen