WatersOfOblivion-footpedal 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/routing_extension.rb +18 -2
  2. data/rails/init.rb +0 -5
  3. metadata +1 -1
@@ -4,17 +4,33 @@ module FootPedal
4
4
  # /footpedal/login:: The login page
5
5
  # /footpedal/login/login:: Authenticates and redirects
6
6
  # /footpedal/login/logout:: Unauthenticates and redirects to the login page
7
+ #
8
+ # To enable these, add the following to <tt>config/routes.rb</tt>
9
+ #
10
+ # # Enable all three of the routes
11
+ # map.footpedal
12
+ #
13
+ # # If you only want to enable some of them, you can...
14
+ # map.footpedal_login # /footpedal/login
15
+ # map.footpedal_authenticate # /footpedal/login/login
16
+ # map.footpedal_logout # /footpedal/login/logout
7
17
  module RoutingExtension
8
- def footpedal
18
+ def footpedal_login
9
19
  @set.add_route "/footpedal/login", :controller => "foot_pedal/login", :action => "index"
10
20
  end
11
21
 
12
- def footpedal_login
22
+ def footpedal_authenticate
13
23
  @set.add_route "/footpedal/login/login", :controller => "foot_pedal/login", :action => "login", :method => :post
14
24
  end
15
25
 
16
26
  def footpedal_logout
17
27
  @set.add_route "/footpedal/login/logout", :controller => "foot_pedal/login", :action => "logout", :method => :delete
18
28
  end
29
+
30
+ def footpedal
31
+ footpedal_login
32
+ footpedal_authenticate
33
+ footpedal_logout
34
+ end
19
35
  end
20
36
  end
data/rails/init.rb CHANGED
@@ -13,11 +13,6 @@ require File.join('foot_pedal', 'login_controller')
13
13
  # Add the routing extension and draw the route
14
14
  require File.join(File.dirname(__FILE__), '..', 'lib', 'routing_extension')
15
15
  ActionController::Routing::RouteSet::Mapper.send :include, FootPedal::RoutingExtension
16
- ActionController::Routing::Routes.draw do |map|
17
- map.footpedal
18
- map.footpedal_login
19
- map.footpedal_logout
20
- end
21
16
 
22
17
  # Add the initializer
23
18
  require File.join(File.dirname(__FILE__), '..', 'lib', 'initializer')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: WatersOfOblivion-footpedal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Bryant