conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Add gem data, root path\n"
},
{
"from": "human",
"value": "require 'pathname'\n\nmodule Tachikoma\n # ~/users-tachikoma-dir\n def self.root_path\n @root_path ||= Pathname.new(Dir.pwd)\n end\n\n def self.root_path=(root_path)\n @root_path = Pathname.new Fil... | ruby | chosen |
[
{
"from": "human",
"value": "Add de-namespaced Booking class. Stupid copy paste, probably to be dropped again.\n"
},
{
"from": "gpt",
"value": "class Booking < ActiveRecord::Base\n validates_presence_of :debit_account, :credit_account, :title, :amount, :value_date\n\n belongs_to :debit_account... | ruby | chosen |
[
{
"from": "system",
"value": "Handle when optional folders don't exist."
},
{
"from": "human",
"value": "require \"pathname\"\nrequire \"open-uri\"\n\nmodule Meem::Templates\n PATHS = [\n Pathname.new(\"#{ENV['HOME']}/.meem/\"),\n Pathname.new(\"#{DIRECTORY}/../templates/\")\n ]\n\n # L... | ruby | chosen |
[
{
"from": "system",
"value": "Put back SSL verification on for aws-sdk\n"
},
{
"from": "human",
"value": "require 'aws-sdk'\nrequire 'stacker/stack'\n\nmodule Stacker\n class Region\n\n attr_reader :name, :defaults, :stacks, :templates_path\n\n def initialize(name, defaults, stacks, templ... | ruby | chosen |
[
{
"from": "human",
"value": "Add task to remove non-existent track_id from Event.\n"
},
{
"from": "gpt",
"value": "namespace :events do\n desc 'Create demo data using our factories'\n task fix_wrong_track: :environment do\n events = Event.all.select { |e| e.track_id && Track.find_by(id: e.t... | ruby | chosen |
[
{
"from": "system",
"value": "Use relative path to test file\n\nReverted last commits use of the full path to the test file.\nThe executable is tested from within the `testpath`, so it's unnecessary.\n"
},
{
"from": "human",
"value": "require 'formula'\n\nclass P0f < Formula\n homepage 'http://... | ruby | chosen |
[
{
"from": "system",
"value": "Add 'application/json' Accept header to requests\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nrequire 'oauth'\nrequire 'oauth/signature/plaintext'\nrequire 'json'\n\nmodule PlanningCenter\n class Client\n SITE = 'https://planningcenteronline.com'\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix sorting and inclusion of subregions in Geodata class.\n"
},
{
"from": "human",
"value": "class Geodata\n\n def self.standard_countries_subregions\n serialize_countries(sorted_countries(%w(US CA)))\n end\n\n def self.serialize_countries(countries)\n coun... | ruby | chosen |
[
{
"from": "system",
"value": "Remove iOS platform specification from podspec\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = \"RxBluetoothKit\"\n s.version = \"1.2.3\"\n s.summary = \"Bluetooth library for RxSwift\"\n\n s.description = <<... | ruby | chosen |
[
{
"from": "system",
"value": "Include the repo's name in the \"committers\" event JSON\n"
},
{
"from": "human",
"value": "require_relative 'integration_helper'\n\ndescribe \"Gitlactica\" do\n include EventMachineHelper\n include GitHubApiHelper\n include JSONHelper\n\n it \"given a list of r... | ruby | chosen |
[
{
"from": "human",
"value": "Add a pod specification file.\n"
},
{
"from": "gpt",
"value": "Pod::Spec.new do |s|\n s.name = 'MCHTTPRequestLogger'\n s.version = '0.5.0'\n s.license = 'BSD 3-Clause'\n s.summary = 'Output HTTP requests made with AFNetworking in the debug console.'\n s.h... | ruby | chosen |
[
{
"from": "system",
"value": "Add show Action to Clubs Controller\n\nUpdate the Clubs controller to include a show action.\n"
},
{
"from": "human",
"value": "class ClubsController < ApplicationController\n before_filter :authenticate_user!\n before_filter :get_club\n\n def edit\n authorize... | ruby | chosen |
[
{
"from": "system",
"value": "Set proper redirect after List creation\n"
},
{
"from": "human",
"value": "class ListsController < ApplicationController\n def index\n @lists = List.all\n end\n\n def new\n @list = List.new\n end\n\n def create\n end\n\n def edit\n end\n\n def show\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add label for Commit SHA1 in graph.\n"
},
{
"from": "human",
"value": "class ReposController < ApplicationController\n # ZOMG too much logic here.\n # TODO: Refactor and add tests.\n def show\n @repo = Repo.find_by(name: params[:repo_name])\n @commits = @re... | ruby | chosen |
[
{
"from": "system",
"value": "Sort the versions on the graph properly\n"
},
{
"from": "human",
"value": "class StatsController < ApplicationController\n before_filter :find_gem, :only => :show\n before_filter :ensure_hosted, :only => :show\n\n def index\n @number_of_gems = Rubyge... | ruby | chosen |
[
{
"from": "system",
"value": "Add users show, eliminate empty routes in users controller\n"
},
{
"from": "human",
"value": "class UsersController < ApplicationController\n def new\n end\n\n def create\n\n end\n\n def index\n end\n\n def show\n @user = User.find(1)\n end\nend"
},
{... | ruby | chosen |
[
{
"from": "system",
"value": "Add some more tests for attachments\n"
},
{
"from": "human",
"value": "require 'rails_helper'\n\nRSpec.describe Attachment do\n let(:attachment) { build(:attachment) }\n\n it \"must be valid\" do\n expect(attachment).to be_valid\n end\nend\n"
},
{
"fro... | ruby | chosen |
[
{
"from": "system",
"value": "Add helper to install puppet/pe/puppet-agent\n"
},
{
"from": "human",
"value": "require 'beaker-rspec/spec_helper'\nrequire 'beaker-rspec/helpers/serverspec'\n\nunless ENV['RS_PROVISION'] == 'no'\n # This will install the latest available package on el and deb base... | ruby | chosen |
[
{
"from": "system",
"value": "Clean up acceptance spec helper\n"
},
{
"from": "human",
"value": "require 'beaker-rspec'\nrequire 'beaker-puppet'\nrequire 'beaker/puppet_install_helper'\nrequire 'beaker/module_install_helper'\n\nrun_puppet_install_helper unless ENV['BEAKER_provision'] == 'no'\nin... | ruby | chosen |
[
{
"from": "system",
"value": "Make sure adapter definitions go through on 1.8\n"
},
{
"from": "human",
"value": "require 'helper'\n\n# Tests that verify that on 1.8 versions of ruby, simplecov simply\n# does not launch and does not cause errors on the way\nclass Test18FallBacks < Test::Unit::Tes... | ruby | chosen |
[
{
"from": "human",
"value": "Add .podspec for cocoapods support\n"
},
{
"from": "gpt",
"value": "Pod::Spec.new do |s|\n s.name = 'Layout'\n s.version = \"1.0.0\"\n s.summary = \"Elegant view layout for iOS :leaves:\"\n s.homepage = \"https://github.com/s... | ruby | chosen |
[
{
"from": "system",
"value": "Set proper type for jbuilder option to prevent a warning with Thor >= 0.19.3\n\nSee https://github.com/erikhuda/thor/pull/435, right now we got a warning\n>Expected string default value for '--jbuilder'; got true (boolean)\n"
},
{
"from": "human",
"value": "require ... | ruby | chosen |
[
{
"from": "system",
"value": "Set up Unicorn as production server\n"
},
{
"from": "human",
"value": "# config/unicorn.rb\nif ENV[\"RAILS_ENV\"] == \"development\"\n worker_processes 1\nelse\n worker_processes 3\nend\n\ntimeout 30"
},
{
"from": "gpt",
"value": "# config/unicorn.rb\n... | ruby | chosen |
[
{
"from": "human",
"value": "Insert minimal podspec file to allow inclusion via Cocoapods"
},
{
"from": "gpt",
"value": "Pod::Spec.new do |s|\n s.name = \"UIImage-Resize\"\n s.version = \"0.1.0\"\n s.summary = \"UIImage-Resize\"\n s.homepage = \"https://... | ruby | chosen |
[
{
"from": "system",
"value": "Fix the :erb filter in rails.\n\nFixes #654\n"
},
{
"from": "human",
"value": "module Haml\n class SafeErubisTemplate < Tilt::ErubisTemplate\n\n def initialize_engine\n end\n\n def prepare\n @options.merge! :engine_class => ActionView::Template::Handl... | ruby | chosen |
[
{
"from": "system",
"value": "Add rake task for rubicritic rake task\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\nnamespace :pc_reports do\n require 'rubocop/rake_task'\n\n # HTML\n RuboCop::RakeTask.new(:rubocop_html) do |tsk|\n tsk.options = ['-fhtml', '-opublic/repo... | ruby | chosen |
[
{
"from": "system",
"value": "Fix logic bug wherein the app emailed if the gem version is the latest.\n"
},
{
"from": "human",
"value": "require './lib/gem_version_validator.rb'\n\nnamespace :mail do\n desc \"test the current cached status, and email if it's bad\"\n task :if_gem_version_stale ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix Swift version in podspec\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n \n s.name = \"Tabman\"\n s.platform = :ios, \"9.0\"\n s.requires_arc = true\n s.swift_version = \"4.2\"\n\n s.version = \"2.4.1\"\n s.summary = \"A po... | ruby | chosen |
[
{
"from": "system",
"value": "Update controller to accept :content from js to db"
},
{
"from": "human",
"value": "class TaggerController < ApplicationController\n def index\n end\n \n # Saves a string to a file named filename on a user's machine\n def save_local\n send_data(\"#{params[:d... | ruby | chosen |
[
{
"from": "system",
"value": "Add myself as an author\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'active_interaction/version'\n\nGem::Specification.new do |spec|\n spec.name ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix minor bug in spec\n"
},
{
"from": "human",
"value": "require \"spec_helper\"\n\ndescribe Blimp::Sources::DiskSource do\n describe \"#initialize\" do\n it \"should take a root path\" do\n source = Blimp::Sources::DiskSource.new(\"/root\")\n source.r... | ruby | chosen |
[
{
"from": "system",
"value": "Change queue namespace of UpdateHeadPipelineForMergeRequestWorker\n"
},
{
"from": "human",
"value": "class UpdateHeadPipelineForMergeRequestWorker\n include ApplicationWorker\n include PipelineQueue\n\n def perform(merge_request_id)\n merge_request = MergeRequ... | ruby | chosen |
[
{
"from": "system",
"value": "Test cases for merging skills\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nrequire 'spec_helper'\n\ndescribe Skill do\n it \"should be created\" do\n expect { create(:skill) }.to change(Skill, :count).by(+1)\n end\n\n it \"should be valid\" do\n... | ruby | chosen |
[
{
"from": "system",
"value": "Use `let` to set up filtered array\n\nPopulate using OpenScruct instances with and without posters.\n"
},
{
"from": "human",
"value": "require_relative '../lib/movie_filter'\n\nRSpec.describe 'MovieFilter' do\n it 'returns the correct amount of movies' do\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Use a database join to get products' variants, reducing round trips.\n"
},
{
"from": "human",
"value": "Spree::OptionValue.class_eval do\n\n scope :for_product, lambda { |product| select(\"DISTINCT #{table_name}.*\").where(\"spree_option_values_variants.variant_id ... | ruby | chosen |
[
{
"from": "system",
"value": "Add hint text to money questions\n\nPreviously all money questions had a default hint-text of `in £`\nhttps://github.com/alphagov/smart-answers/pull/4150/commits/dfa0742c44874c4abbcf363451be86f7c9a8e607\n\nThis was recently removed for content clarity\nhttps://github.com/alphag... | ruby | chosen |
[
{
"from": "system",
"value": "NEW: Add recipient_id and is_new to comment serializer\n"
},
{
"from": "human",
"value": "class TaskCommentSerializer < ActiveModel::Serializer\n attributes :id, :comment, :created_at, :comment_by\n\n def comment_by\n object.user.name\n end\nend\n"
},
{
... | ruby | chosen |
[
{
"from": "system",
"value": "Revert \"The test recipe doesn’t need build-essential\"\n\nThis reverts commit 790106d85b77cdc269785e4f14b33936d7eea998.\n"
},
{
"from": "human",
"value": "name 'perl_test'\nversion '0.0.1'\ndepends 'perl'\n"
},
{
"from": "gpt",
"value": "name 'perl_test... | ruby | chosen |
[
{
"from": "system",
"value": "Package version increased from 0.1.6 to 0.1.7\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'raygun_client'\n s.version = '0.1.6'\n s.summary = 'Client for the Raygun API using the Obsidian HTTP client'\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix the selection of months on the payment view.\n"
},
{
"from": "human",
"value": "class CheckoutCell < Cell::Rails\n # Seriously Ruby, screw you for making me do this. Y U NO NO DATES?\n MONTH_NAMES = %w(January Febuary March April May June July August September... | ruby | chosen |
[
{
"from": "system",
"value": "Remove s from Tips method\n"
},
{
"from": "human",
"value": "get '/sms' do\n erb :send_sms\nend\n\npost '/sms' do\n tip = Tips.find(rand(1..(Tips.all.length)))\n msg = \"Envirotip:\" + tip\n\n\n @client = Twilio::REST::Client.new ENV['ACCOUNT_SID'], ENV['AUTH_TO... | ruby | chosen |
[
{
"from": "system",
"value": "Add some comments about how to run with local instance of snapshot server.\n"
},
{
"from": "human",
"value": "# This file is used by Rack-based servers to start the application.\nrequire 'shutterbug'\nrequire ::File.expand_path('../config/environment', __FILE__)\n\... | ruby | chosen |
[
{
"from": "system",
"value": "Add enum source_type in Bookmark model\n"
},
{
"from": "human",
"value": "class Bookmark < ApplicationRecord\n has_many :bookmark_tags\n has_many :tags, through: :bookmark_tags\nend\n"
},
{
"from": "gpt",
"value": "class Bookmark < ApplicationRecord\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add validations to Question model\n"
},
{
"from": "human",
"value": "class Question < ActiveRecord::Base\n belongs_to :user\n has_many :answers\n has_many :votes, as: :votable\n has_many :comments, as: :commentable\n\n def to_param\n \"#{id}-#{title.paramete... | ruby | chosen |
[
{
"from": "system",
"value": "Add validation to make repsonse content mandatory\n"
},
{
"from": "human",
"value": "class Response < ActiveRecord::Base\n belongs_to :responder, class_name: :User\n belongs_to :respondable, polymorphic: true\n has_many :votes, as: :votable\n\n def responder_nam... | ruby | chosen |
[
{
"from": "system",
"value": "Add custom from for welcome_email\n"
},
{
"from": "human",
"value": "class UserMailer < ApplicationMailer\n def welcome_email(user, organization)\n with_locale(user, organization) do\n organization_name = organization.display_name || t(:your_new_organizatio... | ruby | chosen |
[
{
"from": "system",
"value": "Increase failed login count to 6\n\nChange-Id: I44d0b6a06e9f97b9cd3f51056af1c11c8fbcc47f\n"
},
{
"from": "human",
"value": "class UserSession < Authlogic::Session::Base\n\n consecutive_failed_logins_limit 5\n # TODO think about removing timeout or make it optional... | ruby | chosen |
[
{
"from": "system",
"value": "Use deathmax's evomats json for data instead of scraping wiki\n"
},
{
"from": "human",
"value": "require 'json'\nrequire 'net/https'\nrequire 'uri'\n\nuri = URI.parse(\"https://raw.githubusercontent.com/Deathmax/bravefrontier_data/master/evo_list.json\")\nhttp = Net... | ruby | chosen |
[
{
"from": "system",
"value": "Add aggregate access shortcut method for integration tests.\n"
},
{
"from": "human",
"value": "class ActiveSupport::IntegrationCase < ActiveSupport::TestCase\n include Capybara::DSL\n include Rails.application.routes.url_helpers\n \n setup do\n # remove any a... | ruby | chosen |
[
{
"from": "system",
"value": "Revert \"update pod spec to 0.1.12\"\n\nThis reverts commit 5d0af5d00e711d27baefac1e5f19fd36e55a63a9.\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = \"APAddressBook\"\n s.version = \"0.1.12\"\n s.summary = \"Easy access to iO... | ruby | chosen |
[
{
"from": "system",
"value": "Change gemspec to contain README.md\n"
},
{
"from": "human",
"value": "Gem::Specification.new do |s|\n s.name = 'haproxy_log_parser'\n s.version = IO.read('VERSION').chomp\n s.authors = ['Toby Hsieh']\n s.homepage = 'https://github.com/tobyhs/haproxy_log_parser'... | ruby | chosen |
[
{
"from": "system",
"value": "Adjust in Week entity to implement translate\n"
},
{
"from": "human",
"value": "module Villeme\n module Entities\n class Week\n\n def initialize(id)\n @id = id\n end\n\n def get_day_of_week\n case @id\n when 1 then 'Domingo'\n... | ruby | chosen |
[
{
"from": "system",
"value": "Add source .bash_profile to commands\n"
},
{
"from": "human",
"value": "node[:crons].each_pair do |cronname, options|\n cron cronname do\n minute options[:minute] || \"*\"\n hour options[:hour] || \"*\"\n day options[:day] || \"*\"\n month opt... | ruby | chosen |
[
{
"from": "system",
"value": "Use the channel we open\n"
},
{
"from": "human",
"value": "#!/usr/bin/env ruby\n# encoding: utf-8\n\nrequire \"amqp\"\n\nAMQP.start(:host => \"localhost\") do |connection|\n channel = AMQP::Channel.new(connection)\n queue = channel.queue(\"task_queue\", :durable... | ruby | chosen |
[
{
"from": "system",
"value": "Send the proper ePub as part of the download\n"
},
{
"from": "human",
"value": "class Api::PapersController < ApplicationController\n include RestrictAccess\n protect_from_forgery except: :update\n\n def index\n @papers = filtered_papers\n render json: @pap... | ruby | chosen |
[
{
"from": "human",
"value": "Add common methods from topology controllers to new mixin\n"
},
{
"from": "gpt",
"value": "module TopologyMixin\n def show\n # When navigated here without id, it means this is a general view for all providers (not for a specific provider)\n # all previous navi... | ruby | chosen |
[
{
"from": "system",
"value": "Fix errant line from merge\n"
},
{
"from": "human",
"value": "class ResponsibilitiesAgreement < SimpleDelegator\n include ActiveModel::Conversion\n extend ActiveModel::Naming\n extend SingleForwardable\n\n def_single_delegator :Agreement, :reflect_on_associati... | ruby | chosen |
[
{
"from": "system",
"value": "MAke sure the atc client UI is started upon bootup\n"
},
{
"from": "human",
"value": "#\n# Copyright (c) 2014, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root director... | ruby | chosen |
[
{
"from": "system",
"value": "Update modify account api call to require account id as an argument since WePay requires it, and allow find_account to be called without arguments.\n"
},
{
"from": "human",
"value": "module WepayRails\n module Api\n module AccountMethods\n def create_accoun... | ruby | chosen |
[
{
"from": "system",
"value": "Remove the logger level configuration\n"
},
{
"from": "human",
"value": "Coderwall::Application.configure do\n config.threadsafe! unless $rails_rake_task\n config.cache_classes = true\n config.consider_all_requests_local = false\n config.action_controller.perfor... | ruby | chosen |
[
{
"from": "system",
"value": "Remove scale for better accuracy in NB\n"
},
{
"from": "human",
"value": "module MiniMagick\n class Image\n def get_pixels(*args)\n convert = MiniMagick::Tool::Convert.new\n if args.any?\n raise ArgumentError, \"must provide 4 arguments: (x, y, ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix Nagios server installs via package using a closed out pull request\n"
},
{
"from": "human",
"value": "#\n# Author:: Seth Chisamore <schisamo@opscode.com>\n# Cookbook Name:: nagios\n# Recipe:: server_package\n#\n# Copyright 2011, Opscode, Inc\n#\n# Licensed under... | ruby | chosen |
[
{
"from": "system",
"value": "Add settings to cache key\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nmodule CacheHelper\n def cache_buster(version)\n \"#{ Setting['advanced.cache_buster'] }#{ version }\"\n end\nend\n"
},
{
"from": "gpt",
"value": "# encoding: utf-8\n\... | ruby | chosen |
[
{
"from": "system",
"value": "Fix initial sync commits order...\n"
},
{
"from": "human",
"value": "class GithubSyncJob < BackgroundJob\n @queue = :default\n\n extend Resque::Plugins::Workers::Lock\n\n def self.lock_workers(params)\n \"github-sync-#{params[:stack_id]}\"\n end\n\n def perf... | ruby | chosen |
[
{
"from": "system",
"value": "Rework to include required payload\n"
},
{
"from": "human",
"value": "require 'rails_helper'\n\nRSpec.describe API::RawEntityDescriptorsController, type: :controller do\n describe 'post :create' do\n let(:entity_source) { create(:entity_source) }\n let(:sourc... | ruby | chosen |
[
{
"from": "system",
"value": "Fix issue with class variables\n"
},
{
"from": "human",
"value": "Spree::Api::ApiHelpers.class_eval do\n\n alias_method :orig_order_attributes, :order_attributes\n\n @@order_attributes = []\n def self.extended_order_attributes\n @@order_attributes\n end\n de... | ruby | chosen |
[
{
"from": "human",
"value": "[api] Add visual code to product and variant attributes\n"
},
{
"from": "gpt",
"value": "module Spree\n module Api\n ApiHelpers.module_eval do\n\n def product_attributes\n [:id, :name, :visual_code, :description, :price,\n :available_on, :perm... | ruby | chosen |
[
{
"from": "system",
"value": "Make more sense to be in the dashboard of an app.\n"
},
{
"from": "human",
"value": "Rails.application.routes.draw do\n\n scope \"admin\", :module => :admin, :as => \"admin\" do\n\n match \"/\" => \"dashboard#show\", :as => \"dashboard\"\n match \"/app/:appli... | ruby | chosen |
[
{
"from": "system",
"value": "Add routing for the new action\n"
},
{
"from": "human",
"value": "ActionController::Routing::Routes.draw do |map|\n\n map.resource :user\n map.resource :password, :only => [:new, :create, :edit, :update]\n map.resource :activation, :only => [:new, :create]\n map... | ruby | chosen |
[
{
"from": "system",
"value": "Create route for delete /items/:id\n"
},
{
"from": "human",
"value": "Rails.application.routes.draw do\n get '/items', to: 'items#index'\n get '/items/new', to: 'items#new', as: 'new_item'\n post '/items', to: 'items#create'\n get '/items/:id', to: 'items#show',... | ruby | chosen |
[
{
"from": "system",
"value": "Make the root page redirect to /members\n\nDone as an actual redirect, because web. Resolves #109\n"
},
{
"from": "human",
"value": "MemberDirectory::Application.routes.draw do\n\n get \"errors/not_found\"\n\n get \"errors/server_error\"\n\n devise_for :members, ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix bad naming of when adding migrations"
},
{
"from": "human",
"value": "module SpreeMailChimp\n module Generators\n class InstallGenerator < Rails::Generators::Base\n\n def add_javascripts\n append_file \"app/assets/javascripts/store/all.js\", \"//... | ruby | chosen |
[
{
"from": "human",
"value": "Add tests for the Rectangle class\n"
},
{
"from": "gpt",
"value": "require 'minitest/autorun'\nrequire 'r2d'\n\ndescribe Rectangle do\n before do\n R2D::Window.create width: 640, height: 480\n @rectangle = Rectangle.new(10, 20, 300, 500)\n end\n\n it 'can ha... | ruby | chosen |
[
{
"from": "system",
"value": "Set the version number because linuxbrew thinks it is \"Unix\"\n"
},
{
"from": "human",
"value": "\n# Licensed under the Apache License, Version 2.0 (the License);\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the Li... | ruby | chosen |
[
{
"from": "human",
"value": "Add code wars (7) - binary score\n"
},
{
"from": "gpt",
"value": "# http://www.codewars.com/kata/56cafdabc8cfcc3ad4000a2b\n# --- iteration 1 ---\ndef score(n)\n n < 2 ? n : 2**Math.log(n, 2).ceil - 1\nend\n\n# --- iteration 2 ---\ndef score(n)\n n < 2 ? n : 2**(n.t... | ruby | chosen |
[
{
"from": "system",
"value": "Configure seeds proxy via ENV['SEEDS'].\n"
},
{
"from": "human",
"value": "class SeedsProxy < Rack::Proxy\n USE = :remote\n LOCAL_URL = 'localhost:3001'\n REMOTE_URL = 'cocoa-tree.github.io:80'\n\n def rewrite_env(env)\n if USE == :remote\n env[\"HTTP_HO... | ruby | chosen |
[
{
"from": "system",
"value": "Install redis on heroku for sidekiq\n"
},
{
"from": "human",
"value": "require_relative \"../base\"\n\nmodule Suspenders\n module Production\n class ManifestGenerator < Generators::Base\n def render_manifest\n expand_json(\n \"app.json\",\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix link to useful tools."
},
{
"from": "human",
"value": "include_recipe 'useful_tools'\ninclude_recipe 'maintenance::users'\ninclude_recipe 'maintenance::admin_users'\n"
},
{
"from": "gpt",
"value": "include_recipe 'maintanance::useful_tools'\ninclude_... | ruby | chosen |
[
{
"from": "human",
"value": "Add formula for RubyMine EAP with bundled JDK\n"
},
{
"from": "gpt",
"value": "cask :v1 => 'rubymine-eap-bundled-jdk' do\n version '141.373'\n sha256 '2605d3b61d9ae4a0590337d04bc24bf2f1c430cb5c226b1bffafcde6b61e478d'\n\n url \"https://download.jetbrains.com/ruby/R... | ruby | chosen |
[
{
"from": "system",
"value": "Make sure assets are precompiled on Heroku\n\nHeroku recommends that `config.assets.initialize_on_precompile = false`,\nwhich means that this initializer will not be invoked by\n`rake assets:precompile`, which forces developers deploying to Heroku\nto duplicate this initializer... | ruby | chosen |
[
{
"from": "system",
"value": "Add point free style test\n"
},
{
"from": "human",
"value": "require 'test_helper'\n\nclass TryTest < MiniTest::Unit::TestCase\n def test_success\n assert_equal 2, Try { 10 / 5 }.value\n end\n\n def test_failure\n assert_kind_of ZeroDivisionError, Try { 10 ... | ruby | chosen |
[
{
"from": "system",
"value": "Use block for listen... more concise\n"
},
{
"from": "human",
"value": "require \"yaml\"\n\nmodule Frizz\n class Configuration\n YAML_FILENAME = \"frizz.yml\"\n\n attr_accessor :access_key_id, :secret_access_key, :environments,\n :current_environment\n\... | ruby | chosen |
[
{
"from": "system",
"value": "Add test to ensure port numbers are supported in external resources.\n"
},
{
"from": "human",
"value": "require 'test_helper'\nrequire 'ventilation/deep_stack'\n\nclass TestVentilation < Test::Unit::TestCase\n\n context \"a test consumer\"do\n setup do\n Fa... | ruby | chosen |
[
{
"from": "system",
"value": "Update Shell adapter to use a User as its source.\n"
},
{
"from": "human",
"value": "module Lita\n module Adapters\n class Shell < Adapter\n def run\n puts 'Type \"exit\" or \"quit\" to end the session.'\n loop do\n print \"#{robot.na... | ruby | chosen |
[
{
"from": "system",
"value": "Change URI parse depending on `ascii_only?`\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\nrequire 'redirect_follow_get/version'\nrequire 'net/http'\n\nmodule RedirectFollowGet\n class TooManyRedirects < StandardError; end\nend\n\ndef redirect_fo... | ruby | chosen |
[
{
"from": "system",
"value": "Fix a bug: slots cache is not used\n"
},
{
"from": "human",
"value": "module Renoir\n # Store cluster information.\n class ClusterInfo\n class << self\n def node_name(host, port)\n \"#{host}:#{port}\"\n end\n end\n\n def initialize\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor get_headers to avoid needless array looping\n"
},
{
"from": "human",
"value": "require 'socket'\nrequire_relative 'handler'\nrequire_relative 'parser'\n\nclass Server\n\tattr_reader :server, :client, :port, :handler\n\n\tdef initialize(port, array_of_pages,... | ruby | chosen |
[
{
"from": "human",
"value": "Add specs for HtmlEntities module\n"
},
{
"from": "gpt",
"value": "require \"spec_helper\"\nrequire \"str_sanitizer/html_entities\"\n\nRSpec.describe StrSanitizer::HtmlEntities do\n before(:each) do\n @methods = ExampleClass\n\n @encode_string = \"<div>Hello w... | ruby | chosen |
[
{
"from": "system",
"value": "Change to fix spec var shadowing\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nRSpec.describe TTY::Spinner, '#job' do\n it \"adds and executes job\" do\n spinner = TTY::Spinner.new(\"[:spinner] :title\")\n called = []\n work = proc { |spinner| ca... | ruby | chosen |
[
{
"from": "human",
"value": "Create script to add user to sqlite3\n"
},
{
"from": "gpt",
"value": "# -*- coding: utf-8 -*-\n\nrequire 'sqlite3'\n\n@database_yml = ARGV[0]\n\n@nomnichi_db = SQLite3::Database.new(\"nomnichi.sqlite3\")\nprint \"User : \"; user = gets.chomp\nprint \"Pass : \"; pass ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix `test_case_insensitiveness` to follow up eb5fef5\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nrequire \"cases/helper\"\n\nclass PostgresqlCaseInsensitiveTest < ActiveRecord::PostgreSQLTestCase\n class Default < ActiveRecord::Base; end\n\n... | ruby | chosen |
[
{
"from": "system",
"value": "Fix performance platform date validations\n\nvalidation was stopping report being generated\nby the week of the year, regardless of the year\nitself.\n\nThis meant users could not run a report for\nweek 51 of 2018 during week 51 of 2019.\n"
},
{
"from": "human",
"va... | ruby | chosen |
[
{
"from": "system",
"value": "Add more validation to test\n"
},
{
"from": "human",
"value": "class Company\n include ActiveModel::Model\n\n attr_accessor :name, :address, :number\n\n validates :name, :address, :number, presence: {message: \"cannot be blank!\"}\n validates :name, :address, le... | ruby | chosen |
[
{
"from": "system",
"value": "Add an example for cli.remove\n"
},
{
"from": "human",
"value": "require 'spec_helper'\nrequire 'ec2ssh/cli'\nrequire 'ec2ssh/command/init'\n\ndescribe Ec2ssh::CLI do\n subject(:cli) { Ec2ssh::CLI.new }\n\n around do |example|\n silence_stdout { example.run }\n... | ruby | chosen |
[
{
"from": "system",
"value": "Add a few more mongo mapper extension tests"
},
{
"from": "human",
"value": "require 'test_helper'\n\nclass MongoMapperTest < Test::Unit::TestCase\n\n context \"The MongoMapper extension\" do\n setup do\n setup_fixtures\n @person = MongoMapperPerson.cr... | ruby | chosen |
[
{
"from": "system",
"value": "Use git ls-files to generate the file list\n"
},
{
"from": "human",
"value": "require File.expand_path('../lib/daemons/version', __FILE__)\n\nGem::Specification.new do |s|\n s.name = %q{daemons}\n s.version = Daemons::VERSION\n s.date = %q{2013-06-26}\n s.author... | ruby | chosen |
[
{
"from": "system",
"value": "Update files, test_files, executables to use git list."
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib/', __FILE__)\n$:.unshift lib unless $:.include?(lib)\n\nrequire 'openssl-extensions/version'\n\nextra_rdoc_files = ['CHA... | ruby | chosen |
[
{
"from": "system",
"value": "Fix migration after paranoid gem changed the default scope\n"
},
{
"from": "human",
"value": "class AddPoolFamilyToInstance < ActiveRecord::Migration\n def self.up\n add_column :instances, :pool_family_id, :integer\n add_column :deployments, :pool_family_id, ... | ruby | chosen |
[
{
"from": "system",
"value": "Check if table exists before calling columns_hash\n"
},
{
"from": "human",
"value": "module RetinaRails\n module Extensions\n module CarrierWave\n module Mount\n\n def self.included base\n base.module_eval do\n alias_method :origi... | ruby | chosen |
[
{
"from": "system",
"value": "Add migrator for new weapon override structure\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nnamespace :lca do\n namespace :migrate do\n desc 'Move weapon pool data (attack attribute, etc) to new Overrides hash'\n task weapon_overrides: ... | ruby | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.