conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Update gemspec to include new test files.\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"oboe/version\"\n\nGem::Specification.new do |s|\n s.name = %q{oboe}\n s.version = Oboe::Version::STRING\n s.date = Time.no...
ruby
chosen
[ { "from": "system", "value": "Make tests Rails 3 compatible.\n" }, { "from": "human", "value": "# allows testing with edge Rails by creating a test/rails symlink\nlinked_rails = File.dirname(__FILE__) + '/rails'\n\nif File.exists?(linked_rails) && !$:.include?(linked_rails + '/activesupport/lib'...
ruby
chosen
[ { "from": "system", "value": "Update pod spec with new version number\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"APESuperHUD\"\n s.summary = \"A simple way to display a HUD with a message or progress information in your application.\"\n s.version...
ruby
chosen
[ { "from": "system", "value": "Revert \"No need to require unused DescendantsTracker\"\n\nIt breaks the build because of missing ThreadSafe?\nNeeds further investigation.\n\nThis reverts commit 6565b89ea70b377981a0e19e98bedf989bbfb62e.\n" }, { "from": "human", "value": "require 'equalizer'\nrequi...
ruby
chosen
[ { "from": "system", "value": "Update .podspec for 1.0.5 release\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"HSClusterMapView\"\n s.version = \"1.0.4\"\n s.summary = \"A GMSMapView subclass which clusters GMSMarkers within close proximity....
ruby
chosen
[ { "from": "system", "value": "Remove trailing comma that fools Ruby 1.8 parser" }, { "from": "human", "value": "#\n# Copyright 2012, Victor Penso\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...
ruby
chosen
[ { "from": "system", "value": "Update mini metro to Aplha 9e\n" }, { "from": "human", "value": "class MiniMetro < Cask\n url 'http://static.dinopoloclub.com/minimetro/builds/alpha9/MiniMetro-alpha9d-osx.zip'\n homepage 'http://dinopoloclub.com/minimetro/'\n version 'Alpha 9d'\n sha256 '6ab2aa...
ruby
chosen
[ { "from": "system", "value": "Upgrade Slack Beta to 0.69 (2350).\n" }, { "from": "human", "value": "class SlackBeta < Cask\n version '0.60 (1700)'\n sha256 '9245059fdad7914ec911eea121bcca5ccf716ea7b2fbeadc707e618692db89a1'\n\n url 'https://rink.hockeyapp.net/api/2/apps/06bd6493684f65a3b8f47ac...
ruby
chosen
[ { "from": "system", "value": "Use ruby 3.0 on Ubuntu 22.04\n" }, { "from": "human", "value": "default[:ruby][:version] = if node[:lsb][:release].to_f < 20.04\n \"2.5\"\n else\n \"2.7\"\n e...
ruby
chosen
[ { "from": "system", "value": "Fix load issue with background runners\n" }, { "from": "human", "value": "# Copyright 2012 Square 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 obt...
ruby
chosen
[ { "from": "system", "value": "Upgrade Sequel Pro.app from 0c2ea8b95e to f36c6eeb3a2\n" }, { "from": "human", "value": "cask :v1 => 'sequel-pro-nightly' do\n version '4293'\n sha256 '8d75ee4c5198de7bfde6a3fb5578812c1dbe13e08f6451dc219f31fc0d3ef722'\n\n url 'http://nightly.sequelpro.com/builds/...
ruby
chosen
[ { "from": "human", "value": "Patch URI to encode ASCII spaces as \"%20\".\n" }, { "from": "gpt", "value": "module URI\n\n\t# FIX: For some reason, the Bits on the Run API doesn't support the encoding\n\t# of spaces to \"+\". As such, (ASCII space) will encode to \"%20\".\n\tTBLENCWWWCOMP__ ...
ruby
chosen
[ { "from": "system", "value": "Fix typo in test job\n" }, { "from": "human", "value": "# To queue with resque-scheduler: TestJob.wait(5.second).perform_later\n\nclass TestJob < ApplicationJob\n queue_as :default\n \n def perform\n puts \"ActiveJob is working.\"\n end\nend" }, { "fro...
ruby
chosen
[ { "from": "system", "value": "CFitsIO: Add option to install example programs\n\nAdded the option --with-examples to the cfitsio formula, that downloads,\ncompiles and installs some useful programs, like listhead, modhead, etc.\n\nSigned-off-by: Charlie Sharpsteen <828d338a9b04221c9cbe286f50cd389f68de4ecf@s...
ruby
chosen
[ { "from": "system", "value": "Save all repos as a bulk\n" }, { "from": "human", "value": "class NewProjectSaver\n def initialize\n @account_repo = AccountRepository.new\n @project_repo = ProjectRepository.new\n end\n\n def call(id)\n account = account_repo.find_with_projects(id)\n ...
ruby
chosen
[ { "from": "system", "value": "Fix Zlib use to work under JRuby\n" }, { "from": "human", "value": "require 'zlib'\nrequire 'vcr/cassette/serializers'\n\nmodule VCR\n class Cassette\n class Serializers\n # The compressed serializer. This serializer wraps the YAML serializer\n # to wr...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary block in url validator\n" }, { "from": "human", "value": "module MyMoip\n module Validators\n private\n\n def valid_url?(url)\n begin\n uri = URI.parse(url)\n uri.kind_of?(URI::HTTP) or uri.kind_of?(URI::HTTPS)\n res...
ruby
chosen
[ { "from": "system", "value": "Test Suite: Add test coverage for compilation errors.\n" }, { "from": "human", "value": "require 'jade-rails'\nrequire 'test/unit'\n\nclass JadeTest < Test::Unit::TestCase\n JADE_TEMPLATE_FUNCTION_PATTERN = /^function\\s+template\\s*\\(locals\\)\\s*\\{.*\\}$/m\n\n ...
ruby
chosen
[ { "from": "system", "value": "Test Round.seconds_left returns time until round expires\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass RoundTest < ActiveSupport::TestCase\n test \"newly created round has randomly generated url string\" do\n r = Round.new\n assert_not_nil...
ruby
chosen
[ { "from": "system", "value": "[Sass] Load Sass::Plugin::Rack into Rails.configuration, not Metal in Rails 3.\n\nCloses gh-190\n" }, { "from": "human", "value": "unless defined?(Sass::RAILS_LOADED)\n Sass::RAILS_LOADED = true\n\n # Reverse-merging (we're in Rails, anyway) so we dont' clobber wh...
ruby
chosen
[ { "from": "system", "value": "Drop Rails 2 support in DbScrub\n" }, { "from": "human", "value": "# encoding: utf-8\nmodule Specjour\n module DbScrub\n\n begin\n require 'rake'\n extend Rake::DSL if defined?(Rake::DSL)\n if defined?(Rails) && Rails.version =~ /^3/\n Rake...
ruby
chosen
[ { "from": "system", "value": "Add trello configuration to gem\n\nThis commit should print out all the boards you have in your account.\n" }, { "from": "human", "value": "require \"trello_newsletter/version\"\n\nmodule TrelloNewsletter\n # Your code goes here...\nend\n" }, { "from": "gpt...
ruby
chosen
[ { "from": "system", "value": "Change way to check Zookeeper service\n" }, { "from": "human", "value": "# coding: UTF-8\n# Cookbook Name:: cerner_kafka\n# Recipe:: zookeeper_status\n\n\nexecute 'check zookeeper' do\n action :run\n command \" nc -z #{node[\"kafka\"][\"zookeepers\"].first} 2181 \...
ruby
chosen
[ { "from": "system", "value": "Update podspec to add more targets\n" }, { "from": "human", "value": "# Spec for InstantMock Pod\nPod::Spec.new do |s|\n\n # Spec Metadata\n s.name = \"InstantMock\"\n s.version = \"1.1.4\"\n s.summary = \"InstantMock makes it easy to create an...
ruby
chosen
[ { "from": "system", "value": "Remove user confirmation, fix erb typo\n" }, { "from": "human", "value": "require 'active_support/concern'\n\nmodule TokenVerification\n\n class ExpiredToken < StandardError; end\n\n PASSWORD_RESET = 'password_reset'\n EMAIL_CONFIRMATION = 'email_confirmation'\n\...
ruby
chosen
[ { "from": "system", "value": "Add Rake to the 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 'reeltalk/version'\n\nGem::Specification.new do |gem|\n gem.name ...
ruby
chosen
[ { "from": "system", "value": "Make sure VAGRANT_HOME/gems/bin is added to ENV['PATH'] before running librarian-puppet\n" }, { "from": "human", "value": "require 'librarian/puppet'\nrequire 'librarian/action'\n\nmodule VagrantPlugins\n module LibrarianPuppet\n module Action\n class Insta...
ruby
chosen
[ { "from": "system", "value": "Chore: Update gemspec to point to LICENSE.txt\n" }, { "from": "human", "value": "# encoding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\n\nGem::Specification.new do |spec|\n spec.name = 'fuuba...
ruby
chosen
[ { "from": "system", "value": "Change pod spec to 0.0.3\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"RSPOPPickerSheet\"\n s.version = \"0.0.2\"\n s.summary = \"Fullscreen pop-able and block-able picker sheet.\"\n s.homepage = \"https://github.com/...
ruby
chosen
[ { "from": "system", "value": "Remove the version constraint on Foodcritic\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"thor-foodcritic/version...
ruby
chosen
[ { "from": "human", "value": "Add test cases for proxy usage on http, https and ftp.\n\nThe ftp and https test fail, currently.\n" }, { "from": "gpt", "value": "require File.expand_path('../helper', __FILE__)\nrequire 'fileutils'\nrequire 'socket'\nrequire 'mini_portile'\n\nclass TestProxy < Test...
ruby
chosen
[ { "from": "system", "value": "Use RSpec expect syntax in specs" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Aspec::CLI do\n def test_app_dir\n File.expand_path(\"../test_app\", __FILE__)\n end\n\n it \"should list all files in a directory\" do\n cli = Aspec::CLI.ne...
ruby
chosen
[ { "from": "system", "value": "Use logger method instead of the uninitialized variable\n" }, { "from": "human", "value": "module AppInsights\n class BaseInstaller\n attr_accessor :app, :root, :filename, :logger\n\n def initialize(app, root, filename = nil, logger = nil)\n @app, @root,...
ruby
chosen
[ { "from": "system", "value": "Fix rename of test_sqlserver_schema_dump_should_honor_nonstandard_primary_keys test.\n" }, { "from": "human", "value": "require 'cases/sqlserver_helper'\n\n# NOTE: The existing schema_dumper_test doesn't test the limits of <4 limit things\n# for adapaters that aren'...
ruby
chosen
[ { "from": "system", "value": "Remove failing line from story\n" }, { "from": "human", "value": "require 'test_helper'\n\n# Tests scenarios related to interacting with Characters\nclass CharacterStoriesTest < ActionDispatch::IntegrationTest\n \n setup do\n @user = log_in_as_user\n end\n \n...
ruby
chosen
[ { "from": "system", "value": "Docs: Clarify that VersionAssociation is in separate gem\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire \"paper_trail/version_concern\"\n\nmodule PaperTrail\n # This is the default ActiveRecord model provided by PaperTrail. Most simple\...
ruby
chosen
[ { "from": "system", "value": "Switch to using popen3 to run command\n" }, { "from": "human", "value": "require 'resque/plugins/status'\nrequire 'pty'\nrequire 'timeout'\n\nmodule ScoringEngine\n module Engine\n class WorkUnit\n @queue = \"score_checks\"\n\n include Resque::Plugins:...
ruby
chosen
[ { "from": "system", "value": "Add a level on the route consistency error\n" }, { "from": "human", "value": "require \"route_consistency_checker\"\n\ndef report_errors(errors)\n GovukError.notify(\n \"Inconsistent routes\",\n parameters: {\n errors: errors,\n }\n )\n\n errors.eac...
ruby
chosen
[ { "from": "system", "value": "Remove require. Requires are set at the base level.\n" }, { "from": "human", "value": "require 'curses'\n\n#noinspection RubyResolve\nmodule PPCurses\n class BaseAction\n\n def set_window(win)\n @win = win\n end\n\n def x_padding\n self.win_padd...
ruby
chosen
[ { "from": "system", "value": "Replace secure option with returning value if it's a Proc\n" }, { "from": "human", "value": "require \"rack/dynamic_session_secure/version\"\n\nmodule Rack\n module DynamicSessionSecure\n # Your code goes here...\n end\nend\n" }, { "from": "gpt", "v...
ruby
chosen
[ { "from": "system", "value": "Fix \"undefined symbol: __cxa_pure_virtual\" error on load.\n" }, { "from": "human", "value": "require 'mkmf'\nrequire 'fileutils'\n\nDir.chdir \"../../leveldb\"\nsystem \"make libleveldb.a\" or abort\nDir.chdir \"../ext/leveldb\"\n\n$CFLAGS << \" -I../../leveldb/in...
ruby
chosen
[ { "from": "system", "value": "Remove relative url root setting from ENV var\n\nThis is already being set by Rails configuration.\n" }, { "from": "human", "value": "module ActionController\n module Compatibility\n extend ActiveSupport::Concern\n\n # Temporary hax\n included do\n # ...
ruby
chosen
[ { "from": "system", "value": "Test for missing internal src\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe \"Scripts tests\" do\n\n it \"fails for broken external src\" do\n file = \"#{FIXTURES_DIR}/script_broken_external.html\"\n output = capture_stderr { HTML::Pr...
ruby
chosen
[ { "from": "system", "value": "Fix gemspec by removing utf8 char - It breaks running some applications\n" }, { "from": "human", "value": "require \"./lib/em-jsonrpc/version\"\n\nGem::Specification.new do |spec|\n spec.name = \"em-jsonrpc\"\n spec.version = EventMachine::JsonRPC::VERSION\n spec...
ruby
chosen
[ { "from": "system", "value": "Change to update dev dependency\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'finite_machine/version'\n\nGem::Specification.new do |spec|\n spec.name...
ruby
chosen
[ { "from": "system", "value": "Fix an issue with templating SKUs.\n" }, { "from": "human", "value": "module IslayShop\n module Admin\n class ProductsController < ApplicationController\n resourceful :product\n header('Products')\n\n def show\n dependencies\n @produ...
ruby
chosen
[ { "from": "system", "value": "Include layout id in the page response\n" }, { "from": "human", "value": "json.container do\n json.call container, :id\n json.type container.type.demodulize\n\n if container.try(:layout).present?\n json.layout do\n json.partial! \"/ninetails/containers/co...
ruby
chosen
[ { "from": "system", "value": "Change offeres_to to offers_to for method naming\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n# Serializer used to render the DFC Offer from an OFN Product\n# into JSON-LD format based on DFC ontology\nmodule DfcProvider\n class OfferSerializ...
ruby
chosen
[ { "from": "human", "value": "Add concern to prefix translations with module name translations\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nmodule GobiertoCommon\n module ModuleNamePrefixable\n extend ActiveSupport::Concern\n\n module ClassMethods\n def module_key...
ruby
chosen
[ { "from": "system", "value": "Add mandatory User Agent as client_name\n" }, { "from": "human", "value": "module Hawk\n module Model\n\n ##\n # Fetches models from the remote HTTP endpoint.\n #\n module Connection\n def self.included(base)\n base.extend ClassMethods\n ...
ruby
chosen
[ { "from": "system", "value": "Fix reversed logic for child validity\n\nThis was preventing the embedded form validity check from ever returning a proper result for a rich text field with fully valid embedded forms" }, { "from": "human", "value": "module Formalist\n class Form\n class Validit...
ruby
chosen
[ { "from": "system", "value": "Modify the code to check for lib/facter also to handle fact only modules\n" }, { "from": "human", "value": "module Librarian\n module Puppet\n module Source\n module Local\n\n def install!(manifest)\n manifest.source == self or raise Argumen...
ruby
chosen
[ { "from": "human", "value": "Patch javadoc process to avoid warning due to source in jar\n" }, { "from": "gpt", "value": "raise 'Patch already integrated into buildr code' unless Buildr::VERSION.to_s == '1.5.6'\n\nmodule Buildr\n module JavadocPatch\n module ProjectExtension\n include E...
ruby
chosen
[ { "from": "human", "value": "Add some general rdb specs." }, { "from": "gpt", "value": "# encoding: UTF-8\nrequire File.expand_path(\"../../spec_helper\", __FILE__)\n\ndescribe \"Rdb\", :js => true do\n fixtures :projects, :projects_trackers, :users, :members,\n :member_roles, :issues, :issu...
ruby
chosen
[ { "from": "system", "value": "Fix wording in user spec\n" }, { "from": "human", "value": "require \"spec_helper\"\nrequire \"jotform/report\"\n\nmodule JotForm\n describe User do\n let(:api) { API.new(ENV[\"JOTFORM_API_KEY\"]) }\n\n context \"#reports\" do\n it \"returns a list of re...
ruby
chosen
[ { "from": "system", "value": "Remove category from event specs\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe Event, type: :model do\n\n it { is_expected.to validate_presence_of(:category)}\n it { is_expected.to validate_presence_of(:volunteers_needed)}\n it { is_...
ruby
chosen
[ { "from": "system", "value": "Add Welsh test case to home routing spec\n" }, { "from": "human", "value": "require_relative '../spec_helper'\n\ndescribe 'Home routing' do\n it 'routes /en to the home controller' do\n expect(get('/en')).to route_to(controller: \"home\", action: \"show\", local...
ruby
chosen
[ { "from": "system", "value": "Create a GlobalUser migrate_all task\n" }, { "from": "human", "value": "namespace :global_user do\n desc \"Get Maximum_user id from all tenants\"\n task maximum_user_id: :environment do\n puts \"searching all tenants\"\n puts \"ID: #{GlobalUserMigrator.maxim...
ruby
chosen
[ { "from": "system", "value": "Support running spec for one file.\n" }, { "from": "human", "value": "Dir['algorithms/**/*.md'].each do |file_name|\n matcher = File.read(file_name).match(/~~~\\n(require 'rspec'\\n.+?)\\n~~~/m)\n\n next if matcher.nil?\n\n puts \"Running #{file_name}\"\n matche...
ruby
chosen
[ { "from": "system", "value": "Check if protip owner is banned before indexing.\n" }, { "from": "human", "value": "class IndexProtip < Struct.new(:protip_id)\n extend ResqueSupport::Basic\n\n @queue = 'HIGH'\n\n def perform\n protip = Protip.find(protip_id)\n protip.tire.update_index\n ...
ruby
chosen
[ { "from": "system", "value": "Use name instead of keyword\n" }, { "from": "human", "value": "module Github\n\n class Params\n\n # Construct params for query\n # params : query_params\n # Returns formatted params for api call\n\n def initialize(params)\n @params = params\n ...
ruby
chosen
[ { "from": "system", "value": "Add exact title match examples.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe \"Default search\" do\n\n it \"Should match popular items\" do\n default_search('b3340555', 'Pubmed', 3)\n end\n\n it \"Should match partial titles\" do\n d...
ruby
chosen
[ { "from": "system", "value": "Support both Cisco::Platform and Platform\n" }, { "from": "human", "value": "require 'facter'\n\nFacter.add(:cisco) do\n confine :operatingsystem => :nexus\n confine :cisco_node_utils do\n # Any version is OK so long as it is installed\n true\n end\n\n set...
ruby
chosen
[ { "from": "system", "value": "Add show_exceptions in configure block\n" }, { "from": "human", "value": "Dotenv.load if ENV['RACK_ENV'] == \"development\"\n\nrequire 'rollbar'\n\nDir[\"./helpers/*.rb\"].each { |file| require file }\nDir[\"./models/*.rb\"].each { |file| require file }\nDir[\"./rou...
ruby
chosen
[ { "from": "system", "value": "Update spec to use short url\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe \"pages\" do\n let(:english) { create :language }\n let(:page_params) { { title: 'Away we go!', language_id: english.id } }\n\n describe 'POST create' do\n i...
ruby
chosen
[ { "from": "system", "value": "Fix small bug in test\n" }, { "from": "human", "value": "# Copyright (C) 2016 Colin Fulton\n# All rights reserved.\n#\n# This software may be modified and distributed under the\n# terms of the three-clause BSD license. See LICENSE.txt\n# (located in root directory o...
ruby
chosen
[ { "from": "system", "value": "Clean up \" => '\n" }, { "from": "human", "value": "require \"rails_helper\"\n\nRSpec.describe EventsController, :type => :controller do\n describe \"GET #index\" do\n before(:each) do\n create_list(:event, 3)\n get :index\n end\n\n it \"responds...
ruby
chosen
[ { "from": "system", "value": "Raise error if engine is not MRI.\n" }, { "from": "human", "value": "require 'apnotic/connection'\nrequire 'apnotic/notification'\nrequire 'apnotic/response'\nrequire 'apnotic/stream'\nrequire 'apnotic/version'\n\nmodule Apnotic\nend\n" }, { "from": "gpt", ...
ruby
chosen
[ { "from": "system", "value": "Fix to revert resouces to resource_bundles\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"WebKitPlus\"\n s.version = \"0.4.0\"\n s.summary = \"A support library for WKWebView.\"\n\n s.description = <<-DESC\n WebKitPlus is a suppo...
ruby
chosen
[ { "from": "system", "value": "Upgrade HandBrake to 0.9.9, add application link\n" }, { "from": "human", "value": "class Handbrake < Cask\n url 'http://handbrake.fr/rotation.php?file=HandBrake-0.9.8-MacOSX.6_GUI_x86_64.dmg'\n homepage 'http://handbrake.fr/'\n version '0.9.8'\n sha1 'd255b4daa...
ruby
chosen
[ { "from": "system", "value": "Add auto_updates flag to Handbrake\n" }, { "from": "human", "value": "cask 'handbrake' do\n version '0.10.3'\n sha256 '5bf327f6d42901668490338c32eab8cc2d4db3e09ea1cb9b8c44573ed8fb5dda'\n\n url \"http://download.handbrake.fr/releases/#{version}/HandBrake-#{version...
ruby
chosen
[ { "from": "human", "value": "Add Sketch Up (version 8) Cask\n" }, { "from": "gpt", "value": "class SketchUp < Cask\n url 'http://dl.trimble.com/sketchup/SketchUpMEN.dmg'\n homepage 'http://www.sketchup.com/intl/en/'\n version '8'\n sha1 '0dbfc19d64119fee86b38bc757b0d2431eef01e0'\n\n link :a...
ruby
chosen
[ { "from": "system", "value": "Update authentication for api to be cleaner\n" }, { "from": "human", "value": "module Authenticate\n extend ActiveSupport::Concern\n\n def self.getKeyUser(token)\n ApiKey.where(access_token: token.split(\" \")[2]).pluck('user_id')\n end\n\n def self.getKeyExp...
ruby
chosen
[ { "from": "human", "value": "Apply localization in API v2 controller\n" }, { "from": "gpt", "value": "module Spree::Api::V2::BaseControllerDecorator\n Spree::Api::V2::BaseController.include(SpreeI18n::ControllerLocaleHelper)\nend\nSpree::Api::V2::BaseController.prepend(Spree::Api::V2::BaseContr...
ruby
chosen
[ { "from": "system", "value": "Handle 'not found' errors in /admin/user/../edit\n" }, { "from": "human", "value": "namespace \"/admin/users\" do\n\n admin_menu \"/admin/users/\", icon: 'fa-users', label: 'Users', priority: 20\n\n\n before do\n layout \"admin/modal\" if request.xhr?\n end\n\...
ruby
chosen
[ { "from": "system", "value": "Remove belongs_to relationships from SplitTimeSerializer.\n" }, { "from": "human", "value": "class SplitTimeSerializer < BaseSerializer\n attributes :id, :effort_id, :lap, :split_id, :bitkey, :time_from_start, :data_status, :pacer, :remarks\n link(:self) { api_v1_...
ruby
chosen
[ { "from": "system", "value": "Support numeric and boolean literals in query builder.\n" }, { "from": "human", "value": "module CMIS\n module Utils\n module_function\n\n def build_query_statement(type_id, properties, *queried_properties)\n QueryStatementBuilder.new(type_id, properties...
ruby
chosen
[ { "from": "system", "value": "Remove double slash from path\n" }, { "from": "human", "value": "require 'color'\n\nrequire \"coloration/extensions.rb\"\nrequire \"coloration//style.rb\"\nrequire \"coloration/abstract_converter.rb\"\nrequire \"coloration/color_rgba.rb\"\n\ndir = File.dirname(__FIL...
ruby
chosen
[ { "from": "system", "value": "Create structured content when creating a sub section\n\nThis makes it so that structured content is created when a sub section is. It also adds the validation into the sub section model to ensure that the content is valid according to the Structured content. This in turn means...
ruby
chosen
[ { "from": "system", "value": "Fix for outputting 'provider:' twice in .travis.yml\n\nThe 'travis setup engineyard' command outputted\r\ndeploy:\r\n provider:\r\n provider: engineyard" }, { "from": "human", "value": "require 'travis/cli/setup'\nrequire 'yaml'\n\nmodule Travis\n module CLI\n ...
ruby
chosen
[ { "from": "system", "value": "Add spec over style class\n" }, { "from": "human", "value": "describe Gnuplot::Plot do\n subject(:style) { described_class.new }\n\n xit \"Adds tests here\"\nend\n" }, { "from": "gpt", "value": "describe Gnuplot::Plot::Style do\n subject(:style) { des...
ruby
chosen
[ { "from": "system", "value": "[TTPLAT-1117] Add legal name to organization factories.\n" }, { "from": "human", "value": "FactoryBot.define do\n factory :organization do\n customer_id { 1 }\n address1 { '100 Main St' }\n city { 'Harrisburg' }\n state { 'PA' }\n zip { '...
ruby
chosen
[ { "from": "system", "value": "Make tests go quicker by changing dirwatch timers\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe \"filesystem_watcher\" do\n before(:each) do\n @core = Core.new\n @core.logger = DummyLogger.new \n @core.builder = DummyBuilder.new...
ruby
chosen
[ { "from": "system", "value": "Fix eventmachine crashing by using epoll\n" }, { "from": "human", "value": "require 'em-websocket'\nrequire 'json'\nrequire 'optparse'\n\naddress = \"0.0.0.0\"\nport = 8080\n\nOptionParser.new do |opts|\n opts.banner = \"Usage: bundle exec server.rb [options]\"\n\n...
ruby
chosen
[ { "from": "human", "value": "Add migration to add fields to annual report uploads\n" }, { "from": "gpt", "value": "class AddMoreFieldsToTradeUploads < ActiveRecord::Migration\n def change\n add_column :trade_annual_report_uploads, :is_from_epix, :boolean, default: false\n add_column :trad...
ruby
chosen
[ { "from": "system", "value": "Remove follow button in share mode\n" }, { "from": "human", "value": "module UsersHelper\n def follow_user_button(user, size_classes = \"tiny expand\")\n if user_signed_in? && user != current_user\n if current_user.following?(user)\n following = curr...
ruby
chosen
[ { "from": "system", "value": "Convert fail routes for things/post, /put, /delete routes from erb's to redirects\n" }, { "from": "human", "value": "get '/things' do\n @things = Thing.all\n erb :\"/things/index\"\nend\n\nget '/things/new' do\n erb :\"/things/new\"\nend\n\nget '/things/:id' do\n...
ruby
chosen
[ { "from": "system", "value": "Remove from_hash scopes from Authorization\n\nNot used since authorization refactory.\n" }, { "from": "human", "value": "class Authorization < ActiveRecord::Base\n belongs_to :user\n belongs_to :oauth_provider\n\n validates_presence_of :oauth_provider, :uid\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add tolk to Spree Navigation\n" }, { "from": "human", "value": "Deface::Override.new(:virtual_path => \"spree/layouts/admin\",\n :name => \"add tolk tab\",\n :insert_bottom => \"[data-hook='admin_tabs'], #admin_tabs[data-hook]...
ruby
chosen
[ { "from": "system", "value": "Use new observer API. Fixes Rails3\n" }, { "from": "human", "value": "module CollectiveIdea #:nodoc:\n module ActionController #:nodoc:\n module Audited #:nodoc:\n def audit(*models)\n ActiveSupport::Deprecation.warn(\"#audit is deprecated. Declare #...
ruby
chosen
[ { "from": "system", "value": "Add logging to onmiauth action\n" }, { "from": "human", "value": "class User < ActiveRecord::Base\n\thas_many :students, order: :first_name\n\n # Include default devise modules. Others available are:\n # :confirmable, :lockable, :timeoutable and :omniauthable\n d...
ruby
chosen
[ { "from": "system", "value": "Create \"lanes generate sceen\" command\n" }, { "from": "human", "value": "require_relative 'model_attribute'\n\nmodule Lanes\n module Command\n\n class GenerateScreen < Thor::Group\n include Thor::Actions\n OPTIONS = {\n ...
ruby
chosen
[ { "from": "system", "value": "Remove some code irrelevant to the story\n" }, { "from": "human", "value": "module ThreeLittlePigs\n class Pot\n TEMPERATURE_TO_BOIL_WATER = 110 # °C\n private_constant :TEMPERATURE_TO_BOIL_WATER\n\n attr_accessor :contents, :temperature\n\n def initial...
ruby
chosen
[ { "from": "system", "value": "Return status codes from the CI build script\n" }, { "from": "human", "value": "#!/usr/bin/ruby\nrequire File.dirname($0) + '/common'\n\nBRANCH = 'master'\nREMOTE = 'origin'\n\ndef clean_build()\n return (system(\"git checkout -f #{BRANCH}\") and\n system(...
ruby
chosen
[ { "from": "human", "value": "Add task to fix sheffield\n" }, { "from": "gpt", "value": "namespace :after_party do\n desc 'Deployment task: fix_sheffield_config'\n task fix_sheffield_config: :environment do\n puts \"Running deploy task 'fix_sheffield_config'\"\n\n # Put your task implemen...
ruby
chosen
[ { "from": "system", "value": "Migrate page publicity using SQL\n\nBefore this was done in Ruby and did not work. This does the\nsame migration in SQL and therefore much faster.\n" }, { "from": "human", "value": "class AddTimebasedPublishingColumnsToPages < ActiveRecord::Migration\n def up\n ...
ruby
chosen
[ { "from": "system", "value": "Make Capybara locator more specific\n" }, { "from": "human", "value": "require 'rails_helper'\n\nfeature 'vimrc generation' do\n scenario 'User can generate vimrc with all default settings', js: true do\n visit '/'\n\n click_on('Generate')\n\n expect(page)...
ruby
chosen
[ { "from": "system", "value": "Add warning message if the user is testing with webpack running\n" }, { "from": "human", "value": "# TODO: Move to react_on_rails\n\nmodule ReactOnRails\n module EnsureAssetsCompiled\n def self.check_built_assets\n return if @checked_built_assets\n bui...
ruby
chosen
[ { "from": "system", "value": "Add Refs to the Vuns shallow search scope\n" }, { "from": "human", "value": "module MetasploitDataModels::ActiveRecordModels::Vuln\n def self.included(base)\n base.class_eval {\n belongs_to :host, :class_name => \"Mdm::Host\"\n belongs_to :service, :cl...
ruby
chosen
[ { "from": "system", "value": "Fix domain get for non admins, Delete nonsense auth. check\n" }, { "from": "human", "value": "module Identity\n class DomainsController < ::DashboardController\n rescue_from \"MonsoonOpenstackAuth::Authentication::NotAuthorized\", with: :not_member_error\n au...
ruby
chosen