path-to 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/Rakefile +1 -1
- data/lib/path-to/described_routes.rb +5 -5
- data/lib/path-to.rb +1 -1
- data/test/path-to/test_described_routes.rb +1 -2
- metadata +3 -3
data/History.txt
CHANGED
data/Rakefile
CHANGED
@@ -13,7 +13,7 @@ $hoe = Hoe.new('path-to', PathTo::VERSION) do |p|
|
|
13
13
|
p.extra_deps = [
|
14
14
|
['httparty','>= 0.4.2'],
|
15
15
|
['addressable','>= 2.1.0'],
|
16
|
-
['described_routes','>= 0.
|
16
|
+
['described_routes','>= 0.5.0']
|
17
17
|
]
|
18
18
|
p.extra_dev_deps = [
|
19
19
|
['newgem', ">= #{::Newgem::VERSION}"]
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require "path-to"
|
2
|
-
require "described_routes
|
2
|
+
require "described_routes"
|
3
3
|
|
4
4
|
module PathTo
|
5
5
|
#
|
@@ -155,11 +155,11 @@ module PathTo
|
|
155
155
|
@resource_templates = options[:resource_templates]
|
156
156
|
unless @resource_templates
|
157
157
|
if (json = options[:json])
|
158
|
-
@resource_templates = ::
|
158
|
+
@resource_templates = ResourceTemplate::ResourceTemplates.parse_json(json)
|
159
159
|
elsif (yaml = options[:yaml])
|
160
|
-
@resource_templates = ::
|
160
|
+
@resource_templates = ResourceTemplate::ResourceTemplates.parse_yaml(yaml)
|
161
161
|
elsif (xml = options[:xml])
|
162
|
-
@resource_templates = ::
|
162
|
+
@resource_templates = ResourceTemplate::ResourceTemplates.parse_xml(xml)
|
163
163
|
end
|
164
164
|
end
|
165
165
|
|
@@ -217,7 +217,7 @@ module PathTo
|
|
217
217
|
# Returns a hash of all ResourceTemplates (the tree flattened) keyed by name
|
218
218
|
#
|
219
219
|
def resource_templates_by_name
|
220
|
-
@resource_templates_by_name ||=
|
220
|
+
@resource_templates_by_name ||= resource_templates.all_by_name
|
221
221
|
end
|
222
222
|
|
223
223
|
#
|
data/lib/path-to.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'rubygems'
|
2
1
|
require 'test/unit'
|
3
2
|
require 'path-to/described_routes'
|
4
3
|
|
@@ -43,7 +42,7 @@ class TestDescribedRoutes < Test::Unit::TestCase
|
|
43
42
|
|
44
43
|
def test_resource_templates_by_name
|
45
44
|
assert_equal(RESOURCE_TEMPLATE_NAMES, app.resource_templates_by_name.keys.sort)
|
46
|
-
assert_kind_of(
|
45
|
+
assert_kind_of(ResourceTemplate, app.resource_templates_by_name["user"])
|
47
46
|
end
|
48
47
|
|
49
48
|
def test_app_child_class_for
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: path-to
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Burrows (asplake)
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-05-
|
12
|
+
date: 2009-05-22 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
requirements:
|
41
41
|
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 0.
|
43
|
+
version: 0.5.0
|
44
44
|
version:
|
45
45
|
- !ruby/object:Gem::Dependency
|
46
46
|
name: newgem
|