font-awesome-helper 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ea45b6faf333eb1f423d9bf8289189ae5d3ee6c1
4
- data.tar.gz: 2845e86e284ae0975fca44e93994c6562e68c39b
3
+ metadata.gz: aba6036acc266fd5589c72d8bc17944a298daaf3
4
+ data.tar.gz: 199f6e4f477e42a4789a5324b5e99dba1447d31b
5
5
  SHA512:
6
- metadata.gz: 312e22337d4c3955ea88b0481cd3d6911a138db3b4b4cde977c9b34f856ae8821f909d25552d1d0c9272ad87d998f0719c325b25a86b61a9fe5977f46b20bab5
7
- data.tar.gz: 29f8601bade82fadddb485ae9e69b42d688bdd88e316f02a22e506620e1f678b88d7b5beb74618f07724050119cb57bbb241768e02f8392cccc1cb94c2ceabd1
6
+ metadata.gz: 8586eb3bf5069207821b3efd090c6ef3a292ae477641266f5854710c1ae04e05aab7f08e0f95af9905ddfc4d814539aa0cf282a6b87d489d3e43f15c1ca40d84
7
+ data.tar.gz: 32b112b06a2510b3aca8cf3ca54d6b5580c89d4357d53505501c1328c0a5ce11ab77a6c09a89d730ebc78523f61c52ef8443e4d60232331c35bf8bd6759d076f
@@ -1,4 +1,4 @@
1
1
  require 'font-awesome-helper/version'
2
- require 'font-awesome-helper/fa-icon'
2
+ require 'font-awesome-helper/fa_icon'
3
3
  require 'font-awesome-helper/helpers'
4
4
  require 'font-awesome-helper/railtie'
@@ -2,18 +2,20 @@ module FontAwesomeHelper
2
2
  module Helpers
3
3
  FA_CLASS_PREFIX = 'fa'
4
4
 
5
- # TODO: fw (e.g. `fa_icon 'github', fixed: true`)
6
- # TODO: border (e.g. `fa_icon 'github', border: true`)
7
- # TODO: spin (e.g. `fa_icon 'github', spin: true`)
8
- # TODO: size (e.g. `fa_icon 'github', size: '2x'`)
9
- # TODO: rotate (e.g. `fa_icon 'github', rotate: 90`)
10
- # TODO: flip (e.g. `fa_icon 'github', flip: :vertical`)
11
5
  def fa_icon(names, options = {})
12
6
  icon = FaIcon.new(names, options)
13
7
  (block_given? ? yield(icon.to_tag) : icon.to_tag).html_safe
14
8
  end
15
9
 
16
- # TODO: stackしやすいやつ
17
- # TODO: fa-ul,fa-liのやつ
10
+ def fa_ul(options = {}, &block)
11
+ classes = %W(#{FA_CLASS_PREFIX}-ul)
12
+ classes += options.delete(:class).split(' ') if options.key? :class
13
+ content_tag :ul, class: classes.join(' '), &block
14
+ end
15
+
16
+ def fa_li(names, options = {})
17
+ content = fa_icon(names + ' li') { |i| "#{i}#{yield}" }
18
+ content_tag :li, content, options
19
+ end
18
20
  end
19
21
  end
@@ -1,3 +1,3 @@
1
1
  module FontAwesomeHelper
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: font-awesome-helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masayuki IZUMI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-27 00:00:00.000000000 Z
11
+ date: 2014-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -62,7 +62,7 @@ files:
62
62
  - MIT-LICENSE
63
63
  - Rakefile
64
64
  - lib/font-awesome-helper.rb
65
- - lib/font-awesome-helper/fa-icon.rb
65
+ - lib/font-awesome-helper/fa_icon.rb
66
66
  - lib/font-awesome-helper/helpers.rb
67
67
  - lib/font-awesome-helper/railtie.rb
68
68
  - lib/font-awesome-helper/version.rb