irus_analytics 0.0.1 → 0.0.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
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YTkzNzFkYmU1YzliZjc2YjExZTk5NmY0NWNlOTU1NWVhYTI5NGU0NA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDcyZWUyZTYzNGYxMjFjZTkzMDBlMTYwYzVhZjJhODQ2ZDdkOWY3Yw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MDdiYjJjNDhiNDFjMjI5YmZkM2Y0OWYxZTAxOTY0ZWQwNjU4MWVjZWNjNzQ5
|
10
|
+
MzkwNWJiOTllMDc3OWI4OWNhNzBmMzE0Nzg2YmQ3ZGI3MTM5ZGE1NTczMDgw
|
11
|
+
NGFhMjRlNmE2MmM5OWIxNTM2MzdkNDk1NzAyODlhNzZjYzMwNzY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OGM4ZmUyNzk2YzI5NmRmODlkYWJmOGQ3MTM0ZjI0ZjgyODc1Y2YyM2M0M2Yw
|
14
|
+
N2FhOTc4MWRlMDMzNmZmNWRjYmFmZmUxNjAzNzQ2MGZkOTNmNDQ5NmM0YzFm
|
15
|
+
MTU4MTlkYTdlNWI3YjljNzVlNmE0MDNlNWY5ZDc1NjQxNzg5ZjU=
|
@@ -42,10 +42,14 @@ module IrusAnalytics
|
|
42
42
|
|
43
43
|
# At present, all the params, are mandatory...
|
44
44
|
def missing_mandatory_params?(params)
|
45
|
-
|
45
|
+
mandatory_params.each { |mandatory_param| @missing_params << mandatory_param if params[mandatory_param].to_s.empty? }
|
46
46
|
return !@missing_params.empty?
|
47
47
|
end
|
48
48
|
|
49
|
+
def mandatory_params
|
50
|
+
[:date_stamp, :client_ip_address, :user_agent, :item_oai_identifier, :file_url, :source_repository]
|
51
|
+
end
|
52
|
+
|
49
53
|
def openurl_link_resolver(context_object)
|
50
54
|
OpenURL::Transport.new(@irus_server_address, context_object)
|
51
55
|
end
|
@@ -24,7 +24,14 @@ describe IrusAnalytics::IrusAnalyticsService do
|
|
24
24
|
end
|
25
25
|
|
26
26
|
it "will throw an exception if any of the mandatory IRUS data is missing" do
|
27
|
-
|
27
|
+
irus_analytics_service.irus_server_address = "irus_address"
|
28
|
+
expect { irus_analytics_service.send_analytics({}) }.to raise_error(/Missing the following required params/)
|
29
|
+
end
|
30
|
+
|
31
|
+
it "will allow for a nil http referer" do
|
32
|
+
irus_analytics_service.irus_server_address = "irus_address"
|
33
|
+
test_params[:http_referer] = nil
|
34
|
+
irus_analytics_service.send_analytics(test_params)
|
28
35
|
end
|
29
36
|
|
30
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: irus_analytics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Lamb
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: openurl
|