exclameterize 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/exclameterize.rb CHANGED
@@ -3,17 +3,17 @@ require "exclameterize/version"
3
3
  module Exclameterize
4
4
  def exclameterize(suffix)
5
5
  if self =~ /\!$/
6
- self.gsub(/\!$/, "_with_#{suffix}!")
6
+ self.gsub(/\!$/, "_#{suffix}!")
7
7
  else
8
- self + "_with_#{suffix}"
8
+ self + "_#{suffix}"
9
9
  end
10
10
  end
11
11
 
12
12
  def unexclameterize(suffix)
13
13
  if self =~ /\!$/
14
- self.gsub(/_with_#{suffix}\!$/, "!")
14
+ self.gsub(/_#{suffix}\!$/, "!")
15
15
  else
16
- self.gsub(/_with_#{suffix}$/, '')
16
+ self.gsub(/_#{suffix}$/, '')
17
17
  end
18
18
  end
19
19
  end
@@ -1,3 +1,3 @@
1
1
  module Exclameterize
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -5,9 +5,9 @@ require "exclameterize"
5
5
 
6
6
  class ExclameterizeTest < Test::Unit::TestCase
7
7
  def test_it
8
- assert_equal "test_with_end", "test".exclameterize("end")
9
- assert_equal "test_with_end!", "test!".exclameterize("end")
10
- assert_equal "test", "test_with_end".unexclameterize("end")
11
- assert_equal "test!", "test_with_end!".unexclameterize("end")
8
+ assert_equal "test_with_end", "test".exclameterize("with_end")
9
+ assert_equal "test_with_end!", "test!".exclameterize("with_end")
10
+ assert_equal "test", "test_with_end".unexclameterize("with_end")
11
+ assert_equal "test!", "test_with_end!".unexclameterize("with_end")
12
12
  end
13
13
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exclameterize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: