conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "human",
"value": "Add custom become matcher for acceptance tests\n"
},
{
"from": "gpt",
"value": "require 'timeout'\n\nRSpec::Matchers.define(:become) do |expected|\n match do |block|\n begin\n Timeout.timeout(Capybara.default_wait_time) do\n sleep(0.1) until expected ... | ruby | chosen |
[
{
"from": "system",
"value": "Remove development dependency on Pry\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/git_tracker/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.name = \"git_tracker\"\n gem.version = GitTr... | ruby | chosen |
[
{
"from": "system",
"value": "Fix sanitisation of controller/actions names\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nmodule CodeHelper\n def model_file(controller)\n File.join('app', 'models', \"#{ controller.singularize }.rb\")\n end\n\n def controller_file(controller)\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add twitter handle to twitter message\n"
},
{
"from": "human",
"value": "class UserMailer < ActionMailer::Base\n default from: \"Harry's <welcome@harrys.com>\"\n\n def signup_email(user)\n @user = user\n @twitter_message = \"A8 is upgrading nutrition. Didn’t... | ruby | chosen |
[
{
"from": "system",
"value": "Check if possible type in object from id\n"
},
{
"from": "human",
"value": "module Graph\n Schema = GraphQL::Schema.define do\n query Graph::Types::Query\n\n resolve_type ->(obj, ctx) do\n Graph::Schema.types.values.find { |type| type.name == obj.class.n... | ruby | chosen |
[
{
"from": "system",
"value": "Package version is increased from 0.1.8 to 0.1.9\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'raygun_client'\n s.version = '0.1.8'\n s.summary = 'Client for the Raygun API using the Obsidian HTTP client'\... | ruby | chosen |
[
{
"from": "system",
"value": "Remove references to time now that we're using assert_migration\n"
},
{
"from": "human",
"value": "require 'rails'\nrequire 'spec_helper'\nrequire 'generator_spec/test_case'\nrequire 'generators/kaleidoscope/kaleidoscope_generator'\n\ndescribe 'TestMigration' do\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Rename ControllerHacks so it sounds less like a temporary fix.\n"
},
{
"from": "human",
"value": "# Sets up use_route across controller tests, from:\n# http://bit.ly/PU4Wm4 (stackoverflow)\n\nmodule ControllerHacks\n def get(action, parameters = nil, session = nil,... | ruby | chosen |
[
{
"from": "system",
"value": "Set a good example using unique index\n"
},
{
"from": "human",
"value": "ActiveRecord::Schema.define(:version => 2) do\n create_table \"databases\", :force => true do |t|\n t.string \"database\"\n t.integer \"master_id\"\n t.integer \"host_id\"\n end\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Update Yii documentation (2.0.9, 1.1.17)\n"
},
{
"from": "human",
"value": "module Docs\n class Yii < UrlScraper\n self.type = 'yii'\n\n options[:attribution] = <<-HTML\n © 2008–2016 by Yii Software LLC<br>\n Licensed under the three clau... | ruby | chosen |
[
{
"from": "system",
"value": "Update list files example to include file metadata\n"
},
{
"from": "human",
"value": "require 'gphoto2'\n\n# List all files\n\ndef visit(folder)\n files = folder.files\n puts \"#{folder.root? ? \"/ (root)\" : folder.path} (#{files.size} files)\"\n\n files.each { ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix permissions of tools file\n"
},
{
"from": "human",
"value": "include_recipe \"sprout-osx-base::homebrew\"\ninclude_recipe \"dna::folders\"\n\nexecute \"tap the djl repo\" do\n command \"brew tap djl/homebrew-apache2\"\n not_if { system(\"brew tap | grep 'd... | ruby | chosen |
[
{
"from": "system",
"value": "Allow also any 1.0.x faraday dependency version.\n\ncloses #71"
},
{
"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.... | ruby | chosen |
[
{
"from": "human",
"value": "Add tests for the organization endpoints\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\n\ndescribe Cyclid::UI::Controllers::Organization do\n include Rack::Test::Methods\n\n let :user do\n u = double('user')\n allow(u).to receive(:username).and_retur... | ruby | chosen |
[
{
"from": "system",
"value": "Fix specs for newer vagrant versions\n"
},
{
"from": "human",
"value": "require 'spec_helper.rb'\n\ndescribe Vagrant::Butcher::Env do\n subject { described_class.new }\n\n it \"is a valid Vagrant UI object\" do\n subject.ui.should be_a Vagrant::UI::BasicScope\n... | ruby | chosen |
[
{
"from": "system",
"value": "Correct caller tracking in delegated deprecation methods\n"
},
{
"from": "human",
"value": "require \"active_support/core_ext/kernel/singleton_class\"\nrequire \"active_support/core_ext/module/delegation\"\n\nmodule ActiveSupport\n class Deprecation\n module Ins... | ruby | chosen |
[
{
"from": "system",
"value": "Remove empty RubyAttribute extension class\n"
},
{
"from": "human",
"value": "module Domgen\n module Ruby\n class RubyAttribute < BaseParentedElement\n end\n\n class RubyClass < Domgen.ParentedElement(:object_type)\n attr_writer :classname\n attr... | ruby | chosen |
[
{
"from": "human",
"value": "Remove defunct unwanted policy teams.\n\nAlso removes connections to editions and \nattachments (though there aren't any for these \ngroups)."
},
{
"from": "gpt",
"value": "# https://www.pivotaltracker.com/story/show/52623285\n\nunwanted_team_emails = \"\n 'fleet@ds... | ruby | chosen |
[
{
"from": "system",
"value": "Remove old update_attribute in post-install\n"
},
{
"from": "human",
"value": "# This file is executed in the Rails evironment by the `rails-post-install` script\n\nPublicBody.each{|body|\n body.translations.each{|translation|\n translation.update_attribut... | ruby | chosen |
[
{
"from": "system",
"value": "Fix workdir (easier than linking dir for fakesu)\n"
},
{
"from": "human",
"value": "module PGQuilter\n module Config\n LOG_LEVEL = ENV['LOG_LEVEL']\n\n QUILTER_NAME = 'pg-quilter'\n QUILTER_EMAIL = ENV['QUILTER_EMAIL']\n\n GITHUB_USER = 'pg-quilter'\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add output when used via rackup\n"
},
{
"from": "human",
"value": "require 'rack/handler'\nrequire 'puma'\n\nmodule Rack\n module Handler\n module Puma\n DEFAULT_OPTIONS = {:Host => '0.0.0.0', :Port => 8080, :Threads => '0:16'}\n\n def self.run(app, op... | ruby | chosen |
[
{
"from": "human",
"value": "Add Sinatra support, layouts and all. Whoopie!\n"
},
{
"from": "gpt",
"value": "# Support for RTemplate in your Sinatra app.\n#\n# require 'rtemplate/sinatra'\n#\n# class App < Sinatra::Base\n# include RTemplate::Sinatra\n# end\nrequire 'rtemplate'\n\nclass RTempla... | ruby | chosen |
[
{
"from": "system",
"value": "Add some attributes to the Place model.\n"
},
{
"from": "human",
"value": "module Nominatim\n class Address\n def initialize(attrs = {})\n @attrs = attrs\n end\n\n def attraction\n @attraction ||= @attrs[:attraction]\n end\n\n def clothes\n... | ruby | chosen |
[
{
"from": "system",
"value": "Use flat json files until ORM for JSON store is created, right now is hard coded to work with sample consumer app for quotes only for testing\n"
},
{
"from": "human",
"value": "# rulers/lib/rulers/file_model.rb\n\nrequire \"multi_json\"\n\nmodule Rulers\n module Mo... | ruby | chosen |
[
{
"from": "system",
"value": "Improve the logic to resolve URI Template in href\n"
},
{
"from": "human",
"value": "module Plz\n module Commands\n class Help\n # @param options [Slop]\n # @param schema [JsonSchema::Schema]\n def initialize(options: nil, schema: nil)\n @o... | ruby | chosen |
[
{
"from": "human",
"value": "Create get stops from API task\n"
},
{
"from": "gpt",
"value": "# Save stops from matka API\nrequire 'nokogiri'\nrequire 'open-uri'\n\ndesc \"Get stops\"\ntask :get_stops => :environment do\n\n url = \"http://api.matka.fi/timetables/?m=stop&company=SH:TUR\"\n\n par... | ruby | chosen |
[
{
"from": "system",
"value": "Make ui task add ui route\n"
},
{
"from": "human",
"value": "require 'yaml'\nrequire 'open-uri'\n\nnamespace :spicerack do\n\n def get_destination(path)\n ENV[\"GEM_TESTING\"] ? \"tmp/#{path}\" : path\n end\n\n def get_source(file)\n source = file['source']... | ruby | chosen |
[
{
"from": "system",
"value": "Fix absence in DNS error.\n"
},
{
"from": "human",
"value": "require 'socket'\r\nrequire 'runit-man/service_info'\r\nrequire 'runit-man/partials'\r\nrequire 'sinatra/content_for'\r\n\r\nmodule Helpers\r\n include Rack::Utils\r\n include Sinatra::Partials\r\n incl... | ruby | chosen |
[
{
"from": "system",
"value": "Add filetypes used in @font-face.\n"
},
{
"from": "human",
"value": "require 'rack/test'\n\nmodule Sinatra\n module AssetPack\n def self.registered(app)\n unless app.root?\n raise Error, \"Please set :root in your Sinatra app.\"\n end\n\n a... | ruby | chosen |
[
{
"from": "system",
"value": "Change document mappings cron to 11:45am\n\nFor Robin.\n"
},
{
"from": "human",
"value": "$: << '.'\nrequire File.dirname(__FILE__) + \"/initializers/scheduled_publishing\"\n# default cron env is \"/usr/bin:/bin\" which is not sufficient as govuk_env is in /usr/loca... | ruby | chosen |
[
{
"from": "system",
"value": "Fix bug clearing old sessions.\n"
},
{
"from": "human",
"value": "# Learn more about this file: http://github.com/javan/whenever\n\nset :environment, 'production_lite'\n\nevery 1.hour, :at => 19 do\n runner 'Site.each { Group.update_memberships; NewsItem.update_fro... | ruby | chosen |
[
{
"from": "system",
"value": "Use asset_paths instead of paths\n"
},
{
"from": "human",
"value": "class TaskList\n\n def self.root_path\n @root_path ||= Pathname.new(File.expand_path(\"../../../\", __FILE__))\n end\n\n def self.asset_paths\n @paths ||= Dir[root_path.join(\"app/assets/*\... | ruby | chosen |
[
{
"from": "system",
"value": "Add Rake tasks for publication/destruction consumers.\n"
},
{
"from": "human",
"value": "namespace :messenger do\n desc \"Run queue consumer\"\n task :listen do\n Daemonette.run(\"publisher_metadata_sync\") do\n Rake::Task[\"environment\"].invoke\n M... | ruby | chosen |
[
{
"from": "system",
"value": "Make Services methods available as module functions\n"
},
{
"from": "human",
"value": "module Workflows\n module Service\n def success!(value=true)\n value\n end\n\n def failure!(value=false)\n Workflows::Error.to_error(value)\n end\n end\nen... | ruby | chosen |
[
{
"from": "system",
"value": "Update gemspec docs a bit\n"
},
{
"from": "human",
"value": "Gem::Specification.new do |spec|\n spec.name = \"lita-jira-issues\"\n spec.version = \"0.1.0\"\n spec.authors = [\"Arthur Maltson\"]\n spec.email = [\"arthur@maltson.com\"]... | ruby | chosen |
[
{
"from": "system",
"value": "Add sslmode to PG connector\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nrequire_relative './odbc'\n\nmodule Carto\n class Connector\n\n # PostgreSQL provider using [psqlODBC](https://odbc.postgresql.org/) driver\n #\n # For complete list of par... | ruby | chosen |
[
{
"from": "system",
"value": "Update the description of one of the ARGF specs.\n"
},
{
"from": "human",
"value": "require File.dirname(__FILE__) + '/../../spec_helper'\n\ndescribe \"ARGF\" do\n it \"is Enumerable\" do\n ARGF.should be_kind_of(Enumerable)\n end\nend\n"
},
{
"from": "... | ruby | chosen |
[
{
"from": "system",
"value": "Use the root_group attribute from Ohai\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n"
},
{
"from": "human",
"value": "#\n# Cookbook:: perl\n# Recipe:: default\n#\n# Copyright:: 2009-2016, Chef Software, Inc.\n#\n# Licensed under th... | ruby | chosen |
[
{
"from": "system",
"value": "Make `nivo_slider` behaves like `content_tag`\n\nThe provided `nivo_slider` view helper now behaves more like Action\nView's `content_tag` for the sake of convenience.\n\nAlso by default it doesn't escape the provided content and sets the\ndiv's id to \"slider\" and adds a \"ni... | ruby | chosen |
[
{
"from": "system",
"value": "Add flexibility measures to the front-end\n"
},
{
"from": "human",
"value": "class MarketModel < ActiveRecord::Base\n include Privacy\n\n FOUNDATIONS = %w(connections kWh kW_connection kW_max kW_contracted kW_flex)\n PRESENTABLES = %w(stakeholder_from stakeholder... | ruby | chosen |
[
{
"from": "system",
"value": "Fix frozen string literal regression\n\nSee: https://freelancing-gods.com/2017/07/27/friendly-frozen-string-literals.html\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nmodule ShellRunner\n # Runs a shell command. Sanitizes Rails-related enviro... | ruby | chosen |
[
{
"from": "system",
"value": "Remove cattr_accesor default value, this breaks in Rails 4.0\n"
},
{
"from": "human",
"value": "class ExceptionNotifier\n class CampfireNotifier\n cattr_accessor :tinder_available do true end\n\n attr_accessor :subdomain\n attr_accessor :token\n attr_ac... | ruby | chosen |
[
{
"from": "system",
"value": "Fix gem name on gemspec\n"
},
{
"from": "human",
"value": "Gem::Specification.new do |s|\n s.name = 'Ruy'\n s.version = '0.0.1'\n s.date = '2014-06-04'\n s.files = Dir['lib/**/*']\n s.author = 'Moove-IT'\n s.license = 'MIT'\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Update to the gem spec\n"
},
{
"from": "human",
"value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"face_recognition/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s|\n s.... | ruby | chosen |
[
{
"from": "system",
"value": "Switch to delimited string for description\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nGem::Specification.new do |spec|\n spec.name = \"coursepack\"\n spec.version = \"0.1.0\"\n spec.authors = [\"Nathan Bailey\"]\n sp... | ruby | chosen |
[
{
"from": "system",
"value": "Update characters info each hour\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nreturn if defined?(Rails::Console) || Rails.env.test? || File.split($0).last == 'rake'\n\ns = Rufus::Scheduler.singleton\n\ns.every '1m' do\n Rails.logger.info \"he... | ruby | chosen |
[
{
"from": "human",
"value": "Add code wars (7) next featured number\n"
},
{
"from": "gpt",
"value": "# http://www.codewars.com/kata/56abc5e63c91630882000057/\n# --- iteration 1 ---\ndef next_numb(n)\n n += 1\n until n >= 9876543210 do\n return n if digits_unique?(n) && n.odd? && multiple_of... | ruby | chosen |
[
{
"from": "system",
"value": "Switch version back to 0.0.2\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = \"NSObject-SafeExpectations\"\n s.version = \"0.0.3\"\n s.summary = \"No more crashes getting unexpected values from a NSDictionary.\"\n s.homepage ... | ruby | chosen |
[
{
"from": "system",
"value": "Replace bang actuator with call actuator.\n"
},
{
"from": "human",
"value": "require_relative 'test_init'\n\nRunner.! 'spec/*.rb' do |exclude|\n exclude =~ /spec_init.rb\\z/\nend\n"
},
{
"from": "gpt",
"value": "require_relative 'test_init'\n\nRunner.('... | ruby | chosen |
[
{
"from": "system",
"value": "Change td-agnet2 package to td-agent and 2.0 version\n"
},
{
"from": "human",
"value": "require 'erb'\nrequire 'fileutils'\nrequire 'rubygems'\n\nname \"td-agent2\"\nmaintainer \"Treasure Data, Inc\"\nhomepage \"http://treasuredata.com\"\ndescription \"Treasure Agen... | ruby | chosen |
[
{
"from": "system",
"value": "Remove old specs for SharedAuth jwt\n"
},
{
"from": "human",
"value": "require \"rails_helper\"\n\ndescribe ApplicationController, type: :controller do\n controller do\n include Concerns::JwtToken\n\n before_action :validate_token\n respond_to :json\n\n ... | ruby | chosen |
[
{
"from": "human",
"value": "Add code wars (6) - stop spinning my words\n"
},
{
"from": "gpt",
"value": "# http://www.codewars.com/kata/5264d2b162488dc400000001/\n# --- iteration 1 ---\ndef spinWords(string)\n string.split(\" \")\n .reduce([]){ |acc, word| acc << (word.size >= 5 ? word.r... | ruby | chosen |
[
{
"from": "system",
"value": "Update test dependency under ruby 2.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 'updateable_views_inheritance/version'\n\nGem::Specification.new do... | ruby | chosen |
[
{
"from": "system",
"value": "Add a few missing files to the manifest.\n"
},
{
"from": "human",
"value": "spec = Gem::Specification.new do |s|\n s.name = 'google_analytics'\n s.version = '1.1'\n s.date = \"2008-11-11\"\n s.author = 'Graeme Mathieson'\n s.email =... | ruby | chosen |
[
{
"from": "system",
"value": "Remove 'type' from key pair list view\n\nRemove 'type' from key pair details page\n(transferred from ManageIQ/manageiq@48a51ef69f0d49fcda814bfd47ad508b5b8f1500)\n"
},
{
"from": "human",
"value": "module AuthKeyPairCloudHelper::TextualSummary\n #\n # Groups\n #\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix bug clearing UKRDC data when patient dies\n\nWhen a patient dies the patient model enters a state where no\nfurther changes can be made to it unless you set the date_of_death\nand death causes. However this validation can be overriden by setting\nthe virtual accessor Patien... | ruby | chosen |
[
{
"from": "system",
"value": "Add rspec as a development 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 \"cash_flow_analysis/version\"\n\nGem::Specification.new do |spe... | ruby | chosen |
[
{
"from": "system",
"value": "Add dependency to podspec file\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = 'NSUserDefaults-AESEncryptor'\n s.version = '0.0.2'\n s.license = 'MIT'\n s.summary = 'Save and load data using AES encryption'\n s.homepage\t = 'https://github.co... | ruby | chosen |
[
{
"from": "system",
"value": "Use `ActiveSupport.on_load` to hook into Active Record.\n\nhttps://github.com/rails/rails/issues/23589#issuecomment-229247727\nhttps://github.com/plataformatec/devise/commit/c2c74b0\n"
},
{
"from": "human",
"value": "require \"action_store/version\"\nrequire \"actio... | ruby | chosen |
[
{
"from": "system",
"value": "Update for new bucket location\n"
},
{
"from": "human",
"value": "class Pdftk < BaseCustom\n\n def path\n \"#{build_path}/vendor/#{name}\"\n end\n\n def name\n \"pdftk\"\n end\n\n def source_url\n \"http://s3.amazonaws.com/guideline-util/pdftk.tar.gz\"... | ruby | chosen |
[
{
"from": "system",
"value": "Remove calls to deleting vat_rates keys, which don't appear to be used anymore\n"
},
{
"from": "human",
"value": "module Spree\n module Admin\n class TaxRatesController < ResourceController\n before_filter :load_data\n\n update.after :update_after\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Remove needless after_initialize to load Forem::Ability\n"
},
{
"from": "human",
"value": "module ::Forem\n class Engine < Rails::Engine\n isolate_namespace Forem\n\n class << self\n attr_accessor :root\n def root\n @root ||= Pathname.new(Fil... | ruby | chosen |
[
{
"from": "system",
"value": "Use .empty? instead of length comparison with 0\n"
},
{
"from": "human",
"value": "module I18n\n module Gettext\n PLURAL_SEPARATOR = \"\\001\"\n CONTEXT_SEPARATOR = \"\\004\"\n\n autoload :Helpers, 'i18n/gettext/helpers'\n\n @@plural_keys = { :en => [:... | ruby | chosen |
[
{
"from": "system",
"value": "Fix case where raw_data is nil\n\nThis happens when Xur isnt at the tower and bungie doesnt return empty tags. Instead they just omit the tag entirely:\r\n\r\n````\r\n{\r\nErrorCode: 1627\r\nThrottleSeconds: 0\r\nErrorStatus: \"DestinyVendorNotFound\"\r\nMessage: \"The Vendor y... | ruby | chosen |
[
{
"from": "human",
"value": "Add feature test for matching against collection\n"
},
{
"from": "gpt",
"value": "require_relative \"../../lib/query_string_search\"\nrequire_relative \"../fixtures/movie\"\n\nRSpec.describe \"Finding data based on an attribute that returns a collection\" do\n let(:... | ruby | chosen |
[
{
"from": "system",
"value": "Update comment description for Querylicious::QueryReducer\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nrequire 'querylicious/types'\nrequire 'querylicious/parser'\nrequire 'querylicious/transform'\nrequire 'querylicious/matcher'\n\nrequire 'dr... | ruby | chosen |
[
{
"from": "system",
"value": "Fix according to the change of command class name\n"
},
{
"from": "human",
"value": "module Specinfra\n module Helper\n module DetectOS\n def commands\n self.class.const_get('Specinfra').const_get('Command').const_get(os[:family]).new\n end\n\n ... | ruby | chosen |
[
{
"from": "human",
"value": "Add a Rake task for migrate DFID research outputs\n\nWe're moving these to a new finder with a new document type, base path\nand metadata fields. This Rake task should migrate the documents one by\none over to the new finder by republishing new editions of the document\nwith the... | ruby | chosen |
[
{
"from": "system",
"value": "Add TODO about module load order\n\nIf a module that inherits from another module gets loaded before its\nparent, then that load will fail with a NameError. We load modules in\nthe order returned by\n Dir[File.join(path, '*.rb')].each\nwhich doesn't guarantee that superclasses... | ruby | chosen |
[
{
"from": "human",
"value": "Add custom rake tasks to clean up newsitem\n"
},
{
"from": "gpt",
"value": "namespace :newsitem do\n desc \"Destroy all newsitem marked as read\"\n task :clear => :environment do\n Newsitem\n .where(\"created_at < ?\", 3.days.ago)\n .where(unread: 0)\n... | ruby | chosen |
[
{
"from": "system",
"value": "Allow controller overrides by parent app.\n"
},
{
"from": "human",
"value": "module Unity\n class Engine < ::Rails::Engine\n isolate_namespace Unity\n\n config.generators do |g|\n g.test_framework :rspec\n g.fixture_replacement :factory_girl, dir: \... | ruby | chosen |
[
{
"from": "system",
"value": "Use InfoRequest.holding_pen_request to find the holding pen\n\nThen it is automatically created if it does not already exist\n"
},
{
"from": "human",
"value": "namespace :cleanup do\n\n desc 'Clean up all message redelivery and destroy actions from the holding pen ... | ruby | chosen |
[
{
"from": "human",
"value": "Add details to SystemsConsole table.\n\n* add pid and status for 2nd level proxy.\n* add url for custom consoles.\n"
},
{
"from": "gpt",
"value": "class AddDetailsToSystemConsoles < ActiveRecord::Migration[5.0]\n def change\n add_column :system_consoles, :url, :s... | ruby | chosen |
[
{
"from": "system",
"value": "Speed up addresses page by prefetching associations\n"
},
{
"from": "human",
"value": "class AddressesController < ApplicationController\n def from\n @address = Address.find(params[:id])\n @deliveries = @address.deliveries_sent.order(\"created_at DESC\").pagi... | ruby | chosen |
[
{
"from": "system",
"value": "Set up instances to use forms\n"
},
{
"from": "human",
"value": "class InstancesController < MVCLI::Controller\n\n requires :instances\n requires :naming\n\n def index\n instances.all\n end\n\n def show\n instance.reload\n end\n\n def create\n option... | ruby | chosen |
[
{
"from": "system",
"value": "Make sure Pony gets loaded\n"
},
{
"from": "human",
"value": "require 'sinatra'\nrequire 'twilio-ruby'\nrequire 'json'\n\nNUMBER_MAP = JSON.parse(ENV[\"ADDRESSES\"])\nSMTP_URI = URI.parse(ENV[\"SMTP_URI\"])\n\nPony.options = {\n from: 'operations@hubbub.co.uk',\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix deprecated use of Fixnum\n\nUsing fixnum in ruby 2.4 generate warnings. change shouldn't have any real world impact (unless someone has a replica set with 2^63 members)"
},
{
"from": "human",
"value": "module MongoMapper\n module Utils\n def self.get_safe_op... | ruby | chosen |
[
{
"from": "system",
"value": "Fix choice of magazine strategy for ms-win platforms.\n"
},
{
"from": "human",
"value": "class Spork::RunStrategy\n attr_reader :test_framework\n @@run_strategies = []\n\n def initialize(test_framework)\n @test_framework = test_framework\n end\n\n def preloa... | ruby | chosen |
[
{
"from": "system",
"value": "Update simplecov requirement from ~> 0.17.1 to ~> 0.18.0\n\nUpdates the requirements on [simplecov](https://github.com/colszowka/simplecov) to permit the latest version.\n- [Release notes](https://github.com/colszowka/simplecov/releases)\n- [Changelog](https://github.com/colszo... | ruby | chosen |
[
{
"from": "system",
"value": "Create initial routing of /api/v1/projects/*\n"
},
{
"from": "human",
"value": "class API::V1::ProjectController < Grape::API\n \n \n resource :projects do\n desc 'GET /api/v1/projects/:id'\n params do\n requires :id, type: Integer\n end\n get ':... | ruby | chosen |
[
{
"from": "system",
"value": "Update development dependency Rails to 3.2.12\n"
},
{
"from": "human",
"value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"link_to_action/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specifica... | ruby | chosen |
[
{
"from": "human",
"value": "Add example of using gem with liblinear\n"
},
{
"from": "gpt",
"value": "# Document classification example using tokkens and linear SVM\nrequire 'tokkens' # `rake install` or `gem install tokkens`\nrequire 'liblinear' # `gem install liblinear-ruby`\n\n# define the ... | ruby | chosen |
[
{
"from": "system",
"value": "Use to_i instead of round\n"
},
{
"from": "human",
"value": "require_relative '../color'\n\nclass ASE\n class Color\n class Gray\n attr_accessor :value\n\n def initialize(value=0)\n @value = value\n end\n\n def read!(file)\n @va... | ruby | chosen |
[
{
"from": "system",
"value": "Set @filters in view spec\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe 'users/index' do\n before(:each) do\n assign(:users, [\n stub_model(User, name: 'Name', email: 'Email', location: 'Location', bio: 'Bio', homepage: 'Homepage', ro... | ruby | chosen |
[
{
"from": "human",
"value": "Add another MainstreamCategory for CO\n\nhttps://www.pivotaltracker.com/story/show/44547999\n"
},
{
"from": "gpt",
"value": "[\n ['Legislative process: taking a bill through Parliament', 'If you are working on proposed legislation or on regulations or orders that ma... | ruby | chosen |
[
{
"from": "system",
"value": "Fix (Hopefully) openSSL failure on TravisCI\n\nTravis is complaining about not being able to find openSSL. Ruby docs\nsay to require 'openssl' where I've been using require 'openSSL'.\n\nMaybe this works?\n"
},
{
"from": "human",
"value": "require 'mixlib/authentica... | ruby | chosen |
[
{
"from": "system",
"value": "Revert \"Disable the language pages for a minute\"\n\nThis reverts commit 06df89b35a4bc15def197f542faadf87058e5987.\n"
},
{
"from": "human",
"value": "class LanguagesController < ApplicationController\n def index\n @languages = Project.popular_languages(:facet_l... | ruby | chosen |
[
{
"from": "system",
"value": "Load LDAP settings from yaml file\n"
},
{
"from": "human",
"value": "module Jackad\n class Config\n def self.setup\n @@options ||= YAML.load_file('/usr/local/jackad.yml')\n end\n end\nend\n"
},
{
"from": "gpt",
"value": "module Jackad\n cla... | ruby | chosen |
[
{
"from": "system",
"value": "Use get_attribute for required attributes.\n"
},
{
"from": "human",
"value": "module Nmap\n #\n # Represents an {OS} class.\n #\n class OSClass\n\n #\n # Initializes the os class.\n #\n # @param [Nokogiri::XML::Node] node\n # The node that conta... | ruby | chosen |
[
{
"from": "system",
"value": "Add docs for error classes\n"
},
{
"from": "human",
"value": "module Rutty\n class NotInstalledError < StandardError; end\n \n class BadUsage < StandardError; end\nend"
},
{
"from": "gpt",
"value": "module Rutty\n ##\n # Raised by {Rutty::Helpers#ch... | ruby | chosen |
[
{
"from": "human",
"value": "Add migration to add domain column to api tokens tables\n"
},
{
"from": "gpt",
"value": "# frozen_string_literal: true\n\nclass AddDomainColumnToApiTokensTables < ActiveRecord::Migration[6.0]\n def change\n add_column :user_api_tokens, :domain, :string\n add_c... | ruby | chosen |
[
{
"from": "system",
"value": "Make config branch name a constant\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nclass ClassroomConfig\n CONFIGURABLES = %w[issues].freeze\n\n attr_reader :github_repository\n\n def initialize(github_repository)\n raise ArgumentError, \"I... | ruby | chosen |
[
{
"from": "system",
"value": "Set ActiveSupport::TestCase.test_order to avoid warning\n"
},
{
"from": "human",
"value": "require 'bundler/setup'\nBundler.require :default, :test\n\nrequire 'active_support/test_case'\nrequire 'minitest/autorun'\nrequire 'mocha/setup'\n\n# Foreigner::Adapter.regis... | ruby | chosen |
[
{
"from": "system",
"value": "Add missing newline at end of file\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe Vcloud::Fog::ModelInterface do\n\n it \"should retrive logged in organization\" do\n vm_href, vdc_href = 'https://vmware.net/vapp/vm-1', 'vdc/vdc-1'\n vm =... | ruby | chosen |
[
{
"from": "system",
"value": "Add file extension to ActiveRecord generator\n"
},
{
"from": "human",
"value": "require 'rails/generators/active_record'\n\nmodule ActiveRecord\n module Generators\n class TwoFactorAuthenticationGenerator < ActiveRecord::Generators::Base\n source_root File.... | ruby | chosen |
[
{
"from": "system",
"value": "Allow newer versions of rspec and bring back to 3.0 \n\nI'm not sure if the gem supports rspec 3.0, but it would be good to go back as far as we can"
},
{
"from": "human",
"value": "lib = File.expand_path(\"../lib\", __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_P... | ruby | chosen |
[
{
"from": "system",
"value": "Add handler for ajax request\n"
},
{
"from": "human",
"value": "get '/answers/:id/edit' do\n @answer = Answer.find(params[:id])\n if logged_in? && (current_user.id == @answer.user_id)\n @answer = Answer.find(params[:id])\n erb :'/answers/edit'\n else\n redirec... | ruby | chosen |
[
{
"from": "system",
"value": "Add show action for member\n"
},
{
"from": "human",
"value": "class MembersController < ApplicationController\n # Setup params for the request\n include SetupRequestParams\n # Cache the request into Redis SET\n include CacheRequest\n # Generate uri based on par... | ruby | chosen |
[
{
"from": "system",
"value": "Use the proper public lang-id\n"
},
{
"from": "human",
"value": "class LabelSerializer < BaseSerializer\n attributes :id, :name, :lang_id, :is_dialect, :for_seq, :for_meaning, :parent_id\nend\n"
},
{
"from": "gpt",
"value": "class LabelSerializer < Base... | ruby | chosen |
[
{
"from": "system",
"value": "Fix rendering each API header twice.\n"
},
{
"from": "human",
"value": "require 'fileutils'\nrequire 'rubygems'\nrequire 'json'\n\nclass FileMerger\n def initialize\n end\n\n def run(file_path)\n # partial files are deleted after being merged, so they may not ... | ruby | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.