massaji 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/README.md +6 -5
- data/lib/massaji.rb +14 -14
- data/lib/massaji/version.rb +1 -1
- data/massaji.gemspec +5 -5
- metadata +9 -9
data/README.md
CHANGED
@@ -9,9 +9,10 @@ Massaji is pretty much the Japanese word for massage right? At least that's what
|
|
9
9
|
$ gem install massaji
|
10
10
|
|
11
11
|
## Use
|
12
|
-
So you
|
12
|
+
So you're using [Salesforce](http://www.salesforce.com) to enter some text
|
13
|
+
for things in your business. Currently you have some text that looks like:
|
13
14
|
|
14
|
-
$ text="whatever.com is where dinosaur
|
15
|
+
$ text="whatever.com is where dinosaur\\342\\200\\231s authomobiles, books & toys
|
15
16
|
are exchanged for whatever online. Connect with thousands of dinos online
|
16
17
|
to exchange full boxes of stuff you no longer uses for stuff they
|
17
18
|
actually need."
|
@@ -20,11 +21,11 @@ This doesnt work very well, we don't want whacky extra characters. In the
|
|
20
21
|
above example, we're simply looking for an apostrophe. We need to run this
|
21
22
|
through a spa to get all of the bad "knots" out.
|
22
23
|
|
23
|
-
$ text = Massaji::Spa.
|
24
|
-
$ => "whatever.com is where dinosaur's authomobiles, books & toys
|
24
|
+
$ text = Massaji::Spa.new(text)
|
25
|
+
$ => "<p>whatever.com is where dinosaur's authomobiles, books & toys
|
25
26
|
are exchanged for whatever online. Connect with thousands of dinos online
|
26
27
|
to exchange full boxes of stuff you no longer uses for stuff they
|
27
|
-
actually need
|
28
|
+
actually need.</p>"
|
28
29
|
|
29
30
|
Great success!
|
30
31
|
|
data/lib/massaji.rb
CHANGED
@@ -17,18 +17,18 @@ module Massaji
|
|
17
17
|
#
|
18
18
|
# Returns the text with appropriate substitutions made.
|
19
19
|
def initialize(text, tag="p")
|
20
|
-
text.gsub!(
|
21
|
-
text.gsub!(
|
22
|
-
text.gsub!(
|
23
|
-
text.gsub!(
|
24
|
-
text.gsub!(
|
20
|
+
text.gsub!(/\\342\\200(?:\\234|\\235)/,'"')
|
21
|
+
text.gsub!(/\\342\\200(?:\\230|\\231)/,"'")
|
22
|
+
text.gsub!(/\\342\\200\\223/,"-")
|
23
|
+
text.gsub!(/\\342\\200\\224/,"--")
|
24
|
+
text.gsub!(/\\342\\200\\246/,"...")
|
25
25
|
|
26
26
|
# not sure what these are, make empty for now
|
27
|
-
text.gsub!(
|
28
|
-
text.gsub!(
|
29
|
-
text.gsub!(
|
30
|
-
text.gsub!(
|
31
|
-
text.gsub!(
|
27
|
+
text.gsub!(/\\342\\200\\242/,"")
|
28
|
+
text.gsub!(/\\342\\200\\250/,"")
|
29
|
+
text.gsub!(/\\342\\204\\242/,"")
|
30
|
+
text.gsub!(/\\303\\251/,"") # e in cafe?
|
31
|
+
text.gsub!(/\\303\\261/,"")
|
32
32
|
|
33
33
|
insert_html(text)
|
34
34
|
text = wrap(text, tag)
|
@@ -65,10 +65,10 @@ module Massaji
|
|
65
65
|
#
|
66
66
|
# Returns text with appropriate html tags in place.
|
67
67
|
def insert_html(text)
|
68
|
-
text.gsub!("
|
69
|
-
text.gsub!("
|
70
|
-
text.gsub!("
|
71
|
-
text.gsub!("
|
68
|
+
text.gsub!("\\r\\n", "<br/><br/>")
|
69
|
+
text.gsub!("\\n\\n", "<br/><br/>")
|
70
|
+
text.gsub!("\\n", "<br/><br/>")
|
71
|
+
text.gsub!("\\t", "-")
|
72
72
|
|
73
73
|
text
|
74
74
|
end
|
data/lib/massaji/version.rb
CHANGED
data/massaji.gemspec
CHANGED
@@ -8,11 +8,11 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.authors = ["brntbeer"]
|
9
9
|
s.email = ["brent.beer@gmail.com"]
|
10
10
|
s.homepage = ""
|
11
|
-
s.summary = %q{
|
12
|
-
s.description = %q{Massaji is used for when you've copy/pasted text
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
s.summary = %q{Massage your text from Salesforce with great success.}
|
12
|
+
s.description = %q{Massaji is used for when you've copy/pasted text into
|
13
|
+
Salesforce from Microsoft Word and the text is suddenly
|
14
|
+
bullshit garbage. Massage that bitch back to the
|
15
|
+
original character.}
|
16
16
|
|
17
17
|
s.rubyforge_project = "massaji"
|
18
18
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: massaji
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- brntbeer
|
@@ -15,14 +15,14 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-08-
|
18
|
+
date: 2011-08-02 00:00:00 Z
|
19
19
|
dependencies: []
|
20
20
|
|
21
21
|
description: |-
|
22
|
-
Massaji is used for when you've copy/pasted text
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
Massaji is used for when you've copy/pasted text into
|
23
|
+
Salesforce from Microsoft Word and the text is suddenly
|
24
|
+
bullshit garbage. Massage that bitch back to the
|
25
|
+
original character.
|
26
26
|
email:
|
27
27
|
- brent.beer@gmail.com
|
28
28
|
executables: []
|
@@ -72,6 +72,6 @@ rubyforge_project: massaji
|
|
72
72
|
rubygems_version: 1.8.5
|
73
73
|
signing_key:
|
74
74
|
specification_version: 3
|
75
|
-
summary:
|
75
|
+
summary: Massage your text from Salesforce with great success.
|
76
76
|
test_files: []
|
77
77
|
|