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 +4 -4
- data/Gemfile.lock +4 -4
- data/lib/web_loader/utils.rb +14 -9
- data/lib/web_loader/version.rb +1 -1
- data/web_loader.iml +15 -16
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57806142eb3fb353786c2e1f8d36bddbf4fbdd75a5752466e426e9fb92b33ebe
|
4
|
+
data.tar.gz: 7b3e79220bd13d8dfad067a305e58df2894677ffc9f3b1b8ab248070840fd0cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
4
|
+
web_loader (1.2.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
minitest (5.
|
10
|
-
rake (13.0
|
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.
|
21
|
+
2.4.20
|
data/lib/web_loader/utils.rb
CHANGED
@@ -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
|
-
|
15
|
-
|
16
|
-
|
17
|
-
#
|
18
|
-
|
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
|
data/lib/web_loader/version.rb
CHANGED
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.
|
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.
|
17
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/minitest-5.
|
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.
|
22
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/minitest-5.
|
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.
|
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
|
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
|
36
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.0
|
37
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.0
|
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
|
42
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.0
|
43
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.0
|
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
|
47
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.1.0/gems/rake-13.0
|
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.
|
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-
|
11
|
+
date: 2023-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Web loader.
|
14
14
|
email:
|