Commit db0570da356665df8e9fc7363cab2aca25b3c572
1 parent
4fa137d0
Exists in
master
and in
2 other branches
Corrected sintax errors
Showing
8 changed files
with
17 additions
and
22 deletions
Show diff stats
Gemfile
@@ -3,10 +3,9 @@ source "http://rubygems.org" | @@ -3,10 +3,9 @@ source "http://rubygems.org" | ||
3 | gemspec | 3 | gemspec |
4 | 4 | ||
5 | group :development, :test do | 5 | group :development, :test do |
6 | - gem 'guard' | ||
7 | - gem 'guard-rspec' | ||
8 | - gem 'guard-bundler' | ||
9 | - gem 'rb-fsevent' | ||
10 | - gem 'simplecov' | 6 | + gem 'guard' |
7 | + gem 'guard-rspec' | ||
8 | + gem 'guard-bundler' | ||
9 | + gem 'rb-fsevent' | ||
10 | + gem 'simplecov' | ||
11 | end | 11 | end |
12 | - |
Rakefile
lib/omniauth/remote_user.rb
lib/omniauth/strategies/remote_user.rb
lib/omniauth_remote_user.rb
lib/omniauth_remote_user/version.rb
references/teste.rb
1 | # references: http://ruby-doc.org/stdlib-2.1.1/libdoc/net/http/rdoc/Net/HTTPHeader.html#method-i-add_field | 1 | # references: http://ruby-doc.org/stdlib-2.1.1/libdoc/net/http/rdoc/Net/HTTPHeader.html#method-i-add_field |
2 | -# import the netHTTP | 2 | +# import the netHTTP |
3 | require 'net/http' | 3 | require 'net/http' |
4 | 4 | ||
5 | # uri get the url http headers | 5 | # uri get the url http headers |
@@ -13,7 +13,7 @@ http_request.each_header { |header,value| puts header + " " + value } | @@ -13,7 +13,7 @@ http_request.each_header { |header,value| puts header + " " + value } | ||
13 | #http_request.set_form_data({"REMOTE_USER" => "siqueira"}) | 13 | #http_request.set_form_data({"REMOTE_USER" => "siqueira"}) |
14 | #http_request.set_form_data({"q" => "ruby", "lang" => "en"}, ';') | 14 | #http_request.set_form_data({"q" => "ruby", "lang" => "en"}, ';') |
15 | 15 | ||
16 | -### add_field adicona um campo novo ou seja um novo HTTP_HEADER no nosso caso o REMOTE_USER | 16 | +### add_field adicona um campo novo ou seja um novo HTTP_HEADER no nosso caso o REMOTE_USER |
17 | http_request.add_field 'REMOTE_USER', 'siqueira' | 17 | http_request.add_field 'REMOTE_USER', 'siqueira' |
18 | 18 | ||
19 | # Com o get_field podemos pegar o conteudo do header REMOTE_USER | 19 | # Com o get_field podemos pegar o conteudo do header REMOTE_USER |
@@ -22,8 +22,8 @@ puts http_request.get_fields('REMOTE_USER') | @@ -22,8 +22,8 @@ puts http_request.get_fields('REMOTE_USER') | ||
22 | # => accept-encoding | 22 | # => accept-encoding |
23 | # => accept | 23 | # => accept |
24 | # => user-agent | 24 | # => user-agent |
25 | -# => host | 25 | +# => host |
26 | 26 | ||
27 | http_response = Net::HTTP.start(uri.hostname, uri.port) do |http| | 27 | http_response = Net::HTTP.start(uri.hostname, uri.port) do |http| |
28 | - http.request(http_request) | 28 | + http.request(http_request) |
29 | end | 29 | end |
spec/spec_helper.rb
@@ -9,6 +9,5 @@ require 'rack/test' | @@ -9,6 +9,5 @@ require 'rack/test' | ||
9 | require 'omniauth/remote_user' | 9 | require 'omniauth/remote_user' |
10 | 10 | ||
11 | RSpec.configure do |config| | 11 | RSpec.configure do |config| |
12 | - config.include Rack::Test::Methods | 12 | + config.include Rack::Test::Methods |
13 | end | 13 | end |
14 | - |