toy-locomotive 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,7 +13,7 @@ module ToyLocomotive
13
13
  end
14
14
  Rails.application.class.routes.draw do
15
15
  ToyLocomotive.routes.each {|route| match route[:path] => "#{route[:controller]}##{route[:action]}", as: route[:as], via: route[:method]}
16
- # controllers.each {|controller| controller._route.call if controller._route}
16
+ controllers.each {|controller| controller.draws.each {|draw| send *draw}}
17
17
  end
18
18
  end
19
19
  end
@@ -1,9 +1,11 @@
1
1
  module ToyLocomotive::Router::Block
2
2
 
3
- mattr_accessor :_route
3
+ def draw *args
4
+ (@_draws ||= []).push args
5
+ end
4
6
 
5
- def route &block
6
- @_route = &block
7
+ def draws
8
+ @_draws || []
7
9
  end
8
10
 
9
11
  end
@@ -1,3 +1,3 @@
1
1
  module ToyLocomotive
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
@@ -13,6 +13,7 @@ end
13
13
 
14
14
  require "toy-locomotive/router/model"
15
15
  require "toy-locomotive/router/controller"
16
+ require "toy-locomotive/router/block"
16
17
  require "toy-locomotive/resources/controller"
17
18
  require "toy-locomotive/attributes/chain"
18
19
  require "toy-locomotive/attributes/model"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toy-locomotive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-28 00:00:00.000000000 Z
12
+ date: 2012-08-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails