oauth-plugin 0.5.0 → 0.5.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e00863337c0f6f630e99c036361c7590f35e7035
4
- data.tar.gz: 58fff0f6ec7e59f35615c9b395736adc9fe0eb81
3
+ metadata.gz: 401132149e044ecdceaf75dd6c9429909822c7ec
4
+ data.tar.gz: 83fbb145b545e4513149c028974ddb18535b3976
5
5
  SHA512:
6
- metadata.gz: 85b490f713c4e5223b55b8c5e2b8e276103177b97b7f8aeae8887d0b73587083dcda787d1d0401717348ac7e0ba8f6eb55d55fc6bd8e04a528db926f72ee34a1
7
- data.tar.gz: d43ead865825626ffdb3fd5e62edce078973b70b794ec61d72852b5aabdbc1573f83ca861c6058534ca4b1118193072da908e4181509d53f62680f32a7efa279
6
+ metadata.gz: 0588fbbd4e3af917bd41402124f13c0a0e00bef47724639a5b718dc6c8a54f9f6e1083c9e1e6e8f93acc64e21b75c40565251d3a99ac261a2f5b349c1edd2c36
7
+ data.tar.gz: 9bba1d5256f96c667ca3e6021b9b791999660cf571b0f2b0a72472ca37a8da99f50f458f2aed6102f66d0905b6b123f5575423ec0bdbca8d4cd316ed582d9c22
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ 0.5.1
2
+ - Support slim templates for consumer [pelle]
3
+ - Add via argument to match routes to support 4.0 [pelle]
1
4
  0.5.0
2
5
  - Make compatible with Rails 4 [tomhughes]
3
6
  - Added support for RefreshTokens [RubenHoms]
@@ -19,7 +19,7 @@ class OauthConsumerGenerator < Rails::Generator::Base
19
19
  m.template 'controller.rb',File.join('app/controllers',"oauth_consumers_controller.rb")
20
20
  m.route_entry "map.resources :oauth_consumers,:member=>{:callback=>:get}"
21
21
 
22
- @template_extension= options[:haml] ? "haml" : "erb"
22
+ @template_extension= options[:haml] ? "haml" : ( options[:slim] ? "slim": "erb")
23
23
 
24
24
  m.template "show.html.#{@template_extension}", File.join('app/views', 'oauth_consumers', "show.html.#{@template_extension}")
25
25
  m.template "index.html.#{@template_extension}", File.join('app/views', 'oauth_consumers', "index.html.#{@template_extension}")
@@ -46,5 +46,7 @@ class OauthConsumerGenerator < Rails::Generator::Base
46
46
  # "Generate the Test::Unit compatible tests instead of RSpec") { |v| options[:test_unit] = v }
47
47
  opt.on("--haml",
48
48
  "Templates use haml") { |v| options[:haml] = v }
49
+ opt.on("--slim",
50
+ "Templates use slim") { |v| options[:slim] = v }
49
51
  end
50
52
  end
@@ -0,0 +1,15 @@
1
+ h1 Services
2
+
3
+ -if @consumer_tokens.empty?
4
+ p You are currently not connected to any external services.
5
+ -else
6
+ p You are connected to the following services:
7
+ ul
8
+ -@consumer_tokens.each do |token|
9
+ li = link_to token.class.service_name.to_s.humanize, oauth_consumer_path(token.class.service_name)
10
+
11
+ -unless @services.empty?
12
+ h3 You can connect to the following services:
13
+ ul
14
+ -@services.each do |service|
15
+ li = link_to service.to_s.humanize,oauth_consumer_path(service)
@@ -0,0 +1,8 @@
1
+ h1
2
+ | You are already Connected to
3
+ = params[:id].humanize
4
+ - form_tag oauth_consumer_path(params[:id]),:method=>:delete do
5
+ = submit_tag "Disconnect"
6
+ | or
7
+ = submit_tag "Reconnect"
8
+ |if you experienced a problem.
@@ -22,7 +22,7 @@ resources :oauth_consumers do
22
22
  member do
23
23
  get :callback
24
24
  get :callback2
25
- match 'client/*endpoint' => 'oauth_consumers#client'
25
+ match 'client/*endpoint' => 'oauth_consumers#client', :via => [:get, :post, :put, :delete]
26
26
  end
27
27
  end
28
28
  ROUTE
@@ -0,0 +1,21 @@
1
+ require 'rails/generators/erb/controller/controller_generator'
2
+
3
+ module Slim
4
+ module Generators
5
+ class OauthConsumerGenerator < Erb::Generators::Base
6
+ source_root File.expand_path('../oauth_consumer_templates', __FILE__)
7
+
8
+ argument :name, :type => :string, :default => 'Oauth'
9
+
10
+ def copy_view_files
11
+ template 'index.html.slim', File.join('app/views', class_path, 'oauth_consumers', 'index.html.slim')
12
+ template 'show.html.slim', File.join('app/views', class_path, 'oauth_consumers', 'show.html.slim')
13
+ end
14
+
15
+ protected
16
+ def handler
17
+ :slim
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,15 @@
1
+ h1 Services
2
+
3
+ -if @consumer_tokens.empty?
4
+ p You are currently not connected to any external services.
5
+ -else
6
+ p You are connected to the following services:
7
+ ul
8
+ -@consumer_tokens.each do |token|
9
+ li = link_to token.class.service_name.to_s.humanize, oauth_consumer_path(token.class.service_name)
10
+
11
+ -unless @services.empty?
12
+ h3 You can connect to the following services:
13
+ ul
14
+ -@services.each do |service|
15
+ li = link_to service.to_s.humanize,oauth_consumer_path(service)
@@ -0,0 +1,8 @@
1
+ h1
2
+ | You are already Connected to
3
+ = params[:id].humanize
4
+ - form_tag oauth_consumer_path(params[:id]),:method=>:delete do
5
+ = submit_tag "Disconnect"
6
+ | or
7
+ = submit_tag "Reconnect"
8
+ |if you experienced a problem.
@@ -1,5 +1,5 @@
1
1
  module Oauth
2
2
  module Plugin
3
- VERSION = "0.5.0"
3
+ VERSION = "0.5.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oauth-plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pelle Braendgaard
@@ -185,10 +185,12 @@ files:
185
185
  - generators/oauth_consumer/templates/controller.rb
186
186
  - generators/oauth_consumer/templates/index.html.erb
187
187
  - generators/oauth_consumer/templates/index.html.haml
188
+ - generators/oauth_consumer/templates/index.html.slim
188
189
  - generators/oauth_consumer/templates/migration.rb
189
190
  - generators/oauth_consumer/templates/oauth_config.rb
190
191
  - generators/oauth_consumer/templates/show.html.erb
191
192
  - generators/oauth_consumer/templates/show.html.haml
193
+ - generators/oauth_consumer/templates/show.html.slim
192
194
  - generators/oauth_provider/USAGE
193
195
  - generators/oauth_provider/lib/insert_routes.rb
194
196
  - generators/oauth_provider/oauth_provider_generator.rb
@@ -303,6 +305,9 @@ files:
303
305
  - lib/generators/rspec/templates/oauth_nonces.yml
304
306
  - lib/generators/rspec/templates/oauth_token_spec.rb
305
307
  - lib/generators/rspec/templates/oauth_tokens.yml
308
+ - lib/generators/slim/oauth_consumer_generator.rb
309
+ - lib/generators/slim/oauth_consumer_templates/index.html.slim
310
+ - lib/generators/slim/oauth_consumer_templates/show.html.slim
306
311
  - lib/generators/test_unit/oauth_provider_generator.rb
307
312
  - lib/generators/test_unit/templates/client_application_test.rb
308
313
  - lib/generators/test_unit/templates/client_applications.yml