mage-hand 0.0.0 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/mage-hand.rb +24 -0
  3. data/mage-hand.gemspec +1 -1
  4. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.0
1
+ 0.0.1
@@ -0,0 +1,24 @@
1
+ require 'ob_port/client'
2
+
3
+ module ObPort
4
+
5
+ protected
6
+
7
+ def ob_port_login_required
8
+ @ob_client = ObPort::Client.new(session[:request_token], session[:access_token], request.url, params)
9
+ store_tokens
10
+ return true if logged_in?
11
+
12
+ redirect_to @ob_client.request_token.authorize_url
13
+ false
14
+ end
15
+
16
+ def logged_in?
17
+ @ob_client.logged_in?
18
+ end
19
+
20
+ def store_tokens
21
+ session[:request_token] = @ob_client.request_token
22
+ session[:access_token] = @ob_client.access_token
23
+ end
24
+ end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mage-hand}
8
- s.version = "0.0.0"
8
+ s.version = "0.0.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Steven Hammond"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mage-hand
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 0
10
- version: 0.0.0
9
+ - 1
10
+ version: 0.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Steven Hammond