omniauth-naranya_id 0.0.1 → 0.0.2

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: c4711dada90933e432f48d98714255757b639097
4
- data.tar.gz: cdca19404edb5e966db62ca1112b422f94ef5843
3
+ metadata.gz: 2c6cf87ecd4cfbc16285bc461405172991bcb343
4
+ data.tar.gz: cfc67136830bdf7e2cd7f6218828b333a4895df3
5
5
  SHA512:
6
- metadata.gz: e838aa519f8f92eb42988330d8e93f792250697a0c237b2603d06a12ea8ef0d40c74d63406f613c1a46037b6767caf6d9b99b1e1857489bd7d5066bad0dc5b78
7
- data.tar.gz: c895b918b6872427338bb2ba5956cc6a691eb168e70a341ad91b93fe95d68f1541282b48688598fa83af45b167505674b4442bfbd519855e2da55095578f4e1e
6
+ metadata.gz: 3dbf9a155d795624b9e5934c4e8ec58a1d288d23b6d8c17e2d92bb510f111a897895db49fbd545a3f403bf16bb106dc199ec3c085851791b2e7c3748fb0d80e3
7
+ data.tar.gz: 9376eeee039cd19281b74f974c1b628b60a42fd5fae99bc67541d03d7020f1f1bc36dec70c5aa919d3bfd959a9a6599eb9bbf84cc8a1e3f78286cba0cc676bb7
data/lib/naranya_id.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  require 'oauth'
2
2
  require 'active_support'
3
+ require 'active_support/core_ext/hash'
4
+
3
5
  module NaranyaId
4
6
 
5
7
  extend ActiveSupport::Autoload
@@ -1,3 +1,5 @@
1
+ require 'active_support/core_ext/hash'
2
+
1
3
  module NaranyaId
2
4
  class User
3
5
  include ActiveModel::Model
@@ -10,6 +12,11 @@ module NaranyaId
10
12
 
11
13
  class << self
12
14
 
15
+ def email_exists?(given_email_address)
16
+ Net::HTTP.get
17
+ consumer.post('/register/checkemail.php')
18
+ end
19
+
13
20
  def translate_attributes(attributes)
14
21
  translated_attributes = {
15
22
  id: attributes[:uuid],
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module NaranyaId
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  require 'omniauth-oauth'
2
- require 'multi_json'
2
+ require 'active_support/core_ext/hash'
3
3
  require 'naranya_id'
4
4
  require 'oauth/signature/plaintext'
5
5
 
@@ -48,6 +48,17 @@ module OmniAuth
48
48
  end
49
49
  end
50
50
 
51
+ # Override para habilitar/deshabilitar el output de debuggeo de HTTP:
52
+ def consumer
53
+ consumer = ::OAuth::Consumer.new(options.consumer_key, options.consumer_secret, options.client_options)
54
+ consumer.http.open_timeout = options.open_timeout if options.open_timeout
55
+ consumer.http.read_timeout = options.read_timeout if options.read_timeout
56
+
57
+ # Se habilita el output sólo si en las opciones debug_oauth es true:
58
+ consumer.http.set_debug_output($stderr) if options.debug_oauth
59
+ consumer
60
+ end
61
+
51
62
  # Indicates if the SDK's api key + secret are missing
52
63
  def sdk_key_or_secret_missing?
53
64
  !(::NaranyaId.config.has_key?(:api_key) && ::NaranyaId.config.has_key?(:api_secret))
@@ -18,9 +18,8 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "activesupport", "~> 4"
22
- spec.add_dependency "activemodel", "~> 4"
23
-
21
+ spec.add_runtime_dependency "activesupport", "~> 4"
22
+ spec.add_runtime_dependency "activemodel", "~> 4"
24
23
  spec.add_runtime_dependency 'omniauth-oauth', '~> 1.0'
25
24
 
26
25
  spec.add_development_dependency 'bundler', "~> 1.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-naranya_id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Quintanilla
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-06 00:00:00.000000000 Z
11
+ date: 2014-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport