quotinator 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/quotinator.rb +34 -0
  2. metadata +2 -2
data/lib/quotinator.rb CHANGED
@@ -9,6 +9,7 @@ class Quotinator
9
9
  end
10
10
 
11
11
  def self.replace(txt)
12
+ # To be depreciated...
12
13
  txt.gsub!(/”/,'"')
13
14
  txt.gsub!(/“/,'"')
14
15
  txt.gsub!(/’/,"'")
@@ -22,4 +23,37 @@ class Quotinator
22
23
  return txt
23
24
  end
24
25
 
26
+ def self.replace_all(txt)
27
+ txt = doublequotes(txt)
28
+ txt = singlequotes(txt)
29
+ txt = ellipsis(txt)
30
+ txt = longdash(txt)
31
+ return txt
32
+ end
33
+
34
+ def self.doublequotes(txt)
35
+ txt.gsub!(/”/,'"')
36
+ txt.gsub!(/“/,'"')
37
+ # There seems to be two different sets of special quotes.
38
+ txt.gsub!(/”/,'"')
39
+ txt.gsub!(/“/,'"')
40
+ return txt
41
+ end
42
+
43
+ def self.singlequotes(txt)
44
+ txt.gsub!(/’/,"'")
45
+ txt.gsub!(/‘/,"'")
46
+ return txt
47
+ end
48
+
49
+ def self.ellipsis(txt)
50
+ txt.gsub!(/…/,"...")
51
+ return txt
52
+ end
53
+
54
+ def self.longdash(txt)
55
+ txt.gsub!(/—/,"-")
56
+ return txt
57
+ end
58
+
25
59
  end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quotinator
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:
8
- - ! '["Eric Roberts"]'
8
+ - Eric Roberts
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []