wilday_ui 0.2.0 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f7ffc8c90a797d359b3cc6d09b0361b7fa6ff5e46d3777e0234befc758054f6a
4
- data.tar.gz: c978c1985d1e399dcec8b381ea03ba00a4dad6981787b0acdb4e19ca512fe648
3
+ metadata.gz: 70c1108ccd7d2bcd7380d152efa3d2cf14e4908f0096d45f1ff79f4c7a0da316
4
+ data.tar.gz: a6bcee81202cc1560ee159afce60ad4abc44fb757e48b3d479d5446a7cb062c7
5
5
  SHA512:
6
- metadata.gz: 475ef6c2763c0f9a9d08653dd6f614a60c0974b574d2ceccaecdb2195ec4f8f36823aa1d764c1438824a3bd1f614ef4c68a04f4448b5b5d4d065115fe73fd2a6
7
- data.tar.gz: 8d504d1ce4999742555579a45436e8cced42808a305f615bd35532acc3800629c156e32e367525b1dbd38032fb2fef88ead1e2eb9368c25413baf094fa772bba
6
+ metadata.gz: 86da6a2371b63e7b078b57a5a03ac3acfd0a14889a512e32026b90cbc2b43b01706422e250f746b29728ad3ba3490b272f5e40fe04ac7f72496a2d6a44066fa4
7
+ data.tar.gz: ddeff11163331b488d1661160e815f4478c2924518a30110ae7c5b7c0f88b4cf05952398a4dcf175808140c6ea3717726aad0281c7fbb9bc0afe206bd5613323
data/README.md CHANGED
@@ -1,14 +1,15 @@
1
1
  # Wilday UI
2
2
 
3
- Wilday UI is a simple, customizable UI component library for Ruby on Rails projects. It includes ready-to-use components such as buttons with customizable styles, sizes, and radius, making it easy to create beautiful, consistent UI elements.
3
+ Wilday UI is a simple, customizable UI component library for Ruby on Rails projects. It provides a collection of prebuilt, reusable components with customizable styles and options, making it easy to build beautiful, consistent, and maintainable user interfaces.
4
4
 
5
5
  ---
6
6
 
7
7
  ## Features
8
8
 
9
- - Prebuilt, customizable button component
10
- - Flexible variants, sizes, and border radius
11
- - Easy integration with Rails as an engine
9
+ - Prebuilt, customizable UI components for common needs
10
+ - Flexible styling options with variants, sizes, and layouts
11
+ - Support for seamless integration with Rails as an engine
12
+ - Built for extensibility and framework compatibility
12
13
 
13
14
  ---
14
15
 
@@ -1,7 +1,17 @@
1
+ require "wilday_ui/version_check"
2
+
1
3
  module WildayUi
2
4
  class Engine < ::Rails::Engine
3
5
  isolate_namespace WildayUi
4
6
 
7
+ # Automatically check for updates
8
+ initializer "wilday_ui.version_check" do
9
+ Rails.application.config.after_initialize do
10
+ Rails.logger.info "[Wilday UI] Version check initialized."
11
+ WildayUi::VersionCheck.check_for_update
12
+ end
13
+ end
14
+
5
15
  # Automatically include helpers in views
6
16
  initializer "wilday_ui.helpers" do
7
17
  ActiveSupport.on_load(:action_view) do
@@ -1,3 +1,3 @@
1
1
  module WildayUi
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -0,0 +1,35 @@
1
+ require "net/http"
2
+ require "json"
3
+
4
+ module WildayUi
5
+ class VersionCheck
6
+ def self.check_for_update
7
+ return unless Rails.env.development?
8
+
9
+ current_version = Gem.loaded_specs["wilday_ui"]&.version&.to_s || WildayUi::VERSION
10
+ latest_version = fetch_latest_version
11
+
12
+ if latest_version && Gem::Version.new(latest_version) > Gem::Version.new(current_version)
13
+ puts "\n\e[33m[Wilday UI] Update available!"
14
+ puts "You are using version #{current_version}, but the latest version is #{latest_version}."
15
+ puts "To update, run: `bundle update wilday_ui` or update your Gemfile to the latest version\e[0m\n"
16
+ Rails.logger.warn <<~WARNING
17
+ [Wilday UI] You are using version #{current_version}, but the latest version is #{latest_version}.
18
+ To update, run `bundle update wilday_ui` or update your Gemfile to the latest version.
19
+ WARNING
20
+ end
21
+ end
22
+
23
+ private
24
+
25
+ def self.fetch_latest_version
26
+ url = URI("https://rubygems.org/api/v1/gems/wilday_ui.json")
27
+ response = Net::HTTP.get(url)
28
+ data = JSON.parse(response)
29
+ data["version"]
30
+ rescue StandardError => e
31
+ Rails.logger.info "[Wilday UI] Could not check for updates: #{e.message}"
32
+ nil
33
+ end
34
+ end
35
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wilday_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - davidwinalda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-09 00:00:00.000000000 Z
11
+ date: 2024-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -60,6 +60,7 @@ files:
60
60
  - lib/wilday_ui.rb
61
61
  - lib/wilday_ui/engine.rb
62
62
  - lib/wilday_ui/version.rb
63
+ - lib/wilday_ui/version_check.rb
63
64
  homepage: https://github.com/davidwinalda/wildayui
64
65
  licenses:
65
66
  - MIT