markaby 0.6.8 → 0.6.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,8 @@
1
+ = 0.6.9
2
+
3
+ * Bug fix for url_for. Previously, you'd need to capture { *_path } instead of
4
+ using the named route directly. Only affected rails 2.3.4+.
5
+
1
6
  = 0.6.8 (2010-06-03)
2
7
 
3
8
  * Add a regression for issue Github #17 (for judofyr / Camping)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{markaby}
8
- s.version = "0.6.8"
8
+ s.version = "0.6.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["_why", "Tim Fletcher", "John Barton", "spox", "smtlaissezfaire"]
12
- s.date = %q{2010-06-03}
12
+ s.date = %q{2010-08-03}
13
13
  s.description = %q{Tim Fletcher and _why's ruby driven HTML templating system}
14
14
  s.email = %q{scott@railsnewbie.com}
15
15
  s.extra_rdoc_files = [
@@ -57,6 +57,7 @@ Gem::Specification.new do |s|
57
57
  "spec/markaby/rails/views/markaby/render_mab_without_explicit_render_call.mab",
58
58
  "spec/markaby/rails/views/markaby/render_with_ivar.mab",
59
59
  "spec/markaby/rails/views/markaby/renders_erb.rhtml",
60
+ "spec/markaby/rails/views/markaby/routes.mab",
60
61
  "spec/markaby/rails_spec.rb",
61
62
  "spec/markaby/rails_version_spec.rb",
62
63
  "spec/markaby/tilt/erb.erb",
@@ -33,7 +33,9 @@ Install it as a plugin:
33
33
 
34
34
  script/plugin install git://github.com/markaby/markaby.git
35
35
 
36
- If you are loading it in a different way (from a gem), make sure it's on the LOAD_PATH, and add the following (in environment.rb):
36
+ If you are loading it in a different way (from a gem), make sure
37
+ it's on the LOAD_PATH, and add the following in
38
+ an initializer (config/initializers/markaby.rb will work):
37
39
 
38
40
  require 'markaby'
39
41
  require 'markaby/rails'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.8
1
+ 0.6.9
@@ -43,4 +43,32 @@ module Markaby
43
43
  end
44
44
  end
45
45
 
46
+ # allow fragments to act as strings. url_for has a
47
+ # nasty case statment in it:
48
+ #
49
+ # case options
50
+ # when String
51
+ # ...
52
+ #
53
+ # which essential is doing the following:
54
+ #
55
+ # String === options
56
+ #
57
+ # We prefer to override url_for rather than String#===
58
+ #
59
+ ActionView::Helpers::UrlHelper.class_eval do
60
+ alias_method :url_for_aliased_by_markaby, :url_for
61
+
62
+ def url_for(options={})
63
+ options ||= {}
64
+
65
+ url = case options
66
+ when Markaby::Fragment
67
+ url_for_aliased_by_markaby(options.to_s)
68
+ else
69
+ url_for_aliased_by_markaby(options)
70
+ end
71
+ end
72
+ end
73
+
46
74
  ActionView::Template.register_template_handler(:mab, Markaby::Rails::TemplateHandler)
@@ -16,6 +16,14 @@ if RUNNING_RAILS
16
16
 
17
17
  $:.unshift MARKABY_ROOT
18
18
  require 'init'
19
+
20
+ ActionController::Routing::Routes.draw do |map|
21
+ map.new_user "/users/new", :controller => "users", :action => "new"
22
+
23
+ # default routes
24
+ map.connect ':controller/:action/:id.:format'
25
+ map.connect ':controller/:action/:id'
26
+ end
19
27
  else
20
28
  warn "Skipping rails specific tests"
21
29
  end
@@ -0,0 +1 @@
1
+ link_to "Foo", new_user_path
@@ -112,6 +112,9 @@ if RUNNING_RAILS
112
112
 
113
113
  render :template => "markaby/form_for_with_multiple_fields"
114
114
  end
115
+
116
+ def routes
117
+ end
115
118
  end
116
119
 
117
120
  class MarkabyOnRailsTest < ActionController::TestCase
@@ -239,6 +242,14 @@ if RUNNING_RAILS
239
242
  assert_equal expected_output,
240
243
  @response.body
241
244
  end
245
+
246
+ def test_routes_work
247
+ get :routes
248
+ assert_response :success
249
+
250
+ expected_output = "<a href=\"/users/new\">Foo</a>"
251
+ assert_equal expected_output, @response.body
252
+ end
242
253
  end
243
254
 
244
255
  describe "rails version" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markaby
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 8
10
- version: 0.6.8
9
+ - 9
10
+ version: 0.6.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - _why
@@ -19,7 +19,7 @@ autorequire:
19
19
  bindir: bin
20
20
  cert_chain: []
21
21
 
22
- date: 2010-06-03 00:00:00 -04:00
22
+ date: 2010-08-03 00:00:00 -04:00
23
23
  default_executable:
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency
@@ -88,6 +88,7 @@ files:
88
88
  - spec/markaby/rails/views/markaby/render_mab_without_explicit_render_call.mab
89
89
  - spec/markaby/rails/views/markaby/render_with_ivar.mab
90
90
  - spec/markaby/rails/views/markaby/renders_erb.rhtml
91
+ - spec/markaby/rails/views/markaby/routes.mab
91
92
  - spec/markaby/rails_spec.rb
92
93
  - spec/markaby/rails_version_spec.rb
93
94
  - spec/markaby/tilt/erb.erb