herbie 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -42,7 +42,7 @@ module Herbie
42
42
  end
43
43
  end
44
44
 
45
- def link(href, text=nil, attrs={}, &block)
45
+ def link_to(href, text=nil, attrs={}, &block)
46
46
  attrs = {:href => href}.merge(attrs)
47
47
  if block_given?
48
48
  erb_concat "#{tag :a, attrs}#{capture_erb(&block)}</a>"
data/lib/herbie.rb CHANGED
@@ -3,5 +3,5 @@ require 'herbie/generic_helpers.rb'
3
3
  require 'herbie/html_helpers.rb'
4
4
 
5
5
  module Herbie
6
- VERSION = '0.0.1'
6
+ VERSION = '0.0.2'
7
7
  end
data/spec/herbie_spec.rb CHANGED
@@ -78,13 +78,13 @@ describe Herbie::Helpers do
78
78
  describe "link helpers" do
79
79
  it "should be able to output a simple link" do
80
80
  href = "http://www.foo.com/"
81
- link(href).should == "<a href=\"#{href}\">#{href}</a>"
81
+ link_to(href).should == "<a href=\"#{href}\">#{href}</a>"
82
82
  end
83
83
 
84
84
  it "should be able to output a link with href and text" do
85
85
  href = "http://www.foo.com/"
86
86
  text = "Visit foo.com"
87
- link(href, text).should == "<a href=\"#{href}\">#{text}</a>"
87
+ link_to(href, text).should == "<a href=\"#{href}\">#{text}</a>"
88
88
  end
89
89
 
90
90
  it "should be able to output links with arbitrary attributes" do
@@ -94,7 +94,7 @@ describe Herbie::Helpers do
94
94
  :class => "navigation",
95
95
  :target => "_parent"
96
96
  }
97
- link(href, text, attrs).should == "<a href=\"#{href}\" class=\"#{attrs[:class]}\" target=\"#{attrs[:target]}\">#{text}</a>"
97
+ link_to(href, text, attrs).should == "<a href=\"#{href}\" class=\"#{attrs[:class]}\" target=\"#{attrs[:target]}\">#{text}</a>"
98
98
  end
99
99
 
100
100
  it "should be able to output a link enclosing arbitrary markup provided by a block" do
@@ -105,7 +105,7 @@ describe Herbie::Helpers do
105
105
  :class => "image"
106
106
  }
107
107
  markup_block = Proc.new { tag :img, :src => "foo.png" }
108
- link(href, text, attrs, &markup_block).should == "<a href=\"#{href}\" class=\"#{attrs[:class]}\">#{capture_erb(&markup_block)}</a>"
108
+ link_to(href, text, attrs, &markup_block).should == "<a href=\"#{href}\" class=\"#{attrs[:class]}\">#{capture_erb(&markup_block)}</a>"
109
109
  end
110
110
  end
111
111
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: herbie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-09-22 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70317520033180 !ruby/object:Gem::Requirement
16
+ requirement: &70233134684500 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '2.6'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70317520033180
24
+ version_requirements: *70233134684500
25
25
  description: Lovable HTML view helpers for use with ERB.
26
26
  email: ben@kapowaz.net
27
27
  executables: []