font_awesome_list 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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +8 -2
- data/lib/font_awesome_list/icon.rb +9 -4
- data/lib/font_awesome_list/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a27ff4d7731c21f55f676a6d93105ea2c8ec9679099039883b6e7a80aa7b3ce
|
4
|
+
data.tar.gz: 3b8ae15e1de1f10bea2f75715facc35c4ef561f6905ff16c7c45d781446f3b12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f3fa3689a8d1389ae9699bc8e8ae337cbd569e82b0b0c1dc88dce22678867715c671222461e520a1010a7cb75bc9313f50b76f664fce829b554d095b79e19ec
|
7
|
+
data.tar.gz: 6e1c6b6982f672b3b5edb7e36d2da64151671102187d10f8082e30b1ec9007a200e480d0b27dbeb89ffb046730c9367ad922aae50330f1fedb607317fcd2bb99
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -20,10 +20,16 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
Access the list of
|
23
|
+
Access the list of the icon names (without the `fa` prefix):
|
24
24
|
|
25
25
|
```ruby
|
26
|
-
FontAwesomeList::Icon.all
|
26
|
+
FontAwesomeList::Icon.all #=> returns hash with {name: "...", styles: ["brands", "solid"]}
|
27
|
+
```
|
28
|
+
|
29
|
+
Access the list of the icon names (without the `fa` prefix):
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
FontAwesomeList::Icon.names #=> returns array of names
|
27
33
|
```
|
28
34
|
|
29
35
|
## Development
|
@@ -2,11 +2,16 @@ require "yaml"
|
|
2
2
|
|
3
3
|
module FontAwesomeList
|
4
4
|
class Icon
|
5
|
-
ICON_FILE = "#{__dir__}/icons.yml".freeze
|
6
|
-
|
7
5
|
def self.all
|
8
|
-
icons
|
9
|
-
|
6
|
+
icons.map { |k,v| { name: k, styles: v["styles"].map(&:to_sym) } }
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.icons
|
10
|
+
YAML.load File.read("#{__dir__}/icons.yml")
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.names
|
14
|
+
icons.keys
|
10
15
|
end
|
11
16
|
end
|
12
17
|
end
|