moss_ruby 1.1.1 → 1.1.2
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 +4 -4
- data/lib/moss_ruby.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7501061523c707fa401f9a21744c3b9689b61eed
|
|
4
|
+
data.tar.gz: 0480f03c83f40c227e96897bbd26cf5b6a7a0b11
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 100549f657224335d56c6f2752cb65ea6cde75aa5fff8d7b498fdace12a5bbf1aff8ce20c3d3ce9033a1869bf9920f12bbb6cda72ae2e64a8af4215799f6ee24
|
|
7
|
+
data.tar.gz: 91cd8e2fe59e97351d1a27bbb56e115336facfc24de4cb872589ba65a338e55c54688ca9f5f1e8ec5ccb4b82d44b08b265410ec6942e47084a261bad2dcaf6e5
|
data/lib/moss_ruby.rb
CHANGED
|
@@ -168,7 +168,7 @@ class MossRuby
|
|
|
168
168
|
|
|
169
169
|
# read the two match files
|
|
170
170
|
match_url = "#{uri}/match#{id}-top.html"
|
|
171
|
-
match_top = open(match_url).read
|
|
171
|
+
match_top = open(match_url).read().encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '?')
|
|
172
172
|
|
|
173
173
|
callback.call(" - checking match #{match} percents") unless callback.nil?
|
|
174
174
|
top = read_pcts match_top
|
|
@@ -177,8 +177,8 @@ class MossRuby
|
|
|
177
177
|
|
|
178
178
|
callback.call(" - fetching #{match} html") unless callback.nil?
|
|
179
179
|
|
|
180
|
-
match_file[0] = open("#{uri}/match#{id}-0.html").read
|
|
181
|
-
match_file[1] = open("#{uri}/match#{id}-1.html").read
|
|
180
|
+
match_file[0] = open("#{uri}/match#{id}-0.html").read().encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '?')
|
|
181
|
+
match_file[1] = open("#{uri}/match#{id}-1.html").read().encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '?')
|
|
182
182
|
|
|
183
183
|
# puts match_top
|
|
184
184
|
# puts "---FILE0\n\n"
|
|
@@ -222,7 +222,7 @@ class MossRuby
|
|
|
222
222
|
result = Array.new
|
|
223
223
|
begin
|
|
224
224
|
callback.call(" - Reading match data") unless callback.nil?
|
|
225
|
-
page = open("#{uri}").read
|
|
225
|
+
page = open("#{uri}").read().encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '?')
|
|
226
226
|
regex = /<TR><TD><A HREF=".*?match(?<match_id>\d+).html">.*\((?<pct0>\d+)%\)<\/A>\n.*?<TD><A.*?((?<pct0>\d+)%\))/i
|
|
227
227
|
# puts "scanning page"
|
|
228
228
|
page.scan(regex).each do | match |
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: moss_ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrew Cain
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-08-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Moss-ruby is an unofficial ruby gem for the Moss system for Detecting
|
|
14
14
|
Software Plagiarism (http://theory.stanford.edu/~aiken/moss/)
|