login_radius 0.0.1 → 1.0.0
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 +7 -0
- data/lib/hash.rb +12 -12
- data/lib/login_radius.rb +12 -11
- data/lib/login_radius/exception.rb +4 -4
- data/lib/login_radius/messages.rb +41 -102
- data/lib/login_radius/related.rb +34 -0
- data/lib/login_radius/user_profile.rb +101 -102
- data/lib/login_radius/user_profile_getters.rb +151 -105
- data/lib/login_radius/version.rb +3 -3
- data/lib/string.rb +7 -8
- metadata +20 -91
- data/.DS_Store +0 -0
- data/.gitignore +0 -18
- data/Gemfile +0 -25
- data/LICENSE +0 -22
- data/LoginRadiusTestApp/.gitignore +0 -15
- data/LoginRadiusTestApp/Gemfile +0 -42
- data/LoginRadiusTestApp/Gemfile.lock +0 -136
- data/LoginRadiusTestApp/README.rdoc +0 -261
- data/LoginRadiusTestApp/Rakefile +0 -7
- data/LoginRadiusTestApp/app/assets/images/rails.png +0 -0
- data/LoginRadiusTestApp/app/assets/javascripts/application.js +0 -15
- data/LoginRadiusTestApp/app/assets/stylesheets/application.css +0 -13
- data/LoginRadiusTestApp/app/controllers/application_controller.rb +0 -17
- data/LoginRadiusTestApp/app/helpers/application_helper.rb +0 -2
- data/LoginRadiusTestApp/app/mailers/.gitkeep +0 -0
- data/LoginRadiusTestApp/app/models/.gitkeep +0 -0
- data/LoginRadiusTestApp/app/views/application/callback.html.erb +0 -1
- data/LoginRadiusTestApp/app/views/application/index.html.erb +0 -7
- data/LoginRadiusTestApp/app/views/layouts/application.html.erb +0 -14
- data/LoginRadiusTestApp/config.ru +0 -4
- data/LoginRadiusTestApp/config/application.rb +0 -62
- data/LoginRadiusTestApp/config/boot.rb +0 -6
- data/LoginRadiusTestApp/config/database.yml +0 -25
- data/LoginRadiusTestApp/config/environment.rb +0 -5
- data/LoginRadiusTestApp/config/environments/development.rb +0 -37
- data/LoginRadiusTestApp/config/environments/production.rb +0 -67
- data/LoginRadiusTestApp/config/environments/test.rb +0 -37
- data/LoginRadiusTestApp/config/initializers/backtrace_silencers.rb +0 -7
- data/LoginRadiusTestApp/config/initializers/inflections.rb +0 -15
- data/LoginRadiusTestApp/config/initializers/mime_types.rb +0 -5
- data/LoginRadiusTestApp/config/initializers/secret_token.rb +0 -7
- data/LoginRadiusTestApp/config/initializers/session_store.rb +0 -8
- data/LoginRadiusTestApp/config/initializers/wrap_parameters.rb +0 -14
- data/LoginRadiusTestApp/config/locales/en.yml +0 -5
- data/LoginRadiusTestApp/config/routes.rb +0 -61
- data/LoginRadiusTestApp/db/seeds.rb +0 -7
- data/LoginRadiusTestApp/lib/assets/.gitkeep +0 -0
- data/LoginRadiusTestApp/lib/tasks/.gitkeep +0 -0
- data/LoginRadiusTestApp/log/.gitkeep +0 -0
- data/LoginRadiusTestApp/public/404.html +0 -26
- data/LoginRadiusTestApp/public/422.html +0 -26
- data/LoginRadiusTestApp/public/500.html +0 -25
- data/LoginRadiusTestApp/public/favicon.ico +0 -0
- data/LoginRadiusTestApp/public/robots.txt +0 -5
- data/LoginRadiusTestApp/script/rails +0 -6
- data/LoginRadiusTestApp/test/fixtures/.gitkeep +0 -0
- data/LoginRadiusTestApp/test/functional/.gitkeep +0 -0
- data/LoginRadiusTestApp/test/integration/.gitkeep +0 -0
- data/LoginRadiusTestApp/test/performance/browsing_test.rb +0 -12
- data/LoginRadiusTestApp/test/test_helper.rb +0 -13
- data/LoginRadiusTestApp/test/unit/.gitkeep +0 -0
- data/LoginRadiusTestApp/vendor/assets/javascripts/.gitkeep +0 -0
- data/LoginRadiusTestApp/vendor/assets/stylesheets/.gitkeep +0 -0
- data/LoginRadiusTestApp/vendor/plugins/.gitkeep +0 -0
- data/README.md +0 -417
- data/Rakefile +0 -2
- data/login_radius.gemspec +0 -20
- data/test/.DS_Store +0 -0
- data/test/basic_async_test.rb +0 -29
- data/test/unit/.DS_Store +0 -0
- data/test/unit/base_test.rb +0 -11
- data/test/unit/user_profile_test.rb +0 -68
data/Rakefile
DELETED
data/login_radius.gemspec
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
require File.expand_path('../lib/login_radius/version', __FILE__)
|
3
|
-
|
4
|
-
Gem::Specification.new do |gem|
|
5
|
-
gem.authors = ["LoginRadius"]
|
6
|
-
gem.email = ["developers@loginradius.com"]
|
7
|
-
gem.description = %q{Ruby wrapper for LoginRadius API}
|
8
|
-
gem.summary = %q{Is a ruby wrapper for LoginRadius API}
|
9
|
-
gem.homepage = "http://www.loginradius.com"
|
10
|
-
gem.files = `git ls-files`.split($\)
|
11
|
-
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
12
|
-
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
13
|
-
gem.name = "login_radius"
|
14
|
-
gem.require_paths = ["lib"]
|
15
|
-
gem.version = LoginRadius::VERSION
|
16
|
-
|
17
|
-
gem.add_dependency 'em-http-request'
|
18
|
-
gem.add_dependency 'em-synchrony'
|
19
|
-
|
20
|
-
end
|
data/test/.DS_Store
DELETED
Binary file
|
data/test/basic_async_test.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
#Just a basic ruby script for testing EM-Synchrony.
|
2
|
-
#Run it in the command line: bundle exec ruby test/basic_async_test.rb
|
3
|
-
#Just does a few GETs to make sure it works in the EM environment.
|
4
|
-
require "rubygems"
|
5
|
-
require "bundler"
|
6
|
-
Bundler.require(:default, :test)
|
7
|
-
require 'em-synchrony'
|
8
|
-
require "em-synchrony/em-http"
|
9
|
-
|
10
|
-
require 'yaml'
|
11
|
-
base_dir = File.expand_path(File.join(File.dirname(__FILE__), "../"))
|
12
|
-
require base_dir + "/lib/login_radius.rb"
|
13
|
-
|
14
|
-
EM.synchrony do
|
15
|
-
TOKEN = "2543d3b0-d3f3-480e-a320-48f297446458"
|
16
|
-
SECRET = "1337670d-f7fd-4066-a2e3-e440aec071ee"
|
17
|
-
|
18
|
-
time = Time.now
|
19
|
-
@user_profile = LoginRadius::UserProfile.new({
|
20
|
-
:token => TOKEN,
|
21
|
-
:secret => SECRET,
|
22
|
-
:async => true
|
23
|
-
})
|
24
|
-
|
25
|
-
@user_profile.login
|
26
|
-
puts @user_profile.contacts!.first
|
27
|
-
p "Total time async was #{Time.now - time}"
|
28
|
-
|
29
|
-
end
|
data/test/unit/.DS_Store
DELETED
Binary file
|
data/test/unit/base_test.rb
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
require "rubygems"
|
2
|
-
require "bundler"
|
3
|
-
Bundler.require(:default, :test)
|
4
|
-
require 'yaml'
|
5
|
-
base_dir = File.expand_path(File.join(File.dirname(__FILE__), "../.."))
|
6
|
-
require base_dir + "/lib/login_radius.rb"
|
7
|
-
|
8
|
-
class BaseTest < ActiveSupport::TestCase
|
9
|
-
def setup
|
10
|
-
end
|
11
|
-
end
|
@@ -1,68 +0,0 @@
|
|
1
|
-
require_relative 'base_test.rb'
|
2
|
-
class UserProfileTest < BaseTest
|
3
|
-
TOKEN = "yourtoken"
|
4
|
-
SECRET = "yoursecret"
|
5
|
-
|
6
|
-
def setup
|
7
|
-
@user_profile = LoginRadius::UserProfile.new({
|
8
|
-
:token => TOKEN,
|
9
|
-
:secret => SECRET,
|
10
|
-
:async => false
|
11
|
-
})
|
12
|
-
@user_profile.login
|
13
|
-
end
|
14
|
-
|
15
|
-
test "basic user profile login sync" do
|
16
|
-
assert_not_nil(@user_profile.id)
|
17
|
-
assert_not_nil(@user_profile.provider)
|
18
|
-
assert(@user_profile.authenticated?)
|
19
|
-
end
|
20
|
-
|
21
|
-
test "mentions" do
|
22
|
-
assert(@user_profile.twitter_mentions.is_a?(Array))
|
23
|
-
end
|
24
|
-
|
25
|
-
test "timeline" do
|
26
|
-
assert(@user_profile.twitter_timeline.is_a?(Array))
|
27
|
-
end
|
28
|
-
|
29
|
-
test "companies" do
|
30
|
-
assert(@user_profile.linked_in_companies.is_a?(Array))
|
31
|
-
end
|
32
|
-
|
33
|
-
test "contacts" do
|
34
|
-
assert(@user_profile.contacts.is_a?(Array))
|
35
|
-
end
|
36
|
-
|
37
|
-
test "groups" do
|
38
|
-
assert(@user_profile.facebook_groups.is_a?(Array))
|
39
|
-
end
|
40
|
-
|
41
|
-
test "posts" do
|
42
|
-
assert(@user_profile.facebook_posts.is_a?(Array))
|
43
|
-
end
|
44
|
-
|
45
|
-
test "events" do
|
46
|
-
assert(@user_profile.facebook_events.is_a?(Array))
|
47
|
-
end
|
48
|
-
|
49
|
-
test "fb post" do
|
50
|
-
params = {
|
51
|
-
:title => "Testing",
|
52
|
-
:url => "www.loginradius.com",
|
53
|
-
:status => "Wizzup",
|
54
|
-
:caption => "Testly",
|
55
|
-
:description => "Testing"
|
56
|
-
}
|
57
|
-
assert(@user_profile.make_facebook_post(params))
|
58
|
-
end
|
59
|
-
|
60
|
-
test "twitter message" do
|
61
|
-
assert(@user_profile.send_twitter_message(@user_profile.contacts.first[:id], "Testing", "This is a test."))
|
62
|
-
end
|
63
|
-
|
64
|
-
test "linked in message" do
|
65
|
-
assert(@user_profile.send_linked_in_message(@user_profile.contacts.first[:id], "Testing", "This is a test."))
|
66
|
-
end
|
67
|
-
|
68
|
-
end
|