string_master 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +1 -1
- data/VERSION +1 -1
- data/lib/string_master/string_master.rb +3 -1
- data/spec/lib/string_master/string_master_spec.rb +2 -2
- data/string_master.gemspec +1 -1
- metadata +2 -2
data/README.markdown
CHANGED
@@ -37,4 +37,4 @@ Fuck yeah.
|
|
37
37
|
|
38
38
|
More
|
39
39
|
---------------
|
40
|
-
Please read RDoc to see all of the available methods of StringMaster class: http://rdoc.info/
|
40
|
+
Please read RDoc to see all of the available methods of StringMaster class: http://rdoc.info/gems/string_master/frames
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.2
|
@@ -116,15 +116,17 @@ class StringMaster
|
|
116
116
|
end
|
117
117
|
end
|
118
118
|
@modified_string = result
|
119
|
+
self
|
119
120
|
end
|
120
121
|
|
121
122
|
# Finds all lines that start with 4 spaces and wraps them into <code> tags.
|
122
123
|
def wrap_code
|
123
|
-
wrap_lines("code", /\A\s{4}/)
|
124
|
+
wrap_lines("code", /\A\s{4}/) # wrap lines already returns `self`
|
124
125
|
end
|
125
126
|
|
126
127
|
def wrap_inline_code(opening_tag="<span class=\"inlineCode\">", closing_tag="</span>")
|
127
128
|
@modified_string.gsub!(/`(.+?)`/, opening_tag + '\1' + closing_tag)
|
129
|
+
self
|
128
130
|
end
|
129
131
|
|
130
132
|
def to_s
|
@@ -41,7 +41,7 @@ I have a piece of code
|
|
41
41
|
exit
|
42
42
|
and here's what my code looks like.
|
43
43
|
CODE
|
44
|
-
StringMaster.new(code).wrap_code.should == <<WRAPPED_CODE
|
44
|
+
StringMaster.new(code).wrap_code.to_s.should == <<WRAPPED_CODE
|
45
45
|
I have a piece of code
|
46
46
|
<code>puts "hello world"
|
47
47
|
exit</code>
|
@@ -52,7 +52,7 @@ WRAPPED_CODE
|
|
52
52
|
it "wraps inline code into <span class=\"inlineCode\"></span> tags" do
|
53
53
|
code = "I have a variable called `a` and it has a `nil` value"
|
54
54
|
parser = StringMaster.new(code)
|
55
|
-
parser.wrap_inline_code.should == "I have a variable called <span class=\"inlineCode\">a</span> and it has a <span class=\"inlineCode\">nil</span> value"
|
55
|
+
parser.wrap_inline_code.to_s.should == "I have a variable called <span class=\"inlineCode\">a</span> and it has a <span class=\"inlineCode\">nil</span> value"
|
56
56
|
end
|
57
57
|
|
58
58
|
it "breaks long words" do
|
data/string_master.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: string_master
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -133,7 +133,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
133
133
|
version: '0'
|
134
134
|
segments:
|
135
135
|
- 0
|
136
|
-
hash:
|
136
|
+
hash: 2478903722703068135
|
137
137
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
138
138
|
none: false
|
139
139
|
requirements:
|