# HG changeset patch # User Michael Granger # Date 1583346299 28800 # Wed Mar 04 10:24:59 2020 -0800 # Node ID 724372c5f5bf2e86607302174f908c936b8994a1 # Parent 8a9eccfb01333b3ba63b87e9a36fe8f5729bf2e5 Use frozen string literals diff --git a/.hgignore b/.hgignore --- a/.hgignore +++ b/.hgignore @@ -6,3 +6,4 @@ ^\.rbx/ \.rbx/ \.lock$ +^spec/\.status$ diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -3,11 +3,14 @@ home : https://hg.sr.ht/~ged/Schedulability +code +: https://hg.sr.ht/~ged/Schedulability + docs -: http://deveiate.org/code/schedulability +: https://deveiate.org/code/schedulability github -: http://github.com/ged/schedulability +: https://github.com/ged/schedulability ## Description diff --git a/lib/schedulability.rb b/lib/schedulability.rb --- a/lib/schedulability.rb +++ b/lib/schedulability.rb @@ -1,6 +1,6 @@ # -*- ruby -*- +# frozen_string_literal: true # vim: set nosta noet ts=4 sw=4: -# encoding: utf-8 require 'loggability' diff --git a/lib/schedulability/exceptions.rb b/lib/schedulability/exceptions.rb --- a/lib/schedulability/exceptions.rb +++ b/lib/schedulability/exceptions.rb @@ -1,5 +1,5 @@ # -*- ruby -*- -#encoding: utf-8 +# frozen_string_literal: true require 'schedulability' unless defined?( Schedulability ) diff --git a/lib/schedulability/parser.rb b/lib/schedulability/parser.rb --- a/lib/schedulability/parser.rb +++ b/lib/schedulability/parser.rb @@ -1,5 +1,5 @@ # -*- ruby -*- -#encoding: utf-8 +# frozen_string_literal: true require 'loggability' require 'schedulability' unless defined?( Schedulability ) @@ -62,7 +62,7 @@ periods.each do |period| period_string = [] period.sort_by{|k, v| k}.each do |scale, ranges| - range_string = "" + range_string = String.new( encoding: 'utf-8' ) range_string << "%s { " % [ scale.to_s ] range_strings = ranges.each_with_object( [] ).each do |range, acc| diff --git a/lib/schedulability/schedule.rb b/lib/schedulability/schedule.rb --- a/lib/schedulability/schedule.rb +++ b/lib/schedulability/schedule.rb @@ -1,5 +1,5 @@ # -*- ruby -*- -#encoding: utf-8 +# frozen_string_literal: true require 'strscan' diff --git a/spec/helpers.rb b/spec/helpers.rb --- a/spec/helpers.rb +++ b/spec/helpers.rb @@ -1,6 +1,6 @@ #!/usr/bin/env ruby # vim: set nosta noet ts=4 sw=4: -# encoding: utf-8 +# frozen_string_literal: true BEGIN { require 'pathname' @@ -31,17 +31,20 @@ ### Mock with RSpec RSpec.configure do |config| - config.run_all_when_everything_filtered = true - config.filter_run :focus - config.order = 'random' - config.warnings = true config.mock_with( :rspec ) do |mock| mock.syntax = :expect end + config.disable_monkey_patching! + config.example_status_persistence_file_path = "spec/.status" + config.filter_run :focus + config.filter_run_when_matching :focus + config.order = :random + config.profile_examples = 5 + config.run_all_when_everything_filtered = true + config.shared_context_metadata_behavior = :apply_to_host_groups config.warnings = true - config.profile_examples = 5 config.include( Loggability::SpecHelpers ) config.include( Schedulability::SpecHelpers ) diff --git a/spec/schedulability/parser_spec.rb b/spec/schedulability/parser_spec.rb --- a/spec/schedulability/parser_spec.rb +++ b/spec/schedulability/parser_spec.rb @@ -5,7 +5,7 @@ require 'schedulability/parser' -describe Schedulability::Parser do +RSpec.describe Schedulability::Parser do it "can parse a single time period structure from a string" do diff --git a/spec/schedulability/schedule_spec.rb b/spec/schedulability/schedule_spec.rb --- a/spec/schedulability/schedule_spec.rb +++ b/spec/schedulability/schedule_spec.rb @@ -7,7 +7,7 @@ require 'schedulability/schedule' -describe Schedulability::Schedule do +RSpec.describe Schedulability::Schedule do before( :all ) do @actual_zone = ENV['TZ'] diff --git a/spec/schedulability_spec.rb b/spec/schedulability_spec.rb --- a/spec/schedulability_spec.rb +++ b/spec/schedulability_spec.rb @@ -7,7 +7,9 @@ require 'schedulability' -describe Schedulability do +RSpec.describe Schedulability do + + # This is just a namespace so there isn't anything to test end