string_master 0.3.7 → 0.3.8
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.
- checksums.yaml +7 -0
- data/Gemfile.lock +88 -45
- data/VERSION +1 -1
- data/lib/string_master/string_master.rb +7 -1
- data/spec/lib/string_master/string_master_spec.rb +6 -0
- data/spec/spec_helper.rb +4 -0
- data/string_master.gemspec +6 -5
- metadata +17 -30
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 4dda1d7c572babaf90cfe7be2777a2b7668416f6
|
|
4
|
+
data.tar.gz: 81914454c060a63d1a57a5a77f542dc86bce209a
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 3979d5c8e3acd3eb1d6ce855200666322913981aa52cd29ec7374db75342f4378b6b7a57b08ccebc16ee3d8e3453e772fbe1b20d18a62290123109c553c14c1e
|
|
7
|
+
data.tar.gz: 36010284b756e6466badb3920f97567aed71b1af68ad65b204d5a0c05b67795564cd020e48ffa8f6e6bd9cb298d29221fd312e11f680672804be8e6ae603a8de
|
data/Gemfile.lock
CHANGED
|
@@ -1,57 +1,100 @@
|
|
|
1
1
|
GEM
|
|
2
2
|
remote: http://rubygems.org/
|
|
3
3
|
specs:
|
|
4
|
-
actionpack (
|
|
5
|
-
|
|
6
|
-
activesupport (=
|
|
7
|
-
|
|
4
|
+
actionpack (4.2.3)
|
|
5
|
+
actionview (= 4.2.3)
|
|
6
|
+
activesupport (= 4.2.3)
|
|
7
|
+
rack (~> 1.6)
|
|
8
|
+
rack-test (~> 0.6.2)
|
|
9
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
|
10
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
|
11
|
+
actionview (4.2.3)
|
|
12
|
+
activesupport (= 4.2.3)
|
|
13
|
+
builder (~> 3.1)
|
|
8
14
|
erubis (~> 2.7.0)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
diff-lcs (1.
|
|
15
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
|
16
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
|
17
|
+
activesupport (4.2.3)
|
|
18
|
+
i18n (~> 0.7)
|
|
19
|
+
json (~> 1.7, >= 1.7.7)
|
|
20
|
+
minitest (~> 5.1)
|
|
21
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
|
22
|
+
tzinfo (~> 1.1)
|
|
23
|
+
addressable (2.3.8)
|
|
24
|
+
builder (3.2.2)
|
|
25
|
+
descendants_tracker (0.0.4)
|
|
26
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
|
27
|
+
diff-lcs (1.2.5)
|
|
22
28
|
erubis (2.7.0)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
faraday (0.9.1)
|
|
30
|
+
multipart-post (>= 1.2, < 3)
|
|
31
|
+
git (1.2.9.1)
|
|
32
|
+
github_api (0.12.3)
|
|
33
|
+
addressable (~> 2.3)
|
|
34
|
+
descendants_tracker (~> 0.0.4)
|
|
35
|
+
faraday (~> 0.8, < 0.10)
|
|
36
|
+
hashie (>= 3.3)
|
|
37
|
+
multi_json (>= 1.7.5, < 2.0)
|
|
38
|
+
nokogiri (~> 1.6.3)
|
|
39
|
+
oauth2
|
|
40
|
+
hashie (3.4.2)
|
|
41
|
+
highline (1.7.2)
|
|
42
|
+
i18n (0.7.0)
|
|
43
|
+
jeweler (2.0.1)
|
|
44
|
+
builder
|
|
45
|
+
bundler (>= 1.0)
|
|
28
46
|
git (>= 1.2.5)
|
|
47
|
+
github_api
|
|
48
|
+
highline (>= 1.6.15)
|
|
49
|
+
nokogiri (>= 1.5.10)
|
|
29
50
|
rake
|
|
30
51
|
rdoc
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
52
|
+
json (1.8.3)
|
|
53
|
+
jwt (1.5.1)
|
|
54
|
+
loofah (2.0.2)
|
|
55
|
+
nokogiri (>= 1.5.9)
|
|
56
|
+
mini_portile (0.6.2)
|
|
57
|
+
minitest (5.7.0)
|
|
58
|
+
multi_json (1.11.2)
|
|
59
|
+
multi_xml (0.5.5)
|
|
60
|
+
multipart-post (2.0.0)
|
|
61
|
+
nokogiri (1.6.6.2)
|
|
62
|
+
mini_portile (~> 0.6.0)
|
|
63
|
+
oauth2 (1.0.0)
|
|
64
|
+
faraday (>= 0.8, < 0.10)
|
|
65
|
+
jwt (~> 1.0)
|
|
66
|
+
multi_json (~> 1.3)
|
|
67
|
+
multi_xml (~> 0.5)
|
|
68
|
+
rack (~> 1.2)
|
|
69
|
+
rack (1.6.4)
|
|
70
|
+
rack-test (0.6.3)
|
|
38
71
|
rack (>= 1.0)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
rspec
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
72
|
+
rails-deprecated_sanitizer (1.0.3)
|
|
73
|
+
activesupport (>= 4.2.0.alpha)
|
|
74
|
+
rails-dom-testing (1.0.6)
|
|
75
|
+
activesupport (>= 4.2.0.beta, < 5.0)
|
|
76
|
+
nokogiri (~> 1.6.0)
|
|
77
|
+
rails-deprecated_sanitizer (>= 1.0.1)
|
|
78
|
+
rails-html-sanitizer (1.0.2)
|
|
79
|
+
loofah (~> 2.0)
|
|
80
|
+
rake (10.4.2)
|
|
81
|
+
rdoc (4.2.0)
|
|
82
|
+
rspec (3.3.0)
|
|
83
|
+
rspec-core (~> 3.3.0)
|
|
84
|
+
rspec-expectations (~> 3.3.0)
|
|
85
|
+
rspec-mocks (~> 3.3.0)
|
|
86
|
+
rspec-core (3.3.2)
|
|
87
|
+
rspec-support (~> 3.3.0)
|
|
88
|
+
rspec-expectations (3.3.1)
|
|
89
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
90
|
+
rspec-support (~> 3.3.0)
|
|
91
|
+
rspec-mocks (3.3.2)
|
|
92
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
93
|
+
rspec-support (~> 3.3.0)
|
|
94
|
+
rspec-support (3.3.0)
|
|
95
|
+
thread_safe (0.3.5)
|
|
96
|
+
tzinfo (1.2.2)
|
|
97
|
+
thread_safe (~> 0.1)
|
|
55
98
|
|
|
56
99
|
PLATFORMS
|
|
57
100
|
ruby
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.3.
|
|
1
|
+
0.3.8
|
|
@@ -157,7 +157,13 @@ class StringMaster
|
|
|
157
157
|
end
|
|
158
158
|
|
|
159
159
|
def wrap_inline_code(opening_tag="<span class=\"inlineCode\">", closing_tag="</span>")
|
|
160
|
-
@modified_string.gsub!(/`(.+?)
|
|
160
|
+
@modified_string.gsub!(/`(.+?)`/m, opening_tag + '\1' + closing_tag)
|
|
161
|
+
self
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Same as wrap_inline_code, but spans across multiplelines
|
|
165
|
+
def wrap_backticks_code(opening_tag="<code>", closing_tag="</code>")
|
|
166
|
+
@modified_string.gsub!(/`(.+?)`/m, opening_tag + '\1' + closing_tag)
|
|
161
167
|
self
|
|
162
168
|
end
|
|
163
169
|
|
|
@@ -73,6 +73,12 @@ WRAPPED_CODE
|
|
|
73
73
|
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"
|
|
74
74
|
end
|
|
75
75
|
|
|
76
|
+
it "wraps code in backticks stretched across multiple lines" do
|
|
77
|
+
code = "`hello\nworld`"
|
|
78
|
+
parser = StringMaster.new(code)
|
|
79
|
+
parser.wrap_backticks_code.to_s.should == "<code>hello\nworld</code>"
|
|
80
|
+
end
|
|
81
|
+
|
|
76
82
|
it "breaks long words" do
|
|
77
83
|
long_string = 'l'; 1.upto(80) { |i| long_string << "o" }; long_string << "ng"
|
|
78
84
|
parser = StringMaster.new(long_string)
|
data/spec/spec_helper.rb
CHANGED
data/string_master.gemspec
CHANGED
|
@@ -2,14 +2,16 @@
|
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
|
5
|
+
# stub: string_master 0.3.8 ruby lib
|
|
5
6
|
|
|
6
7
|
Gem::Specification.new do |s|
|
|
7
8
|
s.name = "string_master"
|
|
8
|
-
s.version = "0.3.
|
|
9
|
+
s.version = "0.3.8"
|
|
9
10
|
|
|
10
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
12
|
+
s.require_paths = ["lib"]
|
|
11
13
|
s.authors = ["Roman Snitko"]
|
|
12
|
-
s.date = "
|
|
14
|
+
s.date = "2015-07-29"
|
|
13
15
|
s.description = "Because every time I create a new webapp, I think about how I should process user-generated content. Should convert urls to links and images? Should I allow certain tags? Should I convert all new lines to *br* tags? Well, now all that is as simple as calling a single method."
|
|
14
16
|
s.email = "roman.snitko@gmail.com"
|
|
15
17
|
s.extra_rdoc_files = [
|
|
@@ -36,12 +38,11 @@ Gem::Specification.new do |s|
|
|
|
36
38
|
]
|
|
37
39
|
s.homepage = "http://github.com/snitko/string_master"
|
|
38
40
|
s.licenses = ["MIT"]
|
|
39
|
-
s.
|
|
40
|
-
s.rubygems_version = "1.8.25"
|
|
41
|
+
s.rubygems_version = "2.4.5"
|
|
41
42
|
s.summary = "Most common string manipulations for a webapp"
|
|
42
43
|
|
|
43
44
|
if s.respond_to? :specification_version then
|
|
44
|
-
s.specification_version =
|
|
45
|
+
s.specification_version = 4
|
|
45
46
|
|
|
46
47
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
|
47
48
|
s.add_runtime_dependency(%q<actionpack>, [">= 0"])
|
metadata
CHANGED
|
@@ -1,78 +1,69 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: string_master
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
5
|
-
prerelease:
|
|
4
|
+
version: 0.3.8
|
|
6
5
|
platform: ruby
|
|
7
6
|
authors:
|
|
8
7
|
- Roman Snitko
|
|
9
8
|
autorequire:
|
|
10
9
|
bindir: bin
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date:
|
|
11
|
+
date: 2015-07-29 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
|
15
14
|
name: actionpack
|
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
|
17
|
-
none: false
|
|
18
16
|
requirements:
|
|
19
|
-
- -
|
|
17
|
+
- - ">="
|
|
20
18
|
- !ruby/object:Gem::Version
|
|
21
19
|
version: '0'
|
|
22
20
|
type: :runtime
|
|
23
21
|
prerelease: false
|
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
-
none: false
|
|
26
23
|
requirements:
|
|
27
|
-
- -
|
|
24
|
+
- - ">="
|
|
28
25
|
- !ruby/object:Gem::Version
|
|
29
26
|
version: '0'
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
|
31
28
|
name: bundler
|
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
|
33
|
-
none: false
|
|
34
30
|
requirements:
|
|
35
|
-
- -
|
|
31
|
+
- - ">="
|
|
36
32
|
- !ruby/object:Gem::Version
|
|
37
33
|
version: '0'
|
|
38
34
|
type: :development
|
|
39
35
|
prerelease: false
|
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
41
|
-
none: false
|
|
42
37
|
requirements:
|
|
43
|
-
- -
|
|
38
|
+
- - ">="
|
|
44
39
|
- !ruby/object:Gem::Version
|
|
45
40
|
version: '0'
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
|
47
42
|
name: jeweler
|
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
|
49
|
-
none: false
|
|
50
44
|
requirements:
|
|
51
|
-
- -
|
|
45
|
+
- - ">="
|
|
52
46
|
- !ruby/object:Gem::Version
|
|
53
47
|
version: '0'
|
|
54
48
|
type: :development
|
|
55
49
|
prerelease: false
|
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
57
|
-
none: false
|
|
58
51
|
requirements:
|
|
59
|
-
- -
|
|
52
|
+
- - ">="
|
|
60
53
|
- !ruby/object:Gem::Version
|
|
61
54
|
version: '0'
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
|
63
56
|
name: rspec
|
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
|
65
|
-
none: false
|
|
66
58
|
requirements:
|
|
67
|
-
- -
|
|
59
|
+
- - ">="
|
|
68
60
|
- !ruby/object:Gem::Version
|
|
69
61
|
version: '0'
|
|
70
62
|
type: :development
|
|
71
63
|
prerelease: false
|
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
73
|
-
none: false
|
|
74
65
|
requirements:
|
|
75
|
-
- -
|
|
66
|
+
- - ">="
|
|
76
67
|
- !ruby/object:Gem::Version
|
|
77
68
|
version: '0'
|
|
78
69
|
description: Because every time I create a new webapp, I think about how I should
|
|
@@ -86,8 +77,8 @@ extra_rdoc_files:
|
|
|
86
77
|
- LICENSE.txt
|
|
87
78
|
- README.markdown
|
|
88
79
|
files:
|
|
89
|
-
- .document
|
|
90
|
-
- .rspec
|
|
80
|
+
- ".document"
|
|
81
|
+
- ".rspec"
|
|
91
82
|
- Gemfile
|
|
92
83
|
- Gemfile.lock
|
|
93
84
|
- LICENSE.txt
|
|
@@ -105,29 +96,25 @@ files:
|
|
|
105
96
|
homepage: http://github.com/snitko/string_master
|
|
106
97
|
licenses:
|
|
107
98
|
- MIT
|
|
99
|
+
metadata: {}
|
|
108
100
|
post_install_message:
|
|
109
101
|
rdoc_options: []
|
|
110
102
|
require_paths:
|
|
111
103
|
- lib
|
|
112
104
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
113
|
-
none: false
|
|
114
105
|
requirements:
|
|
115
|
-
- -
|
|
106
|
+
- - ">="
|
|
116
107
|
- !ruby/object:Gem::Version
|
|
117
108
|
version: '0'
|
|
118
|
-
segments:
|
|
119
|
-
- 0
|
|
120
|
-
hash: -2734865303812765722
|
|
121
109
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
|
-
none: false
|
|
123
110
|
requirements:
|
|
124
|
-
- -
|
|
111
|
+
- - ">="
|
|
125
112
|
- !ruby/object:Gem::Version
|
|
126
113
|
version: '0'
|
|
127
114
|
requirements: []
|
|
128
115
|
rubyforge_project:
|
|
129
|
-
rubygems_version:
|
|
116
|
+
rubygems_version: 2.4.5
|
|
130
117
|
signing_key:
|
|
131
|
-
specification_version:
|
|
118
|
+
specification_version: 4
|
|
132
119
|
summary: Most common string manipulations for a webapp
|
|
133
120
|
test_files: []
|