From 964be55d760013095dfee90243b0cebb9955267a Mon Sep 17 00:00:00 2001 From: Chris Banks Date: Mon, 3 Oct 2022 12:20:00 +0100 Subject: [PATCH 1/3] Use https when fetching gem dependencies. This has been the default for new Gemfiles since a major security incident at rubygems.org in 2013[1]. While we're at it, also fix a missing https in a link in the README. [1]: https://venturebeat.com/business/rubygems-org-hacked-interrupting-heroku-services-and-putting-millions-of-sites-using-rails-at-risk/ --- Gemfile | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 4983a65..8b040b3 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ -source "http://rubygems.org" +source "https://rubygems.org" # Specify your gem's dependencies in plek.gemspec gemspec diff --git a/README.md b/README.md index c24a27c..d595572 100644 --- a/README.md +++ b/README.md @@ -72,4 +72,4 @@ component, for example `frontend` or `content-store`, as opposed to ## Versioning policy -This is versioned according to [Semantic Versioning 2.0](http://semver.org/) +This is versioned according to [Semantic Versioning 2.0](https://semver.org/) From 56242a3e76442646b41b53d62dededc7b31538a5 Mon Sep 17 00:00:00 2001 From: Kevin Dew Date: Mon, 3 Oct 2022 14:32:08 +0100 Subject: [PATCH 2/3] Deprecate the use of Plek.current This method was put in temporarily 10 years ago [1] and has had a todo next to it ever since. We're planning to finally remove this [2] in the 5.0 release so this acts as a warning in the interim. [1]: https://github.com/alphagov/plek/commit/309ef5942a7adcdc6d68a9416fa3267c17a2268f [2]: https://github.com/alphagov/plek/pull/93 --- CHANGELOG.md | 2 ++ lib/plek.rb | 5 ++++- test/plek_test.rb | 6 +++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59e9bb7..9b656e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ # Unreleased + * Deprecate usage of `Plek.current` this method will be removed in next + major version. This adds a warning for users. * Allow setting `GOVUK_APP_DOMAIN=""` (empty string). Similarly for `GOVUK_APP_DOMAIN_EXTERNAL`. This allows single-label domains to be used in service URLs instead of FQDNs, which eliminates a lot of configuration diff --git a/lib/plek.rb b/lib/plek.rb index 4d03ecc..40f0079 100644 --- a/lib/plek.rb +++ b/lib/plek.rb @@ -144,7 +144,10 @@ class << self # Plek.current.find('foo') # as well as the new style: # Plek.new.find('foo') - alias_method :current, :new + def current(...) + warn "Plek.current is deprecated and will be removed. Use Plek.new or Plek.find instead." + new(...) + end # Convenience wrapper. The same as calling +Plek.new.find+. # @see #find diff --git a/test/plek_test.rb b/test/plek_test.rb index 7202544..7d4ee4e 100644 --- a/test/plek_test.rb +++ b/test/plek_test.rb @@ -75,7 +75,11 @@ def test_should_return_dash_divided_source_in_production def test_should_be_able_to_use_current_for_old_style_calls ClimateControl.modify GOVUK_APP_DOMAIN: "foo.bar.baz" do - assert_equal Plek.new.find("foo"), Plek.current.find("foo") + old_style = nil + assert_output("", "Plek.current is deprecated and will be removed. Use Plek.new or Plek.find instead.\n") do + old_style = Plek.current.find("foo") + end + assert_equal Plek.new.find("foo"), old_style end end From cdadda169846d5c81e87650b62a8abd0ab4a616a Mon Sep 17 00:00:00 2001 From: Chris Banks Date: Mon, 3 Oct 2022 12:25:08 +0100 Subject: [PATCH 3/3] Release version 4.1.0. --- CHANGELOG.md | 6 ++++++ lib/plek/version.rb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b656e3..2e261ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,14 @@ # Unreleased +Nothing yet. + +# 4.1.0 + * Deprecate usage of `Plek.current` this method will be removed in next major version. This adds a warning for users. + * Remove public setter methods for `parent_domain` and `external_domain`. + These are not used anywhere so there are no API compatibility issues. * Allow setting `GOVUK_APP_DOMAIN=""` (empty string). Similarly for `GOVUK_APP_DOMAIN_EXTERNAL`. This allows single-label domains to be used in service URLs instead of FQDNs, which eliminates a lot of configuration diff --git a/lib/plek/version.rb b/lib/plek/version.rb index 8681735..0a0380d 100644 --- a/lib/plek/version.rb +++ b/lib/plek/version.rb @@ -1,3 +1,3 @@ class Plek - VERSION = "4.0.0".freeze + VERSION = "4.1.0".freeze end