conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "human",
"value": "Add script to populate org types.\n\nWe'll run this on the server, then remove it.\n"
},
{
"from": "gpt",
"value": "[\n \"Ministerial department\",\n \"Non-ministerial department\",\n \"Executive agency\",\n \"Executive non-departmental public body\",\n \"Adviso... | ruby | chosen |
[
{
"from": "human",
"value": "Add rudimentary tests for MembershipValidators\n"
},
{
"from": "gpt",
"value": "require_relative 'test_helper'\n\nmodule GitHubLdapMembershipValidatorsTestCases\n def make_validator(groups)\n groups = @domain.groups(groups)\n @validator.new(@ldap, groups)\n e... | ruby | chosen |
[
{
"from": "system",
"value": "Remove RSpec gem install dependency.\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'rspec_lister/version'\n\nGem::Specification.new do |spec|\n spec.n... | ruby | chosen |
[
{
"from": "system",
"value": "Add policy lifecycle to s3 buckets\n"
},
{
"from": "human",
"value": "class BuildCloud::S3Bucket\n\n include ::BuildCloud::Component\n\n @@objects = []\n\n def initialize ( fog_interfaces, log, options = {} )\n\n @s3 = fog_interfaces[:s3]\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Remove unique_identifier from attr_reader; it implemented implicitly\n"
},
{
"from": "human",
"value": "%w[ metadata manifest spine guide bindings ].each { |f| require \"epub/publication/package/#{f}\" }\n\nmodule EPUB\n module Publication\n class Package\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Use better stubbed return value for Thread.join()\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\nrequire_relative '../test_base'\n\nclass RunTimedOutTest < TestBase\n\n def self.id58_prefix\n 'c7A'\n end\n\n # - - - - - - - - - - - - - - - -... | ruby | chosen |
[
{
"from": "human",
"value": "Allow to setup hesabu token in dhis2 datastore\n"
},
{
"from": "gpt",
"value": "# frozen_string_literal: true\n\nnamespace :ui do\n def log_info(message)\n puts message\n end\n\n def setup_token(project_anchor)\n unless project_anchor.token\n puts \"INF... | ruby | chosen |
[
{
"from": "system",
"value": "Switch zip generation options to make .config files work\n\nNot sure exactly what the issue is here, but calling `zip - -@` was resulting\nin a differently constructed zip file than `zip name.zip -@` and therefore eb\nconfig files were not getting run. Strangely everything else... | ruby | chosen |
[
{
"from": "system",
"value": "Remove references to asset pipeline\n"
},
{
"from": "human",
"value": "require 'sinatra/asset_pipeline'\n\nmodule Example\n class App < Sinatra::Base\n configure do\n # Asset configuration and settings\n set root: File.expand_path('../../', __FILE__)\n... | ruby | chosen |
[
{
"from": "system",
"value": "Increase delayed jobs max run time\n"
},
{
"from": "human",
"value": "if Rails.env.test? || Rails.env.development?\n Delayed::Worker.delay_jobs = false\nelse\n Delayed::Worker.delay_jobs = true\nend\nDelayed::Worker.destroy_failed_jobs = false\nDelayed::Worker.sle... | ruby | chosen |
[
{
"from": "system",
"value": "Add test file ins php type\n"
},
{
"from": "human",
"value": "module PhpCop\n # The CLI is a class responsible of handling all the command line interface\n # logic\n class CLI\n attr_reader :options, :config_store\n\n def initialize\n @options = {}\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Revert \"Revert \"Hub::Exception should inherit from StandardError\"\"\n\nThis reverts commit a1e6d4ccc8fb60c7b812c821b61efaab07ee80fc.\n"
},
{
"from": "human",
"value": "module Travis\n class Hub\n class Exception\n\n attr_reader :event, :payload, :excepti... | ruby | chosen |
[
{
"from": "human",
"value": "Add rake task to upload assets to S3\n\nThis iterates through the assets and enqueues a job to upload those that\nhave a file on the NFS mount (this should be most of them). The jobs are\nenqueued with a \"lower\" priority (10) than the default (0) [1] with the\nidea that they s... | ruby | chosen |
[
{
"from": "system",
"value": "Use a different timeout style\n"
},
{
"from": "human",
"value": "require 'base64'\nrequire 'docker'\nrequire 'drb/drb'\nrequire 'logger'\nrequire 'securerandom'\nrequire 'set'\n\nTIMEOUT = 1000\n\nExcon.defaults[:write_timeout] = TIMEOUT\nExcon.defaults[:read_timeou... | ruby | chosen |
[
{
"from": "system",
"value": "Add CactEye bugfix as postrequisite.\n"
},
{
"from": "human",
"value": "class Cacteye < Kosmos::Package\n title 'CactEye Telescope'\n aliases 'cacteye'\n url 'https://app.box.com/s/89skim2e3simjwmuof4c'\n\n def install\n merge_directory 'GameData'\n merge_... | ruby | chosen |
[
{
"from": "system",
"value": "Fix style issues in health check\n"
},
{
"from": "human",
"value": "class HealthCheck\n def initialize(app)\n @app = app\n end\n\n def call(env)\n return @app.call(env) unless env[\"PATH_INFO\"] == \"/health_check\"\n\n if database_up?\n response(20... | ruby | chosen |
[
{
"from": "system",
"value": "Fix error : key must be 32 bytes\n"
},
{
"from": "human",
"value": "class PageletRails::Encryptor\n\n DEFAULT_SALT = '!@#Q156^tdSXggT0&*789++8&?_|T%\\/++==RqE'\n\n attr_reader :salt\n\n def self.encode(data, opts = {})\n self.new(opts).encode data\n end\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Handle silent updates of item field values\n"
},
{
"from": "human",
"value": "# https://developers.podio.com/doc/items\nclass Podio::ItemField < ActivePodio::Base\n property :field_id, :integer\n property :type, :string\n property :external_id, :string\n propert... | ruby | chosen |
[
{
"from": "system",
"value": "Change back to old Core scheme in String\n"
},
{
"from": "human",
"value": "module Lodo\n class String\n LED_COUNT = 100\n\n def initialize\n @core = Core\n @device = @core.open_device\n @buffer = @core::Buffer.new\n @buffer_cache = {} # T... | ruby | chosen |
[
{
"from": "system",
"value": "Make sure javascript_expansions config option exists\n"
},
{
"from": "human",
"value": "require 'on_the_spot/controller_extension'\nrequire 'on_the_spot/on_the_spot_helpers'\n\nmodule OnTheSpot\n class Engine < ::Rails::Engine\n\n config.before_initialize do\n ... | ruby | chosen |
[
{
"from": "human",
"value": "Add Rake task to relocate manuals\n\nI don't fully understand the use case for this script but we've agreed\nto wrap it in a Rake task to prevent us from removing it in future. We\ntried to remove it in PR #878 but @h-lame pointed out that it might\nstill be useful for certain s... | ruby | chosen |
[
{
"from": "human",
"value": "Move all the git update logic into a new class\n\nSigned-off-by: Grant Ramsay <4ab1b2fdb7784a8f9b55e81e3261617f44fd0585@gmail.com>\n"
},
{
"from": "gpt",
"value": "require 'update_repo/version'\nrequire 'update_repo/helpers'\nrequire 'open3'\n\nmodule UpdateRepo\n #... | ruby | chosen |
[
{
"from": "system",
"value": "Add method to load components from YAML\n"
},
{
"from": "human",
"value": "require 'upstream/tracker'\n\nmodule Upstream\n module Tracker\n module Helper\n def get_config_dir\n directory = File.join(ENV['HOME'], '.upstream-tracker')\n unless D... | ruby | chosen |
[
{
"from": "system",
"value": "Set default encoding to utf-8 in example app.\nThis is required for the sha foreign key to work between the pact table and the pact_version_content table.\n"
},
{
"from": "human",
"value": "require 'fileutils'\nrequire 'logger'\nrequire 'sequel'\nrequire 'pact_broke... | ruby | chosen |
[
{
"from": "system",
"value": "Make the game use the main loop instead of game loop\n"
},
{
"from": "human",
"value": "require \"tic_tac_toe/version\"\nrequire \"tic_tac_toe/console_shell\"\nrequire \"tic_tac_toe/board\"\nrequire \"tic_tac_toe/game\"\nrequire \"tic_tac_toe/rules\"\n\nmodule TicTa... | ruby | chosen |
[
{
"from": "system",
"value": "Allow headers to end with a question mark\n\nBy default, Markdown lint warns about various header-trailing\npunctuation characters, including question marks:\n<https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md#md007---unordered-list-indentation>.\nAllowing ... | ruby | chosen |
[
{
"from": "system",
"value": "Allow login validation before block\n\nRemoves a block so that the login page is validated before the block,\nwhile the login page is still present, instead of after it when the\nlogin page is long gone\n"
},
{
"from": "human",
"value": "# frozen_string_literal: tru... | ruby | chosen |
[
{
"from": "system",
"value": "Add support for Rails 6.0\n"
},
{
"from": "human",
"value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"queue_classic_admin/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s|... | ruby | chosen |
[
{
"from": "system",
"value": "Package version is increased from 0.18.0.0 to 0.18.1.0\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'evt-messaging'\n s.version = '0.18.0.0'\n s.summary = 'Common primitives for platform-specific messaging... | ruby | chosen |
[
{
"from": "system",
"value": "Package version is increased from 0.29.0.0 to 0.29.0.1\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'evt-messaging'\n s.version = '0.29.0.0'\n s.summary = 'Common primitives for platform-specific messaging... | ruby | chosen |
[
{
"from": "system",
"value": "Fix migration to add purchases counter cache column\n"
},
{
"from": "human",
"value": "class AddPurchasesCountToTags < ActiveRecord::Migration\n def change\n add_column :tags, :purchases_count, :integer, :default => 0\n\n Tag.all.each do |tag|\n tag.upda... | ruby | chosen |
[
{
"from": "system",
"value": "Update editing incidents supervisor system tests\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nrequire 'spec_helper'\n\ndescribe 'editing incidents as a supervisor' do\n before :each do\n @supervisor = create :user, :supervisor\n when_cu... | ruby | chosen |
[
{
"from": "human",
"value": "Add script get projects rundeck\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env ruby\n\n#@author:: 'weezhard'\n#@usage:: 'Delete projects rundeck'\n#@licence:: 'GPL'\n#@version: 1.0.0\n\nrequire 'uri'\nrequire 'rubygems'\nrequire 'json'\nrequire 'net/http'\nr... | ruby | chosen |
[
{
"from": "system",
"value": "Update VMWare Fusion to follow brew-cask\n\nVMWare Fusion was recently added to homebrew-cask.\n"
},
{
"from": "human",
"value": "dmg_package \"VMWare Fusion\" do\n source \"http://download2us.softpedia.com/dl/a5bdb8f0e2faf4dcea62bf272213d56c/513376a7/400024122/mac... | ruby | chosen |
[
{
"from": "system",
"value": "Add proxy methods for students' attributes\n"
},
{
"from": "human",
"value": "class ApplicationDraft < ActiveRecord::Base\n\n include HasSeason\n\n belongs_to :team\n\n validates :team, presence: true\n validates :coaches_hours_per_week, :coaches_why_team_succes... | ruby | chosen |
[
{
"from": "system",
"value": "Add monthly trend to budget statistics\n"
},
{
"from": "human",
"value": "class BudgetStatistics\n attr_accessor :budget\n\n def initialize(budget)\n @budget=budget\n end\n\n def category_distribution\n @budget.categories.map {|category| {:value => categor... | ruby | chosen |
[
{
"from": "system",
"value": "Add TxSplit has_many PiePieces association\n"
},
{
"from": "human",
"value": "class TransactionSplit < ActiveRecord::Base\n belongs_to :transaction_record\nend\n"
},
{
"from": "gpt",
"value": "class TransactionSplit < ActiveRecord::Base\n belongs_to :t... | ruby | chosen |
[
{
"from": "system",
"value": "Change AWS Cloud Refresher to the new format\n\nChange AWS Cloud Refresher to the new format separating collection\nfrom parsing. We use Inventory abstraction for the inventory collection\nand parsing.\n"
},
{
"from": "human",
"value": "class ManageIQ::Providers::Am... | ruby | chosen |
[
{
"from": "system",
"value": "Fix a bug with ruby 1.8.7 when inserting/updating features\n"
},
{
"from": "human",
"value": "class Admin::FeaturesController < Admin::AdminController\n include FeatureGetterHelper\n\n before_filter :get_feature, :only => [:show, :destroy]\n\n def show\n @fea... | ruby | chosen |
[
{
"from": "system",
"value": "Testing: Disable port checking on CircleCI\n"
},
{
"from": "human",
"value": "require 'dockerspec'\nrequire 'dockerspec/serverspec'\n\ndescribe docker_build('.', tag: 'keywhiz') do\n it { should have_entrypoint '/entrypoint.sh' }\n it { should have_workdir %r{^/op... | ruby | chosen |
[
{
"from": "system",
"value": "Enable nomnoml tests on Windows\n"
},
{
"from": "human",
"value": "require_relative 'test_helper'\n\ncode = <<-eos\n[Pirate\n [beard]--[parrot]\n [beard]-:>[foul mouth]\n]\n\n[<abstract>Marauder]<:--[Pirate]\n[Pirate]- 0..7[mischief]\n[jollyness]->[Pirate]\n[jolly... | ruby | chosen |
[
{
"from": "system",
"value": "Change order in requires to fix tests\n"
},
{
"from": "human",
"value": "ENV['RAILS_ENV'] ||= 'test'\nrequire File.expand_path('../../config/environment', __FILE__)\nabort(\"The Rails environment is running in production mode!\") if Rails.env.production?\n\nrequire ... | ruby | chosen |
[
{
"from": "human",
"value": "Add pending specs for weibull distribution\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\nrequire 'statistical/rng/weibull'\nrequire 'statistical/distribution/weibull'\n\ndescribe Statistical::Rng::Weibull do\n it 'passes the G-test at a 95% significance le... | ruby | chosen |
[
{
"from": "system",
"value": "[PH][00000000] Restructure search tests: Change SearchBy page object to GenericSearch; move a generic search test to new GenericSearch test case\n"
},
{
"from": "human",
"value": "module Autobots\n\n # This is the overarching module that contains page objects, modu... | ruby | chosen |
[
{
"from": "system",
"value": "[Metrics] Fix model, use many_to_one, even if it is conceptually one_to_one.\n"
},
{
"from": "human",
"value": "class Metrics < Sequel::Model(:metrics)\n plugin :timestamps\n\n one_to_one :pod\nend\n"
},
{
"from": "gpt",
"value": "class Metrics < Seque... | ruby | chosen |
[
{
"from": "human",
"value": "Upgrade Firefox Nightly Ja to v35.0a1\n"
},
{
"from": "gpt",
"value": "class FirefoxNightlyJa < Cask\n version '35.0a1'\n sha256 '9cde18aabb838684c41e124b50b67006e842f29b12d4f9fa9ab3c5fa964aa12f'\n\n url 'https://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/lat... | ruby | chosen |
[
{
"from": "system",
"value": "Return formatting even if only the background has changed\n"
},
{
"from": "human",
"value": "class Style\n attr_accessor :fg_color\n attr_accessor :bg_color\n attr_accessor :orientation\n\n def format(content)\n raise NotImplementedError, 'Not yet implemented... | ruby | chosen |
[
{
"from": "system",
"value": "Remove runtime requirement on pry gem.\n"
},
{
"from": "human",
"value": "require 'net/ldap'\nrequire 'yaml'\nrequire 'optimist'\nrequire 'memoist'\nrequire 'pry'\nrequire_relative 'ldap/cli'\nrequire_relative 'ldap/base'\nrequire_relative 'ldap/key'\nrequire_relati... | ruby | chosen |
[
{
"from": "human",
"value": "Add user agents in separate file\n"
},
{
"from": "gpt",
"value": "module XP\n USER_AGENTS = {\n ipad: 'Mozilla/5.0 (iPad; CPU OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B176 Safari/7534.48.3',\n iphone: 'Mozilla/5.0 (iPhon... | ruby | chosen |
[
{
"from": "system",
"value": "Add JSON output format to security scans\n\nAdditionally, this commit allows plugins to be able to run the security\nscans from the plugin itself.\n"
},
{
"from": "human",
"value": "namespace :test do\n namespace :security do\n task :setup # NOOP - Stub for cons... | ruby | chosen |
[
{
"from": "human",
"value": "Add (experimental and untested) XCode support"
},
{
"from": "gpt",
"value": "require 'appscript'\n\nclass TimeTap::Editor::Xcode\n include Appscript\n\n def initialize options = {}\n end\n \n def is_running?\n # Cannot use app('Xcode') because it fails when m... | ruby | chosen |
[
{
"from": "system",
"value": "Put back accidentally committed rake removal\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/sidekiq-unique-jobs/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Mikael Henriksson\"]\n g... | ruby | chosen |
[
{
"from": "system",
"value": "Change redirects to cucumber-ruby instead of cucumber on rubydoc\n"
},
{
"from": "human",
"value": "require 'rack-rewrite'\n\nmodule Redirects\n class App < Rack::Rewrite\n def initialize(app)\n super do\n # redirect ruby api to rubydoc.info\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Remove STAR from assessment spec\n"
},
{
"from": "human",
"value": "require 'rails_helper'\n\nRSpec.describe Assessment, type: :model do\n\n it 'validates family' do\n expect(FactoryBot.build(:assessment, family: 'foo')).to be_invalid\n end\n\n context 'MCAS' ... | ruby | chosen |
[
{
"from": "system",
"value": "Delete class from Peeek::Hook::Linker.classes after test\n"
},
{
"from": "human",
"value": "require 'peeek/hook/linker'\n\ndescribe Peeek::Hook::Linker, '.classes' do\n it \"returns classes that inherited #{described_class}\" do\n klass = Class.new(described_cla... | ruby | chosen |
[
{
"from": "system",
"value": "Move all calculations to DB in AdjustmentSource\n\nCloses #364\n"
},
{
"from": "human",
"value": "module Spree\n module AdjustmentSource\n extend ActiveSupport::Concern\n\n included do\n def deals_with_adjustments_for_deleted_source\n adjustment_s... | ruby | chosen |
[
{
"from": "system",
"value": "Fix the mkdir for moduledir\n"
},
{
"from": "human",
"value": "require 'beaker-rspec'\n\nUNSUPPORTED_PLATFORMS = []\n\nunless ENV['RS_PROVISION'] == 'no' or ENV['BEAKER_provision'] == 'no'\n if hosts.first.is_pe?\n install_pe\n else\n install_puppet\n end\n... | ruby | chosen |
[
{
"from": "system",
"value": "Sort countries by name before output in API\n\n"
},
{
"from": "human",
"value": "class API::V1::CountriesController < API::APIController\n\n def index\n @countries = Portal::Country.all.map{ |c| {name: c.name, id: c.id} }\n render :json => @countries\n end\n... | ruby | chosen |
[
{
"from": "system",
"value": "Add presence true validation for title in nav items model file\n"
},
{
"from": "human",
"value": "class NavItem < ActiveRecord::Base\n\n belongs_to :url_page, class_name: \"Page\"\n\n validates :url_type, numericality: { only_integer: true }\n validates :url_type... | ruby | chosen |
[
{
"from": "human",
"value": "Add specs for authentication jwt strategy\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\nrequire 'minitest/mock'\nrequire 'bcrypt'\n\ndescribe AuthenticationJwtStrategy do\n\n let(:password_digest) { BCrypt::Password.create('secret', cost: 1) }\n let(:user... | ruby | chosen |
[
{
"from": "system",
"value": "Remove spaces around array contents\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe '#pipelined' do\n it 'yields to its block' do\n res = false\n @redises.pipelined do\n res = true\n end\n res.should == true\n end\n\n context... | ruby | chosen |
[
{
"from": "human",
"value": "Add spec for run_handler plugin, missed in previous commit\n"
},
{
"from": "gpt",
"value": "require File.expand_path(\"spec_helper\", File.dirname(File.dirname(__FILE__)))\n\ndescribe \"run_handler plugin\" do \n it \"makes r.run :not_found=>:pass keep going on 404\... | ruby | chosen |
[
{
"from": "system",
"value": "Move 404 requests spec to factory_girl.\n"
},
{
"from": "human",
"value": "# -*- encoding : utf-8 -*-\nrequire 'rails_helper'\n\ndescribe \"404 Page Not Found\" do\n\n let(:station) { Station.make! }\n\n context \"on main domain\" do\n before(:each) do\n h... | ruby | chosen |
[
{
"from": "system",
"value": "Add exceptions for blank records in tax categories migration\n\nFixes #4204\n"
},
{
"from": "human",
"value": "class MigrateTaxCategoriesToLineItems < ActiveRecord::Migration\n def change\n \tSpree::LineItem.includes(:variant => { :product => :tax_category }).find... | ruby | chosen |
[
{
"from": "system",
"value": "Fix link parsing in TweetPlugin\n"
},
{
"from": "human",
"value": "# plugin to send a tweet to a Twitter account\nclass TweetPlugin < Campfire::PollingBot::Plugin\n accepts :text_message, :addressed_to_me => true\n \n def process(message)\n case message.comman... | ruby | chosen |
[
{
"from": "system",
"value": "Simplify scope block code for now (fixes problems with 1.8.7)"
},
{
"from": "human",
"value": "module Allowance\n class Permissions\n def initialize(context = nil, &blk)\n @permissions = {}\n @context = context\n instance_exec(context, &blk)\n ... | ruby | chosen |
[
{
"from": "human",
"value": "Add BadgeOverflowConfig class to configure user id\n"
},
{
"from": "gpt",
"value": "require 'yaml'\n\nclass BadgeOverflowConfig\n attr_reader :config_file\n\n def self.instance\n @@instance ||= new('config/users.yml')\n end\n\n def self.user_id\n instance.u... | ruby | chosen |
[
{
"from": "system",
"value": "Remove useless presenter = nil\n"
},
{
"from": "human",
"value": "module Bourgeois\n module ViewHelper\n # Wrap a resource or a collection into its related presenter\n #\n # @example\n # present User.new(name: 'Remi') do |user|\n # puts user.in... | ruby | chosen |
[
{
"from": "system",
"value": "Fix regression in passing in negation of exclude_submodules option\n"
},
{
"from": "human",
"value": "require \"thor\"\nmodule GitReleaseNotes\n class CLI < Thor\n include Thor::Actions\n\n desc \"html\", \"Generates an HTML release notes document showing all... | ruby | chosen |
[
{
"from": "system",
"value": "Enable autoloading also in FairyGarden\n"
},
{
"from": "human",
"value": "module Hatokura\n module FairyGarden\n class FarmVillage < Card\n Name = '農村'\n Cost = 1\n Link = 1\n MainType = :land\n AuthorityPoint = -2\n PlayedAbility =... | ruby | chosen |
[
{
"from": "system",
"value": "Add opalerb to admitted path finder extensions\n"
},
{
"from": "human",
"value": "require 'hike'\nrequire 'pathname'\n\nmodule Opal\n class HikePathFinder < Hike::Trail\n def initialize(paths = Opal.paths)\n super()\n append_paths *paths\n append_... | ruby | chosen |
[
{
"from": "system",
"value": "Allow to use different tag\n\nSometimes is better to use pre instead of textarea because it have some issues with html inside of json object."
},
{
"from": "human",
"value": "module Rack\n class IframeTransport\n def initialize(app)\n @app = app\n end\n\... | ruby | chosen |
[
{
"from": "system",
"value": "Test case without sign_in in addition\n"
},
{
"from": "human",
"value": "require 'test_helper'\n\nclass DashboardControllerTest < ActionDispatch::IntegrationTest\n setup do\n @user = users(:one)\n end\n \n test \"should get index\" do\n sign_in_user(@user)... | ruby | chosen |
[
{
"from": "system",
"value": "[FeatureFlag] Add a default value block for settings flags\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\nmodule Bundler\n class FeatureFlag\n def self.settings_flag(flag)\n unless Bundler::Settings::BOOL_KEYS.include?(flag.to_s)\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Use TEST_ENV when running tests\n"
},
{
"from": "human",
"value": "require 'pakyow-support'\nrequire 'pakyow-core'\nrequire 'pakyow-presenter'\nrequire 'pakyow-mailer'\n\nrequire_relative 'test_help/ext/request'\nrequire_relative 'test_help/ext/response'\n\nrequire_... | ruby | chosen |
[
{
"from": "system",
"value": "Add product list to helper\n"
},
{
"from": "human",
"value": "module ProductHelper\n\n def product_value(product)\n case product.to_sym\n when :supporter\n 45\n when :member\n 400\n when :sponsor\n 25000\n when :partner\n 50000\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix missing end from @iachettifederico\n"
},
{
"from": "human",
"value": "require 'active_null/version'\nrequire 'active_null/null_model_builder'\n\nmodule ActiveNull\n def null\n null_class.get\n end\n\n def null_defaults_for_polymorphic mappings\n @polymo... | ruby | chosen |
[
{
"from": "system",
"value": "Concatenate I18n.load_path instead of shoveling.\n"
},
{
"from": "human",
"value": "require \"i18n\"\n\nmodule Lita\n class << self\n # The absolute path to Lita's templates directory.\n # @return [String] The path.\n def template_root\n File.expand_p... | ruby | chosen |
[
{
"from": "human",
"value": "Add Cyberduck - Libre FTP, SFTP, WebDAV & cloud storage browser for Mac & Windows.\n"
},
{
"from": "gpt",
"value": "class Cyberduck < Cask\n url 'http://cyberduck.ch/Cyberduck-4.2.1.zip'\n homepage 'http://cyberduck.ch'\n version '4.2.1'\nend"
}
] | ruby | chosen |
[
{
"from": "system",
"value": "Update Launchbar to version 6.4\n\nThis commit updates the version stanza and the SHA\n"
},
{
"from": "human",
"value": "cask :v1 => 'launchbar' do\n\n if MacOS.release <= :mountain_lion\n version '5.6.4'\n sha256 '22a1ec0c10de940e5efbcccd18b8b048d95fb7c63213... | ruby | chosen |
[
{
"from": "system",
"value": "Remove empty line at end of RandomYiff\n"
},
{
"from": "human",
"value": "require 'net/http'\nrequire 'json'\n\nrequire 'random_yiff/version'\n\nclass RandomYiff\n def self.post_uri\n res = Net::HTTP.get_response(URI('https://e621.net/post/random'))\n URI(res... | ruby | chosen |
[
{
"from": "system",
"value": "Add more precise activesupport version\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"business_time/version\"\n\nGem::Specification.new do |s|\n s.name = \"business_time\"\n s.version = Busin... | ruby | chosen |
[
{
"from": "system",
"value": "Add assertions for rails4.2 in MailerGeneratorTest\n\nI am basically copying tests from `indirect/haml-rails`, and changing to\nslim where necessary.\n"
},
{
"from": "human",
"value": "require 'test_helper'\nrequire 'lib/generators/slim/testing_helper'\n\nclass Slim... | ruby | chosen |
[
{
"from": "system",
"value": "Return path is not used anymore\n"
},
{
"from": "human",
"value": "require 'net/http'\n\nclass ApplicationController < ActionController::Base\n protect_from_forgery\n \n helper :all\n \n after_filter :set_access_control\n \n ##########\n # Set the Access Con... | ruby | chosen |
[
{
"from": "system",
"value": "Add lib to autoload paths\n"
},
{
"from": "human",
"value": "require File.expand_path('../boot', __FILE__)\n\nrequire \"rails\"\n\nrequire \"active_model/railtie\"\nrequire \"active_record/railtie\"\nrequire \"action_controller/railtie\"\nrequire \"action_view/railt... | ruby | chosen |
[
{
"from": "system",
"value": "Move config declaration to the appropriate place\n"
},
{
"from": "human",
"value": "require File.join(File.dirname(__FILE__), 'boot')\n\nRails::Initializer.run do |config|\n config.time_zone = 'UTC'\n config.gem 'authlogic'\n config.gem 'hoptoad_notifier'\n\n co... | ruby | chosen |
[
{
"from": "system",
"value": "Make a few tests green\n"
},
{
"from": "human",
"value": "module ActiveEncode\n module EngineAdapters\n class FfmpegAdapter\n def create(encode)\n new_encode = encode.class.new(encode.input, encode.options)\n new_encode.id = SecureRandom.uuid\... | ruby | chosen |
[
{
"from": "system",
"value": "Print error messages on stderr.\n"
},
{
"from": "human",
"value": "class AssociateProversWithOntologyVersions < ActiveRecord::Migration\n def self.up\n OntologyVersion.find_each do |ontology_version|\n retry_provers_retrieval(ontology_version, 3)\n end\n... | ruby | chosen |
[
{
"from": "system",
"value": "Add netrc as dev dep and use any version of Jekyll over 2.\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'jekyll-github-metadata/version'\n\nGem::Speci... | ruby | chosen |
[
{
"from": "system",
"value": "Fix undefined method `connection' when using Passenger server\n"
},
{
"from": "human",
"value": "module Octoshark\n module ConnectionHandler\n def establish_connection(*args)\n super(*args)\n Octoshark::ConnectionPoolsManager.reset_connection_managers!... | ruby | chosen |
[
{
"from": "human",
"value": "Add a basic test for UserAgent\n"
},
{
"from": "gpt",
"value": "require \"spec_helper\"\n\nclass UserAgentTest\n attr_accessor :user_agent\n include UserAgent\n\n def initialize(user_agent)\n @user_agent = user_agent\n end\nend\n\ndescribe UserAgent do\n cont... | ruby | chosen |
[
{
"from": "system",
"value": "Test for meaningful type error messages.\n"
},
{
"from": "human",
"value": "require 'reindeer'\n\ndescribe 'Reindeer types' do\n it 'should constrain attributes' do\n class QuietWord < Reindeer\n with Reindeer::Role::TypeConstraint\n\n def verify(val)\... | ruby | chosen |
[
{
"from": "human",
"value": "Create specs for RSpec custom matchers"
},
{
"from": "gpt",
"value": "require 'models'\nrequire 'rspec/acts_as_matchers'\n\nRSpec.describe \"Custom RSpec matchers\" do\n it { expect(Product).to be_actable }\n\n it { expect(Pen).to act_as(:product) }\n it { expect(... | ruby | chosen |
[
{
"from": "system",
"value": "Order meetings in list by date descending\n"
},
{
"from": "human",
"value": "class ClubsController < ApplicationController\n before_action :authenticate_leader!\n\n def index\n @clubs = Club.all\n end\n\n def show\n @club = Club.find(params[:id])\n @mee... | ruby | chosen |
[
{
"from": "system",
"value": "Set model id in session after create\n"
},
{
"from": "human",
"value": "class <%= resource_pluralize.capitalize %>Controller < ApplicationController\n\n def new\n @<%= resource_name %> = <%= resource_name.classify %>.new\n end\n\n def create\n @<%= resource... | ruby | chosen |
[
{
"from": "system",
"value": "Create redirects to the new user page\n"
},
{
"from": "human",
"value": "class UsersController < ApplicationController\n def show\n @user = User.find(params[:id])\n end\n\n def new\n @user = User.new\n end\n\n def create\n @user = User.new(user_params)... | ruby | chosen |
[
{
"from": "system",
"value": "Delete print statements from users controller\n"
},
{
"from": "human",
"value": "class UsersController < ApplicationController\n\n\tdef new\n\tend\n\n\tdef show\n\t\t@user = User.find(params[:id])\n\t\tif @user\n\t\t\trender 'show'\n\t\telse\n\t\t\tredirect_to '/'\n... | ruby | chosen |
[
{
"from": "system",
"value": "Update logic in votes controller\n"
},
{
"from": "human",
"value": "<<<<<<< HEAD\nclass VotesController < UserActionsController\n=======\nclass VotesController < ApplicationController\n\n def new\n @vote = Vote.new\n @user = User.find_by(id: params[... | ruby | chosen |
[
{
"from": "system",
"value": "Improve params of product ratings api\n"
},
{
"from": "human",
"value": "module Anego\n class Client\n API_ENDPOINT = \"https://api.appannie.com/v1.2\"\n\n def initialize(api_key: nil)\n @api_key = api_key\n end\n\n def accounts\n request :get... | ruby | chosen |
[
{
"from": "system",
"value": "Return nil for TypeError (from attempting to parse nil)\n"
},
{
"from": "human",
"value": "require 'arena/configurable'\nrequire 'arena/error'\nrequire 'arena/api'\nrequire 'httparty'\nrequire 'json'\n\nmodule Arena\n\n class Client\n include HTTParty\n inclu... | ruby | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.