web-utils 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8a2315d2048160a727547e8e9244d42dfb06872b8d2e033116284aa951c3e7e
4
- data.tar.gz: 48008168ad2f44ff6b8f5b783b03a8f529e59b235b3b619a9975695172b23493
3
+ metadata.gz: c51f28f3490e185eefa169866d88af1b0cf15ce3a61f7a8fbdb9acf955dd160a
4
+ data.tar.gz: b047825464803b6a4c49f79dae32d8159b38f5e3edef97c9712f647bf258a920
5
5
  SHA512:
6
- metadata.gz: 5337eedf0e98063f1a7aabea4650db6c5d8bb7c20f8ab1b65f887d1374c1fb8351ae5fd27f0bcb7d8c9adb8076cfdd42beefa8980bf688cf66788ca98f842d46
7
- data.tar.gz: a88b9779b1229f8d499e68b47c466a298f9181d5fd866890057f5a59a0f247647e921ad5a531fa6c550b1db179dc7eb93306c55aa8a48332800704624c94ec68
6
+ metadata.gz: f3cecb91f83b58fe4c03fceb8941afe56c4dd43d0996adb4a0a92d90cbd413309c4af23c047ba199647a00f14640993becb5765903d07378e78922797d6c5b44
7
+ data.tar.gz: 9227bf1102a6747c5375386ceba11982b929025b83078850e15817d3876d4f1f5817dff32c401ddf2320de40febcf6abe3c89e843912cbf9452955c5b1f1420c
@@ -5,7 +5,7 @@ require 'uri'
5
5
 
6
6
  module WebUtils
7
7
 
8
- VERSION = '0.1.3'
8
+ VERSION = '0.1.4'
9
9
 
10
10
  # Most methods are supposed to be as simple as possible
11
11
  # and just cover most cases.
@@ -108,10 +108,8 @@ module WebUtils
108
108
  end
109
109
  module_function :ensure_key
110
110
 
111
- ACCENTS =
112
- "ÀÁÂÃÄÅàáâãäåĀāĂ㥹ÇçĆćĈĉĊċČčÐðĎďĐđÈÉÊËèéêëĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħÌÍÎÏìíîïĨĩĪīĬĭĮįİıĴĵĶķĸĹĺĻļĽľĿŀŁłÑñŃńŅņŇňʼnŊŋÒÓÔÕÖØòóôõöøŌōŎŏŐőŔŕŖŗŘřŚśŜŝŞ"
113
- WITHOUT_ACCENTS =
114
- "AAAAAAaaaaaaAaAaAaCcCcCcCcCcDdDdDdEEEEeeeeEeEeEeEeEeGgGgGgGgHhHhIIIIiiiiIiIiIiIiIiJjKkkLlLlLlLlLlNnNnNnNnnNnOOOOOOooooooOoOoOoRrRrRrSsSsSsSssT"
111
+ ACCENTS = "ÀÁÂÃÄÅàáâãäåĀāĂ㥹ÇçĆćĈĉĊċČčÐðĎďĐđÈÉÊËèéêëĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħÌÍÎÏìíîïĨĩĪīĬĭĮįİıĴĵĶķĸĹĺĻļĽľĿŀŁłÑñŃńŅņŇňʼnŊŋÒÓÔÕÖØòóôõöøŌōŎŏŐőŔŕŖŗŘřŚśŜŝŞşŠšſŢţŤťŦŧÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųŴŵÝýÿŶŷŸŹźŻżŽž"
112
+ WITHOUT_ACCENTS = "AAAAAAaaaaaaAaAaAaCcCcCcCcCcDdDdDdEEEEeeeeEeEeEeEeEeGgGgGgGgHhHhIIIIiiiiIiIiIiIiIiJjKkkLlLlLlLlLlNnNnNnNnnNnOOOOOOooooooOoOoOoRrRrRrSsSsSsSssTtTtTtUUUUuuuuUuUuUuUuUuUuWwYyyYyYZzZzZz"
115
113
  def slugify s, force_lower=true
116
114
  s = s.to_s
117
115
  .tr(ACCENTS, WITHOUT_ACCENTS)
@@ -324,7 +324,12 @@ describe WebUtils do
324
324
  ['42hello', '42hello'],
325
325
  ['5.0hello', '5.0hello']
326
326
  ].each do |(arg,result)|
327
- assert_equal result, utils.automatic_typecast(arg)
327
+ # This `if` statement is now needed to avoid a depracation warning.
328
+ if result.nil?
329
+ assert_nil utils.automatic_typecast(arg)
330
+ else
331
+ assert_equal result, utils.automatic_typecast(arg)
332
+ end
328
333
  end
329
334
  end
330
335
  it 'Can change what is typecasted' do
@@ -345,10 +350,16 @@ describe WebUtils do
345
350
 
346
351
  describe '#generate_random_id' do
347
352
  it 'Has the correct format' do
348
- assert_match /[a-zA-Z0-9]{16}/, utils.generate_random_id
353
+ out, err = capture_io do
354
+ assert_match /[a-zA-Z0-9]{16}/, utils.generate_random_id
355
+ end
356
+ assert_match "WebUtils::generate_random_id is deprecated", err
349
357
  end
350
358
  it 'Can have a specific length' do
351
- assert_match /[a-zA-Z0-9]{32}/, utils.generate_random_id(32)
359
+ out, err = capture_io do
360
+ assert_match /[a-zA-Z0-9]{32}/, utils.generate_random_id(32)
361
+ end
362
+ assert_match "WebUtils::generate_random_id is deprecated", err
352
363
  end
353
364
  end
354
365
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: web-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mickael Riga
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-08 00:00:00.000000000 Z
11
+ date: 2019-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  - !ruby/object:Gem::Version
86
86
  version: '0'
87
87
  requirements: []
88
- rubygems_version: 3.0.2
88
+ rubygems_version: 3.0.3
89
89
  signing_key:
90
90
  specification_version: 4
91
91
  summary: Web Utils