helpers 0.0.3 → 0.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,9 +1,12 @@
1
- = Version 0.0.1
2
- * Tag, SelfCloseTag builder classes
3
- * Form, FormFor, ButtonTo, ButtonToDelete classes
1
+ = Version 0.1
2
+ * Added Padrino adapter.
3
+
4
+ = Version 0.0.3
5
+ * Fixed Rango adapter (kudos to Tass)
4
6
 
5
7
  = Version 0.0.2
6
8
  * Imported helpers from Rango
7
9
 
8
- = Version 0.0.3
9
- * Fixed Rango adapter (kudos to Tass)
10
+ = Version 0.0.1
11
+ * Tag, SelfCloseTag builder classes
12
+ * Form, FormFor, ButtonTo, ButtonToDelete classes
@@ -6,7 +6,7 @@ require "base64"
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "helpers"
9
- s.version = "0.0.3"
9
+ s.version = "0.1"
10
10
  s.authors = ["Jakub Stastny aka Botanicus"]
11
11
  s.homepage = "http://github.com/botanicus/helpers"
12
12
  s.summary = "Framework-agnostic template helpers"
@@ -70,6 +70,10 @@ module Helpers
70
70
  self.content.push(Tag.new(*args, &block))
71
71
  end
72
72
 
73
+ def self_closing_tag(*args, &block)
74
+ self.content.push(SelfCloseTag.new(*args, &block))
75
+ end
76
+
73
77
  def to_s
74
78
  "#{" " * self.indentation}<#{name}#{attrs.to_html_attrs}>\n#{" " * self.indentation}#{content}\n#{" " * self.indentation}</#{name}>"
75
79
  end
@@ -39,14 +39,14 @@ module Helpers
39
39
 
40
40
  # @since 0.0.2
41
41
  def javascript(basename)
42
- path = Assets.root.join("javascripts/#{basename}.js")
42
+ path = Assets.root.join("javascripts/#{basename}")
43
43
  Tag.new(:script, src: path.url, type: "text/javascript")
44
44
  end
45
45
 
46
46
  # @since 0.0.2
47
47
  def stylesheet(basename, attrs = Hash.new)
48
48
  path = Assets.root.join("stylesheets/#{basename}")
49
- default = {href: path.url, media: 'screen', rel: 'stylesheet', type: 'text/css'}
49
+ default = {href: path.url, media: "screen", rel: "stylesheet", type: "text/css"}
50
50
  SelfCloseTag.new(:link, default.merge(attrs))
51
51
  end
52
52
 
@@ -1,5 +1,4 @@
1
1
  # encoding: utf-8
2
-
3
2
  require "uri"
4
3
 
5
4
  module Helpers
@@ -26,7 +25,7 @@ module Helpers
26
25
  # => "<a href='mailto:joe@example.com'>joe@example.com</a>"
27
26
  # mail_to "joe@example.com", "Title"
28
27
  # => "<a href='mailto:joe@example.com'>Title</a>"
29
- def mail_to(mail, text = mail)
28
+ def email_link(mail, text = mail)
30
29
  mail.gsub!("@" "&#x40;")
31
30
  Tag.new(:a, text, href: "mailto:#{mail}")
32
31
  end
metadata CHANGED
@@ -1,19 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: helpers
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 0
8
- - 3
9
- version: 0.0.3
4
+ prerelease:
5
+ version: "0.1"
10
6
  platform: ruby
11
7
  authors:
12
8
  - Jakub Stastny aka Botanicus
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain:
16
- date: 2010-03-22 00:00:00 +00:00
12
+ date: 2011-05-26 00:00:00 +02:00
17
13
  default_executable:
18
14
  dependencies: []
19
15
 
@@ -46,30 +42,27 @@ has_rdoc: true
46
42
  homepage: http://github.com/botanicus/helpers
47
43
  licenses: []
48
44
 
49
- post_install_message: "[\e[32mVersion 0.0.3\e[0m] Fixed Rango adapter (kudos to Tass)\n"
45
+ post_install_message: "[\e[32mVersion 0.1\e[0m] Added Padrino adapter.\n"
50
46
  rdoc_options: []
51
47
 
52
48
  require_paths:
53
49
  - lib
54
50
  required_ruby_version: !ruby/object:Gem::Requirement
51
+ none: false
55
52
  requirements:
56
53
  - - ">="
57
54
  - !ruby/object:Gem::Version
58
- segments:
59
- - 1
60
- - 9
61
55
  version: "1.9"
62
56
  required_rubygems_version: !ruby/object:Gem::Requirement
57
+ none: false
63
58
  requirements:
64
59
  - - ">="
65
60
  - !ruby/object:Gem::Version
66
- segments:
67
- - 0
68
61
  version: "0"
69
62
  requirements: []
70
63
 
71
64
  rubyforge_project: helpers
72
- rubygems_version: 1.3.6
65
+ rubygems_version: 1.5.3
73
66
  signing_key:
74
67
  specification_version: 3
75
68
  summary: Framework-agnostic template helpers