conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Add udl_module factory that contains an assessment\n"
},
{
"from": "human",
"value": "FactoryGirl.define do\n factory :udl_module do\n sequence(:title) { |n| \"Test Module #{n}\" }\n sequence(:slug) { |n| \"test-module-#{n}\" }\n sub_heading 'testing modul... | ruby | chosen |
[
{
"from": "system",
"value": "Add specs for Candidate.with_profession with object\n"
},
{
"from": "human",
"value": "require 'rails_helper'\n\nRSpec.describe Candidate, type: :model do\n describe \"scopes\" do\n let!(:candidate) { FactoryGirl.create(:candidate, looking_for_work: true) }\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Increase version number to 0.1.0 in podspec.\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n\n s.name = \"StompClient\"\n s.version = \"0.0.1\"\n s.summary = \"Simple STOMP client.\"\n s.description = \"This project is a simple STOMP... | ruby | chosen |
[
{
"from": "system",
"value": "Use public API of MiniTest for registering assertions.\n\nAs suggested by @tenderlove in [1]. This reduces the dependency on\nprivate & potentially more changeable behaviour in MiniTest and gets us\ncloser to the goal of not having to monkey-patch.\n\n[1] https://github.com/fre... | ruby | chosen |
[
{
"from": "system",
"value": "Change default dates - now yesterday -3 to yesterday\n"
},
{
"from": "human",
"value": "namespace :data_feeds do\n desc 'Set up data feeds'\n task :weather_underground_loader, [:start_date, :end_date] => :environment do |_t, args|\n start_date = args[:start_dat... | ruby | chosen |
[
{
"from": "system",
"value": "Add email filter for users api\n"
},
{
"from": "human",
"value": "class Api::UsersController < Api::BaseController\n def index\n @users = User.all\n @users = @users.where(id: params[:users]) if params[:users]\n render json: {users: @users.as_json(only: [:i... | ruby | chosen |
[
{
"from": "system",
"value": "Update gemspec to actually remove test files and add missing text files\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nrequire 'rake'\nrequire File.expand_path('../lib/rr/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.name = 'rr'\n gem.versi... | ruby | chosen |
[
{
"from": "system",
"value": "Work out most popular from 50 projects"
},
{
"from": "human",
"value": "class PlatformsController < ApplicationController\n def index\n @platforms = Download.platforms\n end\n\n def show\n find_platform\n @licenses = Project.platform(@platform_name).pop... | ruby | chosen |
[
{
"from": "system",
"value": "Fix deprecation warnings from FakeWeb\n"
},
{
"from": "human",
"value": "require 'rubygems'\nrequire 'test/unit'\nrequire 'shoulda'\nrequire 'mocha'\nrequire 'fake_web'\n\n$LOAD_PATH.unshift(File.dirname(__FILE__))\nrequire 'term_extraction'\n\nclass Test::Unit::Tes... | ruby | chosen |
[
{
"from": "system",
"value": "Make state abbreviations upper case\n"
},
{
"from": "human",
"value": "class Api::StateSerializer < ActiveModel::Serializer\n attributes :id, :name, :abbr\nend"
},
{
"from": "gpt",
"value": "class Api::StateSerializer < ActiveModel::Serializer\n attrib... | ruby | chosen |
[
{
"from": "human",
"value": "Add runner code for implementation problem: given integer, produce occurences of digits in integer\n"
},
{
"from": "gpt",
"value": "# Given any integer, count the # of occurrences of each digit\n\n# DESIRED OUTPUT (exact format)\n\n# 0 1\n# 1 1\n# 2 0\n# 3 0\n# 4 0\n... | ruby | chosen |
[
{
"from": "system",
"value": "Add a description and summary to the gemspec\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'common_lips'\n\nGem::Specification.new do |spec|\n spec.na... | ruby | chosen |
[
{
"from": "system",
"value": "Change text: to plain: for rails 5\n"
},
{
"from": "human",
"value": "module LiquidRenderer\n class Railtie < ::Rails::Railtie\n config.liquid_renderer = ActiveSupport::OrderedOptions.new\n\n initializer 'liquid_renderer.initialize' do |app|\n app.config... | ruby | chosen |
[
{
"from": "system",
"value": "Remove ensure exec close rabbitmq connection [skip ci]\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nmodule RubyRabbitmqJanus\n module Process\n # Modules for create autonomous process\n module Concurrencies\n # @author VAILLANT Jer... | ruby | chosen |
[
{
"from": "human",
"value": "Add longest substring palindrome function\n"
},
{
"from": "gpt",
"value": "# Find the longest palindrome substring from a given string\n# A O(n^2) time and 0(1) space solution\n\ndef longest_substring_palindrome(str)\n max_length = 1\n start = 0\n low = 0\n high ... | ruby | chosen |
[
{
"from": "system",
"value": "Verify options is a hash before pulling out confirm"
},
{
"from": "human",
"value": "module SweetAlert2Rails\n module ViewHelpers\n def link_to(*args, &block)\n html_options = args[block_given? ? 1 : 2] || {}\n\n if options_has_confirm?(html_options)\n... | ruby | chosen |
[
{
"from": "system",
"value": "Load all configured model paths into the SQL load path\n"
},
{
"from": "human",
"value": "module ActiveRecordViews\n class Railtie < ::Rails::Railtie\n initializer 'active_record_views' do |app|\n ActiveSupport.on_load :active_record do\n ActiveRecor... | ruby | chosen |
[
{
"from": "system",
"value": "Add vulns as indivdual keys\n"
},
{
"from": "human",
"value": "require 'oj'\n\nSEARCHES = {\n \"data.ipmi_compat_password\" => { value: \"1\", name: \"straight-pass\" },\n \"data.ipmi_compat_md2\" => { value: \"1\", name: \"md2\" },\n \"d... | ruby | chosen |
[
{
"from": "system",
"value": "Remove errant debug line in HTTP adapter\n"
},
{
"from": "human",
"value": "module Geokit\n module NetAdapter\n class NetHttp\n def self.do_get(url)\n uri = URI.parse(url)\n req = Net::HTTP::Get.new(url)\n req.basic_auth(uri.user, uri.p... | ruby | chosen |
[
{
"from": "system",
"value": "Rename document -> section in PublishingApiManualWithSectionsWithdrawer\n"
},
{
"from": "human",
"value": "class PublishingApiManualWithSectionsWithdrawer\n def call(manual, _ = nil)\n PublishingAPIWithdrawer.new(\n entity: manual,\n ).call\n\n manual... | ruby | chosen |
[
{
"from": "system",
"value": "Fix for \"undefined method 'with_indifferent_access' for nil:NilClass\" error\n"
},
{
"from": "human",
"value": "require 'httparty'\nrequire 'json'\nrequire 'pushwoosh/request'\nrequire 'pushwoosh/response'\nrequire 'active_support/core_ext/hash/indifferent_access'\... | ruby | chosen |
[
{
"from": "system",
"value": "Verify the physical path of the website\n"
},
{
"from": "human",
"value": "module Serverspec\n module Type\n class IisWebsite < Base\n def enabled?()\n backend.check_iis_website_enabled(@name)\n end\n\n def installed?(provider, version)\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Remove extraneous checking of currency code\n"
},
{
"from": "human",
"value": "module ActiveMerchant #:nodoc:\n module Billing #:nodoc:\n module Integrations #:nodoc:\n module Paydollar\n class Helper < ActiveMerchant::Billing::Integrations::Helper\n... | ruby | chosen |
[
{
"from": "system",
"value": "Remove LivingSocial specific oauth2 code\n\nresolves #15\n"
},
{
"from": "human",
"value": "class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController\n skip_before_filter :authenticate_user!\n def google_oauth2\n\n auth_info = request.env[\... | ruby | chosen |
[
{
"from": "system",
"value": "Use mutators instead of instance variables in config validator\n"
},
{
"from": "human",
"value": "module LiveEditor\n module Cli\n module Validators\n class ConfigValidator\n # Attributes\n attr_reader :errors\n\n # Constructor.\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Update Breezy gemspec with meta\n"
},
{
"from": "human",
"value": "require File.expand_path('../lib/breezy_template/version', __FILE__)\n\nGem::Specification.new do |s|\n s.name = 'breezy_template'\n s.version = BreezyTemplate::VERSION\n s.author = 'Johny ... | ruby | chosen |
[
{
"from": "system",
"value": "Use current time as default before_date\n"
},
{
"from": "human",
"value": "module Citygram::Models\n class Event < Sequel::Model\n many_to_one :publisher\n\n plugin :serialization, :geojson, :geom\n plugin :serialization, :json, :properties\n plugin :ge... | ruby | chosen |
[
{
"from": "system",
"value": "Package version is increased from 0.0.1.4 to 0.0.1.5\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'event_store-client'\n s.version = '0.0.1.4'\n s.summary = 'Common code for the EventStore client'\n s.des... | ruby | chosen |
[
{
"from": "system",
"value": "[BUGFIX] Fix spec (varname was \"s\" not \"spec\")\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\n\nGem::Specification.new do |s|\n s.name = 'fulmar_f... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor null-true-false example in Ruby to make it more readable\n"
},
{
"from": "human",
"value": "def if_value(values)\n puts '\"if value\":'\n values.each { |k, v| puts \"#{k} - #{v ? 'true' : 'false'}\" }\n puts ''\nend\n\ndef nil_value(values)\n puts '\"if... | ruby | chosen |
[
{
"from": "system",
"value": "Delete reference to missing file\n"
},
{
"from": "human",
"value": "$:.unshift(File.dirname(__FILE__))\n\nrequire 'config/environment'\nrequire 'api/v1'\nrequire 'config/logging'\nrequire 'rack/contrib'\n\nENV['RACK_ENV'] ||= 'development'\nset :environment, ENV['RA... | ruby | chosen |
[
{
"from": "system",
"value": "Use username and password in variable names also\n"
},
{
"from": "human",
"value": "require File.expand_path(\"../init\", __FILE__)\nif ENV['ADMIN_USERNAME'] && ENV['ADMIN_PASSWORD']\n use Rack::Auth::Basic do |user, pass|\n user == ENV['ADMIN_USERNAME'] && pass... | ruby | chosen |
[
{
"from": "system",
"value": "Make \"pipe\" a public method\n\nI initially didn't want people creating a pipeline and then tacking\nthings on to it with \"pipeline.pipe(..)\". I'm no longer convinced that's\na bad thing.\n"
},
{
"from": "human",
"value": "module ActiveInteraction\n class Pipeli... | ruby | chosen |
[
{
"from": "system",
"value": "Add deprecation warning for Heroku `git-ssh` strategy\n\nThe new Platform API does not support this\nhttps://devcenter.heroku.com/articles/platform-api-reference.\n"
},
{
"from": "human",
"value": "module DPL\n class Provider\n module Heroku\n class GitSSH ... | ruby | chosen |
[
{
"from": "system",
"value": "Add support for Remy's EventSource Polyfill through long polling"
},
{
"from": "human",
"value": "module Jugglite\n class SseConnection\n attr_reader :body, :request\n\n def initialize(request)\n @request = request\n @body = DeferrableBody.new\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Use FixtureDependencies::HelperMethods in rspec integration\n"
},
{
"from": "human",
"value": "if defined?(RSpec)\n example_group = RSpec::Core::ExampleGroup\n require 'rspec/version'\n if RSpec::Version::STRING >= '2.8.0'\n RSpec.configure do |c|\n c.aro... | ruby | chosen |
[
{
"from": "human",
"value": "Implement Reader class to parse ChangeLog.md"
},
{
"from": "gpt",
"value": "#\n# Author:: Enrico Stahn <mail@enricostahn.com>\n#\n# Copyright 2014, Zanui, <engineering@zanui.com.au>\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may no... | ruby | chosen |
[
{
"from": "system",
"value": "Use the new method for running a command."
},
{
"from": "human",
"value": "module StartingBlocks\n\n class Contract\n\n attr_reader :options\n\n def initialize options\n @options = options\n end\n\n def self.inherited klass\n @contract_types |... | ruby | chosen |
[
{
"from": "human",
"value": "Migrate the section field out of existence.\n"
},
{
"from": "gpt",
"value": "namespace :sections do\n\n desc \"Migrate artefacts to use tags for section information\"\n task :artefact_sections_to_tags => :environment do\n\n IMPORTING_LEGACY_DATA = true # Allow ... | ruby | chosen |
[
{
"from": "system",
"value": "Change mssql registry key creation method\n"
},
{
"from": "human",
"value": "data_path = \"#{node[:mssql][:root_path]}\\\\Data\"\nlog_path = \"#{node[:mssql][:root_path]}\\\\Logs\"\nbackup_path = \"#{node[:mssql][:root_path]}\\\\Backups\"\n\n%w[ data_path log_path b... | ruby | chosen |
[
{
"from": "system",
"value": "Improve solr fq based on Solrizer.solr_name as demoed by @cam156\n"
},
{
"from": "human",
"value": "module Aptrust\n module SolrHelper\n def filter_on_institution(solr_parameters, user_parameters)\n if current_user and !current_user.is? :admin\n solr... | ruby | chosen |
[
{
"from": "system",
"value": "Change returned object from array to hash\n"
},
{
"from": "human",
"value": "module Bandicoot\n module Processor\n attr_accessor :browser, :content\n\n def boot_browser\n self.browser = Watir::Browser.new\n self.browser.goto config.url\n parse_... | ruby | chosen |
[
{
"from": "system",
"value": "Use Module instead of Proc\n"
},
{
"from": "human",
"value": "module ExecJS::Xtrn\n Racks=YAML.load <<-EOY\n -:\n mime: text/x-yaml\n dump: YAML\n json:\n mime: appication/json\n dump: JSON\n EOY\n Rack=Proc.new do |req|\n f=Racks[req... | ruby | chosen |
[
{
"from": "system",
"value": "Add option to customize error message\n\nAdd option to customize error message when using ActiveRecordValidator."
},
{
"from": "human",
"value": "module EmailAddress\n\n # ActiveRecord validator class for validating an email\n # address with this library.\n # Not... | ruby | chosen |
[
{
"from": "system",
"value": "Fix listen host key name in options Hash\n\nRack::Server passes the listen host as `:Host` and not `:Address`.\n"
},
{
"from": "human",
"value": "require 'iodine' unless defined?(::Iodine::VERSION)\n\nmodule Iodine\n # Iodine's {Iodine::Rack} module provides a Rack... | ruby | chosen |
[
{
"from": "system",
"value": "Fix dispute end point handlers sequence\n"
},
{
"from": "human",
"value": "module StripeMock\n module RequestHandlers\n module Disputes\n\n def Disputes.included(klass)\n klass.add_handler 'get /v1/disputes/(.*)', :get_dispute\n klass.a... | ruby | chosen |
[
{
"from": "system",
"value": "Clean up dispute endpoints implementation\n"
},
{
"from": "human",
"value": "module StripeMock\n module RequestHandlers\n module Disputes\n\n def Disputes.included(klass)\n klass.add_handler 'get /v1/disputes/(.*)', :get_dispute\n klass... | ruby | chosen |
[
{
"from": "human",
"value": "Add task for transferring routes from one operator to another.\n"
},
{
"from": "gpt",
"value": "namespace :maintenance do\n\n desc 'Transfer routes from one operator specified as OLD_OPERATOR to another specified as NEW_OPERATOR'\n task :transfer_operator_routes_an... | ruby | chosen |
[
{
"from": "system",
"value": "Add .freeze on result path\n"
},
{
"from": "human",
"value": "require \"to_partial_path_fix/version\"\n\nmodule ToPartialPathFix\nend\n\nmodule ActiveModel\n module Conversion\n def to_partial_path\n parts = self.class._to_partial_path.split('/')\n plu... | ruby | chosen |
[
{
"from": "system",
"value": "Fix one part of broken search function\n"
},
{
"from": "human",
"value": "INDEX_PAGE_SIZE = 10\n\nclass StaticPagesController < ApplicationController\n\n def users\n @users = do_paging(User)\n end\n\n def problems\n @problems = do_paging(Problem)\n end\n\n... | ruby | chosen |
[
{
"from": "system",
"value": "Fix bug when root_doc doesn't exist on inherited class\n"
},
{
"from": "human",
"value": "require 'active_support/core_ext/object/blank.rb'\n\nmodule Tychus\nmodule Parsers\n\n class Base\n attr_reader :uri, :doc, :recipe_doc, :recipe\n\n def self.recipe_attr... | ruby | chosen |
[
{
"from": "system",
"value": "Use check payment method factory in Check payment factory\n"
},
{
"from": "human",
"value": "FactoryGirl.define do\n factory :payment, class: Spree::Payment do\n amount 45.75\n association(:payment_method, factory: :credit_card_payment_method)\n associatio... | ruby | chosen |
[
{
"from": "system",
"value": "CONFIG: Update method to get database name in db helper\n"
},
{
"from": "human",
"value": "module DbHelpers\n def db_concat(*args)\n env = ENV['RAILS_ENV'] || 'development'\n adapter = ActiveRecord::Base.configurations[env]['adapter'].to_sym\n args.map! { ... | ruby | chosen |
[
{
"from": "system",
"value": "Update to reflect recent change in dm-validations.\n\nChange in dm-validations was to an `@api private` method, but I don't see how to remove the coupling between dm-types and dm-validations without invasive changes."
},
{
"from": "human",
"value": "require 'dm-core... | ruby | chosen |
[
{
"from": "system",
"value": "Use Gitlab::Popen instead of spawn [ci skip]\n\nSigned-off-by: Dmitriy Zaporozhets <be23d75b156792e5acab51b196a2deb155d35d6a@gmail.com>\n"
},
{
"from": "human",
"value": "module Gitlab\n module Plugin\n def self.files\n Dir.glob(Rails.root.join('plugins/*')... | ruby | chosen |
[
{
"from": "system",
"value": "Make sure this stuff also works if happy/permissions is not loaded :)"
},
{
"from": "human",
"value": "require 'happy/request'\nrequire 'happy/context_ext/helpers'\n\nmodule Happy\n class Context\n include ContextExtensions::Helpers\n\n attr_reader :request... | ruby | chosen |
[
{
"from": "system",
"value": "Support attr_accessible appears multi times.\n"
},
{
"from": "human",
"value": "require 'astrolabe/builder'\nrequire 'parser/current'\nrequire 'unparser'\n\nclass AttrAccessible2StrongParams::Converter\n def read_attr_accessible(filename)\n root_node, comments =... | ruby | chosen |
[
{
"from": "system",
"value": "Use File.path to coerce pathname arguments into Strings in 1.9\n\nThe previous commit introduced the use of #to_str on the given pathname\nto coerce it into a String, matching the behavior of File.open and other\nfile handling functions under 1.8.\n\nRuby 1.9 introduces the Fil... | ruby | chosen |
[
{
"from": "system",
"value": "Fix check for raised exceptions.\n"
},
{
"from": "human",
"value": "require 'specter/version'\n\nrequire 'clap'\n\nrequire 'specter/file'\nrequire 'specter/spec'\nrequire 'specter/reporter'\n\nclass Specter\n class Flunked < StandardError; end\n class FailedAssert... | ruby | chosen |
[
{
"from": "system",
"value": "Update Jekyll plugin to look at Scala 2.9.2 docs\n"
},
{
"from": "human",
"value": "require 'fileutils'\ninclude FileUtils\n\nprojects = [\"core\", \"examples\", \"repl\", \"bagel\"]\n\nputs \"Moving to project root and building scaladoc.\"\ncurr_dir = pwd\ncd(\"..\... | ruby | chosen |
[
{
"from": "system",
"value": "FReCon::Database.setup: Enable custom Hash for configuration.\n\nIf a Hash is given, it is converted to yaml (via to_yaml) and written to a Tempfile. This Tempfile's path is passed to the Mongoid.load! method instead of the path to the \"mongoid.yml\" file. By default (If no `... | ruby | chosen |
[
{
"from": "system",
"value": "Add nodoc flag to DEFAULT_CONFIG_PATH.\n"
},
{
"from": "human",
"value": "require 'yaml'\nrequire_relative 'coerce'\nrequire_relative 'config/camera'\n\nmodule Halation\n # Application-wide configuraton.\n class Config\n DEFAULT_CONFIG_PATH = File.expand_path(\... | ruby | chosen |
[
{
"from": "system",
"value": "Enable the js_compressor option for Sprockets\n\nBecause the default for Rails 6 is to use webpack for JS the Sprockets\njs_compressor option is not set in the generated production.rb\nenvironment file. This leads to bloated file sizes in production so\nre-enable compression by... | ruby | chosen |
[
{
"from": "system",
"value": "Add static assets config entry\n"
},
{
"from": "human",
"value": "require File.expand_path('../../env', __FILE__)\nrequire File.expand_path('../boot', __FILE__)\n\nrequire \"action_controller/railtie\"\nrequire \"active_resource/railtie\"\nrequire \"sprockets/railti... | ruby | chosen |
[
{
"from": "system",
"value": "Add img folder for cuba.\n"
},
{
"from": "human",
"value": "require 'slim'\nrequire 'dotenv'\nrequire './helpers/logs_helpers'\n\nCuba.use Rack::Static, urls: %w[/js /css], root: \"public\"\nCuba.plugin LogsHelpers\nCuba.plugin Cuba::Render\nCuba.settings[:render][:... | ruby | chosen |
[
{
"from": "system",
"value": "Add some very basic caching behavior.\n\nA `MAX_STALENESS` in number of seconds governs whether or not the\nupdate method actually does any fetching. This is pretty much a\nstand-in until some more thoughtful caching is implemented.\n\nThe update method accepts one parameter, d... | ruby | chosen |
[
{
"from": "system",
"value": "Fix paper admin task spec.\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe StandardTasks::PaperAdminTask do\n describe \"defaults\" do\n subject(:task) { StandardTasks::PaperAdminTask.new }\n specify { expect(task.title).to eq 'Assign Adm... | ruby | chosen |
[
{
"from": "system",
"value": "Use definitions of modifier keys defined by org.sikuli.script.KeyModifier\nUse definitions of keystrokes defined by org.sikuli.script.Key\nAdd support for all arrow keys\n"
},
{
"from": "human",
"value": "require 'java'\n\n# These constants represent keyboard codes ... | ruby | chosen |
[
{
"from": "system",
"value": "Change way of checking rails env."
},
{
"from": "human",
"value": "require 'spree_core'\nrequire 'spree_robokassa_hooks'\n\nmodule SpreeRobokassa\n class Engine < Rails::Engine\n\n config.autoload_paths += %W(#{config.root}/lib)\n\n def self.activate\n D... | ruby | chosen |
[
{
"from": "system",
"value": "Fix path to licence file in gemspec\n"
},
{
"from": "human",
"value": "lib = File.expand_path('../lib', __FILE__)\n$:.unshift(lib) unless $:.include?(lib)\n\nrequire 'rgpg/gem_info'\n\nGem::Specification.new do |s|\n s.name = 'rgpg'\n s.version = Rgpg::GemInfo.ver... | ruby | chosen |
[
{
"from": "system",
"value": "Add fallback to Unix epoch if Date.today method does not exist\n"
},
{
"from": "human",
"value": "lib = File.expand_path('../lib', __FILE__)\n$:.unshift(lib) unless $:.include?(lib)\n\nrequire 'rgpg/gem_info'\n\nGem::Specification.new do |s|\n s.name = 'rgpg'\n s.... | ruby | chosen |
[
{
"from": "system",
"value": "Change billboard message in show deal test.\n"
},
{
"from": "human",
"value": "require \"test_helper\"\n\nfeature \"Deals::ShowADeal\" do\n scenario \"anyone can view deals\" do\n visit root_path\n page.must_have_content \"Deals on Demand.\"\n end\n\n scena... | ruby | chosen |
[
{
"from": "system",
"value": "Check for more encompassing HTTPSuccess instead of 200 response code\n"
},
{
"from": "human",
"value": "# encoding: utf-8\nrequire 'json'\nrequire 'net/http'\nrequire 'net/https'\nrequire 'uri'\n\nclass Concourse2Tracker\n def initialize(git_path:, api_token:, proj... | ruby | chosen |
[
{
"from": "system",
"value": "Add specs for meeting factory\n"
},
{
"from": "human",
"value": "require 'rails_helper'\n\ndescribe 'factories' do \n describe 'user' do \n let(:user) { FactoryGirl.create(:user) }\n\n it 'creates a user' do \n expect{ FactoryGirl.create(:user) }.to chan... | ruby | chosen |
[
{
"from": "system",
"value": "Improve robustness of location tracking.\n"
},
{
"from": "human",
"value": "begin\n require \"android\"\nrescue LoadError\n require \"mock_android\"\nend\n\nmodule AndroidInterface\n DROID = Android.new\n \n def battery_temperature\n DROID.batteryGetTemperat... | ruby | chosen |
[
{
"from": "system",
"value": "Check admin access in compnaies controller update action.\n"
},
{
"from": "human",
"value": "class CompaniesController < ApplicationController\n\n def edit\n unless current_user.admin?\n flash['notice'] = _(\"Only admins can edit company settings.\")\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Update opt-in message and link\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\nrequire \"#{Rails.root}/lib/experiments/spring2018_cmu_experiment\"\n\nclass ExperimentsPresenter\n def initialize(course)\n @course = course\n end\n\n ACTIVE_EXPE... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor McasResultPresenter to be way DRYer\n\n* Thanks @daguar!\n* Less code ++++++\n"
},
{
"from": "human",
"value": "class McasResultPresenter < Struct.new(:result)\n\n def math_performance\n result.math_performance.present? ? result.math_performance : \"—\"... | ruby | chosen |
[
{
"from": "system",
"value": "Remove temp file usage in HttpReader\n"
},
{
"from": "human",
"value": "require 'fileutils'\nrequire 'securerandom'\nrequire 'faraday'\n\nmodule OGR\n class HttpReader\n def read(url, writeable=false)\n file_extension = url.split('.').last\n driver = O... | ruby | chosen |
[
{
"from": "system",
"value": "Make it a bit more random"
},
{
"from": "human",
"value": "module Expgen\n module Randomizer\n extend self\n\n def repeat(number)\n if number == \"*\"\n \"\"\n elsif number == \"+\"\n yield\n elsif number\n number[:int].to_... | ruby | chosen |
[
{
"from": "system",
"value": "Fix private function call in spec\n"
},
{
"from": "human",
"value": "require File.expand_path(File.dirname(__FILE__) + '/spec_helper')\n\ndescribe Example::App do\n before(:each) do\n @config = {\n name: \"Baz\",\n type: :qux,\n serial: \"def4... | ruby | chosen |
[
{
"from": "system",
"value": "Fix passing regex to start_with?\n"
},
{
"from": "human",
"value": "module BetterErrors\n class ExceptionHint\n def initialize(exception)\n @exception = exception\n end\n\n def hint\n case exception\n when NoMethodError\n /\\Aundefine... | ruby | chosen |
[
{
"from": "system",
"value": "Add Ruby version requirement to gemspec\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path(\"../lib\", __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'authem/version'\n\nGem::Specification.new do |spec|\n spec.na... | ruby | chosen |
[
{
"from": "system",
"value": "Make access token optional since some api calls do not have one\n"
},
{
"from": "human",
"value": "module Slack\n module API\n class Base\n attr_reader :access_token\n\n def initialize(access_token)\n @access_token = access_token\n end\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add get_by_sol and get_by_earth_date methods\n"
},
{
"from": "human",
"value": "module MarsPhotos\n class Rover\n attr_accessor :name\n def initialize(name)\n @name = name\n end\n\n def get(parameter = {})\n url = MarsPhotos::Calculations.buil... | ruby | chosen |
[
{
"from": "system",
"value": "Use simple before_app_loads hook instead of bootloader subclass.\n"
},
{
"from": "human",
"value": "if defined?(Merb::Plugins) \n dependency \"activerecord\"\n require File.join(File.dirname(__FILE__) / \"merb\" / \"orms\" / \"active_record\" / \"connection\")\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Update params order for assert test\n"
},
{
"from": "human",
"value": "require 'test_helper'\n\n#\n# == ApplicationHelper Test\n#\nclass ApplicationHelperTest < ActionView::TestCase\n include Rails.application.routes.url_helpers\n\n setup :initialize_test\n\n #\n... | ruby | chosen |
[
{
"from": "system",
"value": "Change hostname because for some reason the former one was failing this remote test\n"
},
{
"from": "human",
"value": "require 'test_helper'\n\nclass RemoteAddReceiverTest < Test::Unit::TestCase\n\n def setup\n @environment = Spreedly::Environment.new(remote_tes... | ruby | chosen |
[
{
"from": "system",
"value": "Fix db username in request spec for creating instances\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe \"gpdb instances\", :network => true do\n let(:valid_attributes) do\n {\n :name => \"chorusgpdb42\",\n :port => 5432,\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Remove specs for Quotes module in StrSanitizer class, respond_to? method will suffice\n"
},
{
"from": "human",
"value": "require \"spec_helper\"\n\nRSpec.describe StrSanitizer do\n it \"has a version number\" do\n expect(StrSanitizer::VERSION).not_to be nil\n e... | ruby | chosen |
[
{
"from": "human",
"value": "Add an install generator to create a forms directory into the app and test directories and include the JS file.\n"
},
{
"from": "gpt",
"value": "require 'rails/generators/base'\n\nmodule ActiveForm\n module Generators\n class InstallGenerator < Rails::Generators:... | ruby | chosen |
[
{
"from": "system",
"value": "Include child submodules in RspecApiHelpers\n"
},
{
"from": "human",
"value": "require 'rspec_api_helpers/version'\nrequire 'rspec_api_helpers/headers'\nrequire 'rspec_api_helpers/json'\nrequire 'rspec_api_helpers/strategies/json_strategy'\n\nrequire 'active_support... | ruby | chosen |
[
{
"from": "human",
"value": "Add general mailer that sends out an email from the email model.\n"
},
{
"from": "gpt",
"value": "class GeneralMailer < ActionMailer::Base\n def email(email)\n from = \"#{email.from_name} <#{email.from_email}>\"\n to = \"#{email.to_name} <#{email.to_email}>\"\... | ruby | chosen |
[
{
"from": "system",
"value": "Remove uninitialized ivar warnings for Token\n"
},
{
"from": "human",
"value": "class Regexp\n\n TOKEN_KEYS = [\n :type,\n :token,\n :text,\n :ts,\n :te,\n :level,\n :set_level,\n :conditional_level\n ].freeze\n\n Token = Struct.new(*TOKEN... | ruby | chosen |
[
{
"from": "system",
"value": "Fix implicit conversion of Fixnum into String\n"
},
{
"from": "human",
"value": "module Puppet::Parser::Functions\n newfunction(:lpad, :type => :rvalue, :doc => <<-EOS\n\nCopyright (C) 2015 Bernd Zeimetz <b.zeimetz@conova.com>\n\nSimple ruby lpad function.\nlpad(int... | ruby | chosen |
[
{
"from": "system",
"value": "Remove more object-proxying craziness in Generator\n"
},
{
"from": "human",
"value": "class Serialize\n class Generator\n instance_methods.each do |m|\n undef_method m unless m =~ /^(__|object_id)/\n end\n\n attr :id\n\n def initialize(object, bloc... | ruby | chosen |
[
{
"from": "system",
"value": "Fix typo + print info\n"
},
{
"from": "human",
"value": "require 'octokit'\nrequire 'resource_loader'\n\nnamespace :resources do\n def github_public_client\n unless ENV.key?('GITHUB_CLIENT_ID') && ENV.key?('GITHUB_CLIENT_SECRET')\n puts 'Please set GITHUB_C... | ruby | chosen |
[
{
"from": "system",
"value": "Make running app engines non-blocking\n"
},
{
"from": "human",
"value": "\nmodule Voodoo\n\n class AppEngine < PeopleTools\n\n def initialize\n super\n @executable = File.join(@tools_bin, %w{psae.exe})\n end\n\n def run(ae_name, target)\n ap... | ruby | chosen |
[
{
"from": "system",
"value": "Support the new version of the apt cookbook\n"
},
{
"from": "human",
"value": "# Configures Ubiquity's PPA repository for package installs.\n#\n# Recipe:: ppa\n# Cookbook:: unifi\n# Author:: Greg Albrecht <gba@onbeep.com>\n# License:: Apache License, Version 2.0\n# ... | ruby | chosen |
[
{
"from": "system",
"value": "Delete rcov gem for ruby 1.9\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"shortest_path/version\"\n\nGem::Specification.new do |s|\n s.name = \"shortest_path\"\n s.version = Shor... | ruby | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.