omniauth-ravelry 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in omniauth-ravelry.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Emily Price
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.markdown ADDED
@@ -0,0 +1,24 @@
1
+ # Omniauth strategy for Ravelry
2
+
3
+ This is the unofficial OmniAuth strategy for authenticating to Ravelry. To use it, you'll need to request an OAuth2 key and secret . See the [Ravlery API Group](http://www.ravelry.com/groups/ravelry-api) for more info on getting one.
4
+
5
+ ## Basic usage
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'omniauth-ravelry'
10
+
11
+
12
+ Set up your strategy:
13
+
14
+ use OmniAuth::Builder do
15
+ provider :ravelry, ENV['RAVELRY_KEY'], ENV['RAVELRY_SECRET']
16
+ end
17
+
18
+ ## Contributing
19
+
20
+ 1. Fork it
21
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
22
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
23
+ 4. Push to the branch (`git push origin my-new-feature`)
24
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
@@ -0,0 +1,5 @@
1
+ module Omniauth
2
+ module Ravelry
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,32 @@
1
+ require 'omniauth-oauth'
2
+
3
+ module OmniAuth
4
+ module Strategies
5
+ class Ravelry < OmniAuth::Strategies::OAuth
6
+ option :name, 'ravelry'
7
+ option :client_options, {
8
+ :site => 'https://www.ravelry.com'
9
+ }
10
+
11
+ uid{ request.params['username'] }
12
+
13
+ info do
14
+ {
15
+ :name => raw_info['name'],
16
+ :location => raw_info['city']
17
+ }
18
+ end
19
+
20
+ extra do
21
+ {
22
+ 'raw_info' => raw_info
23
+ }
24
+ end
25
+
26
+ def raw_info
27
+ {}
28
+ end
29
+
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,2 @@
1
+ require 'omniauth/ravelry/version'
2
+ require 'omniauth/strategies/ravelry'
@@ -0,0 +1,26 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/omniauth/ravelry/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["Emily Price"]
6
+ gem.email = ["price.emily@gmail.com"]
7
+ gem.description = %q{OmniAuth strategy for Ravelry}
8
+ gem.summary = %q{OmniAuth strategy for Ravelry}
9
+ gem.homepage = "http://github.com/duien/omniauth-ravelry"
10
+
11
+ gem.files = `git ls-files`.split($\)
12
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
+ gem.name = "omniauth-ravelry"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = Omniauth::Ravelry::VERSION
17
+
18
+ gem.add_dependency "omniauth", "~> 1.1.0"
19
+ gem.add_dependency "omniauth-oauth", "~> 1.0.1"
20
+ gem.add_dependency "faraday"
21
+ gem.add_dependency "multi_json"
22
+
23
+ gem.add_development_dependency "rake"
24
+ gem.add_development_dependency "rspec", "~> 2.7"
25
+ gem.add_development_dependency "rack-test"
26
+ end
@@ -0,0 +1,13 @@
1
+ $:.unshift File.expand_path('..', __FILE__)
2
+ $:.unshift File.expand_path('../../lib', __FILE__)
3
+ require 'rspec'
4
+ require 'rack/test'
5
+ require 'omniauth'
6
+ require 'omniauth-ravelry'
7
+
8
+ Dir[File.expand_path('../support/**/*', __FILE__)].each { |f| require f }
9
+
10
+ RSpec.configure do |config|
11
+ config.include Rack::Test::Methods
12
+ config.extend OmniAuth::Test::StrategyMacros, :type => :strategy
13
+ end
metadata ADDED
@@ -0,0 +1,133 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-ravelry
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Emily Price
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-07-24 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: omniauth
16
+ requirement: &70135437867780 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 1.1.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70135437867780
25
+ - !ruby/object:Gem::Dependency
26
+ name: omniauth-oauth
27
+ requirement: &70135437867280 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: 1.0.1
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *70135437867280
36
+ - !ruby/object:Gem::Dependency
37
+ name: faraday
38
+ requirement: &70135437866900 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: *70135437866900
47
+ - !ruby/object:Gem::Dependency
48
+ name: multi_json
49
+ requirement: &70135437866440 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :runtime
56
+ prerelease: false
57
+ version_requirements: *70135437866440
58
+ - !ruby/object:Gem::Dependency
59
+ name: rake
60
+ requirement: &70135437866020 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ type: :development
67
+ prerelease: false
68
+ version_requirements: *70135437866020
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: &70135437865520 !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ~>
75
+ - !ruby/object:Gem::Version
76
+ version: '2.7'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: *70135437865520
80
+ - !ruby/object:Gem::Dependency
81
+ name: rack-test
82
+ requirement: &70135437865100 !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ type: :development
89
+ prerelease: false
90
+ version_requirements: *70135437865100
91
+ description: OmniAuth strategy for Ravelry
92
+ email:
93
+ - price.emily@gmail.com
94
+ executables: []
95
+ extensions: []
96
+ extra_rdoc_files: []
97
+ files:
98
+ - .gitignore
99
+ - Gemfile
100
+ - LICENSE
101
+ - README.markdown
102
+ - Rakefile
103
+ - lib/omniauth-ravelry.rb
104
+ - lib/omniauth/ravelry/version.rb
105
+ - lib/omniauth/strategies/ravelry.rb
106
+ - omniauth-ravelry.gemspec
107
+ - spec/spec_helper.rb
108
+ homepage: http://github.com/duien/omniauth-ravelry
109
+ licenses: []
110
+ post_install_message:
111
+ rdoc_options: []
112
+ require_paths:
113
+ - lib
114
+ required_ruby_version: !ruby/object:Gem::Requirement
115
+ none: false
116
+ requirements:
117
+ - - ! '>='
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
120
+ required_rubygems_version: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ requirements: []
127
+ rubyforge_project:
128
+ rubygems_version: 1.8.6
129
+ signing_key:
130
+ specification_version: 3
131
+ summary: OmniAuth strategy for Ravelry
132
+ test_files:
133
+ - spec/spec_helper.rb