conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Remove unused block argument from Populator.\n\nServes no purpose, not supplied or used anywhere.\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nclass ThinkingSphinx::RealTime::Populator\n def self.populate(index)\n new(index).populate\n en... | ruby | chosen |
[
{
"from": "system",
"value": "Remove obsolete code in Product Advertising Endpoint\n"
},
{
"from": "human",
"value": "module Vacuum\n module Endpoint\n # A Product Advertising API endpoint.\n class ProductAdvertising < Base\n # A list of Product Advertising API hosts.\n HOSTS = ... | ruby | chosen |
[
{
"from": "system",
"value": "Tweak to first paragraph processor\n"
},
{
"from": "human",
"value": "require 'helpers/import'\nimport 'yuzu/postprocessors/base'\n\nmodule Yuzu::PostProcessors\n class FirstParagraphPostProcessor < PostProcessor\n def initialize\n @name = :first_paragraph\... | ruby | chosen |
[
{
"from": "system",
"value": "Create a method for failed_archive_counter\n"
},
{
"from": "human",
"value": "module Ci\n class RescueStaleLiveTraceWorker\n include ApplicationWorker\n include CronjobQueue\n\n def perform\n # Archive stale live traces which still resides in redis or... | ruby | chosen |
[
{
"from": "system",
"value": "Add rake as a dependency.\n"
},
{
"from": "human",
"value": "Gem::Specification.new do |s|\n s.name = 'spritz_for_jekyll'\n s.version = '0.6.0'\n s.date = '2014-04-25'\n s.summary = 'Bringing Spritz to Je... | ruby | chosen |
[
{
"from": "system",
"value": "Use page caching on ImagesController\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nclass PagesCore::ImagesController < ApplicationController\n include DynamicImage::Controller\n\n private\n\n def model\n Image\n end\nend\n"
},
{
"from": "gpt... | ruby | chosen |
[
{
"from": "system",
"value": "Add fix for loading fixtures in engine tests\n"
},
{
"from": "human",
"value": "# Configure Rails Environment\nENV[\"RAILS_ENV\"] = \"test\"\n\nrequire File.expand_path(\"../../<%= options[:dummy_path] -%>/config/environment.rb\", __FILE__)\n<% unless options[:skip... | ruby | chosen |
[
{
"from": "system",
"value": "Enable requests using api token for events controller.\n"
},
{
"from": "human",
"value": "class EventsController < ApplicationController\n before_action :authenticate_person!\n #load_and_authorize_resource\n\n def index\n respond_to do |format|\n format.h... | ruby | chosen |
[
{
"from": "system",
"value": "Return 404 for invalid variation keys\n\nThis will be fixed in 6.1.4 but override the method for now.\n\nRef: rails/rails#41772\n"
},
{
"from": "human",
"value": "class ImagesController < ActiveStorage::Representations::ProxyController\n def admin_request?\n fal... | ruby | chosen |
[
{
"from": "system",
"value": "Remove array validation of destinations\n"
},
{
"from": "human",
"value": "class SearchController < ApplicationController\n before_filter :if_not_signed_in\n\n def index\n email = params[:search][:email]\n\n @matching_users = User.where.not(id: current_user.... | ruby | chosen |
[
{
"from": "system",
"value": "Include participant_id (along with person_id) in EffortSerializer to avoid problems during transition. The participant_id attribute is now merely an alias for person_id.\n"
},
{
"from": "human",
"value": "class EffortSerializer < BaseSerializer\n attributes :id, :e... | ruby | chosen |
[
{
"from": "system",
"value": "Fix avatar url in user synchronization\n"
},
{
"from": "human",
"value": "class DiscourseSynchronizationWorker\n include Sidekiq::Worker\n\n def perform(user_id, username)\n \tuser = User.find(user_id)\n\n user.tenants.each do |t|\n \t unless settings_missin... | ruby | chosen |
[
{
"from": "system",
"value": "Send exceptions to sentry async\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nif Rails.env.production? && ENV[\"SENTRY_DSN\"]\n Raven.configure do |config|\n config.dsn = ENV[\"SENTRY_DSN\"]\n\n config.sanitize_fields = Rails.application... | ruby | chosen |
[
{
"from": "human",
"value": "Remove change notes from all editions except detailed guides.\n"
},
{
"from": "gpt",
"value": "editions_to_update = Edition.where(\"type <> 'DetailedGuide'\")\nputs \"Updating #{editions_to_update.count} editions\"\neditions_to_update.update_all(\"change_note = '', m... | ruby | chosen |
[
{
"from": "system",
"value": "Increase gem version and post to rubygems\n"
},
{
"from": "human",
"value": "# Copyright (C) 2014 Continuent, Inc.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may o... | ruby | chosen |
[
{
"from": "system",
"value": "Make sure Newsesque can be STI'd\n"
},
{
"from": "human",
"value": "class Newsesque < Announcement\n include Edition::FactCheckable\n include Edition::FirstImagePulledOut\n\n def apply_any_extra_validations_when_converting_from_imported_to_draft\n class << sel... | ruby | chosen |
[
{
"from": "system",
"value": "Move this so the consumer doesn't have anything to require\n"
},
{
"from": "human",
"value": "class ActiveRecord::Base\n class << self\n def establish_connection_with_adapter_extensions(*args)\n establish_connection_without_adapter_extensions(*args)\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Make supported OS output prettier\n"
},
{
"from": "human",
"value": "require \"boxen/preflight\"\n\nclass Boxen::Preflight::OS < Boxen::Preflight\n SUPPORTED_RELEASES = %w(10.8 10.9 10.10 10.11 10.12 10.13)\n\n def ok?\n osx? && (skip_os_check? || supported_rel... | ruby | chosen |
[
{
"from": "system",
"value": "Stop caching included_modules if they are empty\n"
},
{
"from": "human",
"value": "module Domgen\n module Ruby\n class RubyClass < Domgen.ParentedElement(:object_type)\n attr_writer :classname\n\n def included_modules\n @included_modules ||= []\... | ruby | chosen |
[
{
"from": "system",
"value": "Add rect and size implementation.\n"
},
{
"from": "human",
"value": "module PPCurses\n\n\n class Point\n\n attr_accessor :x, :y\n\n def initialize( x, y )\n @x = x\n @y = y\n end\n\n def to_s\n \"x=#{@x} y=#{@y}\"\n end\n\n end\n\n c... | ruby | chosen |
[
{
"from": "system",
"value": "Add password_confirmation to prevent Devise from leaking password to the log file\n"
},
{
"from": "human",
"value": "# Be sure to restart your server when you modify this file.\n\n# Configure sensitive parameters which will be filtered from the log file.\nRails.appl... | ruby | chosen |
[
{
"from": "system",
"value": "Change update progress task to perform calculations for progress plugins not related with instances\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nnamespace :custom_field_plugins do\n namespace :progress do\n desc \"Calculate total progress ... | ruby | chosen |
[
{
"from": "human",
"value": "Add a spec for Marshal.dump with Rubinius::AtomicReference\n"
},
{
"from": "gpt",
"value": "require File.expand_path('../../../spec_helper', __FILE__)\n\ndescribe \"Marshal.dump\" do\n it \"dumps an AtomicReference\" do\n atomic_reference = Rubinius::AtomicRefere... | ruby | chosen |
[
{
"from": "system",
"value": "Write specs for RoundType.create_round_types method\n"
},
{
"from": "human",
"value": "require 'rails_helper'\n\nRSpec.describe RoundType, type: :model do\n it { expect(subject).to have_many :rounds }\nend\n"
},
{
"from": "gpt",
"value": "require 'rails... | ruby | chosen |
[
{
"from": "system",
"value": "Test marshalling also exact/typed values\n"
},
{
"from": "human",
"value": "#!/usr/bin/env rspec\n# frozen_string_literal: true\n\nrequire_relative \"spec_helper\"\nrequire \"dbus\"\nrequire \"ostruct\"\nrequire \"yaml\"\n\ndata_dir = File.expand_path(\"data\", __di... | ruby | chosen |
[
{
"from": "human",
"value": "Add task to send mail to users (test)\n"
},
{
"from": "gpt",
"value": "task :send_mail_Powerball => :environment do\n puts \"mail sent\"\n user = User.new(username:'mimi', email: 'drodriguez@clunda.co', password:\"12345\")\n Notifier.welcome_email(user)\nend"
}
... | ruby | chosen |
[
{
"from": "system",
"value": "Switch over to using puppet_module_install_on()\n\nThis makes sure the path is correct for Solaris.\n"
},
{
"from": "human",
"value": "require 'beaker-rspec'\n\nUNSUPPORTED_PLATFORMS = [ 'windows', 'Darwin' ]\n\nunless ENV['RS_PROVISION'] == 'no' or ENV['BEAKER_prov... | ruby | chosen |
[
{
"from": "system",
"value": "Add herokuapp to the description\n"
},
{
"from": "human",
"value": "#encoding: UTF-8\n\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'standalone_typograf/version'\n\nGem::Specification.new do |spec|\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Package version is increased from 0.2.0.0 to 0.2.1.0\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'ops_genie_client'\n s.version = '0.2.0.0'\n s.summary = 'Client for the OpsGenie API using the Obsidian HT... | ruby | chosen |
[
{
"from": "system",
"value": "Update and migrate create weathers migration\n"
},
{
"from": "human",
"value": "class CreateWeathers < ActiveRecord::Migration\n def change\n create_table :weathers do |t|\n end\n end\nend\n"
},
{
"from": "gpt",
"value": "class CreateWeathers < A... | ruby | chosen |
[
{
"from": "system",
"value": "Use instrumentation by default in RailsEventStore\n\nIssue: #244\n"
},
{
"from": "human",
"value": "module RailsEventStore\n class Client < RubyEventStore::Client\n attr_reader :request_metadata\n\n def initialize(repository: RailsEventStoreActiveRecord::Even... | ruby | chosen |
[
{
"from": "system",
"value": "Increase verbosity when VERBOSE is set."
},
{
"from": "human",
"value": "require \"open3\"\nrequire \"shellwords\"\n\nmodule Mellon\n module ShellUtils\n module_function\n\n def security(*command, &block)\n sh(\"security\", *command, &block)\n end\n\n... | ruby | chosen |
[
{
"from": "human",
"value": "Add podspec file for future cocoapod submission\n"
},
{
"from": "gpt",
"value": "Pod::Spec.new do |s|\n s.name = 'DropboxSimpleOAuth'\n s.version = '0.0.1'\n s.summary = 'A quick and simple way to authenticate a Dropbox... | ruby | chosen |
[
{
"from": "system",
"value": "Use standard connection for testing\n"
},
{
"from": "human",
"value": "# encoding: utf-8\nrequire 'pg'\nrequire 'sequel'\nrequire 'json'\nrequire 'yaml'\n\nmodule CartoDB\n module Importer2\n module Factories\n class PGConnection\n def initialize(opt... | ruby | chosen |
[
{
"from": "system",
"value": "Rewrite the response on redirect\n"
},
{
"from": "human",
"value": "require 'forwardable'\nrequire 'rack/contrib/cookies'\n\nmodule NYNY\n class RequestScope\n extend Forwardable\n\n attr_reader :request, :response\n def_delegators :request, :params, :sess... | ruby | chosen |
[
{
"from": "system",
"value": "Package version is increased from 0.4.0.1 to 0.4.0.2\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'log'\n s.version = '0.4.0.1'\n s.summary = 'Logging to STD IO with levels, tagging, and coloring'\n s.des... | ruby | chosen |
[
{
"from": "system",
"value": "Change find_by_id(…) for find_by(id: …)\n"
},
{
"from": "human",
"value": "module Socializer\n class ApplicationController < ActionController::Base\n # Prevent CSRF attacks by raising an exception.\n # For APIs, you may want to use :null_session instead.\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Update aws-sdk to latest minor release\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'carrierwave/aws/version'\n\nGem::Specification.new do |... | ruby | chosen |
[
{
"from": "system",
"value": "Include favorited and created_at attributes in favorite serializer\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nmodule GobiertoData\n class FavoriteSerializer < ActiveModel::Serializer\n attributes :id, :user_id, :favorited_type, :favorite... | ruby | chosen |
[
{
"from": "system",
"value": "Use new ruby hash syntax.\n"
},
{
"from": "human",
"value": "\nGiven(/^there are existing event types in the database$/) do\n %w(Home Clinic Phone Email).each do |name|\n instance_variable_set(:\"@#{name.downcase}\", FactoryGirl.create(:events_type, :name => nam... | ruby | chosen |
[
{
"from": "system",
"value": "Allow passing multiple ES urls to config\n"
},
{
"from": "human",
"value": "require 'typhoeus/adapters/faraday'\n\nurl = ENV['ELASTICSEARCH_CLUSTER_URL'] || 'localhost:9200'\n\nElasticsearch::Model.client = Elasticsearch::Client.new url: url do |builder|\n builder.... | ruby | chosen |
[
{
"from": "system",
"value": "Revert \"Try secure: true again\" It's definitely broken\n"
},
{
"from": "human",
"value": "# Be sure to restart your server when you modify this file.\n\nDiscourse::Application.config.session_store :cookie_store, {\n key: '_forum_session',\n secure: SiteSetting.u... | ruby | chosen |
[
{
"from": "system",
"value": "Improve trimming bundle's name (remove all \"vim\" suffix, prefix)\n"
},
{
"from": "human",
"value": "module VundleCli\n module Helpers\n module_function\n\n def file_validate(fpath, check_dir = false)\n fpath = File.expand_path(fpath)\n\n unless Fi... | ruby | chosen |
[
{
"from": "system",
"value": "Switch to idiomatic Array to Hash\n"
},
{
"from": "human",
"value": "module Zippo\n class Uncompressor\n def initialize(io, compressed_size)\n @io = io\n @compressed_size = compressed_size\n end\n def read n\n @io.read n\n end\n protec... | ruby | chosen |
[
{
"from": "system",
"value": "Set required_ruby_version to \">= 2.3\"\n"
},
{
"from": "human",
"value": "lib = File.expand_path('../lib/', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\n\nrequire 'zendesk_api/version'\n\nGem::Specification.new do |s|\n s.name = \"zen... | ruby | chosen |
[
{
"from": "system",
"value": "Cover menu item selection in request test.\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe \"Adding projects\" do\n it \"can be done\" do\n visit root_path\n click_link \"Add project\"\n fill_in \"Name\", with: \"Deployer\"\n fill_i... | ruby | chosen |
[
{
"from": "system",
"value": "Add supported platforms to the metdata\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n"
},
{
"from": "human",
"value": "name 'openssl'\nmaintainer 'Chef Software, Inc.'\nmaintainer_email 'cookbooks@chef.io'\nlicense... | ruby | chosen |
[
{
"from": "system",
"value": "Add oracle and mac_os_x_server as supported platforms\n"
},
{
"from": "human",
"value": "name \"build-essential\"\nmaintainer \"Opscode, Inc.\"\nmaintainer_email \"cookbooks@opscode.com\"\nlicense \"Apache 2.0\"\ndescription \"In... | ruby | chosen |
[
{
"from": "system",
"value": "Bump cookbook version to 1.4.0\n"
},
{
"from": "human",
"value": "name 'apache_zookeeper'\nmaintainer 'Bryan Baugher'\nmaintainer_email 'Bryan.Baugher@Cerner.com'\nlicense 'MIT'\ndescription 'Installs/Configures Apache Zookeeper'\nlon... | ruby | chosen |
[
{
"from": "system",
"value": "Update chef client to 12.4.1\n"
},
{
"from": "human",
"value": "# Add the opscode APT source for chef\ndefault[:apt][:sources] = node[:apt][:sources] | [\"opscode\"]\n\n# Set the default server version\ndefault[:chef][:server][:version] = \"12.0.8-1\"\n\n# Set the d... | ruby | chosen |
[
{
"from": "system",
"value": "Correct the description of the default recipe\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 License at\n#\... | ruby | chosen |
[
{
"from": "system",
"value": "Replace apt cookbook dependency with compat_resource\n"
},
{
"from": "human",
"value": "name 'ossec'\nmaintainer 'Sous Chefs'\nmaintainer_email 'help@sous-chefs.org'\nlicense 'Apache-2.0'\ndescription 'Installs and configures ossec'\n... | ruby | chosen |
[
{
"from": "system",
"value": "Update to next version of cookbook\n"
},
{
"from": "human",
"value": "name \"cerner_kafka\"\nmaintainer \"Cerner Corp.\"\nmaintainer_email \"Bryan.Baugher@cerner.com\"\nlicense \"Apache 2.0\"\ndescription \"Installs and configure... | ruby | chosen |
[
{
"from": "system",
"value": "Add read timeout to BlockchainAdapter::Base.http_request\n"
},
{
"from": "human",
"value": "module StraightEngine\n module BlockchainAdapter\n\n # An almost abstract class, providing guidance for the interfaces of\n # all blockchain adapters as well as supply... | ruby | chosen |
[
{
"from": "system",
"value": "Hide rank in non-ranking variables\n"
},
{
"from": "human",
"value": "module Api\n module V1\n module Adaptation\n class ValueSerializer < ActiveModel::Serializer\n attribute :location\n attribute :value\n attribute :rank\n\n def... | ruby | chosen |
[
{
"from": "system",
"value": "Drop support for Chef clients < 13\n"
},
{
"from": "human",
"value": "name 'wsus-client'\nmaintainer 'Criteo'\nmaintainer_email 'b.courtois@criteo.com'\nlicense 'Apache-2.0'\ndescription 'Configures wsus client'\nlong_description IO.r... | ruby | chosen |
[
{
"from": "system",
"value": "Update dependency on ohai 3.0\n"
},
{
"from": "human",
"value": "name 'sysctl'\nmaintainer 'Sander van Zoest'\nmaintainer_email 'sander+cookbooks@vanzoest.com'\nissues_url 'https://github.com/svanzoest-cookbooks/sysctl/issues' if respond_to?(:issues_url)\nsource_url... | ruby | chosen |
[
{
"from": "system",
"value": "Add missing characters to implicit link regexp\n\n\"]\" and \":\" are not allowed either inside implicit link definitions.\n"
},
{
"from": "human",
"value": "SimpleCov.command_name \"lint\" if ENV[\"COVERAGE\"] == \"true\"\n\nRSpec.describe \"Changelog\" do\n subje... | ruby | chosen |
[
{
"from": "system",
"value": "Make ruby 1.9.2 tests success on my mac. Should be investigated later...\n"
},
{
"from": "human",
"value": "require \"spec_helper\"\n\ndescribe \"daemonzier after start\" do\n\n before :each do\n @pid_files = simple_daemonfile(\n :name => :test1,\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Allow any 1.x faraday version.\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'dropbox_api/version'\n\nGem::Specification.new do |spec|\n spec.name ... | ruby | chosen |
[
{
"from": "system",
"value": "Allow codeclimate connections from CI\n"
},
{
"from": "human",
"value": "require \"minitest/spec\"\nrequire \"minitest/autorun\"\nrequire \"webmock/minitest\"\n\nrequire \"codeclimate-test-reporter\"\nCodeClimate::TestReporter.start\n\nrequire \"bitkassa\"\n\nclass ... | ruby | chosen |
[
{
"from": "system",
"value": "Enable web requests after tests have been run\n"
},
{
"from": "human",
"value": "require 'codeclimate-test-reporter'\nCodeClimate::TestReporter.start\n\n$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\n\nrequire 'map_print'\n\nrequire 'minitest/mock'\nreq... | ruby | chosen |
[
{
"from": "human",
"value": "Add specs for the toplevel Complex method.\n"
},
{
"from": "gpt",
"value": "require File.dirname(__FILE__) + '/../../spec_helper'\nrequire 'complex'\n\ndescribe \"Complex when passed [Complex, Complex]\" do\n it \"returns a new Complex number based on the two given ... | ruby | chosen |
[
{
"from": "system",
"value": "Use `let` instead of `let!`\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nrequire 'rails_helper'\ninclude Scrivito::ControllerHelper\n\nRSpec.feature \"Users\", type: :feature do\n subject { page }\n\n describe \"log in\" do\n let!(:login) { L... | ruby | chosen |
[
{
"from": "human",
"value": "Add script to generate artifacts for GDM\n"
},
{
"from": "gpt",
"value": "require 'psych'\nrequire 'pathname'\nrequire 'csv'\n\ntable = nil\ncollect = false\nschema = {}\n\nartifacts_dir = Pathname.new(\"artifacts\")\nartifacts_dir.mkpath\n\ndef extract(link)\n retu... | ruby | chosen |
[
{
"from": "system",
"value": "Remove alliance_corporations from alliance decorator\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nmodule Eve\n class AllianceDecorator < ApplicationDecorator\n include ActionView::Helpers::NumberHelper\n\n decorates_associations :creato... | ruby | chosen |
[
{
"from": "system",
"value": "Add leading slash to owner link\n"
},
{
"from": "human",
"value": "module OwnerLinkSerializer\n extend ActiveSupport::Concern\n\n module ClassMethods\n\n def links\n links = super\n links.delete(\"#{key}.owners\")\n links[\"#{key}.owner\"] = { hr... | ruby | chosen |
[
{
"from": "system",
"value": "Adjust gemspec with indentation gem (and rake).\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nrequire File.join(File.dirname(__FILE__), 'lib/gir_ffi/version.rb')\n\nGem::Specification.new do |s|\n s.name = \"gir_ffi\"\n s.version = GirFFI::VERSION\... | ruby | chosen |
[
{
"from": "system",
"value": "Use tr instead of gsub.\n"
},
{
"from": "human",
"value": "module IconHelper\n def icon(name, label = nil)\n markup = content_tag :i, nil, class: \"fa fa-#{name.to_s.gsub('_', '-')}\"\n label ? \"#{markup} #{label}\".html_safe : markup\n end\nend\n"
}... | ruby | chosen |
[
{
"from": "human",
"value": "Create a universal mixin for buttons ending with _new or _discover\n\n(cherry picked from commit fe926f173c46e51847ebd7e5f05f007132dc7764)\n"
},
{
"from": "gpt",
"value": "module ApplicationHelper::Button::Mixins::SubListViewScreenMixin\n def sub_list_view_screen?\n... | ruby | chosen |
[
{
"from": "system",
"value": "Move class methods to the top.\n"
},
{
"from": "human",
"value": "class AccessToken < ActiveRecord::Base\n belongs_to :repository\n attr_accessible :expiration, :token\n\n scope :expired, ->() { where('expiration <= ?', Time.now) }\n scope :unexpired, ->() { whe... | ruby | chosen |
[
{
"from": "human",
"value": "Add script to export gems and brews list\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env ruby\n\n# Save brew (and casks) list to brew folder.\n\ndef saveList(list, filePath)\n list = list.chomp\n if list\n File.open(filePath, \"w\") { |f|\n f ... | ruby | chosen |
[
{
"from": "system",
"value": "Migrate to use Last.fm API\n\n- Instead of scraping, uses the Last.fm API to find last scrobbled track\n- Use “nowPlaying” flag or if scrobble was last done in 10 minutes to report\n"
},
{
"from": "human",
"value": "require \"net/http\"\nrequire \"nokogiri\"\n\nmodu... | ruby | chosen |
[
{
"from": "system",
"value": "Exclude executables from the gemspec\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nGem::Specification.new do |spec|\n spec.name = \"fair_dice_roll\"\n spec.version = \"4.0.0\"\n\n spec.author = \"Steve Richert\"\n spec.email = \"steve.ric... | ruby | chosen |
[
{
"from": "system",
"value": "Clean up filter parameter logging script\n"
},
{
"from": "human",
"value": "# Be sure to restart your server when you modify this file.\n\n# Configure sensitive parameters which will be filtered from the log file.\nRails.application.config.filter_parameters += [:pas... | ruby | chosen |
[
{
"from": "system",
"value": "Add require ovirt to ovirt event monitor\n"
},
{
"from": "human",
"value": "class OvirtEventMonitor\n def initialize(options={})\n @options = options\n end\n\n def inventory\n @inventory ||= Ovirt::Inventory.new(@options)\n end\n\n def start\n trap(:TE... | ruby | chosen |
[
{
"from": "system",
"value": "Move deal action to before block for clarity\n"
},
{
"from": "human",
"value": "require 'rails_helper'\n\nRSpec.describe Game, type: :model do\n HAND_SIZE = 10\n KITTY_SIZE = 3\n\n describe \"#deal\" do\n subject(:game) { Game.new }\n \n specify \"each h... | ruby | chosen |
[
{
"from": "system",
"value": "Add tests for Vote model\n"
},
{
"from": "human",
"value": "require 'rails_helper'\n\nRSpec.describe Vote, type: :model do\n pending \"add some examples to (or delete) #{__FILE__}\"\nend\n"
},
{
"from": "gpt",
"value": "require 'rails_helper'\n\nRSpec.d... | ruby | chosen |
[
{
"from": "system",
"value": "Call YAML.safe_load differently according to required parameters\n"
},
{
"from": "human",
"value": "require \"erb\"\nrequire \"yaml\"\n\ndef fixture(name)\n spec_root = File.expand_path(\"..\", File.dirname(__FILE__))\n fixture_path = File.join(spec_root, \"fixtur... | ruby | chosen |
[
{
"from": "system",
"value": "Add Java as a dependency\n"
},
{
"from": "human",
"value": "cask 'burp-suite' do\n version '1.7.06'\n sha256 'ce2da473fdb65f4704ad6597dcd6615ec84e7a4c3c81deaf4f2de360d362a9bd'\n\n url \"https://portswigger.net/Burp/Releases/Download?productId=100&version=#{versio... | ruby | chosen |
[
{
"from": "system",
"value": "Fix migration for rails 5\n"
},
{
"from": "human",
"value": "class CreateAssetAttachments < ActiveRecord::Migration[5.1]\n def change\n create_table :assetable_asset_attachments do |t|\n t.references :asset\n t.references :assetable, :polymorphic => tr... | ruby | chosen |
[
{
"from": "human",
"value": "Put variable parsing logic in separate function\n"
},
{
"from": "gpt",
"value": "module Smitty\n def self.variable_parser(variable_string)\n pairs = variable_string.split('=')\n # content is a file\n begin\n with_content = File.readlines(pairs[1]).map(... | ruby | chosen |
[
{
"from": "system",
"value": "Return SpecInfra::CommandResult object when method name not start with\n`check_`\n"
},
{
"from": "human",
"value": "require 'singleton'\nrequire 'specinfra/command_result'\n\nmodule SpecInfra\n module Backend\n class Base\n include Singleton\n\n def se... | ruby | chosen |
[
{
"from": "system",
"value": "Fix rendering app for the sitemaps.\n\nThey're served by rummager itself, not by frontend.\n\nThis was inadvertantly changed in #480\n"
},
{
"from": "human",
"value": "namespace :publishing_api do\n desc \"Publish special routes such as sitemaps\"\n task :publish_... | ruby | chosen |
[
{
"from": "system",
"value": "Fix syntax error in pages migration\n"
},
{
"from": "human",
"value": "class AddParentToPage < ActiveRecord::Migration\n def change\n add_column :pages, :parent_id, :integer\n add_index :parent_id\n end\nend\n"
},
{
"from": "gpt",
"value": "class... | ruby | chosen |
[
{
"from": "system",
"value": "Fix sort for nil cells in enterprise fee summary\n"
},
{
"from": "human",
"value": "require \"open_food_network/reports/report_data/base\"\n\nmodule OrderManagement\n module Reports\n module EnterpriseFeeSummary\n module ReportData\n class Enterprise... | ruby | chosen |
[
{
"from": "human",
"value": "Add conditioning to parcel items\n"
},
{
"from": "gpt",
"value": "class AddConditioningToParcelItems < ActiveRecord::Migration[5.0]\n def up\n execute <<-SQL\n UPDATE parcel_items AS i\n SET conditioning_unit_id = p.conditioning_unit_id,\n cond... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor to find by username\n"
},
{
"from": "human",
"value": "require 'rest-client'\nrequire 'json'\n\nmodule Expeditions\n extend Discordrb::Commands::CommandContainer\n\n command :regnum, description: 'Get a user\\'s registration number for a given expedition'... | ruby | chosen |
[
{
"from": "system",
"value": "Update podspec to remove V from version number\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = 'FormValidatorSwift'\n s.version = 'v1.0.0'\n s.license = { :type => \"MIT\", :file => \"License.md\" }\n s.summary = 'An organizational tool for wr... | ruby | chosen |
[
{
"from": "system",
"value": "Make xboolean default select lazy for locale change\n"
},
{
"from": "human",
"value": "class Datagrid::Filters::ExtendedBooleanFilter < Datagrid::Filters::EnumFilter #:nodoc: \n\n YES = \"YES\"\n NO = \"NO\"\n\n def initialize(report, attribute, options = {}, &bl... | ruby | chosen |
[
{
"from": "human",
"value": "Add test case for phpeye.\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\n\ndescribe PhpeyeCrawler do\n\n\n describe 'crawl' do\n it 'crawles cakephp and skips all branches' do\n Product.delete_all\n expect( License.count ).to eq(0)\n expec... | ruby | chosen |
[
{
"from": "system",
"value": "Clone all repositories, not only ones from first page\n"
},
{
"from": "human",
"value": "#gitback 0.1\n#credits: Walter White, Updates: Addy Osmani\n#!/usr/bin/env ruby\n# dependencies\nrequire \"json\"\nrequire \"open-uri\"\n# your github username\nusername = \"irn... | ruby | chosen |
[
{
"from": "system",
"value": "Add special paths to I18n load paths end.\n"
},
{
"from": "human",
"value": "module I18nInitialization\n extend self\n\n def environment\n I18n.locale = :ru\n I18n.load_path.unshift(*locale_files)\n yield\n I18n.load_path.shift 2\n I18n.locale = I1... | ruby | chosen |
[
{
"from": "human",
"value": "Add script to check general health of feeds\n"
},
{
"from": "gpt",
"value": "require 'typhoeus'\nrequire 'feedjira'\nrequire 'yaml'\n\nCONFIG = YAML.load_file('config.yml')\n\nfeeds = []\none_year_ago = Time.now - (365*24*60*60)\nerrors = {}\nhydra = Typhoeus::Hydra.... | ruby | chosen |
[
{
"from": "system",
"value": "Return full organization info from the ORG api call\n"
},
{
"from": "human",
"value": "class Api::V1::OrganizationsController < Api::ApiController\n # Given organization_id, look up org profile\n # GET /organizations/{id}\n def show\n get_organization(params[:... | ruby | chosen |
[
{
"from": "system",
"value": "Delete the dangling dependency on ucspi-tcp\n\nThe inclusion of its recipe was removed several years ago in #21, but the\ndependency was left behind.\n\nIf it's no longer needed, then it should be fully removed. It hasn't had a\nrelease in quite some time, nor has the pacman co... | ruby | chosen |
[
{
"from": "system",
"value": "Add supports clause for smartos\n"
},
{
"from": "human",
"value": "name \"smf\"\nmaintainer \"ModCloth, Inc.\"\nmaintainer_email \"ops@modcloth.com\"\nlicense \"Apache 2.0\"\ndescription \"A light weight resource provider (LWRP) for S... | ruby | chosen |
[
{
"from": "system",
"value": "Update maintainer details and associated info after transfering ownership.\n"
},
{
"from": "human",
"value": "name 'rotate-passwords'\nmaintainer 'Danny Roberts'\nmaintainer_email 'danny@thefallenphoenix.net'\nlicense 'BSD-2-Clause'\ndescription 'Installs/Configures... | ruby | chosen |
[
{
"from": "system",
"value": "Add source and issues url\n"
},
{
"from": "human",
"value": "name 'play'\nmaintainer 'Dennis Hoer'\nmaintainer_email 'dennis.hoer@gmail.com'\nlicense 'MIT'\ndescription 'Installs/Configures distribution artifact as a service.'\nlong_description IO.read(File.join(Fil... | ruby | chosen |
[
{
"from": "system",
"value": "Update codecov to version 0.4.3"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nrequire_relative 'lib/filewatcher'\nrequire_relative 'lib/filewatcher/version'\n\nGem::Specification.new do |s|\n s.name = 'filewatcher'\n s.version = ... | ruby | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.