quotinator 0.0.2 → 0.0.3
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/CHANGELOG.md +11 -0
- data/README.md +39 -0
- data/lib/quotinator.rb +4 -12
- metadata +4 -2
data/CHANGELOG.md
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
## Version 0.0.3 (2013-08-01)
|
2
|
+
- Cleaded up the code more.
|
3
|
+
- Added CHANGELOG and README files
|
4
|
+
|
5
|
+
## Version 0.0.2 (2013-08-01)
|
6
|
+
- Split out all substitutions into separate functions allowing everything, or only some things to be modified.
|
7
|
+
- Added "about" function.
|
8
|
+
|
9
|
+
## Version 0.0.1 (2013-08-01)
|
10
|
+
|
11
|
+
- Initial Release
|
data/README.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# The Quotinator
|
2
|
+
================
|
3
|
+
|
4
|
+
## Background
|
5
|
+
|
6
|
+
Blah
|
7
|
+
|
8
|
+
## Usage
|
9
|
+
|
10
|
+
Just include The Quotinator to your gemfile:
|
11
|
+
> `gem "quotinator"`
|
12
|
+
|
13
|
+
Then call any of the functions while passing in the string you wish to clean up.
|
14
|
+
> `Quotinator.replace("It's your text, why not clean it up?")`
|
15
|
+
|
16
|
+
## Available functions
|
17
|
+
|
18
|
+
*about*
|
19
|
+
Outputs a brief description of what the gem does. Pretty much a useless function.
|
20
|
+
|
21
|
+
*replace(txt)*
|
22
|
+
Shorthand function for `replace_all()`
|
23
|
+
|
24
|
+
*replace_all(txt)*
|
25
|
+
Function which handles replacing all known "special" characters.
|
26
|
+
|
27
|
+
*doublequotes(txt)*
|
28
|
+
Replaces only the special double quotation marks
|
29
|
+
|
30
|
+
*singlequotes(txt)*
|
31
|
+
Replaces only the special single quotation marks
|
32
|
+
|
33
|
+
*ellipsis(txt)*
|
34
|
+
Replaces only the special ellipsis (...)
|
35
|
+
|
36
|
+
*longdash(txt)*
|
37
|
+
Replaces only the special long dash
|
38
|
+
|
39
|
+
|
data/lib/quotinator.rb
CHANGED
@@ -8,21 +8,13 @@ class Quotinator
|
|
8
8
|
puts "its text with the basic counterparts."
|
9
9
|
end
|
10
10
|
|
11
|
+
# Just a shorthand function for the replace_all function.
|
11
12
|
def self.replace(txt)
|
12
|
-
|
13
|
-
txt.gsub!(/”/,'"')
|
14
|
-
txt.gsub!(/“/,'"')
|
15
|
-
txt.gsub!(/’/,"'")
|
16
|
-
txt.gsub!(/‘/,"'")
|
17
|
-
txt.gsub!(/…/,"...")
|
18
|
-
txt.gsub!(/ /," ")
|
19
|
-
txt.gsub!(/—/,"-")
|
20
|
-
# There seems to be two different sets of special quotes.
|
21
|
-
txt.gsub!(/”/,'"')
|
22
|
-
txt.gsub!(/“/,'"')
|
23
|
-
return txt
|
13
|
+
return replace_all(txt)
|
24
14
|
end
|
25
15
|
|
16
|
+
# txt.gsub!(/ /," ") ?? Need to figure this character out.
|
17
|
+
|
26
18
|
def self.replace_all(txt)
|
27
19
|
txt = doublequotes(txt)
|
28
20
|
txt = singlequotes(txt)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quotinator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ bindir: bin
|
|
11
11
|
cert_chain: []
|
12
12
|
date: 2013-08-01 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
|
-
description: A simple gem to replace the special
|
14
|
+
description: A simple gem to replace the special characters from Microsoft products
|
15
15
|
to their basic equivalents.
|
16
16
|
email: eric@ercubed.com
|
17
17
|
executables: []
|
@@ -19,6 +19,8 @@ extensions: []
|
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
21
|
- lib/quotinator.rb
|
22
|
+
- CHANGELOG.md
|
23
|
+
- README.md
|
22
24
|
homepage: http://rubygems.org/gems/quotinator
|
23
25
|
licenses:
|
24
26
|
- MIT
|