conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Improve scenario description for the group labels subscription spec\n" }, { "from": "human", "value": "require 'spec_helper'\n\nfeature 'Labels subscription', feature: true do\n let(:user) { create(:user) }\n let(:group) { create(:group) }\n let!(:feature)...
ruby
chosen
[ { "from": "system", "value": "Fix described_class nesting changes in rspec\n\ndescribed_class now returns the nested class, not\nthe outer class. So we need to adjust our specs." }, { "from": "human", "value": "shared_examples_for 'maps JSON fields' do |mapped_attributes|\n let!(:json_handler) ...
ruby
chosen
[ { "from": "system", "value": "Create rails app after passing BUNDLE_GEMFILE env var to the subshell\n" }, { "from": "human", "value": "require 'cucumber/rake/task'\n\ndesc \"Run features\"\nCucumber::Rake::Task.new(:cucumber => [:cucumber_test_app]) do |t|\n t.cucumber_opts = %w[--format pretty...
ruby
chosen
[ { "from": "system", "value": "Update mocha for ruby 2.x fixes\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'henson/version'\n\nGem::Specification.new do |gem|\n gem.name...
ruby
chosen
[ { "from": "system", "value": "Update generator to work with Spree 2.2\n" }, { "from": "human", "value": "module SpreeReturnRequests\n module Generators\n class InstallGenerator < Rails::Generators::Base\n\n class_option :auto_run_migrations, :type => :boolean, :default => false\n\n ...
ruby
chosen
[ { "from": "system", "value": "Fix bad platform_family check in test\n\nCookstyle fixed this\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "apt_update 'update' if platform_family?('ubuntu')\n\ninclude_recipe 'djbdns::server'\nincl...
ruby
chosen
[ { "from": "system", "value": "Fix crash when running specs without coverage\n" }, { "from": "human", "value": "SimpleCov.command_name \"lint\"\n\nRSpec.describe \"Changelog\" do\n subject(:changelog) do\n path = File.join(File.dirname(__dir__), \"CHANGELOG.md\")\n File.read(path)\n end\n...
ruby
chosen
[ { "from": "human", "value": "Add basic tests of all public curricular interactives\n\n[#67779220]\n\nIt will load each interactive and run it for 0.5s if there is a 'play'\nbutton available.\n" }, { "from": "gpt", "value": "require 'spec_helper'\nrequire 'json'\nrequire \"net/http\"\nrequire \"u...
ruby
chosen
[ { "from": "system", "value": "Add dependency on Ruby 2.0.0\n\nI'm about to import the PubSubHub files from the causes.git repo, and\nthey effectively depend on Ruby 2.0.0 because they use 2.0.0 syntax.\n\nMake that dependency explicit in the gemspec.\n\nChange-Id: I9fb4711004b402eb8e5e1150a28e0382a410daad\n...
ruby
chosen
[ { "from": "system", "value": "Correct article specs (all passing)\n" }, { "from": "human", "value": "require \"rails_helper\"\n\ndescribe Article do\n let(:user) { User.create!(username: \"sampleuser\", permission_level: \"author\", password: \"password\") }\n let(:article) { Article.new(orig_...
ruby
chosen
[ { "from": "system", "value": "Add specs for Set initialization behavior\n" }, { "from": "human", "value": "require 'set'\nmodule Concurrent\n RSpec.describe Set do\n let!(:set) { described_class.new }\n\n context 'concurrency' do\n it do\n (1..Concurrent::ThreadSafe::Test::THR...
ruby
chosen
[ { "from": "system", "value": "Use export:redirector_mappings in the cron job\n\nThis replaces the old and now removed script.\n\nAdditionally clean up the now unused job_type.\n" }, { "from": "human", "value": "$: << '.'\nrequire File.dirname(__FILE__) + \"/initializers/scheduled_publishing\"\n#...
ruby
chosen
[ { "from": "system", "value": "Fix rubocop warnings (%w[] array literals)\n" }, { "from": "human", "value": "require_relative 'spec_helper'\n\nrequire 'wright/cli'\nrequire 'wright/version'\n\ndescribe Wright::CLI do\n before(:each) do\n @cli = Wright::CLI.new\n @cli_dir = File.expand_path...
ruby
chosen
[ { "from": "human", "value": "Create a fake github service\n" }, { "from": "gpt", "value": "require 'sinatra/base'\n\nclass FakeGitHub < Sinatra::Base\n get '/user/repos' do\n json_response 200, 'repos.json'\n end\n\n get '/user/orgs' do\n json_response 200, 'orgs.json'\n end\n\n get '...
ruby
chosen
[ { "from": "system", "value": "Add tests for comment model\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe Comment, type: :model do\n pending \"add some examples to (or delete) #{__FILE__}\"\nend\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\nR...
ruby
chosen
[ { "from": "system", "value": "Revise product spec for quantity sold per day\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe Product, type: :model do\n product = Product.create(name: 'Widget')\n\n it 'creates successfully' do\n expect(product).to be_truthy\n end\...
ruby
chosen
[ { "from": "system", "value": "Add missing properties to Security Group Rule resource property type\n" }, { "from": "human", "value": "module Skywriter\n class ResourceProperty\n module EC2\n class SecurityGroupRule < Skywriter::ResourceProperty\n property :FromPort\n prope...
ruby
chosen
[ { "from": "human", "value": "Add test for sm-tools: sm-list-dbs\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\n# sm-list-dbs\n\ndescribe command('sm-list-dbs mysql') do\n its(:exit_status) { should eq 0 }\nend\n\ndescribe command('sm-list-dbs') do\n its(:exit_status) { should eq 2 }...
ruby
chosen
[ { "from": "human", "value": "Add VirtualBox Extension Pack v5.0.0-101573\n\ninstalls and uninstalls using VBoxManage (part of VirtualBox)\n" }, { "from": "gpt", "value": "cask :v1 => 'virtualbox-extension-pack' do\n version '5.0.0-101573'\n sha256 'c357e36368883df821ed092d261890a95c75e50422b75...
ruby
chosen
[ { "from": "human", "value": "Add Go Panda (Client for Pandanet - The Internet Go Server)\n" }, { "from": "gpt", "value": "class Gopanda < Cask\n url 'http://pandanet-igs.com/gopanda2/installer/stable/mac-32/gopanda2-mac-32.zip'\n homepage 'http://pandanet-igs.com/communities/gopanda2'\n versi...
ruby
chosen
[ { "from": "system", "value": "Fix homepage to use SSL in AirDroid Cask\n\nThe HTTP URL is already getting redirected to HTTPS. Using the HTTPS URL directly\nmakes it more secure and saves a HTTP round-trip.\n" }, { "from": "human", "value": "cask :v1 => 'airdroid' do\n version '3.1.0'\n sha256...
ruby
chosen
[ { "from": "system", "value": "Update podspec to use AFNetworking 2.3.1\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"Sqwiggle\"\n s.version = \"0.1.3\"\n s.summary = \"Objective-C Wrapper for Sqwiggle API\"\n s.homepage = \"https://www.sqwiggle.co...
ruby
chosen
[ { "from": "system", "value": "Update gemspec with homepage and diff. email\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"ceo/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do ...
ruby
chosen
[ { "from": "system", "value": "Add a description to gemspec\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'poltergeist/suppressor/version'\n\nGem::Specification.new do |spec|\n spec...
ruby
chosen
[ { "from": "system", "value": "Remove methods that moved to curation_concerns\n" }, { "from": "human", "value": "module Sufia\n module BlacklightOverride\n # TODO: we can remove this override when we can depend on https://github.com/projecthydra-labs/curation_concerns/pull/711\n def render...
ruby
chosen
[ { "from": "system", "value": "Update Jython HEAD to 2.5.2rc3\n" }, { "from": "human", "value": "require 'formula'\n\nclass Jython <Formula\n url \"http://downloads.sourceforge.net/project/jython/jython/2.5.1/jython_installer-2.5.1.jar\",\n :using => :nounzip\n md5 '2ee978eff4306b23753b3fe9d...
ruby
chosen
[ { "from": "human", "value": "Add an example of a free guest.\n" }, { "from": "gpt", "value": "require 'noam-lemma'\n\n# This is an example of a Ruby Lemma that publishes message and *also* uses the\n# \"Guest\" model of connection. This Lemma will advertise that it's available on\n# the local ne...
ruby
chosen
[ { "from": "system", "value": "Upgrade to vault client 0.2.0\n\nThis is the latest version, so we might as well use it.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'add_vault_token...
ruby
chosen
[ { "from": "system", "value": "Fix wrong base model class for SecurityGroup\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Networking\n # Represents the Openstack Security Group\n class SecurityGroup < Core::ServiceLayer::Model\n validates :name, presence: true\n\...
ruby
chosen
[ { "from": "system", "value": "Use correct method to read binary file in Ruby.\n" }, { "from": "human", "value": "require 'test/unit'\nrequire 'socket'\nrequire 'net/http'\n\nclass GetTests < Test::Unit::TestCase\n def setup\n @server = fork {\n exec 'src/dirt -c config/test.cf...
ruby
chosen
[ { "from": "system", "value": "Make url and api_token nil-safe" }, { "from": "human", "value": "require 'net/http'\nrequire 'uri'\n\nrequire 'rubygems'\n\nmodule EventGirl\n class Client\n\n VERSION = '0.1.0'\n\n attr_reader :api_token, :url\n\n def initialize(url, api_token)\n @ur...
ruby
chosen
[ { "from": "human", "value": "Add migration to convert title and subtitle to \"text\" fields from varchar(255).\n" }, { "from": "gpt", "value": "class MakeDocumentsTitleAndSubtitleText < ActiveRecord::Migration\n def self.up\n change_column :documents, :title, :text\n change_column :docume...
ruby
chosen
[ { "from": "system", "value": "Store the ref type for internal use\n" }, { "from": "human", "value": "module Henson\n module Source\n class Git < Generic\n attr_reader :name, :repo, :options\n\n def initialize(name, repo, opts = {})\n @name = name\n @repo = repo\...
ruby
chosen
[ { "from": "system", "value": "Fix bug where last_updated returned wrong date\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule ViewHelpers\n # Returns today's date in Day, Date Month Year format\n #\n # @return [String]\n def today\n Time.now.strftime('%A, %d %B %...
ruby
chosen
[ { "from": "system", "value": "Replace eol ruby-sass to sassc\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"feathericon/sass/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |...
ruby
chosen
[ { "from": "human", "value": "Add script to biuld database\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby -I lib\n\nrequire 'bundler'\nBundler.require(:default)\n\nrequire_relative '../lib/flickr_to_google_photos'\n\nflickr = FlickrToGooglePhotos::Flickr.new(ENV['FLICKR_CONSUMER_KEY'],\n ...
ruby
chosen
[ { "from": "system", "value": "Update Anonymous Pro to sha256 checksums\n" }, { "from": "human", "value": "class FontAnonymousPro < Cask\n url 'http://www.marksimonson.com/assets/content/fonts/AnonymousPro-1.002.zip'\n homepage 'http://www.marksimonson.com/fonts/view/anonymous-pro'\n version '...
ruby
chosen
[ { "from": "system", "value": "JariBakken: Fix error in the file_detector example.\n\nr15466\n" }, { "from": "human", "value": "module Selenium\n module WebDriver\n\n #\n # @api private\n #\n\n module DriverExtensions\n module UploadsFiles\n\n #\n # Set the file de...
ruby
chosen
[ { "from": "human", "value": "Add cask for first stable release of DataGrip\n" }, { "from": "gpt", "value": "cask :v1 => 'datagrip' do\n version '1.0'\n sha256 '32640fd394c57b4c5625e254971d423e84b3e39c0dede63cad17620be52ca155'\n\n url \"https://download.jetbrains.com/datagrip/datagrip-#{versio...
ruby
chosen
[ { "from": "human", "value": "Add integration spec showing relation mapping\n" }, { "from": "gpt", "value": "# encoding: utf-8\n\nrequire 'spec_helper'\n\ndescribe 'Mapping relations' do\n let!(:env) { Environment.coerce(:test => 'memory://test') }\n let!(:model) { mock_model(:id, :name) }\n\...
ruby
chosen
[ { "from": "system", "value": "Add a comment in interceptor spec.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe DisableEmailInterceptor do\n before do\n ActionMailer::Base.register_interceptor(DisableEmailInterceptor)\n end\n\n it 'should not send emails' do\n Gitl...
ruby
chosen
[ { "from": "system", "value": "Remove macOS and watchOS platforms from podspec\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"DeallocationChecker\"\n s.version = \"1.0\"\n s.summary = \"Learn about leaking view controllers without opening Instruments.\"\...
ruby
chosen
[ { "from": "system", "value": "Add Bundler, Rake, & Fury as dev gems to Gemspec\n\nEnsures we have all the tools we need to build & ship a release\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'evertrue_app_assets'\n s.version = '0.0.1.alpha'\n s.licens...
ruby
chosen
[ { "from": "human", "value": "Patch Rails security issue not fixed in a 3.2.x\n" }, { "from": "gpt", "value": "raise \"Check monkey patch for CVE-2015-3226 is still needed\" unless Rails::VERSION::STRING == '3.2.22'\nmodule ActiveSupport\n module JSON\n module Encoding\n private\n c...
ruby
chosen
[ { "from": "system", "value": "Allow more assets without digests.\n" }, { "from": "human", "value": "NonStupidDigestAssets.whitelist += [\n \"logo.gif\",\n \"logo-small.gif\",\n \"inat-logo-pb.png\",\n /spritesheet/,\n /\\.xsl$/,\n /\\.kml$/,\n /iconic_taxa/\n]\n" }, { "from": "gpt...
ruby
chosen
[ { "from": "system", "value": "[168] Fix showing contact_mail in mails\n" }, { "from": "human", "value": "class InvitationsMailer < ApplicationMailer\n def invitation_email(submission, event_dates, event_venue, contact_email)\n email = submission.email\n @token = submission.invitation_toke...
ruby
chosen
[ { "from": "system", "value": "Delete Tests and Fix Up Login Routes\n" }, { "from": "human", "value": "get '/' do\n erb :index\nend\n\nget '/signout' do\n session[:current_user] = nil\n redirect '/'\nend\n\nget \"/auth\" do\n redirect client.auth_code.authorize_url(:redirect_uri => 'http://lo...
ruby
chosen
[ { "from": "system", "value": "Destroy the corresponding Sidekiq::Job when a Sidekiq::Monitor::Job is destroyed" }, { "from": "human", "value": "module Sidekiq\n module Monitor\n class Job < ActiveRecord::Base\n attr_accessible :args, :class_name, :enqueued_at, :finished_at, :jid, :name,...
ruby
chosen
[ { "from": "system", "value": "Fix gemspec summary and description\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path(\"../lib\", __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire \"tco_method/version\"\n\nGem::Specification.new do |spec|\n spec....
ruby
chosen
[ { "from": "system", "value": "Update gemspec file\nUsing Bundler version 1.1.5\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/jquery-qtip2-rails/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Tanguy Krotoff (jQuery...
ruby
chosen
[ { "from": "system", "value": "Create DELETE route for single song\n" }, { "from": "human", "value": "get '/songs' do\n 'all songs'\nend\n\n\nget '/songs/:id' do\n 'show single song'\nend\n\nput '/songs/:id/edit' do\n\nend\n" }, { "from": "gpt", "value": "get '/songs' do\n 'all son...
ruby
chosen
[ { "from": "human", "value": "Add base spec for Attributes::Base\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Aoede::Attributes::Base do\n let(:filename) { File.expand_path('Test - Track.wav', 'spec/support/') }\n let(:track) { Aoede::Track.new(filename) }\n\n describe :C...
ruby
chosen
[ { "from": "system", "value": "Improve error message when index creation fails.\n" }, { "from": "human", "value": "module SearchSpecHelper\n def index\n described_class.index\n end\n\n def refresh_index\n index.refresh\n end\n\n def recreate_index\n index.delete\n\n opts = {\n ...
ruby
chosen
[ { "from": "human", "value": "Add Google Tag Manager module\n" }, { "from": "gpt", "value": "module Analytical\n module Modules\n class GoogleTagManager\n include Analytical::Modules::Base\n\n def initialize(options={})\n super\n @tracking_command_location = :body_prep...
ruby
chosen
[ { "from": "system", "value": "Add support for Ruby 2.1.2\n" }, { "from": "human", "value": "require 'mkmf'\n\ncase RUBY_VERSION\nwhen /1.9.3/, /2.0.0/, /2.1.0/, /2.1.1/, /2.2.0/\n abs_ruby_header_path = File.join(File.dirname(File.realpath(__FILE__)), \"ruby_headers\")\n\n version_suffix = if ...
ruby
chosen
[ { "from": "system", "value": "Add serverspec for the LWRP\n" }, { "from": "human", "value": "require 'spec_helper'\n\nif %w(redhat fedora).include?(os[:family])\n describe service('crond') do\n it { should be_enabled }\n it { should be_running }\n end\nelsif %w(debian ubuntu).include?(os...
ruby
chosen
[ { "from": "system", "value": "Modify Settings as class singleton\n" }, { "from": "human", "value": "require 'yaml'\n\nmodule Settings\n extend self\n\n @_settings = {}\n \n def load\n @_settings = YAML.load_file(\"#{Rails.root}/config/settings.yml\")\n end\n\n def get(key)\n @_settin...
ruby
chosen
[ { "from": "system", "value": "Add defaults to product shipping_category\n" }, { "from": "human", "value": "module Spree\n module Hub\n module Handler\n class AddProductHandler < Base\n attr_reader :params, :options, :taxon_ids, :parent_id\n\n def initialize(message)\n ...
ruby
chosen
[ { "from": "system", "value": "Change homepage route to '/' and create get dashboard route\n" }, { "from": "human", "value": "get '/' do\n redirect '/homepage'\nend\n\nget '/homepage' do\n erb :'homepage/index'\nend\n" }, { "from": "gpt", "value": "get '/' do\n erb :'homepage/ind...
ruby
chosen
[ { "from": "human", "value": "Add code wars (7) caffeine buzz\n" }, { "from": "gpt", "value": "# http://www.codewars.com/kata/5434283682b0fdb0420000e6/\n# iteration 1\ndef caffeineBuzz(n)\n if n % 3 == 0 && n % 4 == 0\n str = \"Coffee\"\n elsif n % 3 == 0\n str = \"Java\"\n end\n retur...
ruby
chosen
[ { "from": "human", "value": "Add code wars (7) - combine objects\n" }, { "from": "gpt", "value": "# http://www.codewars.com/kata/56bd9e4b0d0b64eaf5000819\n# --- iteration 1 ---\ndef combine(*objects)\n objects.reduce({}) do |acc, el|\n el.each do |k, v|\n if acc.key?(k)\n acc[k] ...
ruby
chosen
[ { "from": "system", "value": "Refactor change method_missing to select_by_type\n" }, { "from": "human", "value": "class GreekString\n class Container\n require 'forwardable'\n extend Forwardable\n\n def_delegators :@container, :[], :<<, :each, :map, :flat_map\n\n def initialize(lett...
ruby
chosen
[ { "from": "system", "value": "Add note (implying why versions are necessary).\n" }, { "from": "human", "value": "# Since we've designed metrics/docs tables to revolve around\n# the pods table, but be independent of each other, we can\n# run all trunk migrations first, then all others.\n#\n\n# Tr...
ruby
chosen
[ { "from": "system", "value": "Update gem version to 0.0.3\n" }, { "from": "human", "value": "require 'rubygems'\n\nGEMSPEC = Gem::Specification.new do |spec|\n spec.name = 'smartview'\n spec.summary = 'A library for communicating with Hyperion SmartView providers'\n spec.description = %...
ruby
chosen
[ { "from": "system", "value": "Revert \"Make sure rails51 uses ruby buildpack\"\n\n[#142382213]\n\nThis reverts commit cb72ad960b8893a534764be51ac7dcecae96efcc.\n" }, { "from": "human", "value": "require 'cf_spec_helper'\n\ndescribe 'Rails 5.1 (Webpack/Yarn) App' do\n let(:buildpack) { ENV.fetch...
ruby
chosen
[ { "from": "system", "value": "Refactor S3 deployment for single file deployment\n" }, { "from": "human", "value": "require 'fog'\n\nmodule Stevenson\n module Deployer\n class S3\n include Deployer::Base\n\n attr_reader :deployment_bucket_name, :deployment_key\n\n def initializ...
ruby
chosen
[ { "from": "system", "value": "Correct name of class according to name of file\n" }, { "from": "human", "value": "class ApplicationHelper::Button::OrchestrationOldDialogsEditDelete < ApplicationHelper::Button::Basic\n def calculate_properties\n super\n if @view_context.x_active_tree == :ol...
ruby
chosen
[ { "from": "system", "value": "Remove reference to missing screenshot.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"LoremIpsum\"\n s.version = \"2.0.0-beta.1\"\n s.summary = \"A lightweight lorem ipsum and image placeholders generator for Objective-C.\...
ruby
chosen
[ { "from": "system", "value": "Add spaces in Submission age validator\n" }, { "from": "human", "value": "class Submission < ActiveRecord::Base\n validates :full_name, :age, :email, :codeacademy_username, :description, :html, :css, :js, :ror, :db,\n :programming_others, :english, :oper...
ruby
chosen
[ { "from": "system", "value": "Change to case over if else\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Unparser\n class Emitter\n # Emiter for float literals\n class Float < self\n handle :float\n\n children :value\n\n INFINITY = ::Float::I...
ruby
chosen
[ { "from": "system", "value": "Use the CourseRouter to retrieve the current course\n" }, { "from": "human", "value": "class SamlController < ApplicationController\n skip_before_filter :require_login, :except => [:logout]\n protect_from_forgery except: :consume\n\n def init\n request = OneLo...
ruby
chosen
[ { "from": "system", "value": "Use a guard clasue in shop controller\n" }, { "from": "human", "value": "class ShopController < ApplicationController\n respond_to :html\n def index\n @products = Product.all\n @order_item = OrderItem.new\n\n # this is (hopefully) part of a short-term hac...
ruby
chosen
[ { "from": "human", "value": "Add code for parsing/searching educator file dump\n\n+ Useful for hunting for educators with missing / incomplete data\n+ i.e. #6\n" }, { "from": "gpt", "value": "require 'csv'\n\nclass AnalyzeStaffTable < Struct.new(:path)\n\n def contents\n encoding_options = {...
ruby
chosen
[ { "from": "system", "value": "Work around chick-egg problem with semver2\n\nOur gemspec uses semver2 to get our version number. Bundler uses our\ngemspec to get our version unumber. We use bundler to install semver2.\n" }, { "from": "human", "value": "require 'semver'\n\nmodule Certmeister\n\n ...
ruby
chosen
[ { "from": "system", "value": "Fix calling first on nil\n" }, { "from": "human", "value": "module LastActiveClassroom\n extend ActiveSupport::Concern\n\n def self.last_active_classrooms(teacher_id, limit=nil)\n last_active_arr = Classroom.find_by_sql(\"SELECT classrooms.id FROM classrooms\n ...
ruby
chosen
[ { "from": "system", "value": "Update podspec to point to 1.3.0\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"HTAutocompleteTextField\"\n s.version = \"1.2.6\"\n s.summary = \"A subclass of UITextField that displays text completion suggestions while a u...
ruby
chosen
[ { "from": "system", "value": "Enable master-slave stuff only when there are some slaves\n" }, { "from": "human", "value": "module DbCharmer\n module DbMagic\n module ClassMethods\n def db_magic(opt = {})\n # Make sure we could use our connections management here\n hijack_c...
ruby
chosen
[ { "from": "system", "value": "Use zip filename in Content-Disposition as quoted string.\n" }, { "from": "human", "value": "require \"zipline/version\"\n\nrequire 'zip'\nrequire 'curb'\n\nrequire \"zipline/fake_stream\"\nrequire \"zipline/output_stream\"\nrequire \"zipline/zip_generator\"\n\n# cl...
ruby
chosen
[ { "from": "system", "value": "Update .gemspec to require adhearsion 2.4, and not require adhearsion-asterisk\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"voicemail/version\"\n\nGem::Specification.new do |s|\n s.name ...
ruby
chosen
[ { "from": "system", "value": "Set the default buildpack url for the java sample to the master branch of the java buildpack repo\n" }, { "from": "human", "value": "require_relative 'spec_helper'\n\ndescribe \"Java\" do\n\n before(:each) do\n set_java_version(app.directory, jdk_version)\n a...
ruby
chosen
[ { "from": "system", "value": "Stop checking for open zxcvbn.js files in specs\n" }, { "from": "human", "value": "RSpec.configure do |config|\n config.after :each do\n ObjectSpace.each_object(File) do |file|\n next if file.closed?\n next if file.path == '/dev/null'\n next if fi...
ruby
chosen
[ { "from": "system", "value": "Clean up the code and allow tracked :user to be Proc or a Symbol/String, setting activity_user on a tracked object takes priority over :user attribute in model definition\n" }, { "from": "human", "value": "module KeepTrack\n module Creation\n extend ActiveSuppor...
ruby
chosen
[ { "from": "system", "value": "Fix supported Swift version to 4.0.0\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'RxKeyboard'\n s.version = '0.8.2'\n s.summary = 'Reactive Keyboard in iOS'\n s.homepage = 'https://github.com/RxSwiftCo...
ruby
chosen
[ { "from": "system", "value": "Revert \"Shouldn't we use bundle exec rake?\"\n\nThis reverts commit 13ebda7a9eb2cb70ddd197d91108a5c814544299.\n" }, { "from": "human", "value": "module Travis\n class Builder\n module Base\n attr_reader :repository, :build, :meta_id, :started_at, :finished...
ruby
chosen
[ { "from": "system", "value": "Fix double loading of asset extensions for transit asset classes\n" }, { "from": "human", "value": "# Technique caged from http://stackoverflow.com/questions/4460800/how-to-monkey-patch-code-that-gets-auto-loaded-in-rails\nRails.configuration.to_prepare do\n Asset....
ruby
chosen
[ { "from": "system", "value": "Update gemspec with newer gem versions\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'ab/version'\n\nGem::Specification.new do |spec|\n spec.name = 'v...
ruby
chosen
[ { "from": "system", "value": "Use Dir.glob instead of git ls-files\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'aggregate/version'\n\nGem::Specification.new do |s|\n s.name = %q{...
ruby
chosen
[ { "from": "system", "value": "Fix name conflict in migration\n" }, { "from": "human", "value": "class QuestionTranslation < ActiveRecord::Migration\n def change\n create_table :question_translations do |t|\n t.integer :question_id\n t.string :language\n t.string :text\n\n ...
ruby
chosen
[ { "from": "system", "value": "Remove superfluous addition definition on Money.\n" }, { "from": "human", "value": "require 'bigdecimal'\n\nmodule Arug\n module Trader\n class Money\n attr_reader :amount, :currency\n\n def initialize(amount, currency)\n @amount = BigDecimal.ne...
ruby
chosen
[ { "from": "system", "value": "Update regex for failing to compile\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'support/editor'\n\nRSpec.feature \"Highlighting the output\", type: :feature, js: true do\n before do\n visit '/'\n editor.set(code)\n within('.header') ...
ruby
chosen
[ { "from": "system", "value": "Include EM minispec in required dev gems\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"omf_common/version\"\n\nGem::Specification.new do |s|\n s.name = \"omf_common\"\n s.version ...
ruby
chosen
[ { "from": "system", "value": "Add label to cmtool menu item\n" }, { "from": "human", "value": "module CouchBlog\n class Engine < ::Rails::Engine\n isolate_namespace CouchBlog\n initializer 'couch_blog.cmtool', after: 'cmtool.build_menu' do\n if defined? Cmtool\n require 'cmtoo...
ruby
chosen
[ { "from": "system", "value": "Load railtie under Rails 4.x\n" }, { "from": "human", "value": "require 'mini_profiler/profiler'\nrequire 'patches/sql_patches'\n\nif defined?(::Rails) && ::Rails::VERSION::MAJOR.to_i == 3\n require 'mini_profiler_rails/railtie'\nend\n" }, { "from": "gpt", ...
ruby
chosen
[ { "from": "system", "value": "Add files group to API\n" }, { "from": "human", "value": "require 'grape'\n\nrequire_relative './worker.rb'\nrequire_relative '../models/build.rb'\nrequire_relative '../entities/build.rb'\nrequire_relative './resources/build.rb'\n\nmodule Ephemeral\n class API < Gr...
ruby
chosen
[ { "from": "system", "value": "Add description and summary to gemspec\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'git_pissed/version'\n\nGem::Specification.new do |spec|\n spec.n...
ruby
chosen
[ { "from": "system", "value": "Revert \"Use simple before_app_loads hook instead of bootloader subclass.\"\n\nThis reverts commit a15f43ae003cc68c671ab325586fa026f5673373.\n" }, { "from": "human", "value": "if defined?(Merb::Plugins)\n dependency \"activerecord\"\n require File.join(File.dirnam...
ruby
chosen
[ { "from": "system", "value": "Refactor to support when no permissions\n" }, { "from": "human", "value": "require 'auth0'\n\nclass Mumukit::Auth::User\n\n attr_accessor :social_id, :user\n\n def initialize(social_id)\n @social_id = social_id\n @user = client.user @social_id\n end\n\n de...
ruby
chosen
[ { "from": "system", "value": "Use a lookup table instead of hand-crafted method to match a number\n" }, { "from": "human", "value": "class NumberRecognizer\n attr_accessor :number\n\n def initialize(number)\n @number = number\n end\n\n def valid?\n valid_dutch_mobile? or valid_belgian_...
ruby
chosen
[ { "from": "system", "value": "Add rugged as runtime 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 'upstreamer/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Add documentation for Inbox subsystem" }, { "from": "human", "value": "module Spotify\n class API\n # @!group Inbox\n attach_function :inbox_post_tracks, [ Session, UTF8String, :array, :int, UTF8String, :inboxpost_complete_cb, :userdata ], Inbox\n attach_f...
ruby
chosen