New Upstream Release - ruby-awrence

Ready changes

Summary

Merged new upstream version: 2.0.1 (was: 1.1.1).

Resulting package

Built on 2023-03-20T00:04 (took 3m36s)

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-releases ruby-awrence

Lintian Result

Diff

diff --git a/MIT-LICENSE b/MIT-LICENSE
index 476b883..4f8b9fd 100644
--- a/MIT-LICENSE
+++ b/MIT-LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2020 Dave Hrycyszyn
+Copyright (c) 2021 Technical Panda Ltd
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the
diff --git a/README.md b/README.md
index 8dedcfd..b9edd07 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,18 @@
 # Awrence
 
 [![Gem Version](https://badge.fury.io/rb/awrence.svg)](https://badge.fury.io/rb/awrence)
+![CI](https://github.com/technicalpanda/awrence/workflows/CI/badge.svg)
 
-Have you ever needed to automatically convert Rubyish `snake_case` to JSON-style `camelBack` or `CamelCase` hash keys?
+Have you ever needed to automatically convert Rubyish `snake_case` to JSON-style `camelBack` or `CamelCase` hash keys? 
 
-Awrence to the rescue.
+Awrence to the rescue!
 
 This gem recursively converts all snake_case keys in a hash structure to camelBack or CamelCase.
 
+## Requirements
+
+* Ruby >= 2.7
+
 ## Installation
 
 Add this to your Gemfile:
@@ -74,16 +79,14 @@ camel_hash = my_hash.to_camelback_keys
 If you've already got `CamelCase` and need to `snake_case` it, you are encouraged to try
 the [Plissken](http://github.com/futurechimp/plissken) gem.
 
-## Contributing to awrence
+## Contributing
+
+Bug reports and pull requests are welcome on GitHub at https://github.com/technicalpanda/awrence. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
+
+## License
 
-* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
-* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
-* Fork the project.
-* Start a feature/bugfix branch.
-* Commit and push until you are happy with your contribution.
-* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
-* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
+The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
 
-# Copyright
+## Code of Conduct
 
-Copyright (c) 2017 Dave Hrycyszyn. See LICENSE.txt for further details.
+Everyone interacting with this project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/technicalpanda/awrence/blob/main/CODE_OF_CONDUCT.md).
diff --git a/VERSION b/VERSION
index 524cb55..38f77a6 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.1.1
+2.0.1
diff --git a/awrence.gemspec b/awrence.gemspec
index 58ae0a9..3f3f094 100644
--- a/awrence.gemspec
+++ b/awrence.gemspec
@@ -2,43 +2,23 @@
 # This file has been automatically generated by gem2tgz #
 #########################################################
 # -*- encoding: utf-8 -*-
-# stub: awrence 1.1.1 ruby lib
+# stub: awrence 2.0.1 ruby lib
 
 Gem::Specification.new do |s|
   s.name = "awrence".freeze
-  s.version = "1.1.1"
+  s.version = "2.0.1"
 
   s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
+  s.metadata = { "rubygems_mfa_required" => "true" } if s.respond_to? :metadata=
   s.require_paths = ["lib".freeze]
   s.authors = ["Dave Hrycyszyn".freeze, "Stuart Chinery".freeze]
-  s.date = "2020-02-01"
+  s.date = "2022-01-23"
   s.description = "Have you ever needed to automatically convert Ruby-style snake_case to CamelCase or camelBack hash keys?\n\nAwrence to the rescue.\n\nThis gem recursively converts all snake_case keys in a hash structure to camelBack.".freeze
-  s.email = ["dhrycyszyn@zonedigital.com".freeze, "stuart.chinery@gmail.com".freeze]
+  s.email = ["dave@constructiveproof.com".freeze, "code@technicalpanda.co.uk".freeze]
   s.files = ["MIT-LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "VERSION".freeze, "lib/awrence.rb".freeze, "lib/awrence/ext/array/to_camel_keys.rb".freeze, "lib/awrence/ext/hash/to_camel_keys.rb".freeze, "lib/awrence/methods.rb".freeze, "lib/awrence/version.rb".freeze]
-  s.homepage = "https://github.com/futurechimp/awrence".freeze
+  s.homepage = "https://github.com/technicalpanda/awrence".freeze
   s.licenses = ["MIT".freeze]
-  s.rubygems_version = "3.2.0.rc.1".freeze
+  s.required_ruby_version = Gem::Requirement.new(">= 2.7".freeze)
+  s.rubygems_version = "3.2.5".freeze
   s.summary = "Camelize your snake keys when working with JSON APIs".freeze
-
-  if s.respond_to? :specification_version then
-    s.specification_version = 4
-  end
-
-  if s.respond_to? :add_runtime_dependency then
-    s.add_development_dependency(%q<byebug>.freeze, ["~> 11.1"])
-    s.add_development_dependency(%q<minitest>.freeze, ["~> 5.14"])
-    s.add_development_dependency(%q<minitest-fail-fast>.freeze, ["~> 0.1"])
-    s.add_development_dependency(%q<minitest-macos-notification>.freeze, ["~> 0.3"])
-    s.add_development_dependency(%q<minitest-reporters>.freeze, ["~> 1.4"])
-    s.add_development_dependency(%q<rake>.freeze, ["~> 13.0"])
-    s.add_development_dependency(%q<rubocop>.freeze, ["~> 0.79"])
-  else
-    s.add_dependency(%q<byebug>.freeze, ["~> 11.1"])
-    s.add_dependency(%q<minitest>.freeze, ["~> 5.14"])
-    s.add_dependency(%q<minitest-fail-fast>.freeze, ["~> 0.1"])
-    s.add_dependency(%q<minitest-macos-notification>.freeze, ["~> 0.3"])
-    s.add_dependency(%q<minitest-reporters>.freeze, ["~> 1.4"])
-    s.add_dependency(%q<rake>.freeze, ["~> 13.0"])
-    s.add_dependency(%q<rubocop>.freeze, ["~> 0.79"])
-  end
 end
diff --git a/debian/changelog b/debian/changelog
index c79fdb1..e436480 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+ruby-awrence (2.0.1-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Mon, 20 Mar 2023 00:00:46 -0000
+
 ruby-awrence (1.1.1-2) unstable; urgency=medium
 
   * Source only upload for migration to testing
diff --git a/lib/awrence/methods.rb b/lib/awrence/methods.rb
index 039603d..bdab53c 100644
--- a/lib/awrence/methods.rb
+++ b/lib/awrence/methods.rb
@@ -6,48 +6,34 @@ module Awrence
     # hash keys suitable for use with a JSON API.
     #
     def to_camelback_keys(value = self)
-      case value
-      when Array
-        value.map { |v| to_camelback_keys(v) }
-      when Hash
-        Hash[value.map { |k, v| [camelize_key(k, false), to_camelback_keys(v)] }]
-      else
-        value
-      end
+      process_value(:to_camelback_keys, value, first_upper: false)
     end
 
     # Recursively converts Rubyish snake_case hash keys to CamelCase JSON-style
     # hash keys suitable for use with a JSON API.
     #
     def to_camel_keys(value = self)
-      case value
-      when Array
-        value.map { |v| to_camel_keys(v) }
-      when Hash
-        Hash[value.map { |k, v| [camelize_key(k), to_camel_keys(v)] }]
-      else
-        value
-      end
+      process_value(:to_camel_keys, value, first_upper: true)
     end
 
     private
 
-    def camelize_key(key, first_upper = true)
-      if key.is_a? Symbol
-        camelize(key.to_s, first_upper).to_sym
-      elsif key.is_a? String
-        camelize(key, first_upper)
+    def camelize_key(key, first_upper: true)
+      case key
+      when Symbol
+        camelize(key.to_s, first_upper: first_upper).to_sym
+      when String
+        camelize(key, first_upper: first_upper)
       else
         key # Awrence can't camelize anything except strings and symbols
       end
     end
 
-    def camelize(snake_word, first_upper = true)
+    def camelize(snake_word, first_upper: true)
       if first_upper
         str = snake_word.to_s
         str = gsubbed(str, /(?:^|_)([^_\s]+)/)
-        str = gsubbed(str, %r{/([^/]*)}, "::")
-        str
+        gsubbed(str, %r{/([^/]*)}, "::")
       else
         parts = snake_word.split("_", 2)
         parts[0] << camelize(parts[1]) if parts.size > 1
@@ -56,11 +42,20 @@ module Awrence
     end
 
     def gsubbed(str, pattern, extra = "")
-      str = str.gsub(pattern) do
+      str.gsub(pattern) do
         extra + (Awrence.acronyms[Regexp.last_match(1)] || Regexp.last_match(1).capitalize)
       end
+    end
 
-      str
+    def process_value(method, value, first_upper: true)
+      case value
+      when Array
+        value.map { |v| send(method, v) }
+      when Hash
+        value.to_h { |k, v| [camelize_key(k, first_upper: first_upper), send(method, v)] }
+      else
+        value
+      end
     end
   end
 end

Debdiff

[The following lists of changes regard files as different if they have different names, permissions or owners.]

Files in second set of .debs but not in first

-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/awrence-2.0.1/VERSION
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/awrence-2.0.1/lib/awrence.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/awrence-2.0.1/lib/awrence/ext/array/to_camel_keys.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/awrence-2.0.1/lib/awrence/ext/hash/to_camel_keys.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/awrence-2.0.1/lib/awrence/methods.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/awrence-2.0.1/lib/awrence/version.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/specifications/awrence-2.0.1.gemspec

Files in first set of .debs but not in second

-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/awrence-1.1.1/VERSION
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/awrence-1.1.1/lib/awrence.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/awrence-1.1.1/lib/awrence/ext/array/to_camel_keys.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/awrence-1.1.1/lib/awrence/ext/hash/to_camel_keys.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/awrence-1.1.1/lib/awrence/methods.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/awrence-1.1.1/lib/awrence/version.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/specifications/awrence-1.1.1.gemspec

Control files: lines which differ (wdiff format)

  • Ruby-Versions: all

More details

Full run details