conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Fix for bitstamp bitcoin client.\n"
},
{
"from": "human",
"value": "module RbtcArbitrage\n module Clients\n class BitstampClient\n include RbtcArbitrage::Client\n\n def balance\n return @balance if @balance\n balances = Bitstamp.balance\n... | ruby | chosen |
[
{
"from": "system",
"value": "Address does not reference the owner.\n"
},
{
"from": "human",
"value": "require File.join(File.dirname(__FILE__), '..', 'test_case')\nrequire 'caruby/util/uniquifier'\n\nclass AddressTest < Test::Unit::TestCase\n include CaTissue::TestCase\n\n def setup\n supe... | ruby | chosen |
[
{
"from": "system",
"value": "Add solution for challenge 4.6\n"
},
{
"from": "human",
"value": "# Concatenate Two Arrays\n\n# I worked on this challenge [by myself ].\n\n\n# Your Solution Below\n\ndef array_concat(array_1, array_2)\n\t\t\n a = array_1+array_2\n a.flatten\n #array_1.concat arr... | ruby | chosen |
[
{
"from": "system",
"value": "Change license to not include license file\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = \"TDNotificationPanel\"\n s.version = \"0.3.1\"\n s.summary = \"TDNotificationPanel is a drop in class that displays a notification pan... | ruby | chosen |
[
{
"from": "system",
"value": "Set license type to “MIT”\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n\n s.name = \"Titanium\"\n s.version = \"0.7\"\n s.summary = \"Image viewer library\"\n\n s.description = <<-DESC\n A library that provides a ... | ruby | chosen |
[
{
"from": "system",
"value": "Add RFC 141 healthcheck endpoints\n\nOnce govuk-puppet has been updated, the old endpoint can be removed.\n\nSee the RFC for more details.\n"
},
{
"from": "human",
"value": "Rails.application.routes.draw do\n get \"/healthcheck\",\n to: GovukHealthcheck.rack_r... | ruby | chosen |
[
{
"from": "system",
"value": "issue-289: Make rubocop happy with last change.\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\nRails.application.routes.draw do\n devise_for :users, controllers: { registrations: 'registrations' }\n\n scope \"/admin\" do\n resources :users, o... | ruby | chosen |
[
{
"from": "system",
"value": "Comment controller actions for following/unfollowing\n"
},
{
"from": "human",
"value": "module Spree\n module Api\n module V1\n\n TaxonsController.class_eval do\n def follow\n taxon = Spree::Taxon.find(params[:id])\n\n # Handle uniq... | ruby | chosen |
[
{
"from": "system",
"value": "Increase length for contact message to 2000 characters.\n"
},
{
"from": "human",
"value": "class ContactMessage\n include ActiveModel::Validations\n include ActiveModel::Conversion\n extend ActiveModel::Naming\n\n attr_accessor :id, :name, :email, :message\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Test for `brew ruby -e 'puts \"testball\".f.path'`\n\nThis test aims to prevent regressions of #9362.\n"
},
{
"from": "human",
"value": "# typed: false\n# frozen_string_literal: true\n\nrequire \"cmd/shared_examples/args_parse\"\n\ndescribe \"Homebrew.ruby_args\" do... | ruby | chosen |
[
{
"from": "system",
"value": "Add Mason to an authors list\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'carquery/version'\n\nGem::Specification.new do |spec|\n spec.name ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix typo with class 2 exercise 1 spec\n"
},
{
"from": "human",
"value": "RSpec.describe 'Class 2 Exercise 1' do\n let(:exercise1) do\n load File.expand_path('../../../lib/class2/exercise1.rb', __FILE__)\n end\n\n it 'outputs to STDOUT' do\n expect { exercis... | ruby | chosen |
[
{
"from": "system",
"value": "Update test to reflect new 'provider' key setting\n\n[#59365332]\n\nSigned-off-by: Matt Royal <6463362714fdee6ae948b4a582165edffac2664e@pivotallabs.com>\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe 'GET /v2/catalog' do\n it 'returns the cata... | ruby | chosen |
[
{
"from": "system",
"value": "Update gc_ruboconfig requirement from ~> 2.25.0 to ~> 2.26.0\n\nUpdates the requirements on [gc_ruboconfig](https://github.com/gocardless/ruboconfig) to permit the latest version.\n- [Release notes](https://github.com/gocardless/ruboconfig/releases)\n- [Changelog](https://githu... | ruby | chosen |
[
{
"from": "system",
"value": "Update rubocop requirement from ~> 1.1.0 to ~> 1.2.0\n\nUpdates the requirements on [rubocop](https://github.com/rubocop-hq/rubocop) to permit the latest version.\n- [Release notes](https://github.com/rubocop-hq/rubocop/releases)\n- [Changelog](https://github.com/rubocop-hq/rub... | ruby | chosen |
[
{
"from": "system",
"value": "Sort of example for an alternative way of defining productions for the same rule\n"
},
{
"from": "human",
"value": "require File.expand_path(File.dirname(__FILE__) + \"/../lib/grammoire\")\n\ngrammar = Grammoire.define do\n rule(:s) { produce(:s) + produce(:s) }\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Update to match ID of mock existing monitor JSON\n"
},
{
"from": "human",
"value": "require 'sinatra/base'\n\nclass FakeCronitor < Sinatra::Base\n get '/v1/monitors/:id' do\n if ['abcd', 'Test Cronitor'].include? params['id']\n return json_response 200, 'ex... | ruby | chosen |
[
{
"from": "system",
"value": "Update Ember Resolver version to 0.1.15\n"
},
{
"from": "human",
"value": "module Ember\n module CLI\n module Resolver\n VERSION = '0.1.14'\n end\n end\nend\n"
},
{
"from": "gpt",
"value": "module Ember\n module CLI\n module Resolver\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Check third level domains for any case\n"
},
{
"from": "human",
"value": "require 'mail'\n\nclass FakeEmailService\n\n def initialize\n fake_domains_file = File.expand_path('../../config/fake_domains.list', __FILE__)\n @fake_domains = File.readlines(fake_doma... | ruby | chosen |
[
{
"from": "system",
"value": "Configure initializer to precompile images.\n"
},
{
"from": "human",
"value": "require \"leaflet-draw-rails/version\"\n\nmodule Leaflet\n module Draw\n module Rails\n class Engine < ::Rails::Engine\n end\n end\n end\nend\n"
},
{
"from": "gp... | ruby | chosen |
[
{
"from": "system",
"value": "Use namespaced names for initializers\n"
},
{
"from": "human",
"value": "module ReportsKit\n class Engine < ::Rails::Engine\n engine_name 'reports_kit'\n\n initializer 'helper' do\n ActiveSupport.on_load(:action_view) do\n include Helper\n en... | ruby | chosen |
[
{
"from": "system",
"value": "Raise ArgumentError if properties are blank\n"
},
{
"from": "human",
"value": "module ReportsKit\n module Helper\n def render_report(properties, &block)\n if properties.is_a?(String)\n path = Rails.root.join('config', 'reports_kit', 'reports', \"#{pr... | ruby | chosen |
[
{
"from": "system",
"value": "Add command name to query\n"
},
{
"from": "human",
"value": "require \"cgi\"\n\nmodule Scout\n module Commands\n class Ask < Scout::Command\n trigger :how\n trigger :what\n trigger :when\n trigger :which\n trigger :who\n help \"A... | ruby | chosen |
[
{
"from": "system",
"value": "Support parsing times with or without seconds\n\nAlso parse the timezone now.\n"
},
{
"from": "human",
"value": "module DataService\n class Record\n require 'securerandom'\n\n attr_reader :uid, :id, :reading, :datetime, :extra\n def initialize(date, value,... | ruby | chosen |
[
{
"from": "system",
"value": "Fix warning with Ruby 2.0.0:\n\nCould not retrieve fact='xcodeversion', resolution='<anonymous>': undefined method `exists' for File:Class\n"
},
{
"from": "human",
"value": "Facter.add(:xcodeversion) do\n confine :operatingsystem => :darwin\n setcode do\n retur... | ruby | chosen |
[
{
"from": "human",
"value": "Add a feature tests to check if a view can be rendered properly\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\n\nfeature 'Pipelines for Merge Requests', feature: true, js: true do\n include WaitForAjax\n\n given(:user) { create(:user) }\n given(:merge_req... | ruby | chosen |
[
{
"from": "system",
"value": "Fix url and homepage to use SSL in Kontroll Cask\n\nThe HTTP URL is already getting redirected to HTTPS. Using the HTTPS URL directly\nmakes it more secure and saves a HTTP round-trip.\n"
},
{
"from": "human",
"value": "cask :v1 => 'kontroll' do\n version :latest\n... | ruby | chosen |
[
{
"from": "system",
"value": "Allow definition of DJ queues\n"
},
{
"from": "human",
"value": "dep_included? 'delayed_job'\n\nnamespace :delayed_job do\n\n desc \"Writes the delayed job part of the Procfile\"\n task :procfile, :roles => :dj do\n procfile_template = <<-EOF.gsub(/^\\s+/, '')\... | ruby | chosen |
[
{
"from": "human",
"value": "Revert \"Moved to one_to_many.rb as Proxy.\"\n\nThis reverts commit 682e5c4ae2c17ae13418f010290776654d05be68.\n"
},
{
"from": "gpt",
"value": "require 'forwardable'\n\nmodule DataMapper\n module Associations\n class ParentToChildAssociation\n extend Forwarda... | ruby | chosen |
[
{
"from": "system",
"value": "Handle weird classes that have no name."
},
{
"from": "human",
"value": "#\n# Copyright 2013-2015, Noah Kantrowitz\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": "human",
"value": "Add tests for this fact.\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\n\ndescribe 'rabbitmq_erlang_cookie', :type => :fact do\n before(:each) { Facter.clear }\n\n it 'works correctly' do\n Facter.fact(:osfamily).stubs(:value).returns('RedHat')\n Fil... | ruby | chosen |
[
{
"from": "system",
"value": "[PoC] Fix improper Dashboard list indexing\n\nHaving two repos I'm facing improper list indexing\nin Dashboard. Here is how it looking https://gist.github.com/a454501c92026be915bf.\nPressing key `1` that corresponds unexising repo is\nclosing space. \nThis fix is Proof of Conce... | ruby | chosen |
[
{
"from": "system",
"value": "Fix initialization with :none arg.\n"
},
{
"from": "human",
"value": "require 'spinoza/system/node'\nrequire 'spinoza/calvin/sequencer'\n#require 'spinoza/calvin/scheduler'\n\nclass Calvin::Node < Spinoza::Node\n attr_reader :sequencer, :scheduler\n attr_reader :l... | ruby | chosen |
[
{
"from": "system",
"value": "Add rake task to backfill publishing_api_* dates\n\nThis task takes all the edition timestamps that are prefixed with\n`temporary_` and backfills their equivalent prefixed with\n`publishing_api_`.\n\nThis is to allow switching to the `publishing_api_*` dates and work\ntowards t... | ruby | chosen |
[
{
"from": "system",
"value": "Fix spacing issue with subcommands."
},
{
"from": "human",
"value": "module Troo\n module CLI\n class ThorFixes < Thor\n def self.banner(command, namespace = nil, subcommand = false)\n if subcommand\n \"#{basename} #{@package_name} #{command... | ruby | chosen |
[
{
"from": "system",
"value": "Fix typo in gem project home page url.\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/html_mini', __FILE__)\n\nGem::Specification.new do |s|\n s.name = %q{html_mini}\n s.version = HtmlMini::VERSION\n s.platform ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix boolean operation for pattern matching\n"
},
{
"from": "human",
"value": "module Sastrawi\n module Morphology\n class InvalidAffixPairSpecification\n def satisfied_by?(word)\n return false if /^me(.*)kan$/.match(word)\n\n return false if w... | ruby | chosen |
[
{
"from": "system",
"value": "Remove trailing question mark in pagination\n"
},
{
"from": "human",
"value": "# add `:no_uri` options to skip query params in pagination urls\nrequire 'will_paginate/view_helpers/action_view'\n\nWillPaginate::ViewHelpers.pagination_options[:no_uri] = false\nWillPag... | ruby | chosen |
[
{
"from": "system",
"value": "REPAIR TABLE does not return output\n"
},
{
"from": "human",
"value": "require_relative '../command'\n\nmodule AmazonAthena\n module Commands\n class RepairTable < AmazonAthena::Command\n\n def initialize(database_table)\n @database_table = database_... | ruby | chosen |
[
{
"from": "system",
"value": "Fix photos breaking on rollout\n"
},
{
"from": "human",
"value": "require 'bundler/capistrano'\nload 'deploy/assets'\nset :application, \"ilp2\"\nset :deploy_to, \"/srv/#{application}\"\nset :repository, \"git://github.com/sdc/leap.git\"\nset :scm, :git\nset :use_s... | ruby | chosen |
[
{
"from": "system",
"value": "Use the committee factory to create councils.\n"
},
{
"from": "human",
"value": "require File.dirname(__FILE__) + '/../../test_helper'\n\nclass Groups::MembershipsControllerTest < ActionController::TestCase\n\n def setup\n @user = FactoryGirl.create(:user)\n ... | ruby | chosen |
[
{
"from": "system",
"value": "[JRO] Check for presence of messageboard_id\n\nBefore searching for something with a particular param key, check that\nit's there.\n"
},
{
"from": "human",
"value": "module Thredded\n class ApplicationController < ::ApplicationController\n helper Thredded::Engin... | ruby | chosen |
[
{
"from": "system",
"value": "Change path in header for login\n"
},
{
"from": "human",
"value": "Rails.application.routes.draw do\n devise_for :users, :controllers => { :omniauth_callbacks => \"users/omniauth_callbacks\" }\n\n root 'home#index'\n\n resources :schedules\nend\n"
},
{
"f... | ruby | chosen |
[
{
"from": "system",
"value": "Add a new route to intercept redirects from Shopify like this: /orders?id=123\n"
},
{
"from": "human",
"value": "ActionController::Routing::Routes.draw do |map|\n map.root :controller => 'login'\n\n map.resources :orders, :only => [:index, :show], :member => {:pre... | ruby | chosen |
[
{
"from": "system",
"value": "Add via to match route, for Rails 4 compatibility.\n"
},
{
"from": "human",
"value": "Devise::Oauth2Providable::Engine.routes.draw do\n root :to => \"authorizations#new\"\n\n resources :authorizations, :only => :create\n match 'authorize' => 'authorizations#new'\... | ruby | chosen |
[
{
"from": "system",
"value": "Add session check in eid/photo\n"
},
{
"from": "human",
"value": "class Frontend::EidController < Frontend::FrontendController\n before_filter :load_club, :only => :auth\n def auth\n save_redirect :post_eid_redirect\n\n request = Onelogin::Saml::Authrequest.... | ruby | chosen |
[
{
"from": "system",
"value": "Fix spec\n* Deal with I18n\n"
},
{
"from": "human",
"value": "require 'rails_helper'\n\nRSpec.feature \"Logins\", type: :feature do\n describe '/login' do\n before do\n create(:user)\n end\n\n describe 'given currect username' do\n before do\n ... | ruby | chosen |
[
{
"from": "human",
"value": "Add a test for a word search.\n"
},
{
"from": "gpt",
"value": "require 'rails_helper'\n\nfeature 'Search question' do\n scenario \"search a keyword\" do\n visit root_path\n find('#search_form').fill_in 'q', with: 'Aliquam'\n click_button 'Search'\n\n exp... | ruby | chosen |
[
{
"from": "system",
"value": "Add map helper to RegistrationController\n\nFixes 3 errors including:\n\nRegistration Terms of Service agreement if accepting Terms of Service is not required allows registration as normal\n Failure/Error: super\n\n ActionView::Template::Error:\n undefined method ... | ruby | chosen |
[
{
"from": "system",
"value": "Package version is increased from 0.1.1 to 0.1.2\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'identifier-uuid'\n s.version = '0.1.1'\n s.summary = 'UUID identifier generator with support for dependency co... | ruby | chosen |
[
{
"from": "system",
"value": "Correct type signatures for main, exit, and puts.\n\nPer POSIX, these should be using machine integers, not 32-bit integers.\n"
},
{
"from": "human",
"value": "require \"brilliant/ast/node\"\nrequire \"brilliant/type\"\nrequire \"llvm/core\"\n\n\nclass Brilliant::AS... | ruby | chosen |
[
{
"from": "system",
"value": "Clean up action only for accounts\n"
},
{
"from": "human",
"value": "module RailsAdmin\n module Config\n module Actions\n\n class CleanUp < RailsAdmin::Config::Actions::Base\n\n register_instance_option :pjax? do\n true\n end\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Remove invoices from Subscription renderer\n"
},
{
"from": "human",
"value": "module Travis::API::V3\n class Renderer::Subscription < ModelRenderer\n representation(:standard, :id, :valid_to, :plan, :coupon, :status, :source, :billing_info, :credit_card_info, :o... | ruby | chosen |
[
{
"from": "system",
"value": "Change YAML file to load\n"
},
{
"from": "human",
"value": "module Fixtures\n path = File.expand_path('./test/fixtures/font-awesome-3-2-1-icons.yml')\n ICONS = YAML.load_file(path).compact.uniq.sort\n\n def self.icons\n ICONS\n end\nend\n"
},
{
"from"... | ruby | chosen |
[
{
"from": "system",
"value": "Change connector configuration's provider foreign key on-delete\n\nMake it restrict rather than cascade, since deleting providers for\nwhich configurations exists should be taken with care.\n"
},
{
"from": "human",
"value": "Sequel.migration do\n up do\n create_... | ruby | chosen |
[
{
"from": "human",
"value": "Refactor Authentication module for Users\n\nMove authentication module to app/models/users/.\nBorrow a finished refactor of Authentication module (it's from the\ndevelopment-OAuth branch)\n"
},
{
"from": "gpt",
"value": "module Users\n module AuthenticatedSessions\n... | ruby | chosen |
[
{
"from": "system",
"value": "Update capistrano lock to 3.7.0\n"
},
{
"from": "human",
"value": "lock '3.6.1'\n\nset :application, 'evemonk'\nset :repo_url, 'git@github.com:biow0lf/evemonk.git'\n\nset :rbenv_type, :user\nset :rbenv_ruby, File.read('.ruby-version').strip\n\nset :linked_files, %w(... | ruby | chosen |
[
{
"from": "human",
"value": "Add my solution to challenge 4.3.1\n"
},
{
"from": "gpt",
"value": "# Format an Address\r\n\r\n# I worked on this challenge [by myself, with: ].\r\n\r\ndef make_address (street, city, state, zip)\r\n\r\n\treturn 'You live at ' + street + ', in the beautiful city of '... | ruby | chosen |
[
{
"from": "system",
"value": "Add destory resource for tags.\n"
},
{
"from": "human",
"value": "Rails.application.routes.draw do\n root 'home#index'\n devise_for :users, controllers: {omniauth_callbacks: \"users/omniauth_callbacks\"}\n\n resources :users, only: [:show] do\n resources :reso... | ruby | chosen |
[
{
"from": "system",
"value": "Delete first 'resources :users'\nThere was another one at the right place (below scope)\n"
},
{
"from": "human",
"value": "Rails.application.routes.draw do\n\n resources :users\n scope '/:locale', :locale => /de|fr|it|en/, :format => /json|html|csv/ do\n resour... | ruby | chosen |
[
{
"from": "system",
"value": "Edit Routes For User Authentication\n"
},
{
"from": "human",
"value": "Rails.application.routes.draw do\n\n resources :questions\n\n root 'questions#index'\n\n get 'welcome/question', to: 'welcome#question'\n\nend\n"
},
{
"from": "gpt",
"value": "Rail... | ruby | chosen |
[
{
"from": "system",
"value": "Declare compatibility with ActiveRecord 3.0.\n\nStrictly speaking, this declares compatibility with every ActiveRecord\nversion >= 2.3.0, and I need a CI build to provide some evidence of\nthat; however, dagnabit's specs and Cucumber scenarios pass with 2.3.10\nand 3.0.3, so I'... | ruby | chosen |
[
{
"from": "system",
"value": "Allow underscores also in interpolations\n"
},
{
"from": "human",
"value": "class Interpolator\n\n REGEXP = /(\\$\\{\\s*(?:[a-zA-Z][a-zA-Z0-9]*::)*[a-zA-Z][a-zA-Z0-9]*\\s*\\})/\n\n\tdef initialize( resolver)\n\t\t@resolver = resolver\n\tend\n\n\tdef translate(strin... | ruby | chosen |
[
{
"from": "system",
"value": "Use query_string method instead of manually mapping query parameters\n"
},
{
"from": "human",
"value": "require_relative 'base'\n\nclass GdsApi::NeedApi < GdsApi::Base\n\n def needs(options = {})\n query = \"?\"+options.map { |k,v| \"#{k}=#{v}\" }.join(\"&\") un... | ruby | chosen |
[
{
"from": "system",
"value": "Remove version check on ActiveSupport"
},
{
"from": "human",
"value": "$LOAD_PATH.unshift(File.dirname(__FILE__)) unless $LOAD_PATH.include?(File.dirname(__FILE__))\n\nrequire 'zlib'\nrequire 'curb'\nrequire 'sax-machine'\nrequire 'loofah'\nrequire 'uri'\n\nrequire ... | ruby | chosen |
[
{
"from": "system",
"value": "Replace ('-' * 25) with a literal.\n"
},
{
"from": "human",
"value": "require 'fileutils'\nrequire 'thor'\n\nmodule Flexo\n class CLI < Thor\n\n include Thor::Actions\n\n # init -------------------------------------------------------------------\n\n desc '... | ruby | chosen |
[
{
"from": "system",
"value": "Set a constant referencing the module scope.\n"
},
{
"from": "human",
"value": "require \"rubinius/toolset/version\"\n\nmodule Rubinius\n module ToolSet\n def self.current\n @current ||= Module.new\n end\n\n def self.start\n @current = nil\n e... | ruby | chosen |
[
{
"from": "system",
"value": "Remove reference to access token\n"
},
{
"from": "human",
"value": "class CacheChannel < ApplicationCable::Channel\n # rubocop:disable Metrics/MethodLength\n # rubocop:disable Metrics/AbcSize\n def set(params)\n search_params = FormatSearchParams.new(params)\n... | ruby | chosen |
[
{
"from": "system",
"value": "Put Lang::List first since it's the most important.\n"
},
{
"from": "human",
"value": "module Moho\n module Lang\n class Expression < Struct.new(:value)\n end\n\n class Int < Expression\n def eval\n value\n end\n end\n\n class String... | ruby | chosen |
[
{
"from": "system",
"value": "Add drug grouper to rake environment\n"
},
{
"from": "human",
"value": "namespace :dgidb do\n namespace :group do\n desc 'run the gene grouper'\n task genes: :environment do\n Utils::Logging::without_sql do\n Genome::Groupers::GeneGrouper.run\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Remove line of code that isn't neede\n"
},
{
"from": "human",
"value": "require 'nokogiri'\nrequire 'ostruct'\nrequire 'urban/version'\nrequire 'urban/web'\n\nmodule Urban\n class Dictionary\n\n attr_accessor :web_service\n\n def initialize\n @web_servic... | ruby | chosen |
[
{
"from": "system",
"value": "Fix pry patch to allow REPL hook for flushing."
},
{
"from": "human",
"value": "require 'pry'\n\nclass Pry\n # To make the console more useful, we make it so we flush the event registry\n # after each line. This makes it so events are triggered after each line.\n... | ruby | chosen |
[
{
"from": "human",
"value": "Add product protoypes shared context to its own file\n"
},
{
"from": "gpt",
"value": "shared_context \"product prototype\" do\n\n def build_option_type_with_values(name, values)\n ot = FactoryGirl.create(:option_type, :name => name)\n values.each do |val|\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Update the demo listing to show more functionality\n"
},
{
"from": "human",
"value": "require 'net/http'\nrequire 'net/https'\nrequire 'uri'\nrequire 'json'\n\nrequire 'rubycouch/client'\nrequire 'rubycouch/definitions'\nrequire 'rubycouch/document'\nrequire 'rubyco... | ruby | chosen |
[
{
"from": "system",
"value": "Remove casting in model - values should always be an array\n"
},
{
"from": "human",
"value": "class TreeFieldType < FieldType\n attr_accessor :values\n\n validates :values, presence: true, if: :validate_presence?\n validate :minimum, if: :validate_minimum?\n va... | ruby | chosen |
[
{
"from": "system",
"value": "Use an Idea 'before_action' to populate associations\n\nBefore rendering either of the 'GET' views, populate potential idea\nassociations with instance variables to allow admins to set idea\nattributes (owners, current, state) to these values.\n"
},
{
"from": "human",
... | ruby | chosen |
[
{
"from": "system",
"value": "Fix matching of non-bare domains for domain-specifying tenants.\n\nBasically reimplmentation of set_current_tenant_by_subdomain_or_domain which also checks request.host\n\nSigned-off-by: Max Fierke <0706025b2bbcec1ed8d64822f4eccd96314938d0@maxfierke.com>\n"
},
{
"from":... | ruby | chosen |
[
{
"from": "system",
"value": "Fix chomp! error when no @section\n"
},
{
"from": "human",
"value": "class ApplicationController < ActionController::Base\n protect_from_forgery with: :exception\n\n before_action :set_locale, :set_section\n\n def set_locale\n I18n.locale = params[\"locale\"] ... | ruby | chosen |
[
{
"from": "system",
"value": " Add filter for facebook callback\n"
},
{
"from": "human",
"value": "class ApplicationController < ActionController::Base\n \n protect_from_forgery with: :exception\n # before_action :authenticate_user!\n before_filter :configure_permitted_parameters, if: :devis... | ruby | chosen |
[
{
"from": "system",
"value": "Remove unused attributes from Preset\n\nRemoved create / update times, and other attributes which had a \"nil\"\nvalue for all the presets.\n\nRef quintel/etsource#298\n"
},
{
"from": "human",
"value": "module Atlas\n # Presets are saved scenarios whose results we ... | ruby | chosen |
[
{
"from": "system",
"value": "Add one more test for background notifications.\n"
},
{
"from": "human",
"value": "require 'test_helper'\n\nclass BackgroundExceptionNotificationTest < ActiveSupport::TestCase\n setup do\n begin\n 1/0\n rescue => e\n @exception = e\n @mail = Ex... | ruby | chosen |
[
{
"from": "system",
"value": "Fix whitespace, once again ...\n"
},
{
"from": "human",
"value": "\nclass Conway\n attr_reader :grid\n\n def initialize\n @grid = Grid.new 53, 7\n end\n\n def start\n number_of_living_cells = (grid.width * grid.heigth * 0.2).round\n # TODO fill closure\... | ruby | chosen |
[
{
"from": "human",
"value": "Add specs for role editor RBAC tree.\n"
},
{
"from": "gpt",
"value": "describe OpsController do\n before(:each) do\n EvmSpecHelper.seed_specific_product_features(\n %w(vm vm_compare vm_delete instance instance_delete image image_delete miq_template \n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add argument and attribute client\n"
},
{
"from": "human",
"value": "require 'erb'\nrequire 'hashie'\nrequire 'yaml'\n\nmodule Mikoshi\n class Plan\n class Base\n attr_reader :data\n\n def initialize(yaml_path: nil)\n raise ArgumentError, 'Yaml ... | ruby | chosen |
[
{
"from": "system",
"value": "Allow Reasoner.apply to take multiple arguments.\n"
},
{
"from": "human",
"value": "require 'rdf'\nrequire 'rdf/reasoner/extensions'\n\nmodule RDF\n ##\n # RDFS/OWL reasonsing for RDF.rb.\n #\n # @see http://www.w3.org/TR/2013/REC-sparql11-entailment-20130321/\n... | ruby | chosen |
[
{
"from": "system",
"value": "Fix did not monitor reaction_added RTM\n"
},
{
"from": "human",
"value": "module Slappy\n class Event\n extend Forwardable\n include Debuggable\n\n attr_accessor :matches, :data\n\n def_delegators :@data, :method_missing, :respond_to_missing?\n\n def... | ruby | chosen |
[
{
"from": "system",
"value": "Use teaspoon instead of jasmine:ci\n\nSigned-off-by: Dmitriy Zaporozhets <be23d75b156792e5acab51b196a2deb155d35d6a@gmail.com>\n"
},
{
"from": "human",
"value": "Rake::Task[\"test\"].clear\n\ndesc \"GitLab | Run all tests\"\ntask :test do\n Rake::Task[\"gitlab:test\... | ruby | chosen |
[
{
"from": "system",
"value": "Document the optional block parameter\n"
},
{
"from": "human",
"value": "require 'faraday'\nrequire 'foauth/version'\n\nmodule Foauth\n # Creates a new `Faraday` instance using the given `email` and `password`.\n #\n # @param [String] email Your foauth.org email ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix test which threw ETIMEDOUT on ruby 1.9.3p551 on Mac OS X.\n"
},
{
"from": "human",
"value": "require_relative '../../../test_helper'\nrequire 'socket'\n\nclass TimeoutInListenQueueTest < Test::Unit::TestCase\n\n include LaunchableRoleTests\n include ServerTest... | ruby | chosen |
[
{
"from": "system",
"value": "Fix policial confg loading function\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nrequire 'policial'\n\nrequire './lib/utils'\nrequire './lib/commentators/console'\nrequire './lib/commentators/github'\n\nclass Runner\n def initialize(config)\n... | ruby | chosen |
[
{
"from": "system",
"value": "Include Renderable, add attr_accessors and set the path\n"
},
{
"from": "human",
"value": "module Dimples\n class Template\n include Frontable\n\n def initialize(site, path)\n @site = site\n @contents, @metadata = read_with_front_matter(path)\n e... | ruby | chosen |
[
{
"from": "system",
"value": "Add method_missing definition to Buoys::Buoy\n\nTo interpret named routes method ex) root_path, in config/buoys/*.rb\n"
},
{
"from": "human",
"value": "module Buoys\n class Buoy\n attr_reader :previous, :context\n # buoy :account do\n # link 'Account', a... | ruby | chosen |
[
{
"from": "system",
"value": "Store actual string contents of SCSS files\n\nThis will enable us to write linters that can access the original file\nin cases where line number or other such information can be inferred\nseparately.\n\nChange-Id: I02182d1fdd19f1ce1a4c4e072c7a0655f1732889\nReviewed-on: https://... | ruby | chosen |
[
{
"from": "system",
"value": "CVEReference: Use text instead of string, to have space for long gitweb URLs\n"
},
{
"from": "human",
"value": "class CreateCveReferences < ActiveRecord::Migration\n def self.up\n create_table :cve_references do |t|\n t.string :source\n t.strin... | ruby | chosen |
[
{
"from": "system",
"value": "Fix failing DB migration for localized_names\n\nPrevious version worked correctly for migration but failed with an\nunsupported error on rollback.\n\nAddress with explicit `up`/`down` blocks.\n"
},
{
"from": "human",
"value": "Sequel.migration do\n change do\n a... | ruby | chosen |
[
{
"from": "system",
"value": "Use RestClient instead of Typhoeus in the worker\n"
},
{
"from": "human",
"value": "class DownloadManuscriptWorker\n include Sidekiq::Worker\n\n def perform(manuscript_id, url)\n manuscript = Manuscript.find(manuscript_id)\n manuscript.source.download!(url)\... | ruby | chosen |
[
{
"from": "system",
"value": "Use the method args, not the file ones.\n"
},
{
"from": "human",
"value": "require \"Qt\"\nrequire \"qtwebkit\"\nrequire \"straight_shooter/page\"\n\nclass StraightShooter\n \n attr_accessor :page, :app\n \n def self.render(url, filename = nil)\n self.new(url... | ruby | chosen |
[
{
"from": "system",
"value": "Make all of these methods private, called only from init.\n"
},
{
"from": "human",
"value": "module Vmdb\n module Initializer\n def self.init\n _log.info(\"Initializing Application: Program Name: #{$PROGRAM_NAME}, PID: #{Process.pid}, ENV['EVMSERVER']: #{EN... | ruby | chosen |
[
{
"from": "system",
"value": "Make settings feature test timezone-safe\n"
},
{
"from": "human",
"value": "require 'spec_helper'\nfeature \"Settings\", js: true do\n scenario \"edit settings\" do\n Releaf::Settings.destroy_all\n Releaf::Settings.register_defaults(\"content.updated_at\" => ... | ruby | chosen |
[
{
"from": "system",
"value": "Raise NameError Exceptions when not in production\n"
},
{
"from": "human",
"value": "require \"guillotine/engine\"\n\nmodule Guillotine\n def self.execute opts, command_string\n command_array = command_string.downcase.gsub(/[^a-z0-9\\s\\-\\_]/i, '').split ' '\n ... | ruby | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.