refworks 0.0.4 → 0.0.5
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 +8 -8
- data/lib/refworks.rb +1 -0
- data/lib/refworks/response.rb +11 -0
- data/lib/refworks/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OWQ2MjI4OTZjODQzMDQxNzgyMjU5Y2Q5NzhiNzc5NzAzYTgxZDU5YQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZmMwOWNmMzU2ZTQ1N2Y0MTUwYTM2OWUzZmVkNTY5MThlOTQ5M2VkNA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzdhMDY1M2E0ZTc0YmY1ZTdiMjg4ZTc4YTdiZTkyNzdlMzk5MDgwOGViNjZk
|
10
|
+
MWY2ZTM1N2NkYmM5YTM4ZWJkODBjMDJhZDM2Nzg3NDVlM2JmMzE5Y2I3NTcy
|
11
|
+
N2JhMDExNjVhMjFiNWRiMzhiMzYxNDhjMWNkMGRiODY5YzhkYjU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODQxNDU1NWEwZGRiYTM0NTgzYzg4MjQwMjZhNDUwNzM0M2M1ZDg3NzkwZjVk
|
14
|
+
MjgzODMzNmMzNzY5MjFhNTBjMWUzM2QwNzA3ZTQ2NmZkNWUzZDFiOGY5YzQ4
|
15
|
+
MTE3MjNjZThhN2ZjMzFhNTQ5NmE0YmYyNWVlNmI2ZjAxZDg2MGI=
|
data/lib/refworks.rb
CHANGED
data/lib/refworks/response.rb
CHANGED
@@ -3,6 +3,17 @@ class Response
|
|
3
3
|
attr_reader :body, :parsed_response, :result_code, :result_msg, :process_time
|
4
4
|
|
5
5
|
def initialize(raw_response)
|
6
|
+
# The RefWorks API emits invalid XML. Specifically, when the session is invalid, the ResultMsg field
|
7
|
+
# which comes back contains some illegal raw characters. This is the only set of transformations I
|
8
|
+
# could find which completely eliminate the junk characters.
|
9
|
+
|
10
|
+
p raw_response.body
|
11
|
+
|
12
|
+
raw_response.body.encode!('UTF-8', 'binary', :invalid => :replace, :undef => :replace, :replace => '?')
|
13
|
+
raw_response.body.gsub!(/[\u0001-\u0019]/,'?')
|
14
|
+
|
15
|
+
p raw_response.body
|
16
|
+
|
6
17
|
@body = raw_response.body
|
7
18
|
@parsed_response = raw_response.parsed_response
|
8
19
|
@result_code = parsed_response["refworks"]["RWResult"]["result"]
|
data/lib/refworks/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refworks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fran Fabrizio
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|