[DRE-commits] [SCM] ruby-deprecated.git branch, master, updated. upstream/3.0.0-4-g5591156

Dmitry Borodaenko angdraug at debian.org
Sat Sep 10 20:39:42 UTC 2011


The following commit has been merged in the master branch:
commit 5591156d10ae47aec1072e1d42ffa3baa467d92c
Author: Dmitry Borodaenko <angdraug at debian.org>
Date:   Sat Sep 10 23:39:15 2011 +0300

    README from GitHub

diff --git a/debian/patches/0002-README-from-GitHub.patch b/debian/patches/0002-README-from-GitHub.patch
new file mode 100644
index 0000000..51e94f8
--- /dev/null
+++ b/debian/patches/0002-README-from-GitHub.patch
@@ -0,0 +1,83 @@
+From: Dmitry Borodaenko <angdraug at debian.org>
+Date: Sat, 10 Sep 2011 23:35:32 +0300
+Subject: README from GitHub
+
+---
+ README |   67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 67 insertions(+), 0 deletions(-)
+ create mode 100644 README
+
+diff --git a/README b/README
+new file mode 100644
+index 0000000..528c976
+--- /dev/null
++++ b/README
+@@ -0,0 +1,67 @@
++Deprecated is a module to help you deprecate code BEFORE you remove it. Don't
++surprise your users, deprecate them!
++
++Usage is simple:
++
++    class Foo
++      include Deprecated
++
++      def moo
++        "cow"
++      end
++
++      deprecated :moo
++
++      def sheep
++        "baaa"
++      end
++
++      deprecated :sheep, "Sounds#baa"
++
++      protected
++
++      def bar
++        true
++      end
++
++      deprecated :bar
++    end
++    
++    Foo.new.moo # warns that the call is deprecated
++    
++    Deprecated.set_action(:raise)
++    Foo.new.moo # raises with the same message
++
++    Deprecated.set_action do |klass, sym, replacement|
++      email_boss(
++        "Someone tried to use #{klass}##{sym}! " +
++        "They should be using #{replacement} instead!"
++      )
++    end
++
++    Foo.new.sheep # do I really need to explain?
++
++    Foo.new.bar # still protected!
++
++Let's do it live!
++
++    class Bar
++      include Deprecated
++
++      # sets it just for this class
++      deprecated_set_action do |klass, sym, replacement|
++        email_boss(
++          "Someone tried to use #{klass}##{sym}! " +
++          "They should be using #{replacement} instead!"
++        )
++      end
++
++      def cow
++        "moo"
++      end
++
++      deprecate :cow # emails your boss when called!
++    end
++
++Please see Deprecated::Module#deprecated, Deprecated.set_action, and
++Deprecated::Module#deprecated_set_action for more information.
+-- 
diff --git a/debian/patches/series b/debian/patches/series
index 69aab0b..6dfff95 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 0001-unit-test-fixes.patch
+0002-README-from-GitHub.patch

-- 
ruby-deprecated.git



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