rails_templated_urls 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 25be1f91da436b8de6a9c4a87c9b24ac1122fbc8
4
- data.tar.gz: 5a42d5a6f11a99c9dff221816e7624346bc744f8
3
+ metadata.gz: 5589bbdb5208706c2d1f25d1ae1f4da922abc40e
4
+ data.tar.gz: e9d74cdc8550befeb68635c3c13cc25ca6acbe55
5
5
  SHA512:
6
- metadata.gz: 2b11f213c0573f692ef5b7cdabf3d20eb0e21a3d1fa297294ad8ac2199f0c8e19e3d375375a1dce0cfe6a04f09d2f33848e1058e78f1f012d77a65f0a35fcfa7
7
- data.tar.gz: 0ba48952beae83ded5a3644a748db0b88e4b88103fd301b2b12eebfdda16fce01a44283222b70d78018cfc215b35ad4f45101c982087154780f103e780a82092
6
+ metadata.gz: fde8250e5b2dc486d4bf3d05c90fd8a3a06bd6eaf0c52107b623319ae6f9e4d493aff58b5215b1a344124c653bebc012274fbc4b52117bc4539f54e544a6e20c
7
+ data.tar.gz: 4aa634f68b097e8dce221310cc0fdba2adfdfe6ad0f34d561f6708eaec090d9ccd442bea888484063cfedbdff03e491b1d138edcf4b3e5b02c5acb8a5797cf9a
@@ -5,15 +5,16 @@ module RailsTemplatedUrls
5
5
  class Builder
6
6
  extend Forwardable
7
7
 
8
- def initialize(name, params, routes)
8
+ def initialize(name, params, url_helpers, routes)
9
9
  @name = name
10
10
  @params = params
11
+ @url_helpers = url_helpers
11
12
  @routes = routes
12
13
 
13
14
  check_route
14
15
  end
15
16
 
16
- def_delegators :@routes, :named_routes, :url_helpers
17
+ def_delegators :@routes, :named_routes
17
18
 
18
19
  def url
19
20
  build(:url)
@@ -46,8 +47,8 @@ module RailsTemplatedUrls
46
47
  end
47
48
 
48
49
  def build(strategy)
49
- url = url_helpers.public_send("#{@name}_#{strategy}",
50
- *required_parts_expressions)
50
+ url = @url_helpers.public_send("#{@name}_#{strategy}",
51
+ *required_parts_expressions)
51
52
 
52
53
  "#{CGI.unescape(url)}#{params_expression}"
53
54
  end
@@ -1,3 +1,3 @@
1
1
  module RailsTemplatedUrls
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
@@ -1,11 +1,11 @@
1
1
  module RailsTemplatedUrls
2
2
  module ViewHelpers
3
3
  def templated_url(name, *params)
4
- Builder.new(name, params, Rails.application.routes).url
4
+ Builder.new(name, params, self, Rails.application.routes).url
5
5
  end
6
6
 
7
7
  def templated_path(name, *params)
8
- Builder.new(name, params, Rails.application.routes).path
8
+ Builder.new(name, params, self, Rails.application.routes).path
9
9
  end
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_templated_urls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lenon Marcel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-05-15 00:00:00.000000000 Z
11
+ date: 2015-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails