web_loader 1.1.0 → 1.2.0

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: 1055ef0181a8f0e5857172c56783111bff1d102686f006c001e5b4b2627e65cb
4
- data.tar.gz: da2499a388951ecc7d0c525442b847da0be5e32ab2b478dd8ae2338e6e0772de
3
+ metadata.gz: 57806142eb3fb353786c2e1f8d36bddbf4fbdd75a5752466e426e9fb92b33ebe
4
+ data.tar.gz: 7b3e79220bd13d8dfad067a305e58df2894677ffc9f3b1b8ab248070840fd0cc
5
5
  SHA512:
6
- metadata.gz: 2e7e1b93c5af2ad6280843558fc89aba4014313c2fbb2999d0148749e20966bf05dcadc1e48bd8e46791feca2c7d78c6c3b99977778da667b36bd32964046ae6
7
- data.tar.gz: 319950bb1a184a361e215805aa49b7dfa661f28bf3d98b28d6baa3124627dd2a4c217762409c75bb375f8e12494c117863b4358319fab02c4682349a79eeeaaf
6
+ metadata.gz: 7269eb19bf3b1a36e88b66f0af750192681fe72ee8308ddb9fae3faab533543ee3a2dcc678fc18b9647919705b8ae869f0f24d38fcdf51ce4f3dce139caeda05
7
+ data.tar.gz: 6578e2aff6cbc4dbd6639ad026f87d435dccf62cfdfe8d88014494225ff2ba58f99a23e5e8c7013102feb7119a47644acd9b39c22c0088e31f3a3acaedd252c1
data/Gemfile.lock CHANGED
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- web_loader (1.1.0)
4
+ web_loader (1.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- minitest (5.19.0)
10
- rake (13.0.6)
9
+ minitest (5.20.0)
10
+ rake (13.1.0)
11
11
 
12
12
  PLATFORMS
13
13
  x86_64-darwin-22
@@ -18,4 +18,4 @@ DEPENDENCIES
18
18
  web_loader!
19
19
 
20
20
  BUNDLED WITH
21
- 2.4.19
21
+ 2.4.20
@@ -5,17 +5,22 @@ module WebLoader
5
5
  def toutf8_charset(str, charset)
6
6
  # charsetが指定されていない場合はnil
7
7
  return nil if charset.to_s.length == 0
8
- # 文字列のcharsetを変更する
9
- str.force_encoding(charset)
10
- # force_encodingが失敗した場合はnil
11
- return nil unless str.valid_encoding?
12
8
 
13
9
  result = nil
14
- if charset =~ /#{UTF_8}/i
15
- result = str
16
- else
17
- # エンコーディングがUTF8じゃない場合変換する
18
- result = str.encode(UTF_8, invalid: :replace, undef: :replace)
10
+ begin
11
+ # 文字列のcharsetを変更する
12
+ str.force_encoding(charset) # 例外が発生する場合あり。例えば"Shift_JIS"ではなく"Shift-JIS"が渡された場合。
13
+ # force_encodingが失敗した場合はnil
14
+ return nil unless str.valid_encoding?
15
+ result = nil
16
+ if charset =~ /#{UTF_8}/i
17
+ result = str
18
+ else
19
+ # エンコーディングがUTF8じゃない場合変換する
20
+ result = str.encode(UTF_8, invalid: :replace, undef: :replace)
21
+ end
22
+ rescue => ex
23
+ puts ex.message
19
24
  end
20
25
  result
21
26
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WebLoader
4
- VERSION = "1.1.0"
4
+ VERSION = "1.2.0"
5
5
  end
data/web_loader.iml CHANGED
@@ -8,47 +8,46 @@
8
8
  <orderEntry type="inheritedJdk" />
9
9
  <orderEntry type="sourceFolder" forTests="false" />
10
10
  <orderEntry type="module-library">
11
- <library name="minitest (v5.19.0) [path][gem]" type="rubylib">
11
+ <library name="minitest (v5.20.0) [path][gem]" type="rubylib">
12
12
  <properties>
13
13
  <option name="version" value="4" />
14
14
  </properties>
15
15
  <CLASSES>
16
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/minitest-5.19.0/lib" />
17
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/minitest-5.19.0/test" />
16
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/lib" />
17
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/test" />
18
18
  </CLASSES>
19
19
  <JAVADOC />
20
20
  <SOURCES>
21
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/minitest-5.19.0/lib" />
22
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/minitest-5.19.0/test" />
21
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/lib" />
22
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/test" />
23
23
  </SOURCES>
24
24
  <excluded>
25
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/minitest-5.19.0/test" />
25
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/test" />
26
26
  </excluded>
27
27
  </library>
28
28
  </orderEntry>
29
29
  <orderEntry type="module-library">
30
- <library name="rake (v13.0.6) [path][gem]" type="rubylib">
30
+ <library name="rake (v13.1.0) [path][gem]" type="rubylib">
31
31
  <properties>
32
32
  <option name="version" value="4" />
33
33
  </properties>
34
34
  <CLASSES>
35
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/doc" />
36
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/exe" />
37
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib" />
35
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.1.0/doc" />
36
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.1.0/exe" />
37
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.1.0/lib" />
38
38
  </CLASSES>
39
39
  <JAVADOC />
40
40
  <SOURCES>
41
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/doc" />
42
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/exe" />
43
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib" />
41
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.1.0/doc" />
42
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.1.0/exe" />
43
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.1.0/lib" />
44
44
  </SOURCES>
45
45
  <excluded>
46
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/doc" />
47
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/exe" />
46
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.1.0/doc" />
47
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.1.0/exe" />
48
48
  </excluded>
49
49
  </library>
50
50
  </orderEntry>
51
- <orderEntry type="library" scope="PROVIDED" name="bundler (v2.4.19, rbenv: 3.1.4) [gem]" level="application" />
52
51
  </component>
53
52
  <component name="RakeTasksCache">
54
53
  <option name="myRootTask">
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: web_loader
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - src
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-07 00:00:00.000000000 Z
11
+ date: 2023-11-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Web loader.
14
14
  email: