conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Use create job, pass zone instead of zone id.\n"
},
{
"from": "human",
"value": "RSpec.describe ManageIQ::Providers::CloudManager::OrchestrationTemplateRunner do\n let(:zone) { FactoryBot.create(:zone) }\n let(:template) { FactoryBot.create(:orchestration_template... | ruby | chosen |
[
{
"from": "system",
"value": "Add more ._methods specs for modules\n"
},
{
"from": "human",
"value": "class RuntimeMethodsSpec\nend\n\nclass RuntimeMethodsSpec2\n def foo; end\n def bar; end\nend\n\nclass RuntimeMethodsSpec3\n def woosh; end\nend\n\nclass RuntimeMethodsSpec3\n def kapow; end... | ruby | chosen |
[
{
"from": "system",
"value": "Remove empty include in task\n"
},
{
"from": "human",
"value": "require 'test_helper'\nrequire 'rails'\n\nclass AdminpanelRakeTest < ActiveSupport::TestCase\n include Rake\n # include\n Rake.application.rake_require 'tasks/adminpanel/adminpanel'\n Rake::Task.def... | ruby | chosen |
[
{
"from": "system",
"value": "Update rspec for using \"transpec\" gem\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/chek/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"tobynet\"]\n gem.email = [\"toby.net... | ruby | chosen |
[
{
"from": "system",
"value": "Move `Format` class to `Format` module\n"
},
{
"from": "human",
"value": "module Calyx\n class Format\n def self.load(filename)\n file = File.read(filename)\n extension = File.extname(filename)\n if extension == \".yml\"\n self.load_yml(fil... | ruby | chosen |
[
{
"from": "system",
"value": "Add versions for activesupport and awesome_print\n"
},
{
"from": "human",
"value": "require \"rubygems\"\n\n# -*- encoding: utf-8 -*-\n$:.push File.expand_path('../lib', __FILE__)\nrequire 'docks/version'\n\nGem::Specification.new do |s|\n s.name = '... | ruby | chosen |
[
{
"from": "system",
"value": "Change default length for a URI to 2083 characters\n"
},
{
"from": "human",
"value": "require 'addressable/uri'\nrequire 'dm-core'\n\nmodule DataMapper\n class Property\n class URI < String\n\n # Maximum length chosen based on recommendation:\n # http:... | ruby | chosen |
[
{
"from": "system",
"value": "Drop unused directive from gemspec\n\nThis gem exposes no executables."
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n\nGem::Specification.new do |gem|\n gem.name = \"rack-utf8_sanitizer\"\n gem.version = '1.7.0'\n gem.authors = ... | ruby | chosen |
[
{
"from": "system",
"value": "Add a sort order to the demo procedures list"
},
{
"from": "human",
"value": "class DemoController < ApplicationController\n include SmartListing::Helper::ControllerExtensions\n helper SmartListing::Helper\n\n def index\n return redirect_to root_path if Rails.... | ruby | chosen |
[
{
"from": "system",
"value": "Fix some N+1 queries on the home page.\n"
},
{
"from": "human",
"value": "class HomeController < ApplicationController\n def home\n @filter = CollectionFilter.new(current_user, LightweightActivity, params[:filter] || {})\n # TODO: Add 'oficial' to the criter... | ruby | chosen |
[
{
"from": "system",
"value": "Add notes as a method\n"
},
{
"from": "human",
"value": "# Who has done the most events? Just counts starts/appearences in results. Not pefect -- some events\n# are probably over-counted.\n# TODO Don't replace existing results\nclass Ironman < Competition\n include... | ruby | chosen |
[
{
"from": "system",
"value": "Fix syntax error in user serializer.\n"
},
{
"from": "human",
"value": "class UserSerializer < ApplicationSerializer\n\n attribute :name, key: :display_name\n attribute :symbolic_role, key: :role_name\n\n attributes :username, :status, :role, :avatar, :a... | ruby | chosen |
[
{
"from": "system",
"value": "Fix GitHub versions on recent store\n"
},
{
"from": "human",
"value": "require 'sequel'\nrequire 'base64'\nrequire_relative 'db'\n\nunless DB.table_exists?(:library_stores)\n DB.create_table(:library_stores) do\n String :name, primary_key: true\n String :sour... | ruby | chosen |
[
{
"from": "human",
"value": "Add initial script to test Evernote API access\n\nMakes use of DEVELOPER_TOKEN instead of OAuth.\r\nShould output a list of my notebooks."
},
{
"from": "gpt",
"value": "# evernote_backup.rb\n\n# are this 'requires' necessary, since we do not implement OAuth anyways?\... | ruby | chosen |
[
{
"from": "human",
"value": "Add example of creating and deleting plans on a connected user's account.\n"
},
{
"from": "gpt",
"value": "#! /usr/bin/ruby\n\n# Example of deleting a plan on a connected user's account\n\nrequire \"stripe\"\n\n# You can do it by passing the access token as an additi... | ruby | chosen |
[
{
"from": "system",
"value": "Add assertion count to drug admin view\n"
},
{
"from": "human",
"value": "ActiveAdmin.register Drug do\n menu priority: 7\n permit_params :pubchem_id, :name, :ncit_id\n\n filter :name\n filter :pubchem_id\n filter :ncit_id\n\n form do |f|\n f.semantic_error... | ruby | chosen |
[
{
"from": "system",
"value": "Update to latest ember-source dependency"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'iridium/ember/version'\n\nGem::Specification.new do |ge... | ruby | chosen |
[
{
"from": "system",
"value": "Fix issues with sudo tty on rhel\n"
},
{
"from": "human",
"value": "name 'default'\ndefault_source :community\ndefault_source :chef_repo, '..'\ncookbook 'nrpe-ng', path: '../../..'\nrun_list 'nrpe-ng::default', 'test::default'\nnamed_run_list :centos, 'yum::default'... | ruby | chosen |
[
{
"from": "system",
"value": "Return 401 unless this teacher has access to this classroom\n"
},
{
"from": "human",
"value": "class Teachers::ProgressReports::Standards::ClassroomTopicsController < Teachers::ProgressReportsController\n include UnitsWithCompletedActivities\n\n def index\n res... | ruby | chosen |
[
{
"from": "system",
"value": "Destroy user if not agreed to terms\n"
},
{
"from": "human",
"value": "class TermsController < ApplicationController\n def index\n end\n\n def accept\n current_user.person.accept!\n end\n \n def decline\n redirect_to signout_path\n end\n\nend\n"
},
... | ruby | chosen |
[
{
"from": "system",
"value": "Add failing tests for page title\n"
},
{
"from": "human",
"value": "require 'test_helper'\n\nclass StaticPagesControllerTest < ActionDispatch::IntegrationTest\n test 'should get home' do\n get static_pages_home_url\n assert_response :success\n end\n\n test ... | ruby | chosen |
[
{
"from": "system",
"value": "Add logging of when a course is deleted\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nrequire_dependency \"#{Rails.root}/lib/wiki_course_edits\"\n\nclass DeleteCourseWorker\n include Sidekiq::Worker\n sidekiq_options unique: :until_executed\n... | ruby | chosen |
[
{
"from": "system",
"value": "Sort the inactive players cards as well\n"
},
{
"from": "human",
"value": "class CurrentRoundPlayerPresenter < SimpleDelegator\n def initialize(player:)\n super(player)\n end\n\n def hand_size\n hand.size\n end\n\n def to_model\n self\n end\n\n def t... | ruby | chosen |
[
{
"from": "system",
"value": "Switch to deploying to app.phpsw.uk since phpsw.uk resolves to CloudFlare\n"
},
{
"from": "human",
"value": "server fetch(:domain),\n user: \"steve\",\n roles: %w[app web],\n ssh_options: {\n forward_agent: true,\n auth_methods: %w[publickey]\n }\n"
},
... | ruby | chosen |
[
{
"from": "system",
"value": "Remove test for old api token endpoint [SCI-2515]\n"
},
{
"from": "human",
"value": "require 'rails_helper'\n\ndescribe Api::ApiController, type: :controller do\n describe 'GET #status' do\n before do\n get :status\n end\n\n it 'Returns HTTP success' ... | ruby | chosen |
[
{
"from": "system",
"value": "Set role as a required field in admin page\n"
},
{
"from": "human",
"value": "class User < ActiveRecord::Base\n # Include default devise modules. Others available are:\n # :confirmable, :lockable, :timeoutable and :omniauthable\n devise :database_authenticatable,... | ruby | chosen |
[
{
"from": "system",
"value": "Fix RSpec deprecation warnings for custom block\n\nCustom matchers which take a block must implement\n`supports_block_expectations?` else they will generate a deprecation\nwarining w/RSpec >= 2.99\n"
},
{
"from": "human",
"value": "require 'rspec/expectations'\n\nRS... | ruby | chosen |
[
{
"from": "system",
"value": "Support deletion of S3 folders\n\nOn S3 folders are nothing but regular objects. However, deleting\nfolder fails silently if there are any objects in it. To resolve\nthis issue, we perform a batch delete of all objects within that\nfolder.\n\nBZ: https://bugzilla.redhat.com/sho... | ruby | chosen |
[
{
"from": "system",
"value": "Make sure rails51 uses ruby buildpack\n\nnot nodejs\n"
},
{
"from": "human",
"value": "require 'cf_spec_helper'\n\ndescribe 'Rails 5.1 (Webpack/Yarn) App' do\n subject(:app) do\n Machete.deploy_app(app_name)\n end\n let(:browser) { Machete::Browser.new(app) }\... | ruby | chosen |
[
{
"from": "system",
"value": "Fix for Travis; load gem with require_relative\n"
},
{
"from": "human",
"value": "unless defined?(SPEC_HELPER_LOADED)\n SPEC_HELPER_LOADED = true\n\n project_root = File.expand_path(File.dirname(__FILE__) + \"/..\")\n require \"rubygems\"\n require \"bundler/set... | ruby | chosen |
[
{
"from": "system",
"value": "Add configuration to run Code Climate test reporter\n"
},
{
"from": "human",
"value": "Dir[File.join(File.dirname(__FILE__), \"../lib/**/*.rb\")].each { |f| require f }\nrequire 'webmock/rspec'\n\nRSpec.configure do |config|\n config.expect_with :rspec do |expectat... | ruby | chosen |
[
{
"from": "system",
"value": "Fix warning with minitest 5.x.\n"
},
{
"from": "human",
"value": "require 'minitest/autorun'\nrequire 'minitest/pride'\n\ndef fixture_path(file)\n File.expand_path(\"../fixtures/#{file}\", __FILE__)\nend\n\n# For my rspec poisoned brain. ;)\nmodule Kernel\n alias_... | ruby | chosen |
[
{
"from": "system",
"value": "Use FakeRedis as specified in documentation\n"
},
{
"from": "human",
"value": "$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\nrequire 'feature_flagger'\nrequire 'fakeredis'\n"
},
{
"from": "gpt",
"value": "$LOAD_PATH.unshift File.expand_path... | ruby | chosen |
[
{
"from": "system",
"value": "Clean up threads after each test\n"
},
{
"from": "human",
"value": "if RUBY_VERSION > '1.9' && RUBY_VERSION < '2.2'\n require 'simplecov'\n require 'coveralls'\n\n SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[\n SimpleCov::Formatter::HTMLFormatte... | ruby | chosen |
[
{
"from": "system",
"value": "Change rspec output - now it display full docs\n"
},
{
"from": "human",
"value": "require 'api_caller'\nrequire 'support/helpers'\nrequire 'support/shared_examples/request_builder'\n\nRSpec.configure do |config|\n config.expect_with :rspec do |expectations|\n ex... | ruby | chosen |
[
{
"from": "system",
"value": "Remove template files and version.rb from coveralls target\n"
},
{
"from": "human",
"value": "ENV[\"RAILS_ENV\"] ||= \"test\"\n\nrequire 'bundler/setup'\nBundler.setup\n\nrequire 'simplecov'\nrequire 'coveralls'\nCoveralls.wear!\nSimpleCov.formatter = SimpleCov::For... | ruby | chosen |
[
{
"from": "system",
"value": "Fix breakage on Ruby 1.8.\n\nRuby 1.8 apparently does not define RUBY_ENGINE.\n\nSigned-off-by: brian m. carlson <738bdd359be778fee9f0fc4e2934ad72f436ceda@crustytoothpaste.net>\n"
},
{
"from": "human",
"value": "$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '... | ruby | chosen |
[
{
"from": "system",
"value": "Revert \"Chrome on Travis no longer needs --no-sandbox switch\"\n\nThis reverts commit f4ecaafbedbcc9a43028f82a511253e0e577ce76.\n"
},
{
"from": "human",
"value": "require \"watir-dom-wait\"\n\nRSpec.configure do |spec|\n spec.filter_run_excluding bug: /\\d+/\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Load only ActionController to test the constraint\n"
},
{
"from": "human",
"value": "ENV[\"RAILS_ENV\"] ||= 'test'\n\nrequire 'rails/all'\nrequire 'rspec'\nrequire 'biceps'\n\n# Load support files\nDir[\"#{File.dirname(__FILE__)}/support/**/*.rb\"].each { |f| requir... | ruby | chosen |
[
{
"from": "system",
"value": "Move requires out of the spec helper.\n"
},
{
"from": "human",
"value": "# encoding: UTF-8\n\nENV[\"RAILS_ENV\"] ||= \"test\"\n\nPROJECT_ROOT = File.expand_path(\"../..\", __FILE__)\n$LOAD_PATH << File.join(PROJECT_ROOT, \"lib\")\n\nBundler.require\n\nrequire 'overr... | ruby | chosen |
[
{
"from": "system",
"value": "Move methods to same line as private\n"
},
{
"from": "human",
"value": "module ITunes\n module Request\n\n # @private\n private\n\n # Perform an HTTP GET request\n def request(request_type, params)\n url = '/WebObjects/MZStoreServices.woa/wa/... | ruby | chosen |
[
{
"from": "human",
"value": "Add uncommited files from prev commit\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\n\ndescribe Morpher::Printer::Mixin do\n describe '#description' do\n let(:object) do\n Class.new do\n include Morpher::Printer::Mixin, Adamantium::Flat\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Update to more concise array append notation.\n"
},
{
"from": "human",
"value": "# graph module\nmodule Graph\n\n # graph.rb\n #\n # a class that represents a graph\n class Graph\n \n attr_accessor :name, :nodes\n def initialize(name)\n @name = name\... | ruby | chosen |
[
{
"from": "system",
"value": "Fix for: Description shouldn't start with an indefinite article, i.e. \"A\"\n"
},
{
"from": "human",
"value": "class Ide < Formula\n desc \"A powerful ide that gets out of your way\"\n homepage \"https://github.com/nrocco/ide\"\n url \"https://github.com/nrocco/i... | ruby | chosen |
[
{
"from": "system",
"value": "Switch Hooloo::Show.popular_today to return enumerator\n"
},
{
"from": "human",
"value": "class Hooloo::Show < Hooloo::MozartHash\n def self.popular_today(args={limit: 10, position: 0})\n args.merge!({sort: 'popular_today'})\n Hooloo.request('shows', args)['d... | ruby | chosen |
[
{
"from": "system",
"value": "Fix typo (spotted by @mrcasals)\n"
},
{
"from": "human",
"value": "# Public: The Hyperclient module has various methods to so you can setup your\n# API client.\n#\n# Examples\n#\n# class MyAPI\n# extend Hyperclient\n#\n# entry_point 'http://api.myapp.com'\... | ruby | chosen |
[
{
"from": "system",
"value": "Remove hours and add eql?\n"
},
{
"from": "human",
"value": "require 'pry'\n\n# Clock solution\nclass Clock\n attr_accessor :hours, :minutes\n\n def initialize(hour: 0, minute: 0)\n @minutes = hour * 60 + minute\n @hours = minutes / 60\n end\n\n def to_s\n... | ruby | chosen |
[
{
"from": "system",
"value": "Fix for Rake task - WORKER_COUNT\n"
},
{
"from": "human",
"value": "require 'sneakers'\nrequire 'sneakers/runner'\n\ntask :environment\n\nnamespace :sneakers do\n desc \"Start work (set $WORKERS=Klass1,Klass2)\"\n task :run => :environment do\n\n workers, miss... | ruby | chosen |
[
{
"from": "system",
"value": "Use underscore for namespace combination\n"
},
{
"from": "human",
"value": "module SoMeta\n module Helper\n def so_meta(name)\n interpolation_data = instance_variable_get(\"@so_meta_#{name}_interpolation\") || {}\n t(\"so_meta.#{controller_path.gsub(/\... | ruby | chosen |
[
{
"from": "system",
"value": "Remove empty spaces in XFDF output - reduce footprint for storage\n"
},
{
"from": "human",
"value": "require 'nokogiri'\n\nmodule Nguyen\n class Xfdf\n \n attr_reader :options\n \n def initialize(fields = {}, options = {})\n @fields = fields\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add minitest as a development dependency\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\nrequire 'English'\n\nGem::Specification.new do |s|\n s.name = 'rusty_blank'\n s.version = '0.0.1'\n s.summary = 'Rust String.blank?'\n s.descripti... | ruby | chosen |
[
{
"from": "system",
"value": "Add failing example on logic against cell life logic\n"
},
{
"from": "human",
"value": "describe Logic do\n let( :size ) { [3,3] }\n let( :gb ) { GridBuilder.new }\n let( :grid ) { gb.create(*size) }\n let( :cells ) { grid.cells }\n let( :logic ) { Logic.new(gr... | ruby | chosen |
[
{
"from": "system",
"value": "Use 'context' blocks for situations instead of describe blocks\n"
},
{
"from": "human",
"value": "require 'spec_helper'\nrequire 'tempfile'\n\nmodule ToyRobotSimulator\n describe 'Obeying situations' do\n let(:output_file) { Tempfile.new('test_output.txt').path ... | ruby | chosen |
[
{
"from": "system",
"value": "Check that index exists before trying to delete it"
},
{
"from": "human",
"value": "module ClinicalTrials\n class Indexer\n\n def self.create_indexes\n Study.__elasticsearch__.delete_index!\n Study.__elasticsearch__.create_index!\n Study.__elastic... | ruby | chosen |
[
{
"from": "system",
"value": "Add original directive to deface override\n"
},
{
"from": "human",
"value": "Deface::Override.new(:virtual_path => \"spree/shared/_footer\",\n :name => \"add_tweets_to_footer\",\n :insert_top => \"section#bottom\",\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Use a github mirror of GNU config\n\nSavannah has been unavailable multiple times this year. We don't\ntypically need frequent updates to the repository. I've pushed a copy\nof it to github, a service which tends to be more reliable for us.\n\nIf we want to use this long term,... | ruby | chosen |
[
{
"from": "system",
"value": "Modify User strong params handling\n"
},
{
"from": "human",
"value": "class UsersController < ApplicationController\n\n def new\n @user = User.new\n authorize @user\n end\n\n def create\n @user = User.new(user_params)\n authorize @user\n if @user.s... | ruby | chosen |
[
{
"from": "system",
"value": "Reduce requests to AWS API by caching\n"
},
{
"from": "human",
"value": "module Ec2list\n class Command\n attr_reader :options\n \n def initialize(argv = [])\n @options = build_options(argv)\n load_profile\n end\n\n def run\n fetch_insta... | ruby | chosen |
[
{
"from": "system",
"value": "Finder: Allow :bank_account_number to be empty\n"
},
{
"from": "human",
"value": "require 'rest-client'\nrequire 'json'\n\nmodule Ibanomat\n URL = 'http://www.sparkasse.de/firmenkunden/konto-karte/iban-resources/iban/iban.php'\n\n def self.find(options)\n raise... | ruby | chosen |
[
{
"from": "system",
"value": "Add mininum httparty version 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 'cptec_inpe/version'\n\nGem::Specification.new do |spec|\n spec.... | ruby | chosen |
[
{
"from": "system",
"value": "Add geocoder method to location model to create address from lat and long, add filtering logic to index action for location controller so that soundtreks that are within 500m of current location appear on map\n"
},
{
"from": "human",
"value": "class LocationsControl... | ruby | chosen |
[
{
"from": "system",
"value": "Add obj to local method\n"
},
{
"from": "human",
"value": "class QuestionsController < ApplicationController\n def index\n end\n\n def new\n if logged_in?\n @question = Question.new\n else\n redirect_to root_path\n end\n end\n\n def create\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Change the podspec version -> 2.5.0\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |spec|\n spec.name = \"Framezilla\"\n spec.version = \"2.4.1\"\n spec.summary = \"Comfortable syntax for working with frames.\"\n\n spec.homep... | ruby | chosen |
[
{
"from": "system",
"value": "Fix issue with permitted params for receiving emails.\n"
},
{
"from": "human",
"value": "class EmailsController < ApplicationController\n skip_before_filter :authenticate_user!, :only => [:create]\n\n def create\n if params[:secret]!= Setting.receiving_emails.s... | ruby | chosen |
[
{
"from": "system",
"value": "Hide nonapproved challenges from landing\n"
},
{
"from": "human",
"value": "class StaticController < ApplicationController\n\n skip_filter :authenticate_user!, :require_admin, :require_supervisor, :only => [:index, :aboutus, :team, :createchallenge, :challengeguide... | ruby | chosen |
[
{
"from": "system",
"value": "Update podpec version to 1.0.0\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = \"GenerateTestCoverageFor_iOS7\"\n s.version = \"0.1.0\"\n s.summary = \"Support to get the test coverage in iOS7.\"\n s.homepage = \"... | ruby | chosen |
[
{
"from": "system",
"value": "Add prerequisites instead of rebuilding them\n\nThis allows additional prerequisites to be added without knowing about\neach other.\n"
},
{
"from": "human",
"value": "if %w[development test].include? Rails.env\n require 'rubocop/rake_task'\n RuboCop::RakeTask.new\... | ruby | chosen |
[
{
"from": "system",
"value": "Use create with a bang\n"
},
{
"from": "human",
"value": "class GamesController < ApplicationController\n def index\n end\n\n def create\n game = Game.create\n\n redirect_to game\n end\n\n def show\n @game = Game.find(params[:id])\n\n @game.deal\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix game links mistakenly forwarding to the search page\n"
},
{
"from": "human",
"value": "class GamesController < ApplicationController\n before_action :set_game\n\n def show\n redirect_to game_category_path(@game, @game.categories.first)\n end\n\n private\n... | ruby | chosen |
[
{
"from": "system",
"value": "Use 'default' as default home node\n"
},
{
"from": "human",
"value": "class GraphController < ApplicationController\n def node\n @nodes = []\n @links = []\n if params[:id] == 'root'\n node = Neo4j::Session.current.query.match(n: {reference: 'Apidae'})... | ruby | chosen |
[
{
"from": "system",
"value": "Set user to current session user_id; Add country to user_params\n"
},
{
"from": "human",
"value": "class UsersController < ApplicationController\n before_action :set_user, only: [:edit, :show, :update, :destroy]\n\n def create\n @user = User.new(user_params)\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Set password for new user\n"
},
{
"from": "human",
"value": "class UsersController < ApplicationController\n\n\tdef new\n\t\t@user = User.new\n\tend\n\n\tdef create\n\t\tuser = User.new(user_params)\n\t\tif user.save\n\t\t\tsession[:user_id] = user.id\n\t\t\tredirec... | ruby | chosen |
[
{
"from": "system",
"value": "Add action update and edit user\n"
},
{
"from": "human",
"value": "class UsersController < ApplicationController\n before_action :set_user, only: [:show, :edit, :update]\n\n def new\n @titel = \"Sign up\"\n @user = User.new \n end\n\n def show\n @tit... | ruby | chosen |
[
{
"from": "system",
"value": "Set user show route and create set_user method\n\nset_user method allows get the user object for edit, update, destroy and show routes before they are requested."
},
{
"from": "human",
"value": "class UsersController < ApplicationController\n\n # GET /signup\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Update Puppet tests for Kibana class\n\nThe 'should compile' directive is too dependant of local environment,\nand failed with Facter option conflicts, let's replace it by more\nspecific tests.\n\nChange-Id: I01156525c10f71e9b9f66481d15db2181ef99730\n"
},
{
"from": "hum... | ruby | chosen |
[
{
"from": "system",
"value": "Use default date in gemspec\n\nAs suggested by Mr. da Salva. Cleaning up my copy pasta.\n\nChange-Id: I6fd7c5064a3305add5e36bb1227a9b421cade4cf\nReviewed-on: https://gerrit.causes.com/22320\nTested-by: Aiden Scandella <1faf1e8390cdac9204f160c35828cc423b7acd7b@causes.com>\nRevie... | ruby | chosen |
[
{
"from": "system",
"value": "Update initialization of lock column\n"
},
{
"from": "human",
"value": "module ModelExtension\n def method_missing(method_name, *arguments, &block)\n /\\A(?<name>.+)_lock=?\\z/ =~ method_name.to_s\n return super if !name\n\n self.class.send(:attr_accessor,... | ruby | chosen |
[
{
"from": "system",
"value": "Exclude gettimeofday() tests on Windows.\n"
},
{
"from": "human",
"value": "#\n# This file is part of ruby-ffi.\n# For licensing, see LICENSE.SPECS\n#\n\nrequire File.expand_path(File.join(File.dirname(__FILE__), \"spec_helper\"))\n\nclass Timeval < FFI::Struct\n l... | ruby | chosen |
[
{
"from": "system",
"value": "Add optional parameters for /random and /randompic to allow specification of arbitrary flickr users and tag\n"
},
{
"from": "human",
"value": "require 'sinatra'\nrequire 'flickraw'\n\ndef random_pic_url\n FlickRaw.api_key = ENV['FLICKR_API_KEY']\n FlickRaw.shared_... | ruby | chosen |
[
{
"from": "system",
"value": "Return an empty response to not crash sinatra and rack\n"
},
{
"from": "human",
"value": "require 'httparty'\nrequire 'sinatra'\nrequire 'json'\n\npost '/payload' do\n push = JSON.parse(request.body.read) # parse the JSON\n repo_name = push['repository']['full_nam... | ruby | chosen |
[
{
"from": "system",
"value": "Fix main.js link so it supports https\n"
},
{
"from": "human",
"value": "class BetaController < ApplicationController\n def index\n @main_js = \"http://www.curatescience.org.s3-website-us-east-1.amazonaws.com/assets/main.js\"\n if ENV[\"MAIN_JS_VERSION\"]\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Allow block syntax for bsat_brand.\n"
},
{
"from": "human",
"value": "module Bsat\n module ContentHelper\n\n def bsat_brand(title, path: nil)\n content_for(:bsat_brand, title)\n content_for(:bsat_brand_path, path) if path.present?\n end\n\n def b... | ruby | chosen |
[
{
"from": "system",
"value": "Move require_relative out of the Settings configure method\n"
},
{
"from": "human",
"value": "require_relative 'exceptions'\nrequire_relative 'output'\n\nmodule Resume\n class Settings\n def self.configure\n configure_development_dependencies\n configu... | ruby | chosen |
[
{
"from": "system",
"value": "Remove online and is_followed from user serializer.\n"
},
{
"from": "human",
"value": "class UserSerializer < ActiveModel::Serializer\n attributes :id, :username, :cover_image_url, :avatar_template, :online, :about, \n :is_followed\n\n def id\n object.name\n... | ruby | chosen |
[
{
"from": "human",
"value": "Change the default gem perms to 644 on *nix platforms\n"
},
{
"from": "gpt",
"value": "#\n# Copyright 2012-2014 Chef Software, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the Lice... | ruby | chosen |
[
{
"from": "system",
"value": "Allow JNLP slaves to be created in Docker\n\nSigned-off-by: Josh Barker <88d7d21fa8a250d4e915db098658a3f5a42acdfb@gmail.com>\n"
},
{
"from": "human",
"value": "include_recipe 'jenkins_server_wrapper::default'\n\nreturn if docker? # the runit_service resource has iss... | ruby | chosen |
[
{
"from": "system",
"value": "Use a dynamic date in the gemspec\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 obtain\n#... | ruby | chosen |
[
{
"from": "system",
"value": "Add simple formatter for metrics logger.\n"
},
{
"from": "human",
"value": "require 'travis/support'\nrequire 'travis/listener/config'\nrequire 'travis/listener/app'\nrequire 'logger'\nrequire 'metriks'\nrequire 'metriks/reporter/logger'\n\n$stdout.sync = true\n\nmo... | ruby | chosen |
[
{
"from": "system",
"value": "Update xACT 2.31 to 2.32"
},
{
"from": "human",
"value": "class Xact < Cask\n version '2.31'\n sha256 '8e971fb8ae3f24a8188b9f70366993520c31922649058c04de0d084af5c8521e'\n\n url \"http://xact.scottcbrown.org/xACT#{version}.zip\"\n appcast 'http://xactupdate.scott... | ruby | chosen |
[
{
"from": "system",
"value": "Change gemspec to remove teset artefacts and restrict Ruby version\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nGem::Specification.new do |spec|\n spec.name = 'pastel-cli'\n spec.version = '0.3.0'\n spec.authors = ['Piotr Murach']\... | ruby | chosen |
[
{
"from": "system",
"value": "Use bundler when calling wheneverized commands\n"
},
{
"from": "human",
"value": "# Use this file to easily define all of your cron jobs.\n#\n# It's helpful, but not entirely necessary to understand cron before proceeding.\n# http://en.wikipedia.org/wiki/Cron\n\n# E... | ruby | chosen |
[
{
"from": "system",
"value": "Format and remove trailing semicolon."
},
{
"from": "human",
"value": "class Parrot\n def initialize type, number_of_coconuts, voltage, nailed\n @type = type;\n @number_of_coconuts = number_of_coconuts;\n @voltage = voltage;\n @nailed = nailed;\n end\n... | ruby | chosen |
[
{
"from": "system",
"value": "Update porspec for version 1.4.0\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n\t\ns.name = 'ShadowView'\ns.version = '1.3.1'\ns.summary = 'ShadowView is an iOS Shadow library that makes view\\'s shadow implementation easy an... | ruby | chosen |
[
{
"from": "system",
"value": "Remove tooltips implementation as it will be in YML\n"
},
{
"from": "human",
"value": "class Aichi11TargetSerializer < BaseSerializer\n PER_PAGE = 1.freeze\n\n def initialize(params={}, data=nil)\n super(Aichi11Target, params, data)\n end\n\n def serialize\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add an invalid trait to bookmark factory\n"
},
{
"from": "human",
"value": "FactoryGirl.define do\n factory :bookmark do\n url { Faker::Internet.url }\n end\nend\n"
},
{
"from": "gpt",
"value": "FactoryGirl.define do\n factory :bookmark do\n url... | ruby | chosen |
[
{
"from": "system",
"value": "Add MIT license to gemspec\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nrequire File.expand_path('../lib/adamantium/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.name = 'adamantium'\n gem.version = Adamantium::VERSION.dup\n ge... | ruby | chosen |
[
{
"from": "system",
"value": "Update mocha for 1.9 fixes"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path(\"../lib/rack/gridfs/version\", __FILE__)\n\nGem::Specification.new do |s|\n s.name = \"rack-gridfs\"\n s.version = Rack::GridFS::VERSION\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Tweak the way Python dependency is expressed.\n"
},
{
"from": "human",
"value": "class NormalizeFilename < Formula\n desc \"Normalize Filename\"\n homepage \"http://github.com/andrewferrier/normalize-filename\"\n url \"https://github.com/andrewferrier/normalize-f... | ruby | chosen |
[
{
"from": "system",
"value": "Set verbose flag by ENV['VERBOSE']\n"
},
{
"from": "human",
"value": "module OrgTodoist\n def self.configure\n @token = ENV[\"ORG_TODOIST_TOKEN\"]\n end\n\n def self.token\n @token\n end\n\n def self.api\n @api ||= OrgTodoist::Api.new\n end\n\n def s... | ruby | chosen |
[
{
"from": "system",
"value": "Update gem description in 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 'snoop/version'\n\nGem::Specification.new do |spec|\n spec.name ... | ruby | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.