stringex 2.0.10 → 2.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZGU3ODRhYzViYjE1ZjliODcxNzFiNjUyMWYwY2QzMTVmODZjNmMzOA==
4
+ MDc3OWVmOWMzZGQwOGRlZDI1YjRmYmNiYWJhZTkwOTFmNjAwZDQ1OQ==
5
5
  data.tar.gz: !binary |-
6
- MWM1NmU4N2VmNzc3MTYwYTI2MGUwZjY1ZmNhYWJhNDY2MmQ2YjJhMQ==
6
+ ODdiMzBhMDM2ZjYwYjI5ZTI1OGJmYjZlYTlhZDdjMmRhN2FhZDE4YQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- N2EyNTA5YmYyMDE3ZTMzNTdhYzQwOGM4NzMzNzk5ZjZkYjU0YmQwNDZjZjA5
10
- ODZhNWRkMGI0ODU3Y2ZhNWU3MGY5ZTIwZmUwMjk0MDYxYWEzYThiNzIxMWM1
11
- OThlNzA2MmNkOTIwNGI1ZWM5ZDk5MmYzNDE1OTFhYWQ1NTZkNmM=
9
+ YzcxMTU1MjUzMTg4OTVhNmRiMjYyNTAwNTllNTE4ODFlMThhMmYxYzkwZjAz
10
+ NjEyYzg0ODhkYWUwOGQzYmVlMDBkYmQ3OWU3ZjE2NzQwOWRjYWY2NjZkNTYz
11
+ NjM0ZDU1M2I0YzljZjQ5NmM2YzA2ZDRjMDYwOGEyYTgzNTQxODY=
12
12
  data.tar.gz: !binary |-
13
- NjYwMTZiMjdjMWI0ZTBmMTNiNzg5OGQxOWI1MGVmYzE0MGEzMjMxZDE3NTQ0
14
- MDczYTNmNzJkOGEzN2U5NThkZjFmYmY2MGY4MWQ1NjhhYzMyMGEzMmY4N2Mx
15
- MGI2NTVlMjAyZjE5ZjBiNzdhYWNmZDUwNGYyMDZkYzgxMjU5ZDg=
13
+ ZjcwZTkzODcwNzA5OWJkZmU4ZjEzZDI5MjQ2YjgwYTMxYmM1YWIyOTkwNWEx
14
+ ODZiOWUxMTQzZTkwMGVjNTlhN2I0Y2FmNTQ0ZWM1MWJhMzhmOWVmNjc3MDI4
15
+ NTQxNzIzZTdkNjQ1OGFiODUyMTNjODE4MDI5Yjk5MWE1NmFjMTg=
@@ -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.10
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.default_settings
182
+ Stringex::Configuration::StringExtensions.new.settings.marshal_dump
175
183
  end
176
184
  end
177
185
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "stringex"
8
- s.version = "2.0.10"
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.10
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