pnthr 1.0.0 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c69e755f251091dd59c1f981d2917afb1e612705
4
- data.tar.gz: 2f871cd87237edb54903904b5fa1a994073fa02d
3
+ metadata.gz: aa7c53ab1a31ab1e49234adb0fc26fa4501b3af2
4
+ data.tar.gz: 77bc14383efc74fc3183036bfc6a58e7ddbe6d84
5
5
  SHA512:
6
- metadata.gz: c73241e5538e4b4250d970c9cd4423d403fb989f9d67e00a9bcdb83e6b7ed5aac40f18d56cc91cbde79ad4f7759575bb2b21812e55891482107a8771a0acb9c5
7
- data.tar.gz: a3b7e45466fc785813534bf929a209ba2eb91bd2a5b3975ef1d060c8435e8d543caf1562d99823e0c43fad1d832d3349e6556317cc224be69e6b724102f05323
6
+ metadata.gz: 1505b89d126b1b408ca9759c9a8c987fabe39dd0a73ccab269435ff62a8af4cfbd3ace40f26e1a1d8f32304cd1b6162d0e0940e50c8724f243bdd861f39de3cf
7
+ data.tar.gz: e8ef50e7f76baee7ca321a4c9f76353971dafefbf8b207282a3e82e041b5a326dc1f862025acb4bedd07b3073a46fdc465bc8dc30974ffdd712f64c4c893b11d
data/lib/pnthr/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pnthr
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.4"
3
3
  end
data/lib/pnthr.rb CHANGED
@@ -13,8 +13,8 @@ module Pnthr
13
13
  @cipher = OpenSSL::Cipher::AES.new(secret.length * 8, :CFB)
14
14
 
15
15
  options[:url] ||= 'https://pnthr-api.herokuapp.com/'
16
- options[:ssl].nil? ? true : options[:ssl]
17
- options[:iv] ||= @cipher.random_iv
16
+ options[:ssl] = options[:ssl].nil? ? true : options[:ssl]
17
+ options[:iv] ||= Base64.encode64(rand.to_s)[0..15]
18
18
 
19
19
  @request = {
20
20
  url: options[:url],
@@ -75,8 +75,7 @@ module Pnthr
75
75
  https = Net::HTTP.new(@request[:uri].host, @request[:uri].port)
76
76
  https.use_ssl = @request[:ssl]
77
77
 
78
- package = Base64.encode64(payload).strip! + "-#{@request[:iv]}"
79
- puts package
78
+ package = Base64.encode64(payload).strip! + "-" + @request[:iv]
80
79
 
81
80
  https.post(@request[:uri].path, package, { 'pnthr' => @request[:id] })
82
81
  end
@@ -3,8 +3,8 @@ require 'pnthr'
3
3
 
4
4
  describe Pnthr do
5
5
 
6
- host_url = 'http://localhost:3000/'
7
- ssl_on = false
6
+ host_url = 'https://pnthr-api.herokuapp.com/'
7
+ ssl_on = true
8
8
  app_id = '534c33bb6637350002000000'
9
9
  app_secret = '9857ec6046ee8d22b90ce68214a8304b'
10
10
 
@@ -24,7 +24,7 @@ describe Pnthr do
24
24
  end
25
25
 
26
26
  it "should not use SSL for local tests" do
27
- pnthr.request[:ssl].should be false
27
+ pnthr.request[:ssl].should be true
28
28
  end
29
29
 
30
30
  it "should properly set the request url" do
@@ -52,7 +52,7 @@ describe Pnthr do
52
52
  end
53
53
 
54
54
  it "should respond with a predictable string" do
55
- response.body.should eq 'NuCn7VFKvrcLzneoRG4='
55
+ response.body.should eq 'NuCn7VFKvrcLzneoRG4=-534c33bb66373500'
56
56
  end
57
57
 
58
58
  it "should encrypt with a predictable string" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pnthr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clay McIlrath
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-24 00:00:00.000000000 Z
11
+ date: 2014-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler