rails_icons 1.5.1 → 1.6.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
  SHA256:
3
- metadata.gz: 645bae107e2a186cb00dd0708c30e27daebcde1b2be5d864efcaec70328f80eb
4
- data.tar.gz: 47ef71241543d1435578efa7d6dc81039b818d333df7f27af90c44c10a2a63f8
3
+ metadata.gz: b0c4ed1a0501a0d7b017f83cdf14348f324ef168c57971e441b36bb46cf0600b
4
+ data.tar.gz: c5bf1e53f107e8f48ad8f83e9eaa80fc3c4b42ab6d793b59875cb64db93acf32
5
5
  SHA512:
6
- metadata.gz: d322f6b6be3037cbbb3511371bb47436164ee515187778bb4249f3effb074485d7702dde5ca2bd46f84cdbe0adb21b3d2832ea97410919d9669b2a958eea0bb0
7
- data.tar.gz: ba7ea5648ee4dc82374721fe2c88d8265a59889c81d67d206a4348d52007ba2ce781d49ebf12079c29c026cb6cab14a4e556f0faef8e247659371f452b110c77
6
+ metadata.gz: e4489e85871338f781fd25d5161fd3743e5c4c2ba651041e5faa403c098d699f0bcb31b255250754543622d1674f18782f9324184b383ba8873cbade43e644f0
7
+ data.tar.gz: f2ae32f97f92d7df6c727cd3e04605688b63bd0e6459ba4f8a7f1894375382dec4ab56a23809f6919656fac6b51a7eaa3d000d2e83d7ad192c6a817fc8de0a9f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rails_icons (1.5.1)
4
+ rails_icons (1.6.0)
5
5
  nokogiri (~> 1.16, >= 1.16.4)
6
6
  rails (>= 7.0)
7
7
 
@@ -122,7 +122,7 @@ GEM
122
122
  marcel (1.0.4)
123
123
  mini_mime (1.1.5)
124
124
  mini_portile2 (2.8.9)
125
- minitest (5.25.5)
125
+ minitest (5.27.0)
126
126
  net-imap (0.5.9)
127
127
  date
128
128
  net-protocol
@@ -136,10 +136,6 @@ GEM
136
136
  nokogiri (1.18.9)
137
137
  mini_portile2 (~> 2.8.2)
138
138
  racc (~> 1.4)
139
- nokogiri (1.18.9-arm64-darwin)
140
- racc (~> 1.4)
141
- nokogiri (1.18.9-x86_64-linux-gnu)
142
- racc (~> 1.4)
143
139
  parallel (1.27.0)
144
140
  parser (3.3.8.0)
145
141
  ast (~> 2.4.1)
@@ -238,9 +234,9 @@ GEM
238
234
  timeout (0.4.3)
239
235
  tzinfo (2.0.6)
240
236
  concurrent-ruby (~> 1.0)
241
- unicode-display_width (3.1.4)
242
- unicode-emoji (~> 4.0, >= 4.0.4)
243
- unicode-emoji (4.0.4)
237
+ unicode-display_width (3.2.0)
238
+ unicode-emoji (~> 4.1)
239
+ unicode-emoji (4.2.0)
244
240
  uri (1.0.3)
245
241
  useragent (0.16.11)
246
242
  websocket-driver (0.8.0)
data/README.md CHANGED
@@ -35,12 +35,12 @@ bundle add rails_icons
35
35
 
36
36
  Install, choosing one of the supported libraries:
37
37
  ```bash
38
- rails generate rails_icons:install --libraries=LIBRARY_NAME
38
+ rails generate rails_icons:install --library=LIBRARY_NAME
39
39
  ```
40
40
 
41
41
  **Example**
42
42
  ```bash
43
- rails generate rails_icons:install --libraries=heroicons
43
+ rails generate rails_icons:install --library=heroicons
44
44
 
45
45
  # Or multiple at once
46
46
  rails generate rails_icons:install --libraries=heroicons lucide
@@ -124,7 +124,7 @@ rails generate rails_icons:sync
124
124
 
125
125
  To sync only a specific library, run:
126
126
  ```bash
127
- rails generate rails_icons:sync --libraries=heroicons
127
+ rails generate rails_icons:sync --library=heroicons
128
128
 
129
129
  # Or multiple at once:
130
130
  rails generate rails_icons:sync --libraries=heroicons lucide
data/bin/release CHANGED
@@ -3,17 +3,32 @@
3
3
  VERSION=$1
4
4
 
5
5
  if [ -z "$VERSION" ]; then
6
- echo "Error: The version number is required."
7
- echo "Usage: $0 <version-number>"
6
+ echo "Error: Version number or bump type is required."
7
+ echo "Usage: $0 <major|minor|patch|version-number>"
8
+
8
9
  exit 1
9
10
  fi
10
11
 
12
+ if [[ "$VERSION" =~ ^(major|minor|patch)$ ]]; then
13
+ CURRENT=$(grep -o '"[^"]*"' ./lib/rails_icons/version.rb | tr -d '"')
14
+ IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT"
15
+
16
+ case $VERSION in
17
+ major) VERSION="$((MAJOR + 1)).0.0" ;;
18
+ minor) VERSION="$MAJOR.$((MINOR + 1)).0" ;;
19
+ patch) VERSION="$MAJOR.$MINOR.$((PATCH + 1))" ;;
20
+ esac
21
+ fi
22
+
11
23
  printf "module RailsIcons\n VERSION = \"$VERSION\"\nend\n" > ./lib/rails_icons/version.rb
24
+
12
25
  bundle
26
+
13
27
  git add Gemfile.lock lib/rails_icons/version.rb
14
28
  git commit -m "Bump version for $VERSION"
15
29
  git push
16
30
  git tag v$VERSION
17
31
  git push --tags
18
- gem build rails_icons.gemspec
19
- gem push "rails_icons-$VERSION.gem"
32
+
33
+ bundle exec rake build
34
+ gem push "pkg/rails_icons-$VERSION.gem"
@@ -8,6 +8,7 @@ module RailsIcons
8
8
 
9
9
  desc "Create the Rails Icons initializer."
10
10
 
11
+ class_option :library, type: :string, desc: "Choose a library (#{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 icons folder"
13
14
  class_option :custom, type: :string, desc: "Name of the custom library"
@@ -94,7 +95,13 @@ module RailsIcons
94
95
  File.readlines(INITIALIZER).any? { _1.match?(line) }
95
96
  end
96
97
 
97
- def libraries = options[:libraries].map(&:downcase)
98
+ def libraries
99
+ [options[:library], *options[:libraries]]
100
+ .compact_blank
101
+ .map(&:downcase)
102
+ .uniq
103
+ .presence || []
104
+ end
98
105
 
99
106
  def validatable? = true
100
107
  end
@@ -9,6 +9,7 @@ module RailsIcons
9
9
 
10
10
  desc "Sync the chosen icon libraries from their respective git repos."
11
11
 
12
+ class_option :library, type: :string, desc: "Choose a library (#{RailsIcons.libraries.keys.join("/")})"
12
13
  class_option :libraries, type: :array, default: [], desc: "Choose libraries (#{RailsIcons.libraries.keys.join("/")})"
13
14
 
14
15
  def sync_icons = libraries.each { Sync::Engine.new(_1).sync }
@@ -16,7 +17,11 @@ module RailsIcons
16
17
  private
17
18
 
18
19
  def libraries
19
- options[:libraries].map(&:downcase).presence || synced_libraries
20
+ [options[:library], *options[:libraries]]
21
+ .compact_blank
22
+ .map(&:downcase)
23
+ .uniq
24
+ .presence || synced_libraries
20
25
  end
21
26
 
22
27
  def synced_libraries
@@ -1,3 +1,3 @@
1
1
  module RailsIcons
2
- VERSION = "1.5.1"
2
+ VERSION = "1.6.0"
3
3
  end
data/lib/rails_icons.rb CHANGED
@@ -5,7 +5,6 @@ require_relative "rails_icons/libraries"
5
5
  require_relative "rails_icons/configuration"
6
6
  require_relative "rails_icons/engine"
7
7
  require_relative "rails_icons/errors"
8
- # require_relative "rails_icons/railtie"
9
8
  require_relative "rails_icons/icon"
10
9
 
11
10
  module RailsIcons
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.5.1
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rails Designer Developers
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
117
  requirements: []
118
- rubygems_version: 3.6.9
118
+ rubygems_version: 4.0.4
119
119
  specification_version: 4
120
120
  summary: Add any icon library to a Rails app
121
121
  test_files: []