moss_ruby 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/moss_ruby.rb +8 -8
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66a5d06f4c05993237b97c727e20090b90fffafc
4
- data.tar.gz: 54080efb6f31bacb9e6e31c7b80425e2723148e5
3
+ metadata.gz: 6388f6ab27c44a591101464aa52b353023baf4e8
4
+ data.tar.gz: a6ea6678cab87b739629d4dfe96070b5b07d9669
5
5
  SHA512:
6
- metadata.gz: 7bf9286ed32e74da05c5c832a6f1fa62ce253d8538a5dcd5b8e7ed2ef17f941f7c54c30ef705aacf655bb265f1cc935ad111b8790f3cbdf4f389315c91ad1712
7
- data.tar.gz: 5d436e7473f5deb1cb9bd40e2ec2263bd995ae5ce200679f83c50691a0a42a1081e9b7189b4b1e6e01c24587eeca525026b3d80cb115b385ceecba7e4856ae5e
6
+ metadata.gz: 230ff756021bca01adfb49e4f91103b421922b8ef10a05dde7754681d9426d0ccc2b32bbbddbefda2a4908f21b81b66d3be173961b97f72e8d75cce59debaeed
7
+ data.tar.gz: 1533a081ee20ba3f568338e1663af6bce61c6f8827360a4c8a07988f23eab25bab0b1bfafa6d15e6e3020bc490da586f5b6486e132aff417468a833acb7acee3
@@ -167,7 +167,8 @@ class MossRuby
167
167
  callback.call("Checking match #{match + 1} (id #{id})") unless callback.nil?
168
168
 
169
169
  # read the two match files
170
- match_top = open("#{uri}/match#{id}-top.html").read
170
+ match_url = "#{uri}/match#{id}-top.html"
171
+ match_top = open(match_url).read
171
172
 
172
173
  callback.call(" - checking match #{match} percents") unless callback.nil?
173
174
  top = read_pcts match_top
@@ -195,12 +196,16 @@ class MossRuby
195
196
  {
196
197
  filename: data[0][:filename],
197
198
  html: strip_a("<PRE>#{data[0][:html]}</PRE>"),
198
- pct: Integer(top[:pct0])
199
+ pct: Integer(top[:pct0]),
200
+ url: match_url,
201
+ part_url: "#{uri}/match#{id}-0.html"
199
202
  },
200
203
  {
201
204
  filename: data[1][:filename],
202
205
  html: strip_a("<PRE>#{data[1][:html]}</PRE>"),
203
- pct: Integer(top[:pct1])
206
+ pct: Integer(top[:pct1]),
207
+ url: match_url,
208
+ part_url: "#{uri}/match#{id}-1.html"
204
209
  }
205
210
  ]
206
211
  end
@@ -213,11 +218,6 @@ class MossRuby
213
218
 
214
219
  private
215
220
 
216
- # <tr><td><a href="http://moss.stanford.edu/results/916994582/match0.html">./done/COS10009-5/4936175/27258/ (51%)</a>
217
- # </td><td><a href="http://moss.stanford.edu/results/916994582/match0.html">./done/COS10009-5/4928431/34630/ (51%)</a>
218
- # </td><td align="right">80
219
- # </td></tr>
220
-
221
221
  def get_matches(uri, min_pct, callback)
222
222
  result = Array.new
223
223
  begin
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.0
4
+ version: 1.1.1
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-06-27 00:00:00.000000000 Z
11
+ date: 2015-06-29 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/)