string_master 0.3.3 → 0.3.4
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/VERSION +1 -1
- data/lib/string_master/string_master.rb +2 -2
- data/spec/lib/string_master/string_master_spec.rb +2 -2
- data/string_master.gemspec +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.4
|
@@ -130,8 +130,8 @@ class StringMaster
|
|
130
130
|
# Preserves whitespace within a given tag. Each occurence of 2 or more spaces
|
131
131
|
# is transformed into a entities.
|
132
132
|
def preserve_whitespace_within(tag)
|
133
|
-
@modified_string.gsub!(/<#{tag}
|
134
|
-
match.gsub(
|
133
|
+
@modified_string.gsub!(/<#{tag}>(.|\n)+?<\/#{tag}>/) do |match|
|
134
|
+
match.gsub(/( )( )+/) { |m| " "*m.length }
|
135
135
|
end
|
136
136
|
self
|
137
137
|
end
|
@@ -46,8 +46,8 @@ CODE
|
|
46
46
|
StringMaster.new(code).wrap_code.to_s.should == <<WRAPPED_CODE
|
47
47
|
I have a piece of code
|
48
48
|
<code>def say_hello
|
49
|
-
|
50
|
-
|
49
|
+
puts "hello world"
|
50
|
+
return true
|
51
51
|
end</code>
|
52
52
|
and here's what my code looks like.
|
53
53
|
WRAPPED_CODE
|
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.4
|
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: 450096338606050278
|
137
137
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
138
138
|
none: false
|
139
139
|
requirements:
|