stringex 2.0.10 → 2.0.11
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 +8 -8
- data/README.rdoc +2 -0
- data/VERSION +1 -1
- data/lib/stringex/string_extensions.rb +9 -1
- data/stringex.gemspec +2 -1
- data/test/unit/string_extensions_configuration_test.rb +17 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MDc3OWVmOWMzZGQwOGRlZDI1YjRmYmNiYWJhZTkwOTFmNjAwZDQ1OQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ODdiMzBhMDM2ZjYwYjI5ZTI1OGJmYjZlYTlhZDdjMmRhN2FhZDE4YQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YzcxMTU1MjUzMTg4OTVhNmRiMjYyNTAwNTllNTE4ODFlMThhMmYxYzkwZjAz
|
10
|
+
NjEyYzg0ODhkYWUwOGQzYmVlMDBkYmQ3OWU3ZjE2NzQwOWRjYWY2NjZkNTYz
|
11
|
+
NjM0ZDU1M2I0YzljZjQ5NmM2YzA2ZDRjMDYwOGEyYTgzNTQxODY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZjcwZTkzODcwNzA5OWJkZmU4ZjEzZDI5MjQ2YjgwYTMxYmM1YWIyOTkwNWEx
|
14
|
+
ODZiOWUxMTQzZTkwMGVjNTlhN2I0Y2FmNTQ0ZWM1MWJhMzhmOWVmNjc3MDI4
|
15
|
+
NTQxNzIzZTdkNjQ1OGFiODUyMTNjODE4MDI5Yjk5MWE1NmFjMTg=
|
data/README.rdoc
CHANGED
@@ -6,6 +6,8 @@ Some [hopefully] useful extensions to Ruby's String class. It is made up of thre
|
|
6
6
|
|
7
7
|
== ActsAsUrl
|
8
8
|
|
9
|
+
<em>NOTE: You can now require 'stringex_lite' instead of 'stringex' and skip loading ActsAsUrl functionality if you don't need it.</em>
|
10
|
+
|
9
11
|
This library is designed to create URI-friendly representations of an attribute, for use in generating urls from your attributes. Basic usage is just calling the method:
|
10
12
|
|
11
13
|
# Inside your model
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.
|
1
|
+
2.0.11
|
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
module Stringex
|
4
4
|
module StringExtensions
|
5
|
+
def self.configure(&block)
|
6
|
+
Stringex::Configuration::StringExtensions.configure &block
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.unconfigure!
|
10
|
+
Stringex::Configuration::StringExtensions.unconfigure!
|
11
|
+
end
|
12
|
+
|
5
13
|
# These methods are all included into the String class.
|
6
14
|
module PublicInstanceMethods
|
7
15
|
# Removes specified character from the beginning and/or end of the string and then performs
|
@@ -171,7 +179,7 @@ module Stringex
|
|
171
179
|
end
|
172
180
|
|
173
181
|
def stringex_default_options
|
174
|
-
Stringex::Configuration::StringExtensions.
|
182
|
+
Stringex::Configuration::StringExtensions.new.settings.marshal_dump
|
175
183
|
end
|
176
184
|
end
|
177
185
|
|
data/stringex.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "stringex"
|
8
|
-
s.version = "2.0.
|
8
|
+
s.version = "2.0.11"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Russell Norris"]
|
@@ -249,6 +249,7 @@ Gem::Specification.new do |s|
|
|
249
249
|
"test/unit/localization_18n_failure_test.rb",
|
250
250
|
"test/unit/localization_test.rb",
|
251
251
|
"test/unit/redcloth_to_html_test.rb",
|
252
|
+
"test/unit/string_extensions_configuration_test.rb",
|
252
253
|
"test/unit/string_extensions_test.rb",
|
253
254
|
"test/unit/unicode_point_suite/basic_greek_test.rb",
|
254
255
|
"test/unit/unicode_point_suite/basic_latin_test.rb",
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require 'test_helper'
|
4
|
+
require 'stringex'
|
5
|
+
|
6
|
+
class StringExtensionsConfigurationTest < Test::Unit::TestCase
|
7
|
+
def teardown
|
8
|
+
Stringex::StringExtensions.unconfigure!
|
9
|
+
end
|
10
|
+
|
11
|
+
def test_can_set_base_settings
|
12
|
+
Stringex::StringExtensions.configure do |c|
|
13
|
+
c.replace_whitespace_with = "~"
|
14
|
+
end
|
15
|
+
assert_equal "foo~bar", "foo bar".to_url
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stringex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Russell Norris
|
@@ -407,6 +407,7 @@ files:
|
|
407
407
|
- test/unit/localization_18n_failure_test.rb
|
408
408
|
- test/unit/localization_test.rb
|
409
409
|
- test/unit/redcloth_to_html_test.rb
|
410
|
+
- test/unit/string_extensions_configuration_test.rb
|
410
411
|
- test/unit/string_extensions_test.rb
|
411
412
|
- test/unit/unicode_point_suite/basic_greek_test.rb
|
412
413
|
- test/unit/unicode_point_suite/basic_latin_test.rb
|