rails_icons 1.6.0 → 1.6.1
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/lib/generators/rails_icons/install_generator.rb +9 -2
- data/lib/rails_icons/base_generator.rb +6 -2
- data/lib/rails_icons/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: e9e2199e5795be0bd65fe3b1ade8a0fde475a93d0833e245c3f93e099e7b7a77
|
|
4
|
+
data.tar.gz: f90c88a1fb8e654b3f603cc15d0708ce17dd34d7c0601aaf42c0ac457909705a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 46ee695f9eb54288b18a9dd4175033ec177b1c2890afe1a7e676807fb111de7be3547af4cad028915a949f77f4bbc14fe85b2d32a47888efc5240361782c2f42
|
|
7
|
+
data.tar.gz: 9076052c13f3b2481f5d61a6d3dea6aef93b12a79b5af6e394ee6b0bb574d3a4c5367dc386c2a5169d653147d19c2a72fc4d656d07c97e2326359b21605936b8
|
data/Gemfile.lock
CHANGED
|
@@ -8,6 +8,7 @@ module RailsIcons
|
|
|
8
8
|
|
|
9
9
|
desc "Install Rails Icons with the chosen libraries. This creates the configuration initializer and will sync the icons."
|
|
10
10
|
|
|
11
|
+
class_option :library, type: :string, desc: "Choose libraries (#{RailsIcons.libraries.keys.join("/")})"
|
|
11
12
|
class_option :libraries, type: :array, default: [], desc: "Choose libraries (#{RailsIcons.libraries.keys.join("/")})"
|
|
12
13
|
class_option :destination, type: :string, default: RailsIcons.configuration.icons_path, desc: "Specify destination folder for icons"
|
|
13
14
|
class_option :skip_sync, type: :boolean, default: false
|
|
@@ -17,14 +18,20 @@ module RailsIcons
|
|
|
17
18
|
end
|
|
18
19
|
|
|
19
20
|
def sync_generator
|
|
20
|
-
return if options[:skip_sync] ||
|
|
21
|
+
return if options[:skip_sync] || libraries.blank?
|
|
21
22
|
|
|
22
23
|
generate("rails_icons:sync", *attributes)
|
|
23
24
|
end
|
|
24
25
|
|
|
25
26
|
private
|
|
26
27
|
|
|
27
|
-
def attributes
|
|
28
|
+
def attributes
|
|
29
|
+
["--libraries=#{libraries.map(&:downcase).join(" ")}", "--destination=#{options[:destination]}"].join(" ")
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def libraries
|
|
33
|
+
[*options.libraries, options.library].compact_blank
|
|
34
|
+
end
|
|
28
35
|
|
|
29
36
|
def validatable? = true
|
|
30
37
|
end
|
|
@@ -15,13 +15,17 @@ module RailsIcons
|
|
|
15
15
|
def validate!
|
|
16
16
|
return if custom_library?
|
|
17
17
|
|
|
18
|
-
raise RailsIcons::LibraryNotFound.new("") if
|
|
18
|
+
raise RailsIcons::LibraryNotFound.new("") if libraries.empty?
|
|
19
19
|
raise RailsIcons::LibraryNotFound.new(invalid_libraries.join(", ")) if invalid_libraries.any?
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
def validatable? = false
|
|
23
23
|
|
|
24
|
-
def
|
|
24
|
+
def libraries
|
|
25
|
+
[*options.libraries, options.library].compact_blank
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def invalid_libraries = libraries.map(&:to_sym).map(&:downcase).reject { RailsIcons.libraries.key?(_1) }
|
|
25
29
|
|
|
26
30
|
def custom_library? = options.custom.present?
|
|
27
31
|
|
data/lib/rails_icons/version.rb
CHANGED