diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/app/inputs/color_input.rb b/app/inputs/color_input.rb index abc1234..def5678 100644 --- a/app/inputs/color_input.rb +++ b/app/inputs/color_input.rb @@ -2,7 +2,7 @@ def input(wrapper_options) hex_code = object.try(attribute_name).presence || options.delete(:hex_code).presence || default_hex_code merged_input_options = merge_wrapper_options(input_html_options, wrapper_options) - merged_input_options.merge!(type: :color) + merged_input_options.merge!(type: :color, value: hex_code) content = ActiveSupport::SafeBuffer.new content << content_tag(:div, input_group(hex_code, merged_input_options), class: 'input-group')
Fix setting default hex color input
diff --git a/spec/plugin/models/rdb_board_spec.rb b/spec/plugin/models/rdb_board_spec.rb index abc1234..def5678 100644 --- a/spec/plugin/models/rdb_board_spec.rb +++ b/spec/plugin/models/rdb_board_spec.rb @@ -5,7 +5,6 @@ let(:board) do RdbBoard.create \ - context: Project.find(1), engine: Rdb::Taskboard, name: 'Test Board' end
Fix spec due to removed context
diff --git a/lib/skroutz_api/paginated_collection.rb b/lib/skroutz_api/paginated_collection.rb index abc1234..def5678 100644 --- a/lib/skroutz_api/paginated_collection.rb +++ b/lib/skroutz_api/paginated_collection.rb @@ -26,7 +26,7 @@ end define_method "#{meth}_page" do |options = {}| - return [] if !self.send("#{meth}?") + return if !self.send("#{meth}?") target_uri = link_header(self.response)[meth.to_sym] gateway = context.respond_to?(:get) ? context : context.client
Return nil on methods trying to perform invalid pagination
diff --git a/lib/generators/angular/scaffold/scaffold_generator.rb b/lib/generators/angular/scaffold/scaffold_generator.rb index abc1234..def5678 100644 --- a/lib/generators/angular/scaffold/scaffold_generator.rb +++ b/lib/generators/angular/scaffold/scaffold_generator.rb @@ -14,9 +14,12 @@ controllers_path = "app/assets/javascripts/angular/controllers" modules_path = "app/assets/javascripts/angular/services/models" + index_path = "app/views/#{plural_name}" template "controller.js.coffee", controllers_path + "/#{plural_name}_controller.js.coffee" + template "dialog_controller.js.coffee", controllers_path + "/#{plural_name}_dialog_controller.js.coffee" template "module.js.coffee", modules_path + "/#{scaffold_name}.js.coffee" + template "index.html.erb", index_path + "/index.html.erb" end private
Index and Form dialog box controllers are added to the scaffold generator.
diff --git a/lib/puppet-lint/plugins/duplicate_class_parameters.rb b/lib/puppet-lint/plugins/duplicate_class_parameters.rb index abc1234..def5678 100644 --- a/lib/puppet-lint/plugins/duplicate_class_parameters.rb +++ b/lib/puppet-lint/plugins/duplicate_class_parameters.rb @@ -6,7 +6,7 @@ level = 0 # if there are no params there is nothing to do, return early. - return if class_idx[:param_tokens].nil? + next if class_idx[:param_tokens].nil? class_idx[:param_tokens].each do |token| class_name = class_idx[:name_token].value
Remove explicit return and replace with a next. Fixes `Non-local exit from iterator, without return value.`
diff --git a/app/controllers/expensesheets_controller.rb b/app/controllers/expensesheets_controller.rb index abc1234..def5678 100644 --- a/app/controllers/expensesheets_controller.rb +++ b/app/controllers/expensesheets_controller.rb @@ -30,10 +30,4 @@ end redirect_to user_path(session[:user_id]) end - - private - def find_user - @user = User.find(session[:user_id]) - end - end
Remove unnecessary find user method
diff --git a/omniauth-vkontakte.gemspec b/omniauth-vkontakte.gemspec index abc1234..def5678 100644 --- a/omniauth-vkontakte.gemspec +++ b/omniauth-vkontakte.gemspec @@ -16,5 +16,5 @@ gem.require_paths = ['lib'] gem.version = OmniAuth::Vkontakte::VERSION - gem.add_runtime_dependency 'omniauth-oauth2', ['>= 1.5', '<= 1.6'] + gem.add_runtime_dependency 'omniauth-oauth2', ['>= 1.5', '<= 1.7.0'] end
Update omniauth-oauth2 to version 1.7.0
diff --git a/features/support/silent_system.rb b/features/support/silent_system.rb index abc1234..def5678 100644 --- a/features/support/silent_system.rb +++ b/features/support/silent_system.rb @@ -1,4 +1,4 @@ def silent_system(cmd) - silent_cmd = cmd + " 2>&1 > /dev/null" + silent_cmd = cmd + " > /dev/null 2>&1" system(silent_cmd) end
Reorder shell direction so 2 is actually appended to 1
diff --git a/debian/ruby-tests.rake b/debian/ruby-tests.rake index abc1234..def5678 100644 --- a/debian/ruby-tests.rake +++ b/debian/ruby-tests.rake @@ -1,3 +1,4 @@+ENV['HOME'] = '/tmp' require 'gem2deb/rake/spectask' Gem2Deb::Rake::RSpecTask.new do |spec| spec.pattern = './spec/**/*_spec.rb'
Fix executing tests.rake: set /home/uwabami as /tmp during test Signed-off-by: Youhei SASAKI <71d846e864222823256d2e7aa2ef5b2fc53b38e3@gfd-dennou.org>
diff --git a/test/rails_app/app/models/business.rb b/test/rails_app/app/models/business.rb index abc1234..def5678 100644 --- a/test/rails_app/app/models/business.rb +++ b/test/rails_app/app/models/business.rb @@ -16,7 +16,7 @@ operating_days 0..6 date_established :datetime next_sale (Time.now + 10.days) - verified false, default: false + verified false, :default => false location :type => :string, :limit => 127 awards ["Best business 2007", "Tastiest Chicken 2008"] managers :serialized
Make all hashes 1.8 compatible
diff --git a/hanami-bootstrap.gemspec b/hanami-bootstrap.gemspec index abc1234..def5678 100644 --- a/hanami-bootstrap.gemspec +++ b/hanami-bootstrap.gemspec @@ -19,7 +19,7 @@ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] - spec.add_dependency "hanami-assets", "~> 0.2" + spec.add_dependency "hanami-assets", "~> 1.0.0.beta1" spec.add_development_dependency "bundler", "~> 1.11" spec.add_development_dependency "rake", "~> 10.0"
Update hanami dep to 1.0.0.beta1
diff --git a/app/uploader/jenkins.rb b/app/uploader/jenkins.rb index abc1234..def5678 100644 --- a/app/uploader/jenkins.rb +++ b/app/uploader/jenkins.rb @@ -4,8 +4,11 @@ def upload dsym_path url = URI.parse(URI.encode(@job_build_url.strip)) - url.query = "" if url.query.nil? - url.query << "delay=0sec" + if url.query.nil? + url.query = "?delay=0sec" + else + url.query << "&delay=0sec" + end url.query << "&dsym_url=#{dsym_path}" HTTParty.post(url) end
Fix query params with token
diff --git a/examples/any_gradient.rb b/examples/any_gradient.rb index abc1234..def5678 100644 --- a/examples/any_gradient.rb +++ b/examples/any_gradient.rb @@ -0,0 +1,60 @@+require 'roda' +require 'calyx' + +class AnyGradient < Calyx::Grammar + html '<body style="margin:0; padding:0">{svg}</body>' + xml '<?xml version="1.0" encoding="utf-8"?>{svg}' + svg ' + <svg width="100%" + height="100%" + version="1.1" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink"> + {defs} + {rect} + </svg> + ' + defs ' + <defs> + {linear_gradient} + </defs> + ' + linear_gradient ' + <linearGradient id="linearGradient-1"> + {stop_fixed} + {stop_offset} + </linearGradient> + ' + stop_fixed '<stop stop-color="{stop_color}" offset="0%"></stop>' + stop_offset '<stop stop-color="{stop_color}" offset="{offset}"></stop>' + stop_color '#{hex_num}{hex_num}{hex_num}' + hex_num '{hex_val}{hex_val}' + hex_val '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' + offset '{tens}{ones}%' + tens 3,4,5,6 + ones 1,2,3,4,5,6,7,8,9,0 + rect ' + <rect id="gradient" + stroke="none" + fill="url(#linearGradient-1)" + fill-rule="evenodd" + x="0" + y="0" + width="100%" + height="100%"></rect> + ' +end + +class Server < Roda + route do |r| + r.root do + AnyGradient.new.generate(:html) + end + end +end + +if STDOUT.tty? + Rack::Server.start :app => Server +else + STDOUT.puts AnyGradient.new.generate(:xml) +end
Add example SVG generator with different output options
diff --git a/lib/autocompleteable.rb b/lib/autocompleteable.rb index abc1234..def5678 100644 --- a/lib/autocompleteable.rb +++ b/lib/autocompleteable.rb @@ -4,8 +4,8 @@ class UnconfiguredException < Exception; end included do - after_create :add_to_autocomplete_cache after_destroy :remove_from_autocomplete_cache + after_save :update_autocomplete_cache, if: :changed? end private @@ -25,11 +25,15 @@ end def autocomplete_data - { } + {} end def autocomplete_cache @autocomplete_cache ||= Soulmate::Loader.new(autocomplete_kind) + end + + def update_autocomplete_cache + remove_from_autocomplete_cache && add_to_autocomplete_cache end def add_to_autocomplete_cache
Update autocomplete cache on record change.
diff --git a/xtap.gemspec b/xtap.gemspec index abc1234..def5678 100644 --- a/xtap.gemspec +++ b/xtap.gemspec @@ -18,5 +18,6 @@ spec.require_paths = ['lib'] spec.add_development_dependency 'bundler', '~> 1.7' - spec.add_development_dependency 'rake', '~> 10.0' + spec.add_development_dependency 'rake', '~> 10.0' + spec.add_development_dependency 'rspec', '~> 3.2.0' end
Add rspec gem to dependencies and reformat file.
diff --git a/db/migrate/20200728210143_adjust_grade_change_tables_for_override_grades.partitions.rb b/db/migrate/20200728210143_adjust_grade_change_tables_for_override_grades.partitions.rb index abc1234..def5678 100644 --- a/db/migrate/20200728210143_adjust_grade_change_tables_for_override_grades.partitions.rb +++ b/db/migrate/20200728210143_adjust_grade_change_tables_for_override_grades.partitions.rb @@ -0,0 +1,55 @@+# +# Copyright (C) 2020 - present Instructure, Inc. +# +# This file is part of Canvas. +# +# Canvas is free software: you can redistribute it and/or modify it under +# the terms of the GNU Affero General Public License as published by the Free +# Software Foundation, version 3 of the License. +# +# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more +# details. +# +# You should have received a copy of the GNU Affero General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +class AdjustGradeChangeTablesForOverrideGrades < CanvasPartman::Migration + include MigrationHelpers::AddColumnAndFk + + disable_ddl_transaction! + tag :postdeploy + self.base_class = Auditors::ActiveRecord::GradeChangeRecord + + GRADE_CHANGE_BASE_TABLE = :auditor_grade_change_records + COLUMNS = %i[assignment_id submission_id submission_version_number].freeze + + def self.up + COLUMNS.each { |column| change_column_null(GRADE_CHANGE_BASE_TABLE, column, true) } + + add_column_and_fk GRADE_CHANGE_BASE_TABLE, :grading_period_id, :grading_periods, if_not_exists: true + + # The new column propagates to the partitioned tables, but the foreign key + # constraint does not, so add it manually + with_each_partition do |partition| + unless connection.foreign_key_exists?(partition, column: :grading_period_id) + foreign_key = connection.send(:foreign_key_name, partition, column: :grading_period_id) + execute("ALTER TABLE #{connection.quote_table_name(partition)} ADD CONSTRAINT #{foreign_key} FOREIGN KEY (grading_period_id) REFERENCES #{connection.quote_table_name('grading_periods')} (id)") + end + end + end + + def self.down + remove_records_with_null_values + + remove_column GRADE_CHANGE_BASE_TABLE, :grading_period_id + COLUMNS.each { |column| change_column_null(GRADE_CHANGE_BASE_TABLE, column, false) } + end + + def self.remove_records_with_null_values + null_record_scope = base_class.where("assignment_id IS NULL OR submission_id IS NULL") + null_record_scope.order(created_at: :asc).find_ids_in_batches(batch_size: 10_000) do |ids| + base_class.where(id: ids).delete_all + end + end +end
Update grade change tables for override grades flag=none closes EVAL-1065 Test plan: - "up" migration: - Ensure migrations run properly - After the migration finishes, check that the assignment_id, submission_id and submission_version_number columns in the auditor_grade_change_records_* tables do *not* have not-null constraints - Check that the grading_period_id column exists on said tables, along with an accompanying foreign key - "down" migration: - Check that the assignment_id, submission_id and submission_version_number column once again have a not-null constraint - Check that the grading_period_id column no longer exists Change-Id: I82d0325ea88f88138e78901415ed8fbe0d7d2814 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/243691 Tested-by: Service Cloud Jenkins <9144042a601061f88f1e1d7a1753ea3e2972119d@instructure.com> Reviewed-by: Jacob Burroughs <8ecea6e385af5cf9f53123f5ca17fb5fd6a6d4b2@instructure.com> Reviewed-by: Spencer Olson <7cc0890d6f1f70810a023e7173eca5724d6c8e49@instructure.com> QA-Review: Adrian Packel <9c6a39807293376f29cba17542b4cb1b663ecc4a@instructure.com> Product-Review: Syed Hussain <1379c89cd1d253d3c5a299cc4d8f6002ada9d6b5@instructure.com>
diff --git a/ibge.gemspec b/ibge.gemspec index abc1234..def5678 100644 --- a/ibge.gemspec +++ b/ibge.gemspec @@ -20,6 +20,6 @@ spec.add_dependency "spreadsheet", "~> 1.0" - spec.add_development_dependency "rake", "~> 10.0" + spec.add_development_dependency "rake", "~> 12.3" spec.add_development_dependency "rspec", "= 3.8.0" end
Update rake requirement from ~> 10.0 to ~> 12.3 Updates the requirements on [rake](https://github.com/ruby/rake) to permit the latest version. - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/commits/v12.3.1) Signed-off-by: dependabot[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
diff --git a/ConfigKit.podspec b/ConfigKit.podspec index abc1234..def5678 100644 --- a/ConfigKit.podspec +++ b/ConfigKit.podspec @@ -3,7 +3,7 @@ Pod::Spec.new do |s| s.name = 'ConfigKit' - s.version = '1.2.5' + s.version = '1.2.6' s.summary = 'Configuration toolkit.' s.description = <<-DESC
Modify : pod spec version
diff --git a/lib/doorkeeper/orm/neo4j/access_grant.rb b/lib/doorkeeper/orm/neo4j/access_grant.rb index abc1234..def5678 100644 --- a/lib/doorkeeper/orm/neo4j/access_grant.rb +++ b/lib/doorkeeper/orm/neo4j/access_grant.rb @@ -1,5 +1,5 @@-require 'doorkeeper/orm/mongoid5/concerns/scopes' -require 'doorkeeper-mongodb/compatible' +require 'doorkeeper/orm/neo4j/concerns/scopes' +require 'doorkeeper-neo4j/compatible' module Doorkeeper class AccessGrant
Remove left over mongoid reference.
diff --git a/lib/girffi/ibaseinfo.rb b/lib/girffi/ibaseinfo.rb index abc1234..def5678 100644 --- a/lib/girffi/ibaseinfo.rb +++ b/lib/girffi/ibaseinfo.rb @@ -1,7 +1,11 @@+require 'girffi/class_base' + module GirFFI # Wraps GIBaseInfo struct, the base \type for all info types. # Decendant types will be implemented as needed. class IBaseInfo + include ClassBase + # This is a helper method to construct a method returning an array, out # of the methods returning their number and the individual elements. # @@ -22,9 +26,6 @@ CODE end - def initialize gobj - @gobj = gobj - end private_class_method :new def name; Lib.g_base_info_get_name @gobj; end @@ -40,9 +41,5 @@ def == other Lib.g_base_info_equal @gobj, other.to_ptr end - - def to_ptr - @gobj - end end end
Use ClassBase to provide initialize and to_ptr.
diff --git a/spec/unit/generators/install_generator_spec.rb b/spec/unit/generators/install_generator_spec.rb index abc1234..def5678 100644 --- a/spec/unit/generators/install_generator_spec.rb +++ b/spec/unit/generators/install_generator_spec.rb @@ -1,6 +1,6 @@ # encoding: utf-8 -require 'spec_helper' +require 'fileutils' require 'generators/loaf/install_generator' RSpec.describe Loaf::Generators::InstallGenerator, type: :generator do @@ -12,5 +12,6 @@ run_generator locale = file("config/locales/loaf.en.yml") expect(locale).to exist + FileUtils.rm_rf(File.expand_path("../../../tmp", __FILE__)) end end
Change to clean up files
diff --git a/config.rb b/config.rb index abc1234..def5678 100644 --- a/config.rb +++ b/config.rb @@ -1,5 +1,13 @@+activate :deploy do |deploy| + deploy.method = :git + deploy.build_before = true +end + # Automatic image dimensions on image_tag helper activate :automatic_image_sizes + +# pretty URLs +activate :directory_indexes # Reload the browser automatically whenever files change configure :development do
Add a deploy method and pretty URLs
diff --git a/Funtestic.gemspec b/Funtestic.gemspec index abc1234..def5678 100644 --- a/Funtestic.gemspec +++ b/Funtestic.gemspec @@ -18,6 +18,19 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_development_dependency "bundler", "~> 1.3" - spec.add_development_dependency "rake" + spec.add_dependency 'redis', '>= 2.1' + spec.add_dependency 'redis-namespace', '>= 1.1.0' + spec.add_dependency 'sinatra', '>= 1.2.6' + spec.add_dependency 'simple-random' + + # Ruby 1.8 doesn't include JSON in the std lib + if RUBY_VERSION < "1.9" + spec.add_dependency 'json', '>= 1.7.7' + end + + spec.add_development_dependency 'rake' + spec.add_development_dependency 'bundler', '~> 1.3' + spec.add_development_dependency 'rspec', '~> 2.14' + spec.add_development_dependency 'rack-test', '>= 0.5.7' + spec.add_development_dependency 'coveralls' end
Add runtime dependencies missing for the gem
diff --git a/cookbooks/nagios/recipes/client_package.rb b/cookbooks/nagios/recipes/client_package.rb index abc1234..def5678 100644 --- a/cookbooks/nagios/recipes/client_package.rb +++ b/cookbooks/nagios/recipes/client_package.rb @@ -18,11 +18,21 @@ # limitations under the License. # -%w{ - nagios-nrpe-server - nagios-plugins - nagios-plugins-basic - nagios-plugins-standard -}.each do |pkg| - package pkg +case platform +when "centos" "redhat" "fedora" "amazon" "scientific" + %w{ + nrpe + nagios-plugins + }.each do |pkg| + package pkg + end +else + %w{ + nagios-nrpe-server + nagios-plugins + nagios-plugins-basic + nagios-plugins-standard + }.each do |pkg| + package pkg + end end
Add support for install NRPE via package on CentOS and similar systems Former-commit-id: 2f1bb3bc6475fa16b61a921e0898e18ec515ac40 [formerly 46a219961f40fe59231d731019375814a9c4b867] [formerly 1cedf1c9e07e1703ebb42f7a53e59f990ace7533 [formerly 4101cb57c11083d9a5b5f4f85223d7febb608b2c [formerly 0ce0555029846c77b64dba610210ef9a7e992aa7]]] Former-commit-id: 882ad1bc0424b71972c108b1a920cccbeb8d7c28 [formerly c66121ab6aa31fdcaf2676e4615e6a2bf919914e] Former-commit-id: bda90e4385763874ca852535287d0e83f64d7575 Former-commit-id: a0516c370d78211b0dea39a166557d7b1b3ee3f0
diff --git a/glow.gemspec b/glow.gemspec index abc1234..def5678 100644 --- a/glow.gemspec +++ b/glow.gemspec @@ -16,7 +16,7 @@ Handles Flash messages in Javascript for Rails xhr-responses. Fires a dom event when flash messages are present. DESC - s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.md"] + s.files = Dir["{app,config,db,lib,vendor}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.md"] s.test_files = Dir["test/**/*"] s.rdoc_options = ['--main', 'README.md', '--charset=UTF-8']
Add vendor dir to gemspec files list
diff --git a/grim.gemspec b/grim.gemspec index abc1234..def5678 100644 --- a/grim.gemspec +++ b/grim.gemspec @@ -7,7 +7,7 @@ s.version = Grim::VERSION s.authors = ["Jonathan Hoyt"] s.email = ["jonmagic@gmail.com"] - s.homepage = "" + s.homepage = "http://github.com/jonmagic/grim" s.summary = %q{Extract slides and text from a PDF.} s.description = %q{Grim is a simple gem for extracting a page from a pdf and converting it to an image as well as extract the text from the page as a string. It basically gives you an easy to use api to ghostscript, imagemagick, and pdftotext specific to this use case.}
Set homepage to github page.
diff --git a/test/helper.rb b/test/helper.rb index abc1234..def5678 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -13,5 +13,5 @@ require File.expand_path('lib/mem_model') Dir[File.expand_path('../support/*.rb', __FILE__)].each { |file| require file } -gem 'minitest', '5.2.0' +require 'minitest' require 'minitest/autorun'
Use require (not gem) for minitest
diff --git a/JSONModel.podspec b/JSONModel.podspec index abc1234..def5678 100644 --- a/JSONModel.podspec +++ b/JSONModel.podspec @@ -11,6 +11,7 @@ s.ios.deployment_target = '5.0' s.osx.deployment_target = '10.7' + s.watchos.deployment_target = '2.0' s.source_files = 'JSONModel/**/*.{m,h}' s.public_header_files = 'JSONModel/**/*.h'
Add deployment target to support watchOS 2
diff --git a/test/models/user_test.rb b/test/models/user_test.rb index abc1234..def5678 100644 --- a/test/models/user_test.rb +++ b/test/models/user_test.rb @@ -18,4 +18,9 @@ @user.email = ' ' assert_not @user.valid? end + + test 'name should not be too long' do + @user.name = "a" * 51 + assert_not @user.valid? + end end
Add test case for user name length
diff --git a/lib/mocha/integration/test_unit/gem_version_230_to_231.rb b/lib/mocha/integration/test_unit/gem_version_230_to_231.rb index abc1234..def5678 100644 --- a/lib/mocha/integration/test_unit/gem_version_230_to_231.rb +++ b/lib/mocha/integration/test_unit/gem_version_230_to_231.rb @@ -10,7 +10,7 @@ module GemVersion230To231 def self.included(mod) - $stderr.puts "Monkey patching Test::Unit gem >= v2.0.3 and <= v2.0.9" if $options['debug'] + $stderr.puts "Monkey patching Test::Unit gem >= v2.3.0 and <= v2.3.1" if $options['debug'] end def run(result) assertion_counter = AssertionCounter.new(result)
Debug message had the wrong test-unit version numbers.
diff --git a/app/controllers/choose_a_country_controller.rb b/app/controllers/choose_a_country_controller.rb index abc1234..def5678 100644 --- a/app/controllers/choose_a_country_controller.rb +++ b/app/controllers/choose_a_country_controller.rb @@ -8,7 +8,6 @@ def choose_a_country restart_journey if identity_provider_selected? && !user_journey_type?(JourneyType::EIDAS) @other_ways_description = current_transaction.other_ways_description - logger.info request.referrer ? "choose a country controller - referred by #{request.referrer}" : 'choose a country controller - no referrer' end private
Revert "EID-1774 Implement eIDAS escape route (exploration)"
diff --git a/app/controllers/gend_image_pages_controller.rb b/app/controllers/gend_image_pages_controller.rb index abc1234..def5678 100644 --- a/app/controllers/gend_image_pages_controller.rb +++ b/app/controllers/gend_image_pages_controller.rb @@ -5,7 +5,7 @@ include GendImagesHelper def show - @gend_image = GendImage.find_by_id_hash_and_is_deleted!(params[:id], false) + @gend_image = GendImage.active.find_by_id_hash!(params[:id]) @src_image = SrcImage.without_image.find(@gend_image.src_image_id) @gend_image_url = gend_image_url_for(@gend_image)
Use active scope instead of dynamic finder.
diff --git a/release/package/linux/rpm.rb b/release/package/linux/rpm.rb index abc1234..def5678 100644 --- a/release/package/linux/rpm.rb +++ b/release/package/linux/rpm.rb @@ -26,6 +26,7 @@ --after-install "release/debian-after-install.sh" \ -d "p7zip" \ -d "desktop-file-utils" \ + -d "libXScrnSaver" \ #{distro_files} }
:penguin: Add missing fedora dependency libXScrnSaver
diff --git a/lib/resource_kit/action_invoker.rb b/lib/resource_kit/action_invoker.rb index abc1234..def5678 100644 --- a/lib/resource_kit/action_invoker.rb +++ b/lib/resource_kit/action_invoker.rb @@ -46,7 +46,7 @@ def append_hooks(hook_type, request) (action.hooks[hook_type] || []).each do |hook| - hook.call(*args, request) and next if hook.kind_of?(Proc) + context.instance_exec(*args, request, &hook) and next if hook.kind_of?(Proc) context.send(hook, *args, request) end end
Use instance exec instead of call on hook procs.
diff --git a/capi/recipes/vim_luan.rb b/capi/recipes/vim_luan.rb index abc1234..def5678 100644 --- a/capi/recipes/vim_luan.rb +++ b/capi/recipes/vim_luan.rb @@ -17,7 +17,7 @@ owner node['sprout']['user'] end -execute './install --non-interactive' do +execute './update --non-interactive' do cwd dotvim user node['sprout']['user'] end
Update vim plugins when installing luan's vim * luan claims this won't break initial installations, so we will trust him Signed-off-by: Dan Wendorf <aacfaec681ee5d2ca2a22f1deac31c830d964d35@pivotal.io>
diff --git a/icloud.rb b/icloud.rb index abc1234..def5678 100644 --- a/icloud.rb +++ b/icloud.rb @@ -1,9 +1,11 @@ require './lib/ruby-icloud' +require 'io/console' require 'pry' def get_password prompt="Password: [typing will be hidden]" - `read -s -p "#{prompt}" password; echo $password`.chomp + puts prompt + STDIN.noecho(&:gets).chomp end def get_username
Replace system call for password with ruby
diff --git a/features/step_definitions/fetching_steps.rb b/features/step_definitions/fetching_steps.rb index abc1234..def5678 100644 --- a/features/step_definitions/fetching_steps.rb +++ b/features/step_definitions/fetching_steps.rb @@ -1,5 +1,5 @@ Before do - %w(Repo User).each do |attr| + %w(Repo User Organization).each do |attr| GitHub.const_get(attr).delete_all end end
Clean up all models in cucumber tests.
diff --git a/features/step_definitions/my_first_steps.rb b/features/step_definitions/my_first_steps.rb index abc1234..def5678 100644 --- a/features/step_definitions/my_first_steps.rb +++ b/features/step_definitions/my_first_steps.rb @@ -1,7 +1,7 @@ Given /^I am on the Welcome Screen$/ do wait_for(:timeout => 5) { element_exists("label text:'Top Box Office'") } - touch("view marked: 'MovieCell-1-1'") + touch("view marked: 'MovieCell-1-0'") wait_for(:timeout => 5) { element_exists("label text:'Movie info'") } # check_element_exists("view marked: 'Rotten'")
Check first movie under Top Box
diff --git a/spec/support/fluent_logger_helper.rb b/spec/support/fluent_logger_helper.rb index abc1234..def5678 100644 --- a/spec/support/fluent_logger_helper.rb +++ b/spec/support/fluent_logger_helper.rb @@ -1,6 +1,6 @@ module FluentLoggerHelper def logger - Fluent::Logger.class_variable_get(:@@default_logger) + Fluent::Logger.default end def last_log(tag)
Access the default logger simply
diff --git a/lib/bindi.rb b/lib/bindi.rb index abc1234..def5678 100644 --- a/lib/bindi.rb +++ b/lib/bindi.rb @@ -2,7 +2,7 @@ require 'bindi/version' class Bindi - def initialize serializer + def initialize serializer = Marhsal @serializer = serializer end @@ -55,4 +55,4 @@ def keys Ohm.redis.keys.map &:to_sym end -end+end
Set default serializer to Marshal.
diff --git a/lib/bindi.rb b/lib/bindi.rb index abc1234..def5678 100644 --- a/lib/bindi.rb +++ b/lib/bindi.rb @@ -45,6 +45,6 @@ alias has_key key? def keys - @redis.keys.map &:to_sym + @redis.keys end end
Stop mapping keys to Symbols.
diff --git a/refinerycms-tweets.gemspec b/refinerycms-tweets.gemspec index abc1234..def5678 100644 --- a/refinerycms-tweets.gemspec +++ b/refinerycms-tweets.gemspec @@ -18,6 +18,6 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_dependency 'refinerycms-core', '~> 2.1.0' - spec.add_dependency 'refinerycms-i18n', '~> 2.1.0' + spec.add_dependency 'refinerycms-core', '~> 3.0.0' + spec.add_dependency 'refinerycms-i18n', '~> 3.0.0' end
Update gemspec to refinerycms 3.0
diff --git a/rubyzome/load_local_app.rb b/rubyzome/load_local_app.rb index abc1234..def5678 100644 --- a/rubyzome/load_local_app.rb +++ b/rubyzome/load_local_app.rb @@ -14,8 +14,8 @@ $views['/'+typename+'/'+viewname]=Kernel.const_get(viewname) end + DataMapper.setup(:default,$db_url) # Include all models Dir["app/models/*.rb"].each { |file| require file } - - DataMapper.setup(:default,$db_url) + DataMapper.finalize end
Update to be Datamapper 1.0 compatible
diff --git a/lib/jazzy.rb b/lib/jazzy.rb index abc1234..def5678 100644 --- a/lib/jazzy.rb +++ b/lib/jazzy.rb @@ -1,2 +1,4 @@ require 'jazzy/config' require 'jazzy/doc_builder' + +Encoding.default_external = 'UTF-8'
Set the default encoding to UTF-8. After making myself a little shell script to run on build of a scheme in Xcode, it would always fail on me, even though running it from the terminal worked fine. Setting the default encoding to UTF-8 seems to fix this issue. Reference: https://github.com/berkshelf/berkshelf-api/issues/112 (near the bottom) It's an encoding thing, notice how the JSON parser is trying to use US-ASCII as it's encoding. As of ruby 1.9 the encoding for JSON parser is explicit so you can either add this to the berks executable: Encoding.default_external = "UTF-8"
diff --git a/lib/uspec.rb b/lib/uspec.rb index abc1234..def5678 100644 --- a/lib/uspec.rb +++ b/lib/uspec.rb @@ -16,7 +16,7 @@ at_exit do failures = Uspec::Stats.exit_code status = $!.respond_to?(:status) ? $!.status : 0 - errors = ($! && $!.cause == nil) ? 0 : 1 + errors = $!.respond_to?(:cause) && $!.cause ? 1 : 0 code = [failures, status, errors].max exit code end
Exit with 0 if there are no errors.
diff --git a/templates/spec/support/database_cleaner.rb b/templates/spec/support/database_cleaner.rb index abc1234..def5678 100644 --- a/templates/spec/support/database_cleaner.rb +++ b/templates/spec/support/database_cleaner.rb @@ -1,2 +1,14 @@-require 'capybara/rails' -require 'capybara/rspec' +RSpec.configure do |config| + config.before(:suite) do + DatabaseCleaner.strategy = :transaction + DatabaseCleaner.clean_with(:truncation) + end + + config.before(:each) do + DatabaseCleaner.start + end + + config.after(:each) do + DatabaseCleaner.clean + end +end
Fix database cleaner support for RSpec
diff --git a/installers/unix/Dockerfile.builder b/installers/unix/Dockerfile.builder index abc1234..def5678 100644 --- a/installers/unix/Dockerfile.builder +++ b/installers/unix/Dockerfile.builder @@ -7,8 +7,8 @@ yum -y groupinstall 'Development Tools' && \ yum -y install centos-release-scl epel-release && \ yum -y install autoconf bzip2-devel curl git gzip libtool makeself \ - readline-devel rh-python35 spatialindex-devel sudo \ - sqlite-devel tar which xz zip zlib-devel + readline-devel rh-python27 rh-python35 spatialindex-devel \ + sudo sqlite-devel tar which xz zip zlib-devel ARG uid=107 @@ -18,8 +18,6 @@ USER builder ENV HOME /home/builder -ENV PATH=/opt/rh/rh-python35/root/usr/bin:$PATH -ENV LD_LIBRARY_PATH=/opt/rh/rh-python35/root/usr/lib64 WORKDIR ${HOME}
Install rh-python27 in Docker but do not set envs
diff --git a/test/test_slugizer.rb b/test/test_slugizer.rb index abc1234..def5678 100644 --- a/test/test_slugizer.rb +++ b/test/test_slugizer.rb @@ -10,6 +10,11 @@ should "generate the slug" do @blogpost.slug.should =~ /\w+-blog-post-title/ + end + + should "not generate the slug if the slug key is blank" do + @empty_blogpost = BlogPost.new + @empty_blogpost.slug.should be_nil end should "return the slug as param" do
Test to ensure that slugs aren't generated when slug_key values are blank
diff --git a/lib/googlemaps/services/global_constants.rb b/lib/googlemaps/services/global_constants.rb index abc1234..def5678 100644 --- a/lib/googlemaps/services/global_constants.rb +++ b/lib/googlemaps/services/global_constants.rb @@ -0,0 +1,34 @@+# coding: utf-8 +require 'googlemaps/services/version' + +# Global constants used across the library +# +# @since 1.3.5 +module Constants + # The User-Agent header + USER_AGENT = 'GoogleMapsRubyClient/' + GoogleMaps::Services::VERSION + + # The default base URL for all requests + DEFAULT_BASE_URL = 'https://maps.googleapis.com' + + # HTTP statuses that will trigger a retry request + RETRIABLE_STATUSES = [500, 503, 504] + + # The supported transportation modes + TRAVEL_MODES = %w(driving walking bicycling transit) + + # The features to avoid + AVOID_FEATURES = %w(tolls highways ferries indoor) + + # The base URL for Roads API + ROADS_BASE_URL = 'https://roads.googleapis.com' + + # The supported scale values + ALLOWED_SCALES = [2, 4] + + # The supported image formats + SUPPORTED_IMG_FORMATS = ["png32", "gif", "jpg", "jpg-baseline"] + + # The supported map types + SUPPORTED_MAP_TYPES = ["satellite", "hybrid", "terrain"] +end
:sparkles: Add global constants used across the library
diff --git a/lib/mountable_processing_server/endpoint.rb b/lib/mountable_processing_server/endpoint.rb index abc1234..def5678 100644 --- a/lib/mountable_processing_server/endpoint.rb +++ b/lib/mountable_processing_server/endpoint.rb @@ -17,7 +17,8 @@ image = MiniMagick::Image.open @source_directory + original if params["frame"] - image = image.coalesce + # Currently to expensive for large GIFs + # image = image.coalesce frame = image.frames[params["frame"].to_i] Tempfile.open "frame" do |file|
Disable coalesce of GIFs for the time being
diff --git a/lib/torque/postgresql/attributes/builder.rb b/lib/torque/postgresql/attributes/builder.rb index abc1234..def5678 100644 --- a/lib/torque/postgresql/attributes/builder.rb +++ b/lib/torque/postgresql/attributes/builder.rb @@ -9,8 +9,7 @@ module Builder def self.include_on(klass, method_name, builder_klass, **extra, &block) klass.define_singleton_method(method_name) do |*args, **options| - return unless connection.table_exists?(table_name) || - connection.view_exists?(table_name) + return unless table_exists? args.each do |attribute| begin
Use table_exists? directly instead of going through connection
diff --git a/tools/load_testing.rb b/tools/load_testing.rb index abc1234..def5678 100644 --- a/tools/load_testing.rb +++ b/tools/load_testing.rb @@ -0,0 +1,52 @@+require 'json' +require 'httparty' +require 'thread/pool' +require 'awesome_print' + +target = 'http://146.185.153.218' + +i = 0 +hit_count = 0 +error_count = 0 + +times = [] + +pool = Thread.pool(200) + +5000.times do + pool.process do + puts "Begin hit #{ i }" + i += 1 + begin + t1 = Time.now + response = HTTParty.get(target + '/legacy_api/courses') + courses = JSON.load(response.body) + HTTParty.get(target + '/legacy_api/courses' + "/#{ courses.sample["id"] }") + t2 = Time.now + times << t2 - t1 + if response.code != 200 + error_count += 1 + end + rescue Exception => e + puts e + error_count +=1 + end + + hit_count += 1 + end +end + +pool.shutdown + +puts "Hit: #{ hit_count }" +puts "Error: #{ error_count } (#{ (error_count / hit_count) * 100 }%)" + +File.open("#{ Time.now.to_s }_results.csv", 'w') do |io| + i = 0 + times.each do |k| + io.puts "#{i};#{k}" + i += 1 + end +end + +
Add dirty load testing script
diff --git a/app/models/asset_type.rb b/app/models/asset_type.rb index abc1234..def5678 100644 --- a/app/models/asset_type.rb +++ b/app/models/asset_type.rb @@ -1,7 +1,12 @@ class AssetType < ActiveRecord::Base # associations + + # every asset type has 0 or more sub types has_many :asset_subtypes + + # every asset type has 0 or more manufacturers + has_many :manufacturers #attr_accessible :name, :description, :active #attr_accessible :class_name, :form_name, :index_name
Add manufacturer list to asset types
diff --git a/app/models/collection.rb b/app/models/collection.rb index abc1234..def5678 100644 --- a/app/models/collection.rb +++ b/app/models/collection.rb @@ -8,4 +8,8 @@ # override the default Hydra properties so we don't get a prefix deprecation warning. has_metadata "properties", type: Worthwhile::PropertiesDatastream + # override Hydra::Collection to add :solr_page_size + has_and_belongs_to_many :members, property: :has_collection_member, class_name: "ActiveFedora::Base" , after_remove: :remove_member, + solr_page_size: 150 + end
Decrease the solr_page_size to 150 from the default 200
diff --git a/poke.rb b/poke.rb index abc1234..def5678 100644 --- a/poke.rb +++ b/poke.rb @@ -1,6 +1,5 @@ require 'gosu' -require './lib/player.rb' -require './lib/window.rb' +Dir['./lib/*.rb'].each { |file| require file } window = GameWindow.new window.show
Use iteration to require each file in lib/
diff --git a/lib/jeeyo.rb b/lib/jeeyo.rb index abc1234..def5678 100644 --- a/lib/jeeyo.rb +++ b/lib/jeeyo.rb @@ -5,5 +5,6 @@ autoload :Location, "jeeyo/location" EARTH_KILOMETERS_PER_RADIAN = Unit.new("6367.5 km/rad") + EARTH_RADIANS_PER_KILOMETER = EARTH_KILOMETERS_PER_RADIAN.inverse end
Add inverse constant: rad/km for the earth
diff --git a/lib/sower.rb b/lib/sower.rb index abc1234..def5678 100644 --- a/lib/sower.rb +++ b/lib/sower.rb @@ -1,20 +1,34 @@-#%w{activerecord activesupport activemodel arel builder i18n tzinfo}.each do |lib| -# path = File.expand_path("../vendor/#{lib}/lib",__FILE__) -# $:.unshift(path) -#end -#require 'rubygems' -#gem 'activesupport', ">= 3.0.0.beta" -#gem 'activemodel', ">= 3.0.0.beta" -#gem 'activerecord', ">= 3.0.0.beta" -#require 'active_support/all' -#require 'active_record' -#require 'arel' -#ActiveRecord::Base.establish_connection({:adapter => 'mysql', :socket => '/tmp/webo-mysql-stat.sock', :database => 'aimfar_prod'}) -#Arel::Table.engine = Arel::Sql::Engine.new(ActiveRecord::Base) -#users = Arel::Table.new(:users) -#puts Arel::Project.new(users,users[:id]).to_sql +# Use vendored libraries +$:.unshift(File.expand_path('../vendor/activesupport/lib',__FILE__)) +%w{activerecord activesupport activemodel arel builder i18n tzinfo}.each do |lib| + path = File.expand_path("../vendor/#{lib}/lib",__FILE__) + $:.unshift(path) +end -require 'active_support/core_ext' +class Object + def to_sql + "'#{to_s}'" + end + def to_dot + nil + end +end +class NilClass + def to_sql + nil + end +end +class Array + def to_sql + map(&:to_sql).join(',') + end +end + +require 'active_support/all' +require 'active_support/version' +puts ActiveSupport::VERSION::STRING + + require 'sower/relation' require 'sower/condition' require 'sower/node'
Use vendor libraries and add core extensions
diff --git a/lib/anvil.rb b/lib/anvil.rb index abc1234..def5678 100644 --- a/lib/anvil.rb +++ b/lib/anvil.rb @@ -1,6 +1,7 @@ # encoding: UTF-8 require 'anvil/version' +require 'active_support' require 'active_support/core_ext' # Main anvil module
Load active_support before any other active_support file. This loads activesupport/dependencies/autoload.rb.
diff --git a/test/integration/charge_flow_test.rb b/test/integration/charge_flow_test.rb index abc1234..def5678 100644 --- a/test/integration/charge_flow_test.rb +++ b/test/integration/charge_flow_test.rb @@ -20,5 +20,8 @@ get '/round_status/' + @round.url @response_json = JSON.parse(@response.body) assert_no_match /<form/, @response_json['payment_info_template'] + + get '/round/' + @round.url + assert_no_match /<form/, @response.body end end
Test payment form not displayed on round status GET
diff --git a/lib/code_climate_check/get_gpa.rb b/lib/code_climate_check/get_gpa.rb index abc1234..def5678 100644 --- a/lib/code_climate_check/get_gpa.rb +++ b/lib/code_climate_check/get_gpa.rb @@ -32,6 +32,7 @@ else puts 'HTTP request have been failed' null_response + exit(0) end end @@ -42,7 +43,7 @@ end def null_response - {'last_snapshot' => {'gpa' => NULL_GPA}}.to_json + { last_snapshot: { gpa: NULL_GPA } }.to_json end end end
Add exiting when HTTP request is not success
diff --git a/loaf.gemspec b/loaf.gemspec index abc1234..def5678 100644 --- a/loaf.gemspec +++ b/loaf.gemspec @@ -13,8 +13,6 @@ spec.description = %q{Loaf manages and displays breadcrumb trails in your Rails app. It aims to handle breadcrumb data through easy dsl and expose it through view helpers without any assumptions about markup.} spec.files = `git ls-files`.split("\n") - spec.test_files = `git ls-files -- {spec,features}/*`.split("\n") - spec.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } spec.require_paths = ["lib"] spec.metadata['allowed_push_host'] = 'https://rubygems.org'
Change to stop loading test and executable files
diff --git a/lib/erector/rails/form_builder.rb b/lib/erector/rails/form_builder.rb index abc1234..def5678 100644 --- a/lib/erector/rails/form_builder.rb +++ b/lib/erector/rails/form_builder.rb @@ -13,9 +13,9 @@ attr_reader :parent, :template - def initialize(object_name, object, template, options, proc) + def initialize(object_name, object, template, options) @template = template - @parent = parent_builder_class.new(object_name, object, template, options, proc) + @parent = parent_builder_class.new(object_name, object, template, options) end def method_missing(method_name, *args, &block)
Fix FormBuilder for Rails 4.1+ Block parameter for FormBuilder was removed in https://github.com/rails/rails/commit/38aafc037705aab2f09ec924bf634d105002e016
diff --git a/lib/http_client/jruby/response.rb b/lib/http_client/jruby/response.rb index abc1234..def5678 100644 --- a/lib/http_client/jruby/response.rb +++ b/lib/http_client/jruby/response.rb @@ -42,7 +42,7 @@ end def each - @native_response.get_all_headers.each do |h| + @native_response.header_iterator.each do |h| yield h.get_name, h.get_value end end
Switch to the iterator object to be more Java-ninny.
diff --git a/lib/juici/helpers/form_helpers.rb b/lib/juici/helpers/form_helpers.rb index abc1234..def5678 100644 --- a/lib/juici/helpers/form_helpers.rb +++ b/lib/juici/helpers/form_helpers.rb @@ -1,6 +1,6 @@ def form_at(route, fields, opts={}) form = "" - form << %Q{<form class="well" action="#{route}" method="post">\n} + form << %Q{<form action="#{route}" method="post">\n} fields.each do |name, value| form << %Q{<input type="hidden" name="#{name}" value="#{value}">\n}
Remove well class from forms
diff --git a/spec/classes/bitlbee_spec.rb b/spec/classes/bitlbee_spec.rb index abc1234..def5678 100644 --- a/spec/classes/bitlbee_spec.rb +++ b/spec/classes/bitlbee_spec.rb @@ -11,7 +11,7 @@ it { should include_class('bitlbee::config') } it { should contain_package('bitlbee').with_provider('homebrew') } it { should contain_file('/Library/LaunchDaemons/bitlbee.plist').with( 'group' => 'wheel', 'owner' => 'root') } - it { should contain_file('/Library/LaunchDaemons/bitlbee.plist').with_content(/<string>-p<\/string>\s*<string>6667<\/string>/) } + it { should contain_file('/Library/LaunchDaemons/bitlbee.plist').with_content(/<string>-p<\/string>\s*<string>6667<\/string>/), "Should run on port 6667" } it { should contain_file('/Library/LaunchDaemons/bitlbee.plist').with_content(/<string>-i<\/string>\s*<string>localhost<\/string>/), "Should be running with -i localhost." } it { should contain_file('/Library/LaunchDaemons/bitlbee.plist').with_content(/<key>UserName<\/key>\s*<string>#{facts[:luser]}<\/string>/) } it { should contain_file("#{facts[:boxen_home]}/config/bitlbee").with('ensure' => 'directory') }
Add helpful message for port spec.
diff --git a/spec/classes/openssl_spec.rb b/spec/classes/openssl_spec.rb index abc1234..def5678 100644 --- a/spec/classes/openssl_spec.rb +++ b/spec/classes/openssl_spec.rb @@ -1,37 +1,35 @@ require 'spec_helper' describe 'openssl' do - on_puppet_supported_platforms.each do |version, platforms| - platforms.each do |platform, facts| - context "on #{version} #{platform}" do - let(:facts) { facts } + on_supported_os.each do |os, facts| + context "on #{os}" do + let(:facts) { facts } - it { is_expected.to compile.with_all_deps } + it { is_expected.to compile.with_all_deps } - it { is_expected.to contain_package('openssl').with_ensure('present') } + it { is_expected.to contain_package('openssl').with_ensure('present') } - if facts[:osfamily] == 'Debian' - it { is_expected.to contain_package('ca-certificates') } - it { is_expected.to contain_exec('update-ca-certificates').with_refreshonly('true') } - it { is_expected.to contain_file('ca-certificates.crt').with( - :ensure => 'present', - :owner => 'root', - :mode => '0644', - :path => '/etc/ssl/certs/ca-certificates.crt' - ) - } - elsif facts[:osfamily] == 'RedHat' - it { is_expected.not_to contain_package('ca-certificates') } - it { is_expected.not_to contain_exec('update-ca-certificates').with_refreshonly('true') } + if facts[:osfamily] == 'Debian' + it { is_expected.to contain_package('ca-certificates') } + it { is_expected.to contain_exec('update-ca-certificates').with_refreshonly('true') } + it { is_expected.to contain_file('ca-certificates.crt').with( + :ensure => 'present', + :owner => 'root', + :mode => '0644', + :path => '/etc/ssl/certs/ca-certificates.crt' + ) + } + elsif facts[:osfamily] == 'RedHat' + it { is_expected.not_to contain_package('ca-certificates') } + it { is_expected.not_to contain_exec('update-ca-certificates').with_refreshonly('true') } - it { is_expected.to contain_file('ca-certificates.crt').with( - :ensure => 'present', - :owner => 'root', - :mode => '0644', - :path => '/etc/pki/tls/certs/ca-bundle.crt' - ) - } - end + it { is_expected.to contain_file('ca-certificates.crt').with( + :ensure => 'present', + :owner => 'root', + :mode => '0644', + :path => '/etc/pki/tls/certs/ca-bundle.crt' + ) + } end end end
Use rspec-puppet-facts instead of puppet_facts for unit tests
diff --git a/spec/debian/hostname_spec.rb b/spec/debian/hostname_spec.rb index abc1234..def5678 100644 --- a/spec/debian/hostname_spec.rb +++ b/spec/debian/hostname_spec.rb @@ -4,3 +4,9 @@ describe command('hostname') do it { should_not return_stdout 'debian-7-blank' } end + +# Hostname should retunr the UUID +uuid = `mdata-get sdc:uuid` +describe command('hostname') do + it { should return_stdout uuid } +end
Test to ensure the hostname is set to the uuid of the VM
diff --git a/spec/rdayone/journal_spec.rb b/spec/rdayone/journal_spec.rb index abc1234..def5678 100644 --- a/spec/rdayone/journal_spec.rb +++ b/spec/rdayone/journal_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Rdayone::Journal do - describe "loading" do + context "loading" do let(:finder) do f = double("finder") f.stub(:find_entries) { [double("entry")] } @@ -24,7 +24,7 @@ end end - describe "finder interaction" do + context "Rdayone::Finder interaction" do subject { Rdayone::Journal.new("some_path") } it "should default to the provided finder" do
Tidy up spec a bit
diff --git a/json_presentable.gemspec b/json_presentable.gemspec index abc1234..def5678 100644 --- a/json_presentable.gemspec +++ b/json_presentable.gemspec @@ -11,7 +11,8 @@ s.email = ["johnonrails@gmail.com"] s.homepage = "http://github.com/johnnylaw/json_presentable" s.summary = "For presenting JSON from controllers in a Rails app" - s.description = "For presenting JSON from controllers in a Rails app" + s.description = "Presenters that make it easy for you to display your resources as JSON. An easy API allows you to configure the presentation of each resource in different contexts." + s.license = 'MIT' s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]
Add description and license to gemspec
diff --git a/lib/godot.rb b/lib/godot.rb index abc1234..def5678 100644 --- a/lib/godot.rb +++ b/lib/godot.rb @@ -42,7 +42,7 @@ Timeout.timeout(interval) do socket = TCPSocket.open(host, port) end - rescue Errno::ECONNREFUSED, Errno::ETIMEDOUT, Timeout::Error, Errno::EHOSTUNREACH + rescue Errno::ECONNREFUSED, Errno::ETIMEDOUT, Timeout::Error, Errno::EHOSTUNREACH, Errno::EHOSTDOWN end end end
Add EHOSTDOWN to rescuable errors
diff --git a/lib/moltin/resource_collection.rb b/lib/moltin/resource_collection.rb index abc1234..def5678 100644 --- a/lib/moltin/resource_collection.rb +++ b/lib/moltin/resource_collection.rb @@ -3,6 +3,7 @@ @resources = [] def initialize(resource_class, data) + data ||= {} @resources = data.map do |result| resource_class.constantize.new result end @@ -12,6 +13,10 @@ @resources.each { |resource| yield resource } end + def first + @resources.first + end + def to_s @resources.map(&:to_s) end
Allow .first on resource collection
diff --git a/lib/omniauth/strategies/radius.rb b/lib/omniauth/strategies/radius.rb index abc1234..def5678 100644 --- a/lib/omniauth/strategies/radius.rb +++ b/lib/omniauth/strategies/radius.rb @@ -23,7 +23,7 @@ uid { raw_info['id'] } info do - raw_info["attributes"].slice *%w{ + raw_info["info"].slice *%w{ first_name last_name email
Use the 'info' key from the `auth_hash` Migrating from the `attributes` key to `info` since this is the conical key we want to use going forward.
diff --git a/default_options.gemspec b/default_options.gemspec index abc1234..def5678 100644 --- a/default_options.gemspec +++ b/default_options.gemspec @@ -8,8 +8,8 @@ spec.version = DefaultOptions::VERSION spec.authors = ["John Mertens"] spec.email = ["john@versahq.com"] - spec.summary = %q{Super simple library provides an easy DSL for setting default options in methods.} - spec.description = %q{} + spec.summary = %q{Super simple library provides an easy DSL for setting defaults on optional methods arguments.} + spec.description = %q{Implements a simple pattern for creating "options" in Ruby method. Mix it in to a class and use the DSL to setup defaults for methods that can easily be overwritten as needed.} spec.homepage = "" spec.license = "MIT"
Add a description to the gemspec.
diff --git a/lib/tasks/search-term-report.rake b/lib/tasks/search-term-report.rake index abc1234..def5678 100644 --- a/lib/tasks/search-term-report.rake +++ b/lib/tasks/search-term-report.rake @@ -0,0 +1,11 @@+namespace :report do + desc "Run a publication delay report of the last week" + task publication_delay_report: :environment do + PublicationDelayReport.call($stdout) + end + + desc "Find all references to search term" + task find_specific_term_references: :environment do + FindSpecificTerm.call + end +end
Clone report.rake for generic searches Use report.rake as a basis to create a task to run new generic term finder
diff --git a/iis/recipes/install.rb b/iis/recipes/install.rb index abc1234..def5678 100644 --- a/iis/recipes/install.rb +++ b/iis/recipes/install.rb @@ -1,5 +1,38 @@ powershell_script 'Install IIS' do - code 'Add-WindowsFeature Web-Server' + code <<- EOH + Add-WindowsFeature Web-Server, + Web-WebServer, + Web-Common-Http, + Web-Default-Doc, + Web-Dir-Browsing, + Web-Http-Errors, + Web-Static-Content, + Web-Http-Redirect, + Web-Health, + Web-Http-Logging, + Web-Log-Libraries, + Web-Request-Monitor, + Web-Http-Tracing, + Web-Performance, + Web-Stat-Compression, + Web-Security, + Web-Filtering, + Web-Basic-Auth, + Web-Windows-Auth, + Web-App-Dev, + Web-Net-Ext, + Web-Net-Ext45, + Web-Asp-Net, + Web-Asp-Net45, + Web-ISAPI-Ext, + Web-ISAPI-Filter, + Web-WebSockets, + Web-Mgmt-Tools, + Web-Mgmt-Console, + Web-Mgmt-Compat, + Web-Mgmt-Service + EOH + action :run not_if "(Get-WindowsFeature -Name Web-Server).Installed" end
Add additional IIS-related Windows features
diff --git a/lib/ephemeral/app/api.rb b/lib/ephemeral/app/api.rb index abc1234..def5678 100644 --- a/lib/ephemeral/app/api.rb +++ b/lib/ephemeral/app/api.rb @@ -4,6 +4,9 @@ require_relative '../models/build.rb' require_relative '../entities/build.rb' require_relative './resources/build.rb' +require_relative '../models/file.rb' +require_relative '../entities/file.rb' +require_relative './resources/file.rb' module Ephemeral class API < Grape::API
Add require statements for file
diff --git a/lib/janky/notifier/chat_service.rb b/lib/janky/notifier/chat_service.rb index abc1234..def5678 100644 --- a/lib/janky/notifier/chat_service.rb +++ b/lib/janky/notifier/chat_service.rb @@ -2,14 +2,14 @@ module Notifier class ChatService def self.completed(build) - status = build.green? ? "was successful" : "failed" + status = build.green? ? "succeeded :thumbsup:" : "failed :collision::collision::collision::fire::fire::fire:" color = build.green? ? "green" : "red" - message = "Build #%s (%s) of %s/%s %s (%ss) %s" % [ + message = "Build #%s of `%s/%s@%s` %s (took %ss). %s" % [ build.number, - build.short_sha1, build.repo_name, build.branch_name, + build.short_sha1, status, build.duration, build.web_url
Make chat service notifier send better success and failure messages.
diff --git a/lib/attr_secure.rb b/lib/attr_secure.rb index abc1234..def5678 100644 --- a/lib/attr_secure.rb +++ b/lib/attr_secure.rb @@ -15,8 +15,8 @@ # The order in this list matters, as only the first valid adapter will be used # ADAPTERS = [ + AttrSecure::Adapters::ActiveRecord, AttrSecure::Adapters::Sequel, - AttrSecure::Adapters::ActiveRecord, AttrSecure::Adapters::Ruby ]
Revert "Prioritise Sequel over AR" This reverts commit af9777e1f29f7adaba94cd836aecf9679bd421e1.
diff --git a/wateringServer/spec/controllers/plants_controller_spec.rb b/wateringServer/spec/controllers/plants_controller_spec.rb index abc1234..def5678 100644 --- a/wateringServer/spec/controllers/plants_controller_spec.rb +++ b/wateringServer/spec/controllers/plants_controller_spec.rb @@ -38,4 +38,16 @@ expect(assigns(:errors)). to eq ["Species can't be blank"] end end + + describe 'GET #show' do + it 'can show a plant page' do + plant = Plant.create(name: "Test Name", + species: "Test Species", + days_per_watering: 10, + start_date: Date.today() + ) + get :show, params: { id: plant.id } + expect(response).to render_template(:show) + end + end end
Add test to show route for plants
diff --git a/lib/commit_hook.rb b/lib/commit_hook.rb index abc1234..def5678 100644 --- a/lib/commit_hook.rb +++ b/lib/commit_hook.rb @@ -18,11 +18,12 @@ diff2html = DiffToHtml.new diff2html.diff_between_revisions rev1, rev2, prefix, ref_name + branch_name = (ref_name =~ /master$/i) ? "" : "[#{ref_name.split("/").last}]" unless recipient.empty? diff2html.result.reverse.each_with_index do |result, i| nr = number(diff2html.result.size, i) emailer = Emailer.new project_path, recipient, result[:commit_info][:email], result[:commit_info][:author], - "#{prefix}#{nr} #{result[:commit_info][:message]}", result[:text_content], result[:html_content], rev1, rev2, ref_name + "#{prefix}#{branch_name}#{nr} #{result[:commit_info][:message]}", result[:text_content], result[:html_content], rev1, rev2, ref_name emailer.send end end
Include the branch name in the subject
diff --git a/test/test_verbs.rb b/test/test_verbs.rb index abc1234..def5678 100644 --- a/test/test_verbs.rb +++ b/test/test_verbs.rb @@ -3,6 +3,10 @@ class TestVerbs < Test::Unit::TestCase def test_copular_conjugation assert_equal :am, Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :first, :plurality => :singular) + assert_equal :are, Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :second, :plurality => :singular) + assert_equal :is, Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :third, :plurality => :singular) + assert_equal :are, Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :first, :plurality => :plural) + assert_equal :are, Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :third, :plurality => :plural) end def test_irregular_conjugation assert_equal :break, Verbs::Conjugator.conjugate(:break, :tense => :present, :person => :first, :plurality => :singular)
Test present forms of the copular verb
diff --git a/lib/core/player.rb b/lib/core/player.rb index abc1234..def5678 100644 --- a/lib/core/player.rb +++ b/lib/core/player.rb @@ -11,9 +11,11 @@ # Increments the score of the player relative to the number of lines he just cleared and his current combo def increment_score(lines) - @combo += 1 - @linesCleared += lines - @score += 100 * 2 ** (lines - 1) * combo + if lines != 0 + @combo += 1 + @linesCleared += lines + @score += 100 * 2 ** (lines - 1) * combo + end end def reset_combo
Add check to prevent incrementing score with no line
diff --git a/git-scripts.gemspec b/git-scripts.gemspec index abc1234..def5678 100644 --- a/git-scripts.gemspec +++ b/git-scripts.gemspec @@ -10,7 +10,7 @@ s.email = ['daniel@ifixit.com', 'james@ifixit.com', 'tim@ifixit.com', 'robin@ifixit.com'] s.add_dependency 'bundler' - s.add_dependency 'octokit', '~> 3.0.0' + s.add_dependency 'octokit', '~> 4.0.0' s.add_dependency 'highline' s.add_dependency 'json', '~> 1.8.0'
Update the octokit version to 4.0.0
diff --git a/test/wduck_test.rb b/test/wduck_test.rb index abc1234..def5678 100644 --- a/test/wduck_test.rb +++ b/test/wduck_test.rb @@ -0,0 +1,20 @@+require_relative 'test_helper' + +describe WDuck::Duck do + + subject { WDuck::Duck.new("linux") } + describe "function result that gets called for duck" do + it "should respond to the function call" do + subject.must_respond_to(:result) + end + + it "function should be array of json objects" do + subject.result.must_be_instance_of(Array) + end + end + + describe "check the results of for each condition" do + end + + +end
Write sample test cases replace unit with minitest
diff --git a/lib/mnemosyne/version.rb b/lib/mnemosyne/version.rb index abc1234..def5678 100644 --- a/lib/mnemosyne/version.rb +++ b/lib/mnemosyne/version.rb @@ -7,7 +7,7 @@ PATCH = 0 STAGE = nil - STRING = [MAJOR, MINOR, PATCH, STAGE].reject(&:nil?).join('.') + STRING = [MAJOR, MINOR, PATCH, STAGE].compact.join('.') def self.to_s STRING
chore: Use compact instead of reject(&:nil?) Available in all supported rubys. Deteced by latest rubocop.
diff --git a/lib/macro.rb b/lib/macro.rb index abc1234..def5678 100644 --- a/lib/macro.rb +++ b/lib/macro.rb @@ -36,8 +36,8 @@ caption ||= "" template = %Q{ +%h5=caption %table.table.table-striped.table-bordered - %caption=caption %tr - headers.each do |header| %th=header.to_s
Use a h5 for table captions
diff --git a/test/functional/admin/get_involved_controller_test.rb b/test/functional/admin/get_involved_controller_test.rb index abc1234..def5678 100644 --- a/test/functional/admin/get_involved_controller_test.rb +++ b/test/functional/admin/get_involved_controller_test.rb @@ -0,0 +1,16 @@+require "test_helper" + +class Admin::GetInvolvedControllerTest < ActionController::TestCase + setup do + login_as :gds_editor + end + + should_be_an_admin_controller + + test "GET :index returns ok" do + get :index + + assert_response :success + assert_template "index" + end +end
Add test for Get Involved admin page There is currently no test that loads the admin page for Get Involved. This meant that an error in loading the page (e.g. by breaking a route helper) would not be noticed by running the test suite. I'm not exactly sure what this page is meant to do, other than provide some links to other places, so just adding a basic test that the page loads without error (which would be enough to identify a broken route helper, for example).
diff --git a/lib/micro_q/dsl.rb b/lib/micro_q/dsl.rb index abc1234..def5678 100644 --- a/lib/micro_q/dsl.rb +++ b/lib/micro_q/dsl.rb @@ -1,4 +1,20 @@ module MicroQ + ## + # Convenience methods for calling methods asynchronously + # Adds async_perform by default + # + # Usage + # class MyWorker + # worker :update, :queue => 'non-default' + # + # def update + # end + # end + # + # MyWorker.async_update + # is the same as + # MyWorker.new.async(:queue => 'non-default').update + # module DSL def worker(*opts) self.class_eval do @@ -14,6 +30,10 @@ async_methods = self.microq_options[:methods] |= opts.flatten self.class_eval do + ## + # For each of the methods given to the Object.worker method + # define the async_ prefixed version for convenience + # async_methods.each do |method| async_method = :"async_#{method}" define_singleton_method(async_method) do |*args|
Add Docs for the new DSL.
diff --git a/spec/flipper/redis_spec.rb b/spec/flipper/redis_spec.rb index abc1234..def5678 100644 --- a/spec/flipper/redis_spec.rb +++ b/spec/flipper/redis_spec.rb @@ -5,7 +5,7 @@ describe Flipper::Adapters::Redis do let(:client) { Redis.new } - subject { Flipper::Adapters::Redis.new(client) } + subject { described_class.new(client) } before do client.flushdb
Use the described class for subject.
diff --git a/octo.gemspec b/octo.gemspec index abc1234..def5678 100644 --- a/octo.gemspec +++ b/octo.gemspec @@ -2,7 +2,7 @@ s.name = 'octo' s.summary = 'Run commands in parallel on multiple hosts' s.description = 'A lightweight script that allows you to run commands in parallel on multiple hosts' - s.version = '0.0.2' + s.version = '0.0.3' s.author = 'Nan Zhong' s.email = 'nan@nine27.com' s.homepage = 'https://github.com/nanzhong/octo'
Remove code from sample gli app
diff --git a/ojwt.podspec b/ojwt.podspec index abc1234..def5678 100644 --- a/ojwt.podspec +++ b/ojwt.podspec @@ -21,7 +21,7 @@ s.requires_arc = true - s.source_files = "OJWT/OJ*{.m,.h}" + s.source_files = "OJWT/*OJ*{.m,.h}" s.public_header_files = "OJWT/*.h" end
Update pod spec to reflect categories
diff --git a/lib/tasks/add_admin.rake b/lib/tasks/add_admin.rake index abc1234..def5678 100644 --- a/lib/tasks/add_admin.rake +++ b/lib/tasks/add_admin.rake @@ -1,14 +1,12 @@-# encoding: utf-8 -namespace :add do - desc "通过邮箱地址给一个用户赋予管理员权限" - task :admin => :environment do +namespace :admin do + desc 'Grunt a user as administation' + task add: :environment do email = ENV['email'] logger = Logger.new(File.join(Rails.root, 'log', 'admin.log')) user = User.where("email = ?", email).first - logger.info user.email - logger.info "修改前的权限是:" + user.admin.to_s - user.update_attribute(:admin, true) - logger.info "修改后的权限是:" + user.admin.to_s + user.update_attribute!(:admin, true) + + logger.info "#{user.name} has be grunted as admin!!" end end
Refactor admin rake task. :v:
diff --git a/lib/tasks/emergency.rake b/lib/tasks/emergency.rake index abc1234..def5678 100644 --- a/lib/tasks/emergency.rake +++ b/lib/tasks/emergency.rake @@ -29,5 +29,14 @@ end end end + + # TODO: Run this and then remove it + desc "Create default watches for all users with no current watches" + task create_all_default_watches: :environment do + User.where.not(id: Alert.pluck(:user_id)) do |user| + puts "Creating default watches for #{user.nickname}" + user.watch_all_owners + end + end end end
Add a rake task to set up watches for users that don't have them
diff --git a/lib/podding-cli.rb b/lib/podding-cli.rb index abc1234..def5678 100644 --- a/lib/podding-cli.rb +++ b/lib/podding-cli.rb @@ -3,8 +3,9 @@ require 'thor' require 'settingslogic' +require_relative 'settings/settings_helpers' +require_relative 'settings/setup' require_relative 'settings/load_settings' -require_relative 'settings/settings_helpers' # Load subcommands require_relative 'commands/episode'
Load order, and add setup
diff --git a/lib/rapid_rack/default_receiver.rb b/lib/rapid_rack/default_receiver.rb index abc1234..def5678 100644 --- a/lib/rapid_rack/default_receiver.rb +++ b/lib/rapid_rack/default_receiver.rb @@ -23,7 +23,7 @@ end def logout(env) - env['rack.session'].clear + env['rack.session'].destroy redirect_to('/') end end
Support destroying a user's session in Rails 5.2 `ActionDispatch::Request::Session.clear` stopped working on Rails 5.2. Calling destroy has the intended behaviour.
diff --git a/lib/redis/rails/instrumentation.rb b/lib/redis/rails/instrumentation.rb index abc1234..def5678 100644 --- a/lib/redis/rails/instrumentation.rb +++ b/lib/redis/rails/instrumentation.rb @@ -17,6 +17,7 @@ output = cmds.map do |name, *args| if !args.empty? + args = args.map { |arg| arg.respond_to?(:encoding) && arg.encoding == Encoding::ASCII_8BIT ? 'BINARY DATA' : arg } "[ #{name.to_s.upcase} #{args.join(' ')} ]" else "[ #{name.to_s.upcase} ]"
Replace binary data with placeholder text when logging.
diff --git a/lib/veritas/aggregate.rb b/lib/veritas/aggregate.rb index abc1234..def5678 100644 --- a/lib/veritas/aggregate.rb +++ b/lib/veritas/aggregate.rb @@ -6,7 +6,10 @@ # Evaluate the aggregate using the operands # - # @return [undefined] + # @example + # Aggregate.call # => raises NotImplementedError + # + # @return [Object] # # @api public def self.call(*)
Document the return value for Aggregate.call
diff --git a/lib/sandthorn_sequel_projection.rb b/lib/sandthorn_sequel_projection.rb index abc1234..def5678 100644 --- a/lib/sandthorn_sequel_projection.rb +++ b/lib/sandthorn_sequel_projection.rb @@ -23,12 +23,17 @@ ProcessedEventsTracker.migrate!(configuration.projections_driver) end + def event_store + configuration.event_store + end + end class Configuration - attr_accessor :projections_driver, :event_driver, :projections_folder + attr_accessor :projections_driver, :event_store, :projections_folder class << self alias_method :default, :new end end end +
Make event store configurable, this makes it possible to not depend upon Sandthorn core lib. Decoupling galore!
diff --git a/lib/scss_lint/linter/hex_format.rb b/lib/scss_lint/linter/hex_format.rb index abc1234..def5678 100644 --- a/lib/scss_lint/linter/hex_format.rb +++ b/lib/scss_lint/linter/hex_format.rb @@ -1,24 +1,20 @@ module SCSSLint class Linter::HexFormat < Linter include LinterRegistry - - def visit_prop(node) - if node.value.is_a?(Sass::Script::String) && - node.value.type == :identifier - - node.value.value.scan(HEX_REGEX) do |match| - add_hex_lint(node, match.first) unless valid_hex_format?(match.first) - end - end - - yield # Continue visiting children - end def visit_script_color(node) return unless node.original && node.original.match(HEX_REGEX) unless valid_hex_format?(node.original[HEX_REGEX, 1]) add_hex_lint(node, node.original) + end + end + + def visit_script_string(node) + return unless node.type == :identifier + + node.value.scan(HEX_REGEX) do |match| + add_hex_lint(node, match.first) unless valid_hex_format?(match.first) end end
Simplify HexFormat linter string searching The `HexFormat` linter was using `visit_prop` with a manual check to see if the value of the property was a `Sass::Script::String`, rather than just using `visit_script_string`. Switching to `visit_script_string` simplifies the code. Change-Id: I84a64b97071b74d9d37ff40360f4683a2e557368 Reviewed-on: https://gerrit.causes.com/29015 Tested-by: jenkins <d95b56ce41a2e1ac4cecdd398defd7414407cc08@causes.com> Reviewed-by: Shane da Silva <6f6e68d1df92f30cb4b3ce35260ddf94a402f33d@causes.com>
diff --git a/pakyow-mailer/lib/mailer/mailer.rb b/pakyow-mailer/lib/mailer/mailer.rb index abc1234..def5678 100644 --- a/pakyow-mailer/lib/mailer/mailer.rb +++ b/pakyow-mailer/lib/mailer/mailer.rb @@ -12,7 +12,12 @@ end def deliver_to(recipient, subject = nil) - @message.body = self.view.to_html + html_content = self.view.to_html + @message.html_part do + content_type 'text/html; charset=UTF-8' + body html_content + end + @message.subject = subject if subject if recipient.is_a?(Array)
Set HTML part of message instead of body