diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/cookbooks/yum/attributes/default.rb b/cookbooks/yum/attributes/default.rb index abc1234..def5678 100644 --- a/cookbooks/yum/attributes/default.rb +++ b/cookbooks/yum/attributes/default.rb @@ -24,7 +24,7 @@ default['yum']['epel_release'] = case node['platform_version'].to_i when 6 - "6-5" + "6-6" when 5 "5-4" when 4
Make sure we get the latest epel release. If we don't do this and someone yum updates a box it breaks chef. Found out the hard way. Former-commit-id: 82e38889b207dee7b4fca02c7dcbacd96a552fc8 [formerly 1ad52aeae55bcf40fed1cc8a6179ebcc575c66f7] [formerly 87cb199e9559df1e75dc30b086fc4246b2da36ea [formerly 3bf37533809446ca51c242738b54c647d1218e2f [formerly 21e4885555814a17296d54bd2debd49c26a46d7b]]] Former-commit-id: 9ec661af68fb0c21482a4fce6d2993a38cff6ec7 [formerly 646246c7b53ec0ab68b1409e41277def75d152ca] Former-commit-id: bb1ff914c1ea7f3da023befca6bbadb4e7be2f20 Former-commit-id: 6becc9d187e09f99044c52c0ae7b7d3731107942
diff --git a/stateoscope.gemspec b/stateoscope.gemspec index abc1234..def5678 100644 --- a/stateoscope.gemspec +++ b/stateoscope.gemspec @@ -27,4 +27,5 @@ spec.add_development_dependency 'rspec' spec.add_development_dependency 'timecop' spec.add_development_dependency 'codeclimate-test-reporter' + spec.add_development_dependency 'pry' end
Add pry to dev dependencies
diff --git a/init.rb b/init.rb index abc1234..def5678 100644 --- a/init.rb +++ b/init.rb @@ -1,4 +1,3 @@-#WebDav plugin for REDMINE require 'redmine' Dir::foreach(File.join(File.dirname(__FILE__), 'lib')) do |file| next unless /\.rb$/ =~ file @@ -14,11 +13,28 @@ version '0.1.2' settings :default => {'bbb_server' => '', 'bbb_salt' => ''}, :partial => 'settings-bbb/settings' - + project_module :bigbluebutton do permission :bigbluebutton_join, :bbb => :start permission :bigbluebutton_start, {} permission :bigbluebutton_moderator, {} end +end -end+Redmine::WikiFormatting::Macros.register do + desc "Insert the link to the BigBlueButton room. Examples: \n\n <pre>{{bbb}}\n{{bbb(project_id)}}</pre>" + macro :bbb do |obj, args| + if args[0] and !args[0].empty? + project_identifier = args[0].strip + project = Project.find_by_identifier(project_identifier) + return nil unless project + end + project = @project unless project + return nil unless project + return nil unless project.module_enabled?("bigbluebutton") + project_id = project.identifier + project_name = project.name + link_name = project.name + " - " + "meeting room" + h(link_to(link_name, {:controller => 'bbb', :action => 'start', :project_id => project_id})) + end +end
Add wiki macro for BBB link Usage: {{bbb}} - link to the current project meeting room {{bbb(project_id)}} - link to the meeting room for project_id
diff --git a/app/models/user.rb b/app/models/user.rb index abc1234..def5678 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -3,4 +3,6 @@ # :confirmable, :lockable, :timeoutable and :omniauthable devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable + + devise :omniauthable, omniauth_providers: [:bnet] end
Make User Omniauthable via bnet
diff --git a/util/tarsnap-gui.rb b/util/tarsnap-gui.rb index abc1234..def5678 100644 --- a/util/tarsnap-gui.rb +++ b/util/tarsnap-gui.rb @@ -2,7 +2,7 @@ desc "Cross-platform GUI front-end for the Tarsnap command-line client." homepage "https://github.com/Tarsnap/tarsnap-gui/wiki/Tarsnap" url "https://github.com/Tarsnap/tarsnap-gui/archive/v1.0.tar.gz" - sha256 "" + sha256 "cd21d2a85f073e72f10900632fdcb49956985255a5711fb4f6d434433b09dac9" head "https://github.com/Tarsnap/tarsnap-gui.git" depends_on "qt5"
Update Homebrew recipe shasum for v1.0 tarball.
diff --git a/lib/rubocop/cop/style/nil_comparison.rb b/lib/rubocop/cop/style/nil_comparison.rb index abc1234..def5678 100644 --- a/lib/rubocop/cop/style/nil_comparison.rb +++ b/lib/rubocop/cop/style/nil_comparison.rb @@ -15,15 +15,12 @@ class NilComparison < Cop MSG = 'Prefer the use of the `nil?` predicate.'.freeze - OPS = [:==, :===].freeze - - NIL_NODE = s(:nil) + def_node_matcher :nil_comparison?, '(send _ {:== :===} (:nil))' def on_send(node) - _receiver, method, args = *node - return unless OPS.include?(method) - - add_offense(node, :selector) if args == NIL_NODE + nil_comparison?(node) do + add_offense(node, :selector) + end end private
Modify Style/NilComparison to use NodePattern
diff --git a/db/seeds.rb b/db/seeds.rb index abc1234..def5678 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,15 +1,45 @@-# This file should contain all the record creation needed to seed the database with its default values. -# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). -# -# Examples: -# -# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) -# Mayor.create(name: 'Emanuel', city: cities.first) -require 'pry' -require 'json' - file = File.open("data-files/polls_all.json") file.readlines.each do |row| json = JSON.parse(row) - binding.pry + json.each do |poll| + poll_obj = Poll.create!(build_poll_args(poll)) + poll["questions"].each do |question| + topic = Topic.find_or_create_by(name: question["topic"] || question["name"]) + question_obj = topic.questions.create!(build_question_args(question)) + question["subpopulations"].each do |pop| + size = pop["observations"] + pop["responses"].each do |r| + Response.create!(build_response_args(r, poll_obj.id, question_obj.id)) + end + end + end + end end + +def build_response_args(response, p_id, q_id) + { + percentage: response["value"], + answer: response["choice"], + poll_id: p_id, + question_id: q_id + } +end + +def build_question_args(question) + { + state: question["state"], + content: question["name"] + } +end + +def build_poll_args(poll) + { + pollster: poll["pollster"], + start_date: poll["start_date"], + end_date: poll["end_date"], + source: poll["source"], + partisan: poll["partisan"] != "Nonpartisan", + affiliation: poll["affiliation"] + } +>>>>>>> seed-logic +end
Resolve merge conflict in seed file
diff --git a/Support/syntax/syntax_highlight_test_spec.rb b/Support/syntax/syntax_highlight_test_spec.rb index abc1234..def5678 100644 --- a/Support/syntax/syntax_highlight_test_spec.rb +++ b/Support/syntax/syntax_highlight_test_spec.rb @@ -0,0 +1,48 @@+# This spec file is for manually checking the syntax highlighting. It is not meant to be executed. +describe SyntaxHighlighting do + + it 'works for a simple example (single quoted)' do + # ... + end + + it "works for a simple example (double quoted)" do + # ... + end + + context 'in a context (single quoted)' do + context "that is nested (double quoted)" do + it "still works correctly" do + # ... + end + end + end + + # See https://github.com/rspec/rspec-tmbundle/issues/45 + context 'with multiline + descriptions (single quoted)' do + + context "or double + quoted" do + + it 'still works for + single quoted strings' do + # ... + end + + it "still works for + double quoted strings" do + # ... + end + end + end + + context "for pending examples" do + # Make sure `keyword.other.rspec.pending` is really present – it may be visually indistinct from `keyword.other.rspec.example`. + it "gives `it` the scope `keyword.other.rspec.pending` (double quotes)" + it 'gives `it` the scope `keyword.other.rspec.pending` (single quotes)' + end + + if foo + puts "Some Ruby code here, #{should} be highlightes correctly", :foo + end +end
Add file for manually checking syntax highlighting Currently there is no good to automate tests for the syntax highglighting. But this is better than nothing.
diff --git a/task/bundler_2.rake b/task/bundler_2.rake index abc1234..def5678 100644 --- a/task/bundler_2.rake +++ b/task/bundler_2.rake @@ -0,0 +1,10 @@+# frozen_string_literal: true + +namespace :bundler_2 do + task :install do + ENV["BUNDLER_SPEC_SUB_VERSION"] = "2.0.0.dev" + Rake::Task["spec:travis:sub_version"].invoke + Rake::Task["install"].invoke + sh("git", "checkout", "--", "lib/bundler/version.rb") + end +end
Add a task to install a bundler 2 dev gem
diff --git a/plugins/titlecase.rb b/plugins/titlecase.rb index abc1234..def5678 100644 --- a/plugins/titlecase.rb +++ b/plugins/titlecase.rb @@ -11,8 +11,8 @@ # capitalize first and last words x.first.to_s.smart_capitalize! x.last.to_s.smart_capitalize! - # small words after colons are capitalized - x.join(" ").gsub(/:\s?(\W*#{small_words.join("|")}\W*)\s/) { ": #{$1.smart_capitalize} " } + # small words after colons or periods are capitalized + x.join(" ").gsub(/(:|\.)\s?(\W*#{small_words.join("|")}\W*)\s/) { "#{$1} #{$2.smart_capitalize} " } end def titlecase!
Allow capitalization after a period.
diff --git a/thumbor-versionable.gemspec b/thumbor-versionable.gemspec index abc1234..def5678 100644 --- a/thumbor-versionable.gemspec +++ b/thumbor-versionable.gemspec @@ -1,7 +1,6 @@ # encoding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require 'new_idea_cms/version' Gem::Specification.new do |spec| spec.name = 'thumbor-versionable'
Delete non used reference to the gem version.
diff --git a/library/rexml/attribute/inspect_spec.rb b/library/rexml/attribute/inspect_spec.rb index abc1234..def5678 100644 --- a/library/rexml/attribute/inspect_spec.rb +++ b/library/rexml/attribute/inspect_spec.rb @@ -13,7 +13,7 @@ end it "does not escape text" do - a = REXML::Attribute.new("&&", "<>") - a.inspect.should == "&&='<>'" + a = REXML::Attribute.new("name", "<>") + a.inspect.should == "name='<>'" end end
Stop to use invalid XML attribute name
diff --git a/spec/features/global_assets_spec.rb b/spec/features/global_assets_spec.rb index abc1234..def5678 100644 --- a/spec/features/global_assets_spec.rb +++ b/spec/features/global_assets_spec.rb @@ -20,12 +20,12 @@ end it "should have a form for employee search", js: true do - find('#nav-search-trigger a').click + find('#masthead-q-komin').click page.should have_selector('#masthead-search-person') end it "should have a form for intranet search", js: true do - find('#nav-search-trigger a').click + find('#masthead-q-komin').click page.should have_selector('#masthead-search-intranet') end end
Update spec to match new masthead search
diff --git a/spec/godville_kit/pantheons_spec.rb b/spec/godville_kit/pantheons_spec.rb index abc1234..def5678 100644 --- a/spec/godville_kit/pantheons_spec.rb +++ b/spec/godville_kit/pantheons_spec.rb @@ -1,3 +1,4 @@+# encoding: utf-8 require 'spec_helper' describe 'Pantheons' do
Fix encoding issue on pantheons spec for ruby 1.9.3
diff --git a/lib/cucumber/salad/widgets/form.rb b/lib/cucumber/salad/widgets/form.rb index abc1234..def5678 100644 --- a/lib/cucumber/salad/widgets/form.rb +++ b/lib/cucumber/salad/widgets/form.rb @@ -4,7 +4,7 @@ class Form < Widget def self.check_box(name, label = nil) define_method "#{name}=" do |val| - l = label || name_to_label(name) + l = label || name_to_locator(name) if val root.check l @@ -19,7 +19,7 @@ label, = args define_method "#{name}=" do |val| - l = label || name_to_label(name) + l = label || name_to_locator(name) w = opts.fetch(:writer) { ->(v) { v } } root.select w.(val).to_s, from: l @@ -32,7 +32,7 @@ def self.text(name, label = nil) define_method "#{name}=" do |val| - l = label || name_to_label(name) + l = label || name_to_locator(name) root.fill_in l, with: val.to_s end @@ -69,7 +69,7 @@ private - def name_to_label(name) + def name_to_locator(name) name.to_s.humanize end end
Prepare to introduce locator resolver.
diff --git a/lib/log4jruby/support/bootstrap.rb b/lib/log4jruby/support/bootstrap.rb index abc1234..def5678 100644 --- a/lib/log4jruby/support/bootstrap.rb +++ b/lib/log4jruby/support/bootstrap.rb @@ -16,3 +16,10 @@ end end end + +# https://github.com/lenny/log4jruby/issues/14 +# https://github.com/jruby/jruby/wiki/Persistence +if Java::org.apache.log4j.Logger.respond_to?(:__persistent__) + Java::org.apache.log4j.Logger.__persistent__ = true +end +
Fix for JRuby 9K compatibility https://github.com/lenny/log4jruby/issues/14
diff --git a/application/admin/public/theme/default/config.rb b/application/admin/public/theme/default/config.rb index abc1234..def5678 100644 --- a/application/admin/public/theme/default/config.rb +++ b/application/admin/public/theme/default/config.rb @@ -1,3 +1,5 @@+Encoding.default_external = "utf-8" + # Require any additional compass plugins here. # Set this to the root of your project when deployed:
Set default SASS encoding to UTF-8
diff --git a/simple_km.gemspec b/simple_km.gemspec index abc1234..def5678 100644 --- a/simple_km.gemspec +++ b/simple_km.gemspec @@ -22,4 +22,5 @@ gem.add_dependency 'addressable' gem.add_development_dependency 'rspec' gem.add_development_dependency 'pry' + gem.add_development_dependency 'rake' end
Add rake as a dependency for TravisCI.
diff --git a/lib/models/badges/nice_question.rb b/lib/models/badges/nice_question.rb index abc1234..def5678 100644 --- a/lib/models/badges/nice_question.rb +++ b/lib/models/badges/nice_question.rb @@ -17,7 +17,7 @@ }).to_a.first title = question['title'] - score = question['score'].to_i + score = question['score'] remaining = 10 - score "Your question \"#{title}\" has #{score} votes. #{remaining} votes to go!"
Remove redundant use of to_i
diff --git a/lib/node_builder/system_command.rb b/lib/node_builder/system_command.rb index abc1234..def5678 100644 --- a/lib/node_builder/system_command.rb +++ b/lib/node_builder/system_command.rb @@ -15,7 +15,7 @@ def system_cmd(cmd, prompt='COMMAND:') log "%s %s" % [prompt_style(prompt), command_style(cmd)] log "with environment: #{environment.to_s}" - exec_cmd = "sudo -u #{run_as_user} /bin/bash -c 'cd #{@base_folder}; #{cmd}'" + exec_cmd = "sudo -u #{run_as_user} /bin/bash -l -c 'cd #{@base_folder}; #{cmd}'" Open3.popen2e(environment, exec_cmd) do |i, oe, t| oe.each { |line| simple_log line } end
Use login shell to load envs to run commands.
diff --git a/lib/omniauth/strategies/adstage.rb b/lib/omniauth/strategies/adstage.rb index abc1234..def5678 100644 --- a/lib/omniauth/strategies/adstage.rb +++ b/lib/omniauth/strategies/adstage.rb @@ -14,7 +14,7 @@ uid { user_info['id'] } info do - info_hash = properties(user_info) + info_hash = user_info info_hash[:organizations] = organizations_info info_hash end @@ -26,11 +26,7 @@ end def organizations_info - user_info['_embedded']['adstage:organizations'].map { |org| properties(org) } - end - - def properties(entity) - entity.except('_embedded', '_forms', '_links') + user_info['_embedded']['adstage:organizations'] end end end
Return full user and org info.
diff --git a/lib/pc_rails_code_quality/tests.rb b/lib/pc_rails_code_quality/tests.rb index abc1234..def5678 100644 --- a/lib/pc_rails_code_quality/tests.rb +++ b/lib/pc_rails_code_quality/tests.rb @@ -15,5 +15,13 @@ html_reporter = Minitest::Reporters::HtmlReporter.new html_option Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new, html_reporter] + + if defined? RSpec + RSpec.configure do |config| + config.color = true + config.formatter = 'html' + config.output_stream = File.open("#{Rails.root}/public/reports/tests/index.html", 'w') + end + end end end
Use html formatter for rspec
diff --git a/racym.gemspec b/racym.gemspec index abc1234..def5678 100644 --- a/racym.gemspec +++ b/racym.gemspec @@ -18,7 +18,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_dependency "railties", ">= 3.2.13","< 6.0" + spec.add_dependency "railties", ">= 3.2.13","< 7.0" spec.add_development_dependency "bundler", "~> 1.3" spec.add_development_dependency "rake"
Allow up through Rails 6
diff --git a/tests/spec/features/editions_spec.rb b/tests/spec/features/editions_spec.rb index abc1234..def5678 100644 --- a/tests/spec/features/editions_spec.rb +++ b/tests/spec/features/editions_spec.rb @@ -7,7 +7,7 @@ before do visit '/' - editor.set(rust_2018_code) + editor.set(rust_edition_code) end scenario "using the 2015 edition" do @@ -15,8 +15,7 @@ click_on("Run") within(:output, :stderr) do - expect(page).to have_content 'unused variable: `async`' - expect(page).to_not have_content 'expected identifier, found keyword `async`' + expect(page).to have_content 'cannot find struct, variant or union type `async` in this scope' end end @@ -25,8 +24,16 @@ click_on("Run") within(:output, :stderr) do - expect(page).to have_content 'expected identifier, found keyword `async`' - expect(page).to_not have_content 'unused variable: `async`' + expect(page).to have_content "thread 'main' panicked at 'Box<Any>'" + end + end + + scenario "using the 2021 edition" do + in_advanced_options_menu { select '2021' } + click_on("Run") + + within(:output, :stderr) do + expect(page).to have_content 'format argument must be a string literal', wait: 10 end end @@ -34,10 +41,11 @@ Editor.new(page) end - def rust_2018_code + def rust_edition_code <<~EOF + #![allow(non_fmt_panic)] fn main() { - let async = 42; + panic!(async {}) } EOF end
Test that selecting Rust 2021 works
diff --git a/lib/vendorificator/hooks/chef_cookbook.rb b/lib/vendorificator/hooks/chef_cookbook.rb index abc1234..def5678 100644 --- a/lib/vendorificator/hooks/chef_cookbook.rb +++ b/lib/vendorificator/hooks/chef_cookbook.rb @@ -1,7 +1,10 @@-require 'chef/cookbook/metadata' - module Vendorificator::Hooks module ChefCookbookDependencies + def initialize(*args) + require 'chef/cookbook/metadata' + super + end + # Add required Chef cookbooks to vendor modules def dependencies ignored =
Move Chef requirement to runtime.
diff --git a/app/controllers/data/scenarios_controller.rb b/app/controllers/data/scenarios_controller.rb index abc1234..def5678 100644 --- a/app/controllers/data/scenarios_controller.rb +++ b/app/controllers/data/scenarios_controller.rb @@ -4,8 +4,7 @@ before_filter :find_scenario, :only => [:show, :edit, :update] def index - base = Scenario.scoped - base = base.recent_first + base = Scenario.recent_first if params[:q] if params[:q] =~ /^\d+$/ base = base.by_id(params[:q])
Remove unnecessary (and broken) call to "scoped"
diff --git a/pronto-spell.gemspec b/pronto-spell.gemspec index abc1234..def5678 100644 --- a/pronto-spell.gemspec +++ b/pronto-spell.gemspec @@ -12,11 +12,23 @@ s.homepage = 'http://github.org/mmozuras/pronto-spell' s.summary = 'Pronto runner that uses Aspell for spell checking' - s.required_rubygems_version = '>= 1.3.6' - s.license = 'MIT' + s.licenses = ['MIT'] + s.required_ruby_version = '>= 1.9.3' + s.rubygems_version = '1.8.23' - s.files = Dir.glob('{lib}/**/*') + %w(LICENSE README.md) - s.test_files = `git ls-files -- {spec}/*`.split("\n") + s.files = `git ls-files`.split($RS).reject do |file| + file =~ %r{^(?: + spec/.* + |Gemfile + |Rakefile + |\.rspec + |\.gitignore + |\.rubocop.yml + |\.travis.yml + )$}x + end + s.test_files = [] + s.extra_rdoc_files = ['LICENSE', 'README.md'] s.require_paths = ['lib'] s.add_dependency('pronto', '~> 0.5.0')
Reduce size of the gem by only including the necessary files via gemspec
diff --git a/watirspec_helper.rb b/watirspec_helper.rb index abc1234..def5678 100644 --- a/watirspec_helper.rb +++ b/watirspec_helper.rb @@ -8,7 +8,7 @@ require 'operawatir/helper' -OperaWatir.newandshinyplease! +OperaWatir.use_version 2 RSpec.configure do |config| config.mock_with :rr @@ -37,6 +37,10 @@ OperaWatir::Helper.browser end + def window + browser.active_window + end + def fixture(*paths) [WatirSpec.host, *paths].join('/') end
Use version 2, and provide a window
diff --git a/app/models/create_organization_from_array.rb b/app/models/create_organization_from_array.rb index abc1234..def5678 100644 --- a/app/models/create_organization_from_array.rb +++ b/app/models/create_organization_from_array.rb @@ -10,7 +10,7 @@ return nil if @row[@mappings[:date_removed]] return nil if Organization.find_by_name(organization_name) - org = build_organization(organization_name) + org = build_organization org.save! validate: validate org @@ -29,7 +29,7 @@ end end - def build_organization(organization_name) + def build_organization_from_array address = Address.new(@row[@mappings[:address]]).parse org = Organization.new({ name:organization_name,
Add specs for CreateOrganizationFromArray service class
diff --git a/cucumber-puppet.gemspec b/cucumber-puppet.gemspec index abc1234..def5678 100644 --- a/cucumber-puppet.gemspec +++ b/cucumber-puppet.gemspec @@ -17,4 +17,5 @@ gem.add_dependency('cucumber') gem.add_development_dependency('rspec') + gem.add_development_dependency('rake') end
Add rake as a development dependency
diff --git a/test/views_tests.rb b/test/views_tests.rb index abc1234..def5678 100644 --- a/test/views_tests.rb +++ b/test/views_tests.rb @@ -0,0 +1,68 @@+ +$: << File.dirname(__FILE__) +require "test_helper" + +class ViewsTests < PostgreSQLExtensionsTestCase + def test_create_view + Mig.create_view("foos_view", "SELECT * FROM foos") + Mig.create_view("foos_view", "SELECT * FROM foos", :replace => true) + Mig.create_view("foos_view", "SELECT * FROM foos", :temporary => true) + Mig.create_view("foos_view", "SELECT * FROM foos", :columns => %w{ hello world }) + ARBC.create_view( + { :baz => "foos_view" }, + "SELECT * FROM foos" + ) + + assert_equal([ + %{CREATE VIEW "foos_view" AS SELECT * FROM foos;}, + %{CREATE OR REPLACE VIEW "foos_view" AS SELECT * FROM foos;}, + %{CREATE TEMPORARY VIEW "foos_view" AS SELECT * FROM foos;}, + %{CREATE VIEW "foos_view" ("hello", "world") AS SELECT * FROM foos;}, + %{CREATE VIEW "baz"."foos_view" AS SELECT * FROM foos;} + ], statements) + end + + def test_drop_view + Mig.drop_view(:foos_view) + Mig.drop_view(:foos_view, :if_exists => true) + Mig.drop_view(:foos_view, :cascade => true) + + assert_equal([ + %{DROP VIEW "foos_view";}, + %{DROP VIEW IF EXISTS "foos_view";}, + %{DROP VIEW "foos_view" CASCADE;} + ], statements) + end + + def test_rename_view + Mig.rename_view(:foos_view, :bars_view) + ARBC.rename_view({ :baz => :foos_view }, :bars_view) + + ARBC.with_schema(:blort) do + Mig.rename_view(:foos_view, :bars_view) + end + + assert_equal([ + %{ALTER TABLE "foos_view" RENAME TO "bars_view";}, + %{ALTER TABLE "baz"."foos_view" RENAME TO "bars_view";}, + %{ALTER TABLE "blort"."foos_view" RENAME TO "bars_view";} + ], statements) + end + + def test_alter_view_owner + Mig.alter_view_owner(:foos, :joe) + + assert_equal([ + %{ALTER TABLE "foos" OWNER TO "joe";} + ], statements) + end + + def test_alter_view_schema + Mig.alter_view_schema(:foos, :bar) + + assert_equal([ + %{ALTER TABLE "foos" SET SCHEMA "bar";} + ], statements) + end +end +
Add some tests for VIEWS.
diff --git a/test/test_helper.rb b/test/test_helper.rb index abc1234..def5678 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -5,9 +5,7 @@ Coveralls.wear! if ENV['CI'] != 'true' SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter - SimpleCov.start do - add_filter '/test/' - end + SimpleCov.start end # require order ref. @@ -15,5 +13,3 @@ # ENV['CI'] != 'true" ref. # http://stackoverflow.com/questions/12983137/how-do-detect-if-travis-ci-or-not # http://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables -# add_filter '/test/' ref. -# https://github.com/colszowka/simplecov#string-filter
Revert "Reject "/test/" from the coverage metrics target" This reverts commit 0f4faf7fc995298cfd805ccef5913b0a040ae21b.
diff --git a/test/test_helper.rb b/test/test_helper.rb index abc1234..def5678 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -17,7 +17,7 @@ HasScope::Routes = ActionDispatch::Routing::RouteSet.new HasScope::Routes.draw do - get '/:controller(/:action(/:id))' + resources :trees, only: %i[index new edit show] end class ApplicationController < ActionController::Base
Declare specific routes to get rid of deprecation warning Dynamic :controller/:action route segments are deprecated in Rails: DEPRECATION WARNING: Using a dynamic :controller segment in a route is deprecated and will be removed in Rails 6.1. DEPRECATION WARNING: Using a dynamic :action segment in a route is deprecated and will be removed in Rails 6.1.
diff --git a/test/test_helper.rb b/test/test_helper.rb index abc1234..def5678 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,6 +1,9 @@ require 'factory_girl' require 'faker' require 'telegram_bot' + +# Fix deprecation message +ActiveSupport.test_order = :random # Load support files Dir[File.expand_path('../support/**/*.rb', __FILE__)].each { |f| require f }
Fix warning about an ActiveSupport's configuration deprecation.
diff --git a/test/test_helper.rb b/test/test_helper.rb index abc1234..def5678 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,9 +1,12 @@+require 'i18n' +I18n.available_locales = [:en, :pl] + require 'test/unit' require 'active_support' require 'active_support/test_case' -require 'active_record' require 'logger' +require 'easy_globalize3_accessors' # => globalize3 => active_record plugin_test_dir = File.dirname(__FILE__) @@ -12,6 +15,3 @@ ActiveRecord::Base.establish_connection("sqlite3mem") ActiveRecord::Migration.verbose = false load(File.join(plugin_test_dir, "db", "schema.rb")) - -require 'easy_globalize3_accessors' -I18n.available_locales = [:en, :pl]
Change order of things here and there
diff --git a/ruby/command-t/scanner/file_scanner/git_file_scanner.rb b/ruby/command-t/scanner/file_scanner/git_file_scanner.rb index abc1234..def5678 100644 --- a/ruby/command-t/scanner/file_scanner/git_file_scanner.rb +++ b/ruby/command-t/scanner/file_scanner/git_file_scanner.rb @@ -26,12 +26,12 @@ take(@max_files). to_a - # either git is not available, or this is not a git repository - # fall back to find - return super if stderr.gets - - all_files + # will fall back to find if not a git repository or there's an error + stderr.gets ? super : all_files end + rescue Errno::ENOENT => e + # git executable not present and executable + super ensure set_wild_ignore(@base_wild_ignore) end
Handle missing or unexecutable git binary We need to trap for `Errno::ENOENT` otherwise a missing or non-executable `git` binary will derails us. The `stderr` check is only good for times when we were able to actually launch the binary.
diff --git a/app/models/minute.rb b/app/models/minute.rb index abc1234..def5678 100644 --- a/app/models/minute.rb +++ b/app/models/minute.rb @@ -5,7 +5,7 @@ include Ofx::HtmlSanitizer before_validation :sanitize_textareas - validates :meeting, :presence => true, :inclusion => Rails.configuration.ofx[:meeting_type].keys + validates :meeting, :presence => true, :inclusion => Rails.configuration.ofx[:meeting_type].keys.map {|x| x.to_s} validates :date, :presence => true validates :members, :presence => true validates :minutes, :presence => true
Fix meeting type to validate against strings instead of symbols
diff --git a/app/models/person.rb b/app/models/person.rb index abc1234..def5678 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -1,11 +1,12 @@+# frozen_string_literal: true class Person < ActiveRecord::Base has_many :employments has_many :incomes belongs_to :grant - FULL_TIME_STUDENT = "Full-Time" - PART_TIME_STUDENT = "Part-Time" - STUDENT_STATUSES = [PART_TIME_STUDENT, FULL_TIME_STUDENT] + FULL_TIME_STUDENT = "Full-Time".freeze + PART_TIME_STUDENT = "Part-Time".freeze + STUDENT_STATUSES = [PART_TIME_STUDENT, FULL_TIME_STUDENT].freeze def current_earned_income incomes.select(&:current).reject(&:disabled).map(&:monthly_income).sum
Add freeze to string constants.
diff --git a/edo.gemspec b/edo.gemspec index abc1234..def5678 100644 --- a/edo.gemspec +++ b/edo.gemspec @@ -26,6 +26,6 @@ spec.add_dependency "rubocop" spec.add_dependency "brakeman" - spec.add_development_dependency "bundler", "~> 1.10" - spec.add_development_dependency "rake", "~> 10.0" + spec.add_development_dependency "bundler" + spec.add_development_dependency "rake" end
Remove Rake and Bundler versions from Gemspec
diff --git a/lib/anagram.rb b/lib/anagram.rb index abc1234..def5678 100644 --- a/lib/anagram.rb +++ b/lib/anagram.rb @@ -1,6 +1,6 @@ module Anagram - VERSION = "0.1.35".freeze + VERSION = "0.2.0".freeze end
Switch to version 0.2.0 due to major wlang change.
diff --git a/app/models/concerns/finances.rb b/app/models/concerns/finances.rb index abc1234..def5678 100644 --- a/app/models/concerns/finances.rb +++ b/app/models/concerns/finances.rb @@ -9,4 +9,10 @@ [types, percentages].transpose.to_h end + def total_percentages(data, income) + percentages = expenses.map { |d| ((d.amount.to_f/income.to_f)* 100).floor } + end + end + +Expense.total_percentages(@user.expenses, @user.income)
Add user expense percentage methods
diff --git a/settings.gemspec b/settings.gemspec index abc1234..def5678 100644 --- a/settings.gemspec +++ b/settings.gemspec @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = 'settings' - s.version = '0.0.1.5' + s.version = '0.1.0.0' s.summary = 'Settings data access and assignment' s.description = ' '
Package version is increased from 0.0.1.4 to 0.1.0.0 (Exception types are not backward compatible)
diff --git a/synvert-core.gemspec b/synvert-core.gemspec index abc1234..def5678 100644 --- a/synvert-core.gemspec +++ b/synvert-core.gemspec @@ -18,7 +18,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_runtime_dependency "parser", "~> 2.4.0" + spec.add_runtime_dependency "parser", "~> 2.5.0" spec.add_runtime_dependency "activesupport" spec.add_runtime_dependency "erubis"
Bump parser dependency to ~> 2.5
diff --git a/split-api.gemspec b/split-api.gemspec index abc1234..def5678 100644 --- a/split-api.gemspec +++ b/split-api.gemspec @@ -20,7 +20,7 @@ gem.add_dependency 'multi_json' gem.add_development_dependency 'bundler' - gem.add_development_dependency 'rspec', '~> 3.10.0' + gem.add_development_dependency 'rspec', '~> 3.11.0' gem.add_development_dependency 'rack-test', '~> 1.1' gem.add_development_dependency 'rake', '~> 13.0' end
Update rspec requirement from ~> 3.10.0 to ~> 3.11.0 Updates the requirements on [rspec](https://github.com/rspec/rspec-metagem) to permit the latest version. - [Release notes](https://github.com/rspec/rspec-metagem/releases) - [Commits](https://github.com/rspec/rspec-metagem/compare/v3.10.0...v3.11.0) --- updated-dependencies: - dependency-name: rspec dependency-type: direct:development ... Signed-off-by: dependabot[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@github.com>
diff --git a/custom_counter_cache.gemspec b/custom_counter_cache.gemspec index abc1234..def5678 100644 --- a/custom_counter_cache.gemspec +++ b/custom_counter_cache.gemspec @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- lib = File.expand_path('../lib/', __FILE__) $:.unshift lib unless $:.include?(lib) -require 'lib/custom_counter_cache/version' +require 'custom_counter_cache/version' spec = Gem::Specification.new do |s| s.name = 'custom_counter_cache' @@ -16,6 +16,8 @@ s.files = Dir['lib/**/*.rb'] s.required_rubygems_version = '>= 1.3.6' s.add_dependency('rails', '>= 2.3') + s.add_development_dependency('sqlite3-ruby') + s.add_development_dependency('debugger') s.test_files = Dir['test/**/*.rb'] s.rubyforge_project = 'custom_counter_cache' s.has_rdoc = true
Ruby19: Fix gemspec require, add dev dependencies
diff --git a/benchmarks/memory.rb b/benchmarks/memory.rb index abc1234..def5678 100644 --- a/benchmarks/memory.rb +++ b/benchmarks/memory.rb @@ -1,11 +1,11 @@ require 'bundler'; Bundler.setup -a = GC.stat(:total_allocated_object) +a = GC.stat(:total_allocated_objects) require 'readthis' -b = GC.stat(:total_allocated_object) +b = GC.stat(:total_allocated_objects) require 'redis-activesupport' -c = GC.stat(:total_allocated_object) +c = GC.stat(:total_allocated_objects) puts "readthis: #{b - a}" puts "redis-activesupport: #{c - b}"
Update GC.stats options for Ruby 2.2
diff --git a/spec/core/run_once_spec.rb b/spec/core/run_once_spec.rb index abc1234..def5678 100644 --- a/spec/core/run_once_spec.rb +++ b/spec/core/run_once_spec.rb @@ -15,7 +15,8 @@ @model.should_receive(:limit).and_return 1 @model.should_receive(:create_job_instance).and_return job_instance - @model.run_once :queue, job_clazz + future = @model.run_once :queue, job_clazz + future.get end context "when the specified job does not have a queue attribute" do
Add future invoke to wait for execution.
diff --git a/spec/fuzz/producer_spec.rb b/spec/fuzz/producer_spec.rb index abc1234..def5678 100644 --- a/spec/fuzz/producer_spec.rb +++ b/spec/fuzz/producer_spec.rb @@ -1,7 +1,7 @@ describe "Producing a lot of messages with an unreliable cluster", fuzz: true do let(:logger) { Logger.new(LOG) } let(:kafka) { Kafka.new(seed_brokers: KAFKA_BROKERS, client_id: "test", logger: logger) } - let(:producer) { kafka.get_producer(max_retries: 10, retry_backoff: 5) } + let(:producer) { kafka.get_producer(max_retries: 20, retry_backoff: 5) } before do require "test_cluster"
Allow the fuzz test even more retries
diff --git a/spec/receiver/pop3_spec.rb b/spec/receiver/pop3_spec.rb index abc1234..def5678 100644 --- a/spec/receiver/pop3_spec.rb +++ b/spec/receiver/pop3_spec.rb @@ -3,11 +3,9 @@ describe 'POP3 receiver' do before do - @connection = mock('POP3 Connection') - @connection.stub!(:start).and_return(true) @receiver_options = { :username => 'user', :password => 'pass', - :connection => @connection } + :connection => MockPOP3.new } @receiver = Mailman::Receiver::POP3.new(@receiver_options) end @@ -20,3 +18,9 @@ end end + +class MockPOP3 + def start(account, password) + return self if account == 'user' && password == 'pass' + end +end
Change how POP3 spec mocks
diff --git a/spec/spec_helper_system.rb b/spec/spec_helper_system.rb index abc1234..def5678 100644 --- a/spec/spec_helper_system.rb +++ b/spec/spec_helper_system.rb @@ -36,7 +36,6 @@ # Import in our local helpers c.include ::LocalHelpers - c.include RSpecSystemPuppet::Helpers # This is where we 'setup' the nodes before running our tests c.before :suite do
Remove redundant `include` call in system spec helper. `rspec-system-puppet` helpers are already included few lines above the deleted line, which by the way would have no effect anyway.
diff --git a/Casks/sketch-beta.rb b/Casks/sketch-beta.rb index abc1234..def5678 100644 --- a/Casks/sketch-beta.rb +++ b/Casks/sketch-beta.rb @@ -1,8 +1,8 @@ cask :v1 => 'sketch-beta' do version '3.3' - sha256 '275633effb38fa6e2d963efaa8a2fa9e614638fff67db89ab34acc1e7a469a8e' + sha256 '24324aa78755812667041afb99f5731c6c6f4d26d398b8e0ffaac7f7dc035d59' - url 'https://rink.hockeyapp.net/api/2/apps/0172d48cceec171249a8d850fb16276b/app_versions/69?format=zip&avtoken=845a800cbd0e14ef4030f826397e523b45ca8820' + url 'https://rink.hockeyapp.net/api/2/apps/0172d48cceec171249a8d850fb16276b/app_versions/76?format=zip&avtoken=52bdf01b70c97772a8ed003204ac0e34529a9bc6' homepage 'http://bohemiancoding.com/sketch/beta/' license :commercial
Update checksum and url for Sketch 3.3 Beta
diff --git a/spec/features/survey_create_spec.rb b/spec/features/survey_create_spec.rb index abc1234..def5678 100644 --- a/spec/features/survey_create_spec.rb +++ b/spec/features/survey_create_spec.rb @@ -3,24 +3,24 @@ feature 'User signs in' do given!(:user) { User.create(email: "mrpants666@example.com", password: "DevilPants") } - it "lets a user sign in" do - visit root_path - fill_in 'Email', with: user.email - fill_in 'Password', with: user.password - click_button 'Login' - friendly_string = "Hello #{user.email}!" - expect(page).to have_content friendly_string + context "When the credentials are good" do + it "lets a user sign in" do + visit root_path + fill_in 'Email', with: user.email + fill_in 'Password', with: user.password + click_button 'Login' + friendly_string = "Hello #{user.email}!" + expect(page).to have_content friendly_string + end end -end - -feature "Logging in with bad credentials says bad things" do - given!(:user) { User.create(email: "mrpants666@example.com", password: "DevilPants") } - it "does not let a user without a valid password sign in" do - visit root_path - fill_in 'Email', with: user.email - fill_in 'Password', with: "I love jellybeans!" - click_button 'Login' - expect(page).to have_content "die in a fire!" + context "When the password is bad" do + it "does not let a user without a valid password sign in" do + visit root_path + fill_in 'Email', with: user.email + fill_in 'Password', with: "I love jellybeans!" + click_button 'Login' + expect(page).to have_content "die in a fire!" + end end end
SurveyCreateSpec: Refactor to use contexts in feature
diff --git a/spec/helpers/locales_helper_spec.rb b/spec/helpers/locales_helper_spec.rb index abc1234..def5678 100644 --- a/spec/helpers/locales_helper_spec.rb +++ b/spec/helpers/locales_helper_spec.rb @@ -13,6 +13,7 @@ after do I18n.backend.reload! I18n.enforce_available_locales = default_enforce + I18n.backend.send(:init_translations) end it "returns the language name in i18n.language.name translation" do @@ -29,4 +30,4 @@ end end -end+end
Fix flaky spec for translations This spec was causing a side effect on another spec[2], making it fail 😌 I think it was because no translation had been called yet, in the failing spec, and so the the i18n backend translations had not been initialized, and was always returning empty translations for any locale. This might have been due to tampering with translations in the this newly introduced spec. By forcing translations to load after this new spec, the other spec passes again [2] https://github.com/AyuntamientoMadrid/consul/blob/master/spec/features/localization_spec.rb#L20
diff --git a/spec/unit/options_validator_spec.rb b/spec/unit/options_validator_spec.rb index abc1234..def5678 100644 --- a/spec/unit/options_validator_spec.rb +++ b/spec/unit/options_validator_spec.rb @@ -4,7 +4,7 @@ let(:klass) { Class.extend Loaf::OptionsValidator } it 'validates succesfully known option' do - expect(klass.valid?(crumb_length: 10)).to eq(true) + expect(klass.valid?(match: :exact)).to eq(true) end it 'validates unknown option with an error' do
Change test to include valid option
diff --git a/plugins/files/check-checksums.rb b/plugins/files/check-checksums.rb index abc1234..def5678 100644 --- a/plugins/files/check-checksums.rb +++ b/plugins/files/check-checksums.rb @@ -0,0 +1,58 @@+#!/usr/bin/env ruby +# +# Author: AJ Bourg <aj@ajbourg.com> +# +# Checks the checksums of files. + +require 'rubygems' if RUBY_VERSION < '1.9.0' +require 'sensu-plugin/check/cli' +require 'digest' + +class Checksum < Sensu::Plugin::Check::CLI + + option :files, + :description => "Comma separated list of files to check.", + :short => '-f FILES', + :long => '--files FILES', + :required => true + option :hash, + :description => "The hash these files must hash as. If unspecified the files will be compared to the first file.", + :short => '-h SHA2HASH', + :long => '--hash SHA2HASH' + option :warn_only, + :description => "Warn instead of critical if they don't match", + :short => '-w', + :long => '--warn-only', + :boolean => true + + def run + files = config[:files].split(',') + + if files.length == 1 and !config[:hash] + unknown "We have nothing to compare this file with." + end + + hash = config[:hash] || Digest::SHA2.file(files.first).hexdigest + + errors = [] + + files.each do |file| + if File.exists?(file) + file_hash = Digest::SHA2.file(file).hexdigest + + errors << "#{file} does not match" if file_hash != hash + else + errors << "#{file} does not exist" + end + end + + if errors.length > 0 and config[:warn_only] + warning errors.join("\n") + elsif errors.length > 0 + critical errors.join("\n") + else + ok "Files match." + end + end + +end
Add a checksum file check.
diff --git a/plugins/hosts/windows/cap/ssh.rb b/plugins/hosts/windows/cap/ssh.rb index abc1234..def5678 100644 --- a/plugins/hosts/windows/cap/ssh.rb +++ b/plugins/hosts/windows/cap/ssh.rb @@ -10,7 +10,7 @@ def self.set_ssh_key_permissions(env, key_path) script_path = Host.scripts_path.join("set_ssh_key_permissions.ps1") result = Vagrant::Util::PowerShell.execute( - script_path.to_s, key_path.to_s, + script_path.to_s, "-KeyPath", key_path.to_s, module_path: Host.modules_path.to_s ) if result.exit_code != 0
Include key path flag when calling script
diff --git a/db/migrate/20150715120003_alter_table_customer_partners.rb b/db/migrate/20150715120003_alter_table_customer_partners.rb index abc1234..def5678 100644 --- a/db/migrate/20150715120003_alter_table_customer_partners.rb +++ b/db/migrate/20150715120003_alter_table_customer_partners.rb @@ -1,8 +1,11 @@ class AlterTableCustomerPartners < ActiveRecord::Migration def up - add_column :customers, :enable_tomtom, :boolean, default: false, null: false - add_column :customers, :enable_masternaut, :boolean, default: false, null: false - add_column :customers, :enable_alyacom, :boolean, default: false, null: false + add_column :customers, :enable_tomtom, :boolean, default: true, null: false + add_column :customers, :enable_masternaut, :boolean, default: true, null: false + add_column :customers, :enable_alyacom, :boolean, default: true, null: false + change_column_default(:customers, :enable_tomtom, false) + change_column_default(:customers, :enable_masternaut, false) + change_column_default(:customers, :enable_alyacom, false) end def down
Change default value for enabling partners on existing customers
diff --git a/lib/active_hash.rb b/lib/active_hash.rb index abc1234..def5678 100644 --- a/lib/active_hash.rb +++ b/lib/active_hash.rb @@ -1,4 +1,4 @@-require 'activesupport' +require 'active_support' require 'active_hash/base' require 'active_file/base' require 'active_yaml/base'
Fix 'activesupport' deprecation warning in require
diff --git a/jara.gemspec b/jara.gemspec index abc1234..def5678 100644 --- a/jara.gemspec +++ b/jara.gemspec @@ -15,7 +15,7 @@ s.summary = %q{Builds and publishes JAR artifacts} s.description = %q{Build self-contained JAR artifacts and publish them to S3} - s.files = Dir['lib/**/*.rb', 'README.md', 'LICENSE.txt', '.yardopts'] + s.files = Dir['bin/*', 'lib/**/*.rb', 'README.md', 'LICENSE.txt', '.yardopts'] s.require_paths = %w(lib) s.bindir = 'bin' s.default_executable = s.name
Add binfiles to the gem This is required to make the jara command work, obviously.
diff --git a/ebayapi.gemspec b/ebayapi.gemspec index abc1234..def5678 100644 --- a/ebayapi.gemspec +++ b/ebayapi.gemspec @@ -21,5 +21,5 @@ s.add_dependency("xml-simple", ["~> 1.0.11"]) s.add_dependency("xml-mapping", ["~> 0.8.1"]) s.add_dependency("libxml-ruby", ["~> 1.1.4"]) - s.add_dependency("money", ["~> 1.7.1"]) + s.add_dependency("money", ["~> 3"]) end
Use a newer version of Money
diff --git a/tiny_tds.gemspec b/tiny_tds.gemspec index abc1234..def5678 100644 --- a/tiny_tds.gemspec +++ b/tiny_tds.gemspec @@ -3,8 +3,8 @@ s.require_paths = ['lib'] s.rubygems_version = '1.3.7' s.name = 'tiny_tds' - s.summary = 'TinyTds - A modern, simple and fast FreeTDS library for Ruby using DB-Library.' - s.description = 'TinyTds - A modern, simple and fast FreeTDS library for Ruby using DB-Library. Developed for the ActiveRecord SQL Server adapter.' + s.summary = 'TinyTDS - A modern, simple and fast FreeTDS library for Ruby using DB-Library.' + s.description = 'TinyTDS - A modern, simple and fast FreeTDS library for Ruby using DB-Library. Developed for the ActiveRecord SQL Server adapter.' s.homepage = 'http://github.com/rails-sqlserver/tiny_tds' s.rdoc_options = ['--charset=UTF-8'] s.version = '0.3.2'
Update spec file with our consistent marketing name - TinyTDS vs TinyTds.
diff --git a/PKAnimations.podspec b/PKAnimations.podspec index abc1234..def5678 100644 --- a/PKAnimations.podspec +++ b/PKAnimations.podspec @@ -11,4 +11,6 @@ s.source_files = 'PKAnimations/**/*.{h,m}' s.requires_arc = true s.dependency 'MGCommand', '0.1.1' + + s.ios.frameworks = 'QuartzCore' end
Add QuartzCore as dependency in Podspec
diff --git a/tools/merge_c.rb b/tools/merge_c.rb index abc1234..def5678 100644 --- a/tools/merge_c.rb +++ b/tools/merge_c.rb @@ -12,7 +12,9 @@ if used[fn] '' else - used[fn] = true + if name != 'keyword.h' + used[fn] = true + end nc = File.read(fn) merge(nc, used) end
Allow including keyword.h multiple times
diff --git a/spec/acceptance/real_time_updates_spec.rb b/spec/acceptance/real_time_updates_spec.rb index abc1234..def5678 100644 --- a/spec/acceptance/real_time_updates_spec.rb +++ b/spec/acceptance/real_time_updates_spec.rb @@ -5,7 +5,7 @@ product = Product.create! :name => "Widget \u0000" expect(Product.search.first).to eq(product) - end + end unless ENV['DATABASE'] == 'postgresql' it "handles attributes for sortable fields accordingly" do product = Product.create! :name => 'Red Fish'
Disable null character check for PostgreSQL. Seems pg updates don't allow such strings in the database. Fine by me.
diff --git a/spec/project_spec.rb b/spec/project_spec.rb index abc1234..def5678 100644 --- a/spec/project_spec.rb +++ b/spec/project_spec.rb @@ -11,17 +11,14 @@ end end - describe 'source codes', broken: true do + describe 'source codes' do before { $stdout = StringIO.new } after { $stdout = STDOUT } it 'has no violations' do # Need to pass an empty array explicitly # so that the CLI does not refer arguments of `rspec` - Rubocop::CLI.new.run([]) - expect($stdout.string).to match( - /files inspected, no offences detected\n/ - ) + expect(Rubocop::CLI.new.run([])).to eq(0) end end end
Enable self-check of code style
diff --git a/config/software/cabal-update.rb b/config/software/cabal-update.rb index abc1234..def5678 100644 --- a/config/software/cabal-update.rb +++ b/config/software/cabal-update.rb @@ -1,8 +1,6 @@ name "cabal-update" build do - # clean out any previous installation details - command "rm -rf ~/.cabal ~/.ghc" # pull in latest package db - command "/usr/bin/cabal update" + command "#{install_dir}/embedded/bin/cabal update" end
Remove cleanup commands; Use installed cabal path
diff --git a/lib/mock_inhalt.rb b/lib/mock_inhalt.rb index abc1234..def5678 100644 --- a/lib/mock_inhalt.rb +++ b/lib/mock_inhalt.rb @@ -1,11 +1,10 @@ require 'sinatra/base' class MockInhalt < Sinatra::Base + set :port, 8080 + get '/' do 'Hello MockInhalt!' end - - # start the server if ruby file executed directly - run! if app_file == $0 end
Set 8080 as default listening port and removed the call to 'run'.
diff --git a/app/models/gem_typo.rb b/app/models/gem_typo.rb index abc1234..def5678 100644 --- a/app/models/gem_typo.rb +++ b/app/models/gem_typo.rb @@ -12,7 +12,7 @@ return false if published_exact_name_matches.any? - match = matched_protected_gem_names.select(:id, :name).first + match = matched_protected_gem_names.select(:name).first return false unless match @protected_gem = match.name
Remove unused id select, not used in existing code
diff --git a/lib/mini_readline/raw_term/windows/win_32_api.rb b/lib/mini_readline/raw_term/windows/win_32_api.rb index abc1234..def5678 100644 --- a/lib/mini_readline/raw_term/windows/win_32_api.rb +++ b/lib/mini_readline/raw_term/windows/win_32_api.rb @@ -3,9 +3,9 @@ #* windows/win_32_api.rb - Support for selected low level Win32 API entry points. module MiniReadline - require 'fiddle' + require 'dl' - #The classic \Win32API gem is deprecated, so we emulate it with fiddle. + #The classic \Win32API gem is deprecated, so we emulate it with DL. class Win32API #Use standard calling conventions @@ -23,7 +23,7 @@ def initialize(dllname, func, import) @proto = import.join.tr("VPpNnLlIi", "0SSI").chomp('0').split('') - handle = DLL[dllname] ||= Fiddle.dlopen(dllname) + handle = DLL[dllname] ||= DL.dlopen(dllname) @func = Fiddle::Function.new(handle[func], TYPES.values_at(*@proto), STDCALL) end
Replace fiddle with DL to avoid compatibility issues with older rubies.
diff --git a/app/graphql/livelog_schema.rb b/app/graphql/livelog_schema.rb index abc1234..def5678 100644 --- a/app/graphql/livelog_schema.rb +++ b/app/graphql/livelog_schema.rb @@ -1,5 +1,5 @@ class LiveLogSchema < GraphQL::Schema - mutation(Types::MutationType) + # mutation(Types::MutationType) query(Types::QueryType) context_class CustomContext
Remove MutationType from LiveLogSchema temporally
diff --git a/app/helpers/profile_helper.rb b/app/helpers/profile_helper.rb index abc1234..def5678 100644 --- a/app/helpers/profile_helper.rb +++ b/app/helpers/profile_helper.rb @@ -4,7 +4,7 @@ end def cancel_edit_profile_button - link_to t(:cancel), :user, class: 'btn btn-secondary' if current_user.profile_completed? + link_to t(:cancel), :user, class: 'btn btn-outline-complementary' if current_user.profile_completed? end def save_edit_profile_button(form)
Change cancel button style from secondary to complementary-outline
diff --git a/Casks/mamp.rb b/Casks/mamp.rb index abc1234..def5678 100644 --- a/Casks/mamp.rb +++ b/Casks/mamp.rb @@ -1,6 +1,6 @@ class Mamp < Cask - version '3.0.7.1' - sha256 'ec80adf7ed676de48c712d08918bcbf45e340bde6d9e0510b72c22565465b90b' + version '3.0.7.2' + sha256 'a6e72143efa73eb919efeb0e9dc0089e291204676da37e9508ac53c2f51f8878' url "http://downloads4.mamp.info/MAMP-PRO/releases/#{version}/MAMP_MAMP_PRO_#{version}.pkg" homepage 'http://www.mamp.info/en/index.html'
Upgrade Mamp Pro to 3.0.7.2
diff --git a/fluent-plugin-elasticsearch.gemspec b/fluent-plugin-elasticsearch.gemspec index abc1234..def5678 100644 --- a/fluent-plugin-elasticsearch.gemspec +++ b/fluent-plugin-elasticsearch.gemspec @@ -18,7 +18,7 @@ s.add_runtime_dependency 'fluentd', '~> 0' s.add_runtime_dependency 'patron', '~> 0' - s.add_runtime_dependency 'elasticsearch', '~> 0' + s.add_runtime_dependency 'elasticsearch', '>= 0' s.add_development_dependency 'rake', '~> 0' s.add_development_dependency 'webmock', '~> 1'
Add support Elasticsearch 1.x version of gem
diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index abc1234..def5678 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -1,5 +1,6 @@ class WelcomeController < ApplicationController - etag { can? :manage, Entity } # Don't cache admin content together with the rest + etag { current_user } # Pages vary depending on whether user is logged on + etag { can? :manage, Entity } # Pages seen as admin may look different def index # Highlight manually curated articles in the frontpage @@ -19,10 +20,9 @@ @photos = (can? :manage, Photo) ? Photo.all : Photo.published @photos = @photos.order("updated_at DESC").limit(6) - # FIXME: Should check published_at of both topics and posts. But make it so the - # web doesn't break if there're none of them. - fresh_when last_modified: [#@highlights.maximum(:published_at), - @posts.maximum(:published_at), - @photos.maximum(:updated_at)].max + # FIXME: Should check that web doesn't break if there're none of them, i.e. without seed data. + fresh_when etag: [ @highlights, + @posts, + @photos] end end
Use etag instead of last-modified when checking fresh_when
diff --git a/spec/search_builder/sufia/my_shares_search_builder_spec.rb b/spec/search_builder/sufia/my_shares_search_builder_spec.rb index abc1234..def5678 100644 --- a/spec/search_builder/sufia/my_shares_search_builder_spec.rb +++ b/spec/search_builder/sufia/my_shares_search_builder_spec.rb @@ -23,7 +23,7 @@ it "filters things we have access to in which we are not the depositor" do expect(subject).to eq ["access_filter1 OR access_filter2", - "{!terms f=has_model_ssim}GenericWork,Collection", + "{!terms f=has_model_ssim}GenericWork,Atlas,Collection", "-suppressed_bsi:true", "-depositor"] end
Update test to expect multiple concerns
diff --git a/app/helpers/blog/pagination_helper.rb b/app/helpers/blog/pagination_helper.rb index abc1234..def5678 100644 --- a/app/helpers/blog/pagination_helper.rb +++ b/app/helpers/blog/pagination_helper.rb @@ -13,7 +13,7 @@ protected def url(page) - path = current_path + path = @template.request.path if page == 1 path = path.sub(PAGE_PARAMETER, "") @@ -25,17 +25,8 @@ Wheelhouse::PathUtils.normalize_path(path) end + alias url_for url - - def current_path - request = @template.request - - if request.respond_to?(:original_fullpath) - request.original_fullpath.sub(/\?#{request.query_string}$/, "") - else - request.path - end - end end DEFAULTS = {
Revert "Fix pagination paths in Rails 4.2" This reverts commit a920fdb615171394f24a26d9be23eeda5cf421b1.
diff --git a/lib/boned.rb b/lib/boned.rb index abc1234..def5678 100644 --- a/lib/boned.rb +++ b/lib/boned.rb @@ -9,7 +9,7 @@ $:.unshift a } -class Boned +module Boned module VERSION def self.to_s load_config @@ -27,7 +27,7 @@ require 'bone' module Boned - Bone.source = 'redis://root@localhost:6379' + Bone.source = 'redis://root@localhost:8045' #Bone.debug = true end
Use Redis on port 8045
diff --git a/lib/chest.rb b/lib/chest.rb index abc1234..def5678 100644 --- a/lib/chest.rb +++ b/lib/chest.rb @@ -1,6 +1,6 @@ module Chest PLUGINS_FOLDER = File.expand_path('~/Library/Containers/com.bohemiancoding.sketch3/Data/Library/Application Support/com.bohemiancoding.sketch3/Plugins') - MANIFEST_PATH = File.join(PLUGINS_FOLDER, 'plugins.json') + MANIFEST_PATH = File.join(PLUGINS_FOLDER, '.manifest.json') end require 'chest/version'
Rename manifest file to .manifest.json
diff --git a/tasks/native.rake b/tasks/native.rake index abc1234..def5678 100644 --- a/tasks/native.rake +++ b/tasks/native.rake @@ -4,8 +4,8 @@ # NOTE: version used by cross compilation of Windows native extension # It do not affect compilation under other operating systems # The version indicated is the minimum DLL suggested for correct functionality -BINARY_VERSION = "3.7.11" -URL_VERSION = "3071100" +BINARY_VERSION = "3.7.13" +URL_VERSION = "3071300" # build sqlite3_native C extension Rake::ExtensionTask.new('sqlite3_native', HOE.spec) do |ext|
Update SQLite port to 3.7.13
diff --git a/hebruby.gemspec b/hebruby.gemspec index abc1234..def5678 100644 --- a/hebruby.gemspec +++ b/hebruby.gemspec @@ -1,11 +1,11 @@ Gem::Specification.new do |s| s.name = 'hebruby' - s.version = '2.1.0' - s.date = '2016-05-20' + s.version = '2.1.1' + s.date = '2018-04-01' s.summary = "Convert Hebrew dates to/from Julian dates" s.description = "Convert Hebrew dates to/from Julian dates" s.authors = ["Ron Evans"] - s.email = 'nick@quaran.to' + s.email = 'ron@hybridgroup.com' s.files = ["lib/hebruby.rb"] s.homepage = 'http://rubygems.org/gems/hebruby'
Update gemspec file for v2.1.1 release Signed-off-by: Ron Evans <b937b287f61b7a223d4aac55072db1a5381d3bb3@hybridgroup.com>
diff --git a/hubtime.gemspec b/hubtime.gemspec index abc1234..def5678 100644 --- a/hubtime.gemspec +++ b/hubtime.gemspec @@ -17,7 +17,7 @@ s.files = `git ls-files`.split("\n") s.require_paths = ["lib"] - s.add_dependency("active_support", "~> 3.0") + s.add_dependency("activesupport", "~> 3.0") s.add_dependency("commander", "~> 4.1") s.add_dependency("i18n", "~> 0.6") s.add_dependency("tzinfo", "~> 0.3")
Use correct spelling of activesupport This allows updating to newer versions of activesupport than 3.0.0.
diff --git a/test/test_post.rb b/test/test_post.rb index abc1234..def5678 100644 --- a/test/test_post.rb +++ b/test/test_post.rb @@ -6,7 +6,7 @@ describe 'Post' do subject do - filename = Tilt.new(File.join(__dir__, 'templates', "#{filename}.erb")) + filename = '2015-01-01-a-post.markdown' path = File.join(test_site.source_paths[:posts], filename) Dimples::Post.new(test_site, path) end
Undo the damage writing code at stupid o'clock will do.
diff --git a/lib/ripl.rb b/lib/ripl.rb index abc1234..def5678 100644 --- a/lib/ripl.rb +++ b/lib/ripl.rb @@ -4,6 +4,7 @@ end def self.start(*args); Runner.start(*args); end + def self.started?; instance_variable_defined? :@shell; end def self.plugins file = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
Add Ripl.started?, idea from @janlelis
diff --git a/lib/tweet.rb b/lib/tweet.rb index abc1234..def5678 100644 --- a/lib/tweet.rb +++ b/lib/tweet.rb @@ -2,7 +2,7 @@ class Tweet def palindrome?(min_length) essence = to_essence - essence == essence.reverse && essence.length >= min_length + essence.length >= min_length && essence == essence.reverse end private
Check for length first in palindrome?
diff --git a/cuba-template-generator.gemspec b/cuba-template-generator.gemspec index abc1234..def5678 100644 --- a/cuba-template-generator.gemspec +++ b/cuba-template-generator.gemspec @@ -22,5 +22,5 @@ spec.add_development_dependency 'rake', '~> 10.0' spec.add_development_dependency 'rspec', '~> 3.1.0' spec.add_dependency 'cuba', '~> 3.4.0' - spec.add_runtime_dependency 'commander', '~> 4.3.0' + spec.add_runtime_dependency 'commander', '~> 4.4.0' end
Update gemspec dependency commander to ~> 4.4.0
diff --git a/spec/dummy/app/controllers/content_controller.rb b/spec/dummy/app/controllers/content_controller.rb index abc1234..def5678 100644 --- a/spec/dummy/app/controllers/content_controller.rb +++ b/spec/dummy/app/controllers/content_controller.rb @@ -1,10 +1,14 @@ class ContentController < ApplicationController around_filter :track_user - def home + def index end def post + redirect_to root_path + end + + def put redirect_to root_path end
Add put and index actions
diff --git a/spec/features/delayed/cancel_delayed_job_spec.rb b/spec/features/delayed/cancel_delayed_job_spec.rb index abc1234..def5678 100644 --- a/spec/features/delayed/cancel_delayed_job_spec.rb +++ b/spec/features/delayed/cancel_delayed_job_spec.rb @@ -0,0 +1,36 @@+require 'rails_helper' + +feature 'cancelling a delayed job' do + + let(:some_time_in_the_future) { Time.now + 3600 } + + scenario 'cancelling the job from the search page' do + given_there_is_a_delayed_job + when_i_search_for_the_delayed_job + and_i_cancel_the_job + then_i_should_be_on_the_delayed_job_page + and_the_job_should_not_be_present_on_the_page + end + + def given_there_is_a_delayed_job + Resque.enqueue_at(some_time_in_the_future, SomeIvarJob) + end + + def and_i_cancel_the_job + click_button 'Cancel' + end + + def when_i_search_for_the_delayed_job + visit resque_scheduler_engine_routes.delayed_path + fill_in 'search', with: 'some' + click_button 'Search' + end + + def then_i_should_be_on_the_delayed_job_page + expect(current_path).to eq resque_scheduler_engine_routes.delayed_path + end + + def and_the_job_should_not_be_present_on_the_page + expect(page).to_not have_content 'SomeIvarJob' + end +end
Test for cancelling a delayed job from the search page
diff --git a/Formula/jiratools.rb b/Formula/jiratools.rb index abc1234..def5678 100644 --- a/Formula/jiratools.rb +++ b/Formula/jiratools.rb @@ -3,7 +3,7 @@ class Jiratools < Formula desc "Collection of command-line tool(s) for Jira." homepage "https://github.com/lottadot/jiratools" - url "https://github.com/lottadot/jiratools/archive/0.3.2.tar.gz" + url "https://github.com/lottadot/jiratools/archive/0.3.3.tar.gz" version "0.3.3" # shasum -a 256 sha256 "e0d9a9a347386b4c1861d37556d532e9fa10c2a82bf4e1858408331f08808c04"
Fix for Jiratools 0.3.3 filename/SHA
diff --git a/Formula/proctools.rb b/Formula/proctools.rb index abc1234..def5678 100644 --- a/Formula/proctools.rb +++ b/Formula/proctools.rb @@ -0,0 +1,29 @@+require 'brewkit' + +class Proctools <Formula + @version='0.4pre1' + @url='http://downloads.sourceforge.net/project/proctools/proctools/0.4pre1/proctools-0.4pre1.tar.gz' + @homepage='http://sourceforge.net/projects/proctools' + @md5='714e4350749c680a7806635632d524b1' + + def patches + { :p0 => ["patch-pfind-Makefile.diff", + "patch-pfind-pfind.c.diff", + "patch-pgrep-Makefile.diff", + "patch-pkill-Makefile.diff", + "patch-proctools-fmt.c.diff", + "patch-proctools-proctools.c.diff", + "patch-proctools-proctools.h.diff", + ].map { |file_name| "http://svn.macports.org/repository/macports/trunk/dports/sysutils/proctools/files/#{file_name}" } + } + end + + def install + system "bsdmake" + + ["pgrep/pgrep", "pkill/pkill", "pfind/pfind"].each do |prog| + bin.install prog + man1.install prog + ".1" + end + end +end
Add a formula for pgrep/pfind/pkill.
diff --git a/test/fixtures/cookbooks/test/recipes/instance.rb b/test/fixtures/cookbooks/test/recipes/instance.rb index abc1234..def5678 100644 --- a/test/fixtures/cookbooks/test/recipes/instance.rb +++ b/test/fixtures/cookbooks/test/recipes/instance.rb @@ -1,5 +1,6 @@ memcached_instance 'web_cache' do port 11_212 + udp_port 11_212 memory 64 action [:start, :enable] end @@ -8,6 +9,7 @@ memcached_instance 'backend_cache' do port 11_213 + udp_port 11_213 memory 64 ulimit 31_337 threads 10 @@ -17,6 +19,7 @@ memcached_instance_sysv_init 'painful_cache' do port 11_214 + udp_port 11_214 memory 64 ulimit 31_337 threads 10
Set the ports in the test recipe
diff --git a/steam-condenser.gemspec b/steam-condenser.gemspec index abc1234..def5678 100644 --- a/steam-condenser.gemspec +++ b/steam-condenser.gemspec @@ -15,7 +15,7 @@ s.add_dependency 'multi_xml', '~> 0.5.2' s.add_development_dependency 'mocha', '~> 0.13.0' - s.add_development_dependency 'rake', '~> 10.0.1' + s.add_development_dependency 'rake', '~> 10.1.0' s.add_development_dependency 'shoulda-context', '~> 1.1.1' s.add_development_dependency 'yard', '~> 0.8.0'
Update rake dependency to 10.1.0
diff --git a/lib/dimples/configuration.rb b/lib/dimples/configuration.rb index abc1234..def5678 100644 --- a/lib/dimples/configuration.rb +++ b/lib/dimples/configuration.rb @@ -11,9 +11,9 @@ generation: default_generation, paths: default_paths, layouts: default_layouts, + pagination: default_pagination, date_formats: default_date_formats, - feed_formats: default_feed_formats, - pagination: default_pagination + feed_formats: default_feed_formats } end @@ -21,7 +21,7 @@ { categories: true, - post_feed: true, + main_feed: true, category_feeds: true, archive_feeds: true, @@ -58,7 +58,7 @@ end def self.default_feed_formats - %w[atom json] + ['atom'] end def self.default_pagination
Rename post_feed to main_feed, and remove the json feed format
diff --git a/config/initializers/sentry.rb b/config/initializers/sentry.rb index abc1234..def5678 100644 --- a/config/initializers/sentry.rb +++ b/config/initializers/sentry.rb @@ -6,4 +6,6 @@ config.sanitize_fields = Rails.application.config.filter_parameters.map(&:to_s) + + config.processors -= [Raven::Processor::PostData] end
Include POST data with Sentry reports No data POSTed to ETEngine contains user information, and is required to accurately reproduce errors which occur during scenario updates.
diff --git a/lib/activity.rb b/lib/activity.rb index abc1234..def5678 100644 --- a/lib/activity.rb +++ b/lib/activity.rb @@ -4,7 +4,7 @@ } named_scope :by_action, lambda { |action| - { :conditions => { :action => action }} + { :conditions => { :action => action.to_s }} } named_scope :by_item, lambda { |item| @@ -35,7 +35,7 @@ def self.report(user, action, object=nil) returning Activity.new do |a| a.item = object if object - a.action = action + a.action = action.to_s a.user = user a.save! end
Use simple strings instead of symbols for the action
diff --git a/features/support/env.rb b/features/support/env.rb index abc1234..def5678 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -49,5 +49,3 @@ World do FakeUserEnvironment.new end - -ENV['THOR_DEBUG'] = '1' # To raise an exception as is.
Revert THOR_DEBUG to the default for proper tests
diff --git a/features/support/env.rb b/features/support/env.rb index abc1234..def5678 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -13,7 +13,7 @@ if ENV['CI'] require 'knapsack' - Knapsack::Adapters::RSpecAdapter.bind + Knapsack::Adapters::SpinachAdapter.bind end %w(select2_helper test_env repo_helpers).each do |f|
Fix Knapsack report generation for Spinach
diff --git a/lib/govuk_template/engine.rb b/lib/govuk_template/engine.rb index abc1234..def5678 100644 --- a/lib/govuk_template/engine.rb +++ b/lib/govuk_template/engine.rb @@ -2,11 +2,20 @@ class Engine < ::Rails::Engine initializer "govuk_template.assets.precompile" do |app| app.config.assets.precompile += %w( + favicon.ico govuk-template*.css fonts*.css govuk-template.js ie.js vendor/goog/webfont-debug.js + apple-touch-icon-120x120.png + apple-touch-icon-152x152.png + apple-touch-icon-60x60.png + apple-touch-icon-76x76.png + favicon.ico + gov.uk_logotype_crown_invert.png + gov.uk_logotype_crown_invert_trans.png + opengraph-image.png ) end end
Add static files to `assets.precompile` This avoids errors in apps using sprockets-rails > 3
diff --git a/lib/mongoff/pretty_errors.rb b/lib/mongoff/pretty_errors.rb index abc1234..def5678 100644 --- a/lib/mongoff/pretty_errors.rb +++ b/lib/mongoff/pretty_errors.rb @@ -1,7 +1,8 @@ module Mongoff module PrettyErrors - def pretty_errors(record) + def pretty_errors(record, stack = Set.new) return {} unless record + stack << record errors = record.errors.messages.dup.with_indifferent_access if errors.key?(:base) && !property?(:base) errors[:'$'] = errors.delete(:base) @@ -16,17 +17,22 @@ end if (associations[name.to_s] || associations[name.to_sym]).many? record.send(name).each_with_index do |associated, index| - next unless (associated_errors = model.pretty_errors(associated)).present? + next if stack.include?(associated) + next unless (associated_errors = model.pretty_errors(associated, stack)).present? errors[name][index] = associated_errors end else - association_errors = model.pretty_errors(record.send(name)) - if association_errors.present? - errors[name].merge!(association_errors) + associated = record.send(name) + unless stack.include?(associated) + association_errors = model.pretty_errors(associated, stack) + if association_errors.present? + errors[name].merge!(association_errors) + end end end errors.delete(name) if errors[name].blank? end + stack.delete(record) errors end end
Fix | Recursive pretty errors
diff --git a/lib/photomosaic/color/rgb.rb b/lib/photomosaic/color/rgb.rb index abc1234..def5678 100644 --- a/lib/photomosaic/color/rgb.rb +++ b/lib/photomosaic/color/rgb.rb @@ -9,11 +9,11 @@ end def max - @max ||= [@red, @green, @blue].max.to_f + @max ||= [@red, @green, @blue].max end def min - @min ||= [@red, @green, @blue].min.to_f + @min ||= [@red, @green, @blue].min end def to_hsv @@ -36,23 +36,23 @@ return -1 if max == min _hue = case max - when @red.to_f - ((@green - @blue) / (max - min)) % 6 - when @green.to_f - (@blue - @red) / (max - min) + 2 + when @red + ((@green - @blue).to_f / (max - min)) % 6 + when @green + (@blue - @red).to_f / (max - min) + 2 else - (@red - @green) / (max - min) + 4 + (@red - @green).to_f / (max - min) + 4 end (_hue * 60).to_i end def saturation - (max - min) / max * 100 + (max - min).to_f / max * 100 end def value - max * 100 / 256 + (max * 100).to_f / 256 end end end
Set maximun and minimum values of RGB by integer
diff --git a/test/i18n_test.rb b/test/i18n_test.rb index abc1234..def5678 100644 --- a/test/i18n_test.rb +++ b/test/i18n_test.rb @@ -0,0 +1,13 @@+# frozen_string_literal: true + +require 'i18n/tasks' + +class I18nTest < Minitest::Test + def test_does_not_have_unused_keys + unused_keys = I18n::Tasks::BaseTask.new.unused_keys + msg = "#{unused_keys.leaves.count} unused i18n keys, run " \ + '`i18n-tasks unused` to show them' + + assert_empty unused_keys, msg + end +end
Add a test to prevent unused i18n keys