[DRE-commits] [foodcritic] 01/02: Use ruby-hashery instead of rufus-lru. It is compatible, and in the archive already.

Stefano Rivera stefano at rivera.za.net
Mon Jul 25 20:18:50 UTC 2016


This is an automated email from the git hooks/post-receive script.

stefanor pushed a commit to branch master
in repository foodcritic.

commit 2b0173ea9f712f4b839178cd5c9f0e7015a9b55d
Author: Stefano Rivera <stefanor at debian.org>
Date:   Mon Jul 25 13:05:32 2016 -0700

    Use ruby-hashery instead of rufus-lru. It is compatible, and in the archive already.
---
 debian/changelog            |  7 +++++++
 debian/control              |  2 ++
 debian/patches/hashery-lru  | 36 ++++++++++++++++++++++++++++++++++++
 debian/patches/no-rufus-lru | 32 --------------------------------
 debian/patches/series       |  2 +-
 5 files changed, 46 insertions(+), 33 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index adab162..090b038 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+foodcritic (7.0.1-2) UNRELEASED; urgency=medium
+
+  * Use ruby-hashery instead of rufus-lru. It is compatible, and in the
+    archive already.
+
+ -- Stefano Rivera <stefanor at debian.org>  Mon, 25 Jul 2016 13:03:10 -0700
+
 foodcritic (7.0.1-1) unstable; urgency=medium
 
   * New upstream release.
diff --git a/debian/control b/debian/control
index f4c669f..94b8366 100644
--- a/debian/control
+++ b/debian/control
@@ -11,6 +11,7 @@ Build-Depends: chef,
                ruby-aruba (>= 0.4.11),
                ruby-cucumber-core (>= 1.3),
                ruby-erubis,
+               ruby-hashery,
                ruby-minitest (>= 3.3.0),
                ruby-nokogiri (>= 1.5.4),
                ruby-ronn,
@@ -28,6 +29,7 @@ XB-Ruby-Versions: ${ruby:Versions}
 Depends: ruby | ruby-interpreter,
          ruby-cucumber-core (>= 1.3),
          ruby-erubis,
+         ruby-hashery,
          ruby-nokogiri (>= 1.5.4),
          ruby-treetop (>= 1.4.10),
          ruby-yajl (>= 1.1.0),
diff --git a/debian/patches/hashery-lru b/debian/patches/hashery-lru
new file mode 100644
index 0000000..a4c0879
--- /dev/null
+++ b/debian/patches/hashery-lru
@@ -0,0 +1,36 @@
+Description: Use hashery's LRU implementation
+ We don't have ruby-rufus-lru in the archive, but hashery's implementation is
+ sufficiently compatible.
+Author: Stefano Rivera <stefanor at debian.org>
+Last-Update: 2016-07-25
+Forwarded: not-needed
+
+--- a/lib/foodcritic/api.rb
++++ b/lib/foodcritic/api.rb
+@@ -1,5 +1,5 @@
+ require 'nokogiri'
+-require 'rufus-lru'
++require 'hashery/lru_hash'
+ 
+ module FoodCritic
+   # Helper methods that form part of the Rules DSL.
+@@ -246,7 +246,7 @@
+ 
+     # Read the AST for the given Ruby source file
+     def read_ast(file)
+-      @ast_cache ||= Rufus::Lru::Hash.new(5)
++      @ast_cache ||= Hashery::LRUHash.new(5)
+       if @ast_cache.include?(file)
+         @ast_cache[file]
+       else
+--- a/foodcritic.gemspec
++++ b/foodcritic.gemspec
+@@ -17,7 +17,7 @@
+   s.add_dependency('treetop', '~> 1.4')
+   s.add_dependency('yajl-ruby', '~> 1.1')
+   s.add_dependency('erubis')
+-  s.add_dependency('rufus-lru', '~> 1.0')
++  s.add_dependency('hashery')
+   s.files = Dir['chef_dsl_metadata/*.json'] +
+     Dir['lib/**/*.rb'] +
+     Dir['misc/**/*']
diff --git a/debian/patches/no-rufus-lru b/debian/patches/no-rufus-lru
deleted file mode 100644
index f7e099b..0000000
--- a/debian/patches/no-rufus-lru
+++ /dev/null
@@ -1,32 +0,0 @@
-Description: Temporarily back-out the LRU caching
- Reverts 4f35d2a1aaddbfa6cf7b0dda6d37b34183be5f3f
- We haven't packaged ruby-rufus-lru, and are unlikely to in time for Jessie's
- frieeze.
-Author: Stefano Rivera <stefanor at debian.org>
-Last-Update: 2014-10-24
-Forwarded: not-needed
-
---- a/lib/foodcritic/api.rb
-+++ b/lib/foodcritic/api.rb
-@@ -1,5 +1,4 @@
- require 'nokogiri'
--require 'rufus-lru'
- 
- module FoodCritic
-   # Helper methods that form part of the Rules DSL.
-@@ -246,12 +245,10 @@
- 
-     # Read the AST for the given Ruby source file
-     def read_ast(file)
--      @ast_cache ||= Rufus::Lru::Hash.new(5)
--      if @ast_cache.include?(file)
--        @ast_cache[file]
--      else
--        @ast_cache[file] = uncached_read_ast(file)
-+      @ast_cache ||= Hash.new do |h,k|
-+        h[k] = uncached_read_ast(k)
-       end
-+      @ast_cache[file]
-     end
- 
-     # Retrieve a single-valued attribute from the specified resource.
diff --git a/debian/patches/series b/debian/patches/series
index a1e5aaf..ec878b3 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,3 @@
 system-install-layout
-no-rufus-lru
+hashery-lru
 autopkgtests-no-lib

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/foodcritic.git



More information about the Pkg-ruby-extras-commits mailing list