wdd-ruby-ext 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1 @@
1
+ gem 'wdd-ruby-ext', :path=>"."
data/Gemfile.lock ADDED
@@ -0,0 +1,13 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ wdd-ruby-ext (0.2.2)
5
+
6
+ GEM
7
+ specs:
8
+
9
+ PLATFORMS
10
+ ruby
11
+
12
+ DEPENDENCIES
13
+ wdd-ruby-ext!
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.2.3
@@ -51,14 +51,12 @@ class String
51
51
  # >> "this is that".mgpsub( [ [/(that)/, 'really $1!'], [/this/, 'that'] ] )
52
52
  # => that is really that!"
53
53
  #
54
- def mgpsub(string, key_value_pairs=[].freeze)
54
+ def mgpsub(key_value_pairs=[].freeze)
55
55
  regexp_fragments = key_value_pairs.collect { |k,v| k }
56
- string.gsub(Regexp.union(*regexp_fragments)) do |match|
56
+ gsub(Regexp.union(*regexp_fragments)) do |match|
57
57
  replacement_term = key_value_pairs.detect{|k,v| k=~match}[1]
58
- vars = %w{$1 $2 $3 $4 $5 $6 $7 $8 $9 $` $& $’}
58
+ vars = ["$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", "$9", "$`", "$&", "$'"]
59
59
  vars.each do |var|
60
- tm_safe_log var
61
- tm_safe_log eval(var)||''
62
60
  replacement_term.gsub!( Regexp.compile("\\"+var), eval(var)||'' )
63
61
  end
64
62
  replacement_term
data/wdd-ruby-ext.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{wdd-ruby-ext}
8
- s.version = "0.2.2"
8
+ s.version = "0.2.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["shock"]
@@ -19,6 +19,8 @@ Gem::Specification.new do |s|
19
19
  s.files = [
20
20
  ".document",
21
21
  ".gitignore",
22
+ "Gemfile",
23
+ "Gemfile.lock",
22
24
  "LICENSE",
23
25
  "README.rdoc",
24
26
  "Rakefile",
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wdd-ruby-ext
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 2
10
- version: 0.2.2
9
+ - 3
10
+ version: 0.2.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - shock
@@ -46,6 +46,8 @@ extra_rdoc_files:
46
46
  files:
47
47
  - .document
48
48
  - .gitignore
49
+ - Gemfile
50
+ - Gemfile.lock
49
51
  - LICENSE
50
52
  - README.rdoc
51
53
  - Rakefile