resource_awareness 0.0.8 → 0.0.9

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.
@@ -35,7 +35,7 @@ module Rails
35
35
  xml.singular_name singular_name
36
36
  xml.path_prefix path_prefix
37
37
  xml.path path
38
- xml.controller_name controller_name
38
+ xml.controller_path controller_path
39
39
  end
40
40
  end
41
41
  end
@@ -1,9 +1,10 @@
1
1
  require 'rails/application'
2
+ require 'resource_awareness/resource_collection'
2
3
 
3
4
  module ResourceAwareness
4
5
  module ApplicationExtensions
5
6
  def resources
6
- @resources ||= []
7
+ @resources ||= ResourceCollection.new
7
8
  end
8
9
  end
9
10
  end
@@ -0,0 +1,9 @@
1
+ module ResourceAwareness
2
+ class ResourceCollection < Array
3
+
4
+ def [](identifier)
5
+ find { |r| r.id == identifier }
6
+ end
7
+
8
+ end
9
+ end
@@ -1,4 +1,4 @@
1
1
  task :resources => :environment do
2
2
  width_of_widest_route_id = Rails.application.resources.collect(&:id).max.length
3
- puts Rails.application.resources.collect { |r| "%-#{width_of_widest_route_id + 20}s%s" % [r.id, r.path] }
3
+ puts Rails.application.resources.collect { |r| "%-#{width_of_widest_route_id + 20}s%-30s%s" % [r.id, r.type, r.path] }
4
4
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 8
9
- version: 0.0.8
8
+ - 9
9
+ version: 0.0.9
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ingo Weiss
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-30 00:00:00 +02:00
17
+ date: 2010-05-22 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -60,6 +60,7 @@ files:
60
60
  - lib/resource_awareness/application_extensions.rb
61
61
  - lib/resource_awareness/mapper_extensions.rb
62
62
  - lib/resource_awareness/railtie.rb
63
+ - lib/resource_awareness/resource_collection.rb
63
64
  - lib/resource_awareness.rb
64
65
  - lib/tasks/resource_awareness.rake
65
66
  has_rdoc: true