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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0c4ed1a0501a0d7b017f83cdf14348f324ef168c57971e441b36bb46cf0600b
4
- data.tar.gz: c5bf1e53f107e8f48ad8f83e9eaa80fc3c4b42ab6d793b59875cb64db93acf32
3
+ metadata.gz: e9e2199e5795be0bd65fe3b1ade8a0fde475a93d0833e245c3f93e099e7b7a77
4
+ data.tar.gz: f90c88a1fb8e654b3f603cc15d0708ce17dd34d7c0601aaf42c0ac457909705a
5
5
  SHA512:
6
- metadata.gz: e4489e85871338f781fd25d5161fd3743e5c4c2ba651041e5faa403c098d699f0bcb31b255250754543622d1674f18782f9324184b383ba8873cbade43e644f0
7
- data.tar.gz: f2ae32f97f92d7df6c727cd3e04605688b63bd0e6459ba4f8a7f1894375382dec4ab56a23809f6919656fac6b51a7eaa3d000d2e83d7ad192c6a817fc8de0a9f
6
+ metadata.gz: 46ee695f9eb54288b18a9dd4175033ec177b1c2890afe1a7e676807fb111de7be3547af4cad028915a949f77f4bbc14fe85b2d32a47888efc5240361782c2f42
7
+ data.tar.gz: 9076052c13f3b2481f5d61a6d3dea6aef93b12a79b5af6e394ee6b0bb574d3a4c5367dc386c2a5169d653147d19c2a72fc4d656d07c97e2326359b21605936b8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rails_icons (1.6.0)
4
+ rails_icons (1.6.1)
5
5
  nokogiri (~> 1.16, >= 1.16.4)
6
6
  rails (>= 7.0)
7
7
 
@@ -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] || options[:libraries].blank?
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 = ["--libraries=#{options[:libraries].map(&:downcase).join(" ")}", "--destination=#{options[:destination]}"].join(" ")
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 options.libraries.empty?
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 invalid_libraries = options.libraries.map(&:to_sym).map(&:downcase).reject { RailsIcons.libraries.key?(_1) }
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
 
@@ -1,3 +1,3 @@
1
1
  module RailsIcons
2
- VERSION = "1.6.0"
2
+ VERSION = "1.6.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_icons
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rails Designer Developers