crp 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 +4 -4
- data/lib/crp/review_poster.rb +12 -7
- data/lib/crp/version.rb +1 -1
- 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: dd491db9c71eacf30cdb43479ded32b1c3fa3e08
|
4
|
+
data.tar.gz: 94c72d9762cc82fd8414f8b4ca8e8dcee67328c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51100c857a3c19701a06efa509b563c977d9b5af74e0b018e87cb596867e56a8a93dafce407a3ec3b297eb46a3b679fdbd4f304acb8b4ac774f1d8d2dbf5802b
|
7
|
+
data.tar.gz: 822c5768139f6696e1a7bf761e69435618428e0811799b7808bd51ee09fff60b69c09cfc53959ae40d60cd0c3953ab7463029e3125f048541cd0ac9d43d336e0
|
data/lib/crp/review_poster.rb
CHANGED
@@ -10,13 +10,17 @@ module CRP
|
|
10
10
|
DESCRIPTION_REVIEW_CODE = 2
|
11
11
|
IMAGE_REVIEW_CODE = 3
|
12
12
|
|
13
|
-
def initialize(host = ENV['CRP_HOST'], client = ENV['CRP_CLIENT'], key = ENV['CRP_KEY'])
|
14
|
-
raise ArgumentError, "Missing CRP host"
|
15
|
-
raise ArgumentError, "Missing CRP client"
|
16
|
-
raise ArgumentError, "Missing CRP key"
|
17
|
-
|
18
|
-
|
19
|
-
@
|
13
|
+
def initialize(host = ENV['CRP_HOST'], client = ENV['CRP_CLIENT'], key = ENV['CRP_KEY'], username = ENV['CRP_USERNAME'], password = ENV['CRP_PASSWORD'])
|
14
|
+
raise ArgumentError, "Missing CRP host" if host.nil? || host.strip.empty?
|
15
|
+
raise ArgumentError, "Missing CRP client" if client.nil? || client.strip.empty?
|
16
|
+
raise ArgumentError, "Missing CRP key" if key.nil? || key.strip.empty?
|
17
|
+
raise ArgumentError, "Missing CRP username" if username.nil? || username.strip.empty?
|
18
|
+
raise ArgumentError, "Missing CRP password" if password.nil? || password.strip.empty?
|
19
|
+
@host = host
|
20
|
+
@client = client
|
21
|
+
@key = key
|
22
|
+
@username = username
|
23
|
+
@password = password
|
20
24
|
end
|
21
25
|
|
22
26
|
# Submits a new username review to CRP.
|
@@ -41,6 +45,7 @@ module CRP
|
|
41
45
|
http.use_ssl = true
|
42
46
|
http.verify_mode = OpenSSL::SSL::VERIFY_NONE # Host certificate does not cover the subdomain
|
43
47
|
request = Net::HTTP::Get.new(uri.request_uri)
|
48
|
+
request.basic_auth(@username, @password)
|
44
49
|
response = http.request(request)
|
45
50
|
ReviewResponse.new(response)
|
46
51
|
end
|
data/lib/crp/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crp
|
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
|
- Agile Wings
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: webmock
|