File tree 2 files changed +31
-30
lines changed
2 files changed +31
-30
lines changed Original file line number Diff line number Diff line change 1
- OAUTH_CONFIG = { :sites => { } , :model => nil }
2
-
3
- Dir [ "#{ Rails . root } /config/oauth/*.yml" ] . collect { |f |
4
- YAML . load_file ( f ) . each_pair { |site , props |
5
- OAUTH_CONFIG [ :sites ] . update ( site . to_sym => { } ) unless OAUTH_CONFIG [ :sites ] . has_key? site . to_sym
6
- if props . class == Hash
7
- props . each_pair { |k , v |
8
- OAUTH_CONFIG [ :sites ] [ site . to_sym ] . update ( k . to_sym => v )
9
- }
10
- end
11
- }
12
- }
1
+ require 'oauth/consumer'
13
2
14
- module Rails
15
- class << self
16
- def oauth
17
- OAUTH_CONFIG [ :sites ]
18
- end
19
- def oauth_model
20
- OAUTH_CONFIG [ :model ]
21
- end
22
- def oauth_model = model
23
- OAUTH_CONFIG [ :model ] = model
24
- end
25
- end
26
- end
3
+ require 'oauth_side/ext/hash'
27
4
5
+ require 'oauth_controller'
6
+ require 'oauth_token'
7
+ require 'oauth_side/model'
28
8
29
- require 'oauth/consumer'
30
9
require 'oauth_side'
Original file line number Diff line number Diff line change 1
- require 'oauth_side/ext/hash'
2
- require 'oauth_controller'
3
- require 'oauth_token'
4
- require 'oauth_side/model'
1
+ OAUTH_CONFIG = { :sites => { } , :model => nil }
2
+
3
+ Dir [ "#{ Rails . root } /config/oauth/*.yml" ] . collect { |f |
4
+ YAML . load_file ( f ) . each_pair { |site , props |
5
+ OAUTH_CONFIG [ :sites ] . update ( site . to_sym => { } ) unless OAUTH_CONFIG [ :sites ] . has_key? site . to_sym
6
+ if props . class == Hash
7
+ props . each_pair { |k , v |
8
+ OAUTH_CONFIG [ :sites ] [ site . to_sym ] . update ( k . to_sym => v )
9
+ }
10
+ end
11
+ }
12
+ }
13
+
14
+ module Rails
15
+ class << self
16
+ def oauth
17
+ OAUTH_CONFIG [ :sites ]
18
+ end
19
+ def oauth_model
20
+ OAUTH_CONFIG [ :model ]
21
+ end
22
+ def oauth_model = model
23
+ OAUTH_CONFIG [ :model ] = model
24
+ end
25
+ end
26
+ end
5
27
6
28
Rails . oauth . each_pair { |site , props |
7
29
OauthController . class_eval <<-EOF
You can’t perform that action at this time.
0 commit comments