teepee 0.11.1 → 0.11.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: 52c5a12236553c6bbbba5e3e4b76911fc5c08bf6
4
- data.tar.gz: 802a7e05a905db3029696e79a5a6233cd7f3fd02
3
+ metadata.gz: 03b03bde14f638ca63a57c2e0aed51fcc20b2aa8
4
+ data.tar.gz: 768bd1ac97298ffdef41a9699ac1e03ded0c9e28
5
5
  SHA512:
6
- metadata.gz: 67caaf39fc1ff50402f6314cdf1f9f18be115efe7d6c51da7f740534829b1072b37b5a31ab0db53b37885b13f0eedc10ccc65f361acc0be25d165b529808ed46
7
- data.tar.gz: 8db22bc11be8ad5e5f3845bdd8c826895442bb49dbec64213557b53b47b7eadb27ff63a580393748b1da88288fd7bb9f718753cc17c9c914f04b0fec30fb52e1
6
+ metadata.gz: ea7ac23111f327be2941ef91d814c007d14e35311d702dbb31ba7c41d694a07276a04fffd6e6a2c7263d3b589ed68a9eb674930d6d6062a581e7d0e17e32dc96
7
+ data.tar.gz: 0f59f6a3228b1439c84ce4846473fbc42efd066826566d60b8dbb9e529f3b2572a62cee62e2a6e564d4b207b5d8787bdf6daa46d4c624369f36dd28c240da0a8
@@ -259,6 +259,8 @@ module Teepee
259
259
  "href",
260
260
  "url"
261
261
  @@commander.link expressions
262
+ when "mailto"
263
+ @@commander.mailto first_word_token
262
264
  when "img",
263
265
  "image"
264
266
  @@commander.image expressions
@@ -138,6 +138,10 @@ module Teepee
138
138
  left_strip right_strip expressions
139
139
  end
140
140
 
141
+ def valid_email_address? email_address
142
+ email_address =~ /\A[[:graph:]]+@[\w.]+\z/
143
+ end
144
+
141
145
  #----------------------------------------------------------------------------
142
146
 
143
147
  def + *numbers
@@ -515,6 +519,14 @@ module Teepee
515
519
  ensure_numeric Math.log10 number
516
520
  end
517
521
 
522
+ def mailto email_address
523
+ if valid_email_address?
524
+ html_tag :a, email_address, {href: "mailto:#{email_address}"}
525
+ else
526
+ command_error "I'm not sure that's a valid email address."
527
+ end
528
+ end
529
+
518
530
  def mod *numbers
519
531
  ensure_numeric numbers.reduce :%
520
532
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teepee
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Mark Gore
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-16 00:00:00.000000000 Z
11
+ date: 2016-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport