[DRE-commits] [ruby-inline] 04/05: Ship inline_method_name_mapping as part of a patch
Christian Hofstaedtler
zeha at moszumanska.debian.org
Wed Jan 15 22:36:26 UTC 2014
This is an automated email from the git hooks/post-receive script.
zeha pushed a commit to branch master
in repository ruby-inline.
commit 8664adc8e8a83f18c1d8f910d50db4fbc64158d5
Author: Christian Hofstaedtler <zeha at debian.org>
Date: Wed Jan 15 23:34:42 2014 +0100
Ship inline_method_name_mapping as part of a patch
This way the file gets installed by dh_ruby, and the tests actually run
through during build time.
---
debian/inline_method_name_mapping.rb | 48 ------------------
.../inline_mapping_instead_of_zentest_mapping | 57 +++++++++++++++++++++-
debian/ruby-inline.install | 1 -
3 files changed, 55 insertions(+), 51 deletions(-)
diff --git a/debian/inline_method_name_mapping.rb b/debian/inline_method_name_mapping.rb
deleted file mode 100644
index a9a3cd0..0000000
--- a/debian/inline_method_name_mapping.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-module MethodNameMapping
- @@method_map = {
- 'bang' => '!',
- 'percent' => '%',
- 'and' => '&',
- 'times' => '*',
- 'times2' => '**',
- 'plus' => '+',
- 'minus' => '-',
- 'div' => '/',
- 'lt' => '<',
- 'lte' => '<=',
- 'spaceship' => '<=>',
- 'lt2' => '<<',
- 'equals2' => '==',
- 'equals3' => '===',
- 'equalstilde' => '=~',
- 'gt' => '>',
- 'ge' => '>=',
- 'gt2' => '>>',
- 'unary_plus' => '+@',
- 'unary_minus' => '-@',
- 'index' => '[]',
- 'index_equals' => '[]=',
- 'carat' => '^',
- 'or' => '|',
- 'tilde' => '~',
- }
-
- @@mapped_re = @@method_map.values.map {|s| Regexp.escape(s)}.join("|")
-
- def to_ruby(name)
- name = name.to_s.dup
- is_class_method = name.sub!(/^class_/, '')
-
- if @@method_map.has_key?(name)
- name=@@method_map[name]
- elsif name.sub!(/_equals(_.*)?$/, '=')
- elsif name.sub!(/_bang(_.*)?$/, '!')
- elsif name.sub!(/_eh(_.*)?$/, '?')
- elsif name =~ /(.*?)_/ and @@method_map.has_key? $1
- name = @@method_map[$1]
- end
- name = 'self.' + name if is_class_method
-
- return name
- end
-end
diff --git a/debian/patches/inline_mapping_instead_of_zentest_mapping b/debian/patches/inline_mapping_instead_of_zentest_mapping
index 26b09f9..383fb07 100644
--- a/debian/patches/inline_mapping_instead_of_zentest_mapping
+++ b/debian/patches/inline_mapping_instead_of_zentest_mapping
@@ -9,8 +9,8 @@ Description: Replaced ZenTestMapping usage with custom implementation
Index: ruby-inline/lib/inline.rb
===================================================================
---- ruby-inline.orig/lib/inline.rb 2014-01-15 18:14:38.476959571 +0100
-+++ ruby-inline/lib/inline.rb 2014-01-15 18:14:38.476959571 +0100
+--- ruby-inline.orig/lib/inline.rb 2014-01-15 23:29:03.227042905 +0100
++++ ruby-inline/lib/inline.rb 2014-01-15 23:29:05.000000000 +0100
@@ -52,7 +52,7 @@ require "digest/md5"
require 'fileutils'
#require 'rubygems'
@@ -38,3 +38,56 @@ Index: ruby-inline/lib/inline.rb
return_type = signature['return']
arity = options[:arity] || signature['arity']
+Index: ruby-inline/lib/inline_method_name_mapping.rb
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ ruby-inline/lib/inline_method_name_mapping.rb 2014-01-15 23:30:02.314633885 +0100
+@@ -0,0 +1,48 @@
++module MethodNameMapping
++ @@method_map = {
++ 'bang' => '!',
++ 'percent' => '%',
++ 'and' => '&',
++ 'times' => '*',
++ 'times2' => '**',
++ 'plus' => '+',
++ 'minus' => '-',
++ 'div' => '/',
++ 'lt' => '<',
++ 'lte' => '<=',
++ 'spaceship' => '<=>',
++ 'lt2' => '<<',
++ 'equals2' => '==',
++ 'equals3' => '===',
++ 'equalstilde' => '=~',
++ 'gt' => '>',
++ 'ge' => '>=',
++ 'gt2' => '>>',
++ 'unary_plus' => '+@',
++ 'unary_minus' => '-@',
++ 'index' => '[]',
++ 'index_equals' => '[]=',
++ 'carat' => '^',
++ 'or' => '|',
++ 'tilde' => '~',
++ }
++
++ @@mapped_re = @@method_map.values.map {|s| Regexp.escape(s)}.join("|")
++
++ def to_ruby(name)
++ name = name.to_s.dup
++ is_class_method = name.sub!(/^class_/, '')
++
++ if @@method_map.has_key?(name)
++ name=@@method_map[name]
++ elsif name.sub!(/_equals(_.*)?$/, '=')
++ elsif name.sub!(/_bang(_.*)?$/, '!')
++ elsif name.sub!(/_eh(_.*)?$/, '?')
++ elsif name =~ /(.*?)_/ and @@method_map.has_key? $1
++ name = @@method_map[$1]
++ end
++ name = 'self.' + name if is_class_method
++
++ return name
++ end
++end
diff --git a/debian/ruby-inline.install b/debian/ruby-inline.install
deleted file mode 100644
index 87c32c1..0000000
--- a/debian/ruby-inline.install
+++ /dev/null
@@ -1 +0,0 @@
-debian/inline_method_name_mapping.rb /usr/lib/ruby/vendor_ruby
\ No newline at end of file
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-inline.git
More information about the Pkg-ruby-extras-commits
mailing list