From 46531b1e15fc2adb0b5b41b1923d03c1b4423763 Mon Sep 17 00:00:00 2001 From: Ali Hamdi Ali Fadel Date: Tue, 3 Sep 2024 09:56:38 +0000 Subject: [PATCH] Change gem name from phlex_icons to phlex-icons --- .github/scripts/prepare-new-gem.sh | 4 ++-- README.md | 8 ++++---- bin/console | 2 +- lib/{phlex_icons.rb => phlex-icons.rb} | 5 +++-- 4 files changed, 10 insertions(+), 9 deletions(-) rename lib/{phlex_icons.rb => phlex-icons.rb} (90%) diff --git a/.github/scripts/prepare-new-gem.sh b/.github/scripts/prepare-new-gem.sh index 3cc645f1..35e8a3eb 100644 --- a/.github/scripts/prepare-new-gem.sh +++ b/.github/scripts/prepare-new-gem.sh @@ -17,7 +17,7 @@ for pack in $packs; do if [ "$pack" != "$pack_to_keep" ]; then rm -rf "lib/phlex/icons/$pack" rm -f "lib/phlex/icons/$pack.rb" - sed -i "/require_relative 'phlex\/icons\/$pack'/d" lib/phlex_icons.rb + sed -i "/require_relative 'phlex\/icons\/$pack'/d" lib/phlex-icons.rb fi done @@ -28,7 +28,7 @@ require_relative '"'"'../base'"'"' ' "lib/phlex/icons/${pack_to_keep}/base.rb" # Rename the main file and gemspec -mv lib/phlex_icons.rb "lib/phlex_icons_${pack_to_keep}.rb" +mv lib/phlex-icons.rb "lib/phlex-icons-${pack_to_keep}.rb" sed -i "s/spec.name = 'phlex-icons'/spec.name = 'phlex-icons-${pack_to_keep}'/" phlex-icons.gemspec sed -i "s/spec.summary = 'Icons library for Phlex'/spec.summary = '${pack_to_keep_cap} icons library for Phlex'/" phlex-icons.gemspec diff --git a/README.md b/README.md index 8128929c..cefbe7f3 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ Phlex::Icons::Tabler.configuration.default_variant = :outline # or :filled ### With `Phlex::Kit` ```ruby -require 'phlex_icons' +require 'phlex-icons' class PhlexIcons < Phlex::HTML include Phlex::Icons @@ -146,7 +146,7 @@ end ### Without `Phlex::Kit` ```ruby -require 'phlex_icons' +require 'phlex-icons' class PhlexIcons < Phlex::HTML def view_template @@ -172,8 +172,8 @@ Let's say you want to use only Heroicons and Flag Icons, you can use the followi Then, in your application, you can use the icons like this: ```ruby -require 'phlex_icons_flag' -require 'phlex_icons_hero' +require 'phlex-icons-flag' +require 'phlex-icons-hero' class PhlexIcons < Phlex::HTML include Phlex::Icons # If you want to use Phlex::Kit. diff --git a/bin/console b/bin/console index 6e1ed992..efc118af 100755 --- a/bin/console +++ b/bin/console @@ -2,7 +2,7 @@ # frozen_string_literal: true require 'bundler/setup' -require 'phlex_icons' +require 'phlex-icons' # You can add fixtures and/or initialization code here to make experimenting # with your gem easier. You can also use a different console, if you like. diff --git a/lib/phlex_icons.rb b/lib/phlex-icons.rb similarity index 90% rename from lib/phlex_icons.rb rename to lib/phlex-icons.rb index cee8d9e5..ecbddcfb 100644 --- a/lib/phlex_icons.rb +++ b/lib/phlex-icons.rb @@ -1,3 +1,6 @@ +# rubocop:disable Naming/FileName +# rubocop:enable Naming/FileName + # frozen_string_literal: true require 'phlex' @@ -6,8 +9,6 @@ require_relative 'phlex/icons/configuration' require_relative 'phlex/icons/version' -require_relative 'phlex/icons/railtie' if defined?(Rails) - require_relative 'phlex/icons/bootstrap' require_relative 'phlex/icons/flag' require_relative 'phlex/icons/hero'