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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6adae638d0482d2722c43ec24fb795af80805f8b
4
- data.tar.gz: b3a43c6695b5b84f7548b15ad26df7d1161a63f5
3
+ metadata.gz: dd491db9c71eacf30cdb43479ded32b1c3fa3e08
4
+ data.tar.gz: 94c72d9762cc82fd8414f8b4ca8e8dcee67328c9
5
5
  SHA512:
6
- metadata.gz: 7a3a98542149a438aadbb52b2e74066dcef40a677f53f6ef7bb316f7688ded0136d76df8e46f790160bb33475fce58a9ce242cd511345c0692b2aef0f46fb538
7
- data.tar.gz: e6cce06b9a7b04ecceadd035380ac44888bc642ecddb0b7a24b5f1c4c5415534e490dc177b9dfe3125f2370274da2d408dff7155db444c9696884471f59077c3
6
+ metadata.gz: 51100c857a3c19701a06efa509b563c977d9b5af74e0b018e87cb596867e56a8a93dafce407a3ec3b297eb46a3b679fdbd4f304acb8b4ac774f1d8d2dbf5802b
7
+ data.tar.gz: 822c5768139f6696e1a7bf761e69435618428e0811799b7808bd51ee09fff60b69c09cfc53959ae40d60cd0c3953ab7463029e3125f048541cd0ac9d43d336e0
@@ -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" 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
- @host = host
18
- @client = client
19
- @key = key
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
@@ -1,3 +1,3 @@
1
1
  module CRP
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
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
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-28 00:00:00.000000000 Z
11
+ date: 2013-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: webmock