eksa-framework 1.2.1 โ†’ 2.2.2

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: 8caab3a457d5024168c3ff86697057d413bb0bdef32351c4cee69cee1da5b2ba
4
- data.tar.gz: 72efe953699777d97650f2f51a1753cc28fd8c1eed5efe7a990ac2775c90c0ee
3
+ metadata.gz: 7d6f7016cde9ee0b7fdc950e4ae0de7cee2425ffde98f2a3879679ce7b685677
4
+ data.tar.gz: 6e6c5b4535d9f08b0f7dd486e4641de30b4df019d1fce4a171f3203bb7bfe07b
5
5
  SHA512:
6
- metadata.gz: 04aaab52ac31d9a29d7ee02010c11719be53fa6b0fc4d0e99ac464efccb5dacc3eb8ea122b0cf24c43d3e94e2945cddf75a8f1b2205d5be6b1e8ed7e9546bdf7
7
- data.tar.gz: '08fdf429f48a8965f70f5e0adc3406224a386b17741a39fa29492eef65b0153501e9f450434231b20a25f98ea4918af524fe525c6ea654afaa0247b2c8dfe2e0'
6
+ metadata.gz: 12e84b512d1b40e62b47dcd10fa06334a2ae49103e251bfa4f1d36df607193b5719563aed61d25a84c252dd8c2cfb55aebcd0868185b1968dcfbdc46c6b6a2f3
7
+ data.tar.gz: 9704f8011116a0d726685e35f8540e1bd592d29e35db3c3ddcaab03b960fc474c52ef46e44ee07b5757ee539a044e8beba3290eba06874d5821db7b90b4c901a
data/README.md CHANGED
@@ -13,11 +13,12 @@
13
13
 
14
14
  * ๐Ÿ’Ž **Modern Glassmorphism UI**: Tampilan transparan yang indah dengan Tailwind CSS & Lucide Icons.
15
15
  * โšก **Rack 3 & Middleware Support**: Mendukung standar terbaru dan pembuatan pipeline middleware kustom.
16
- * ๐Ÿ› ๏ธ **Powerful CLI**: Inisialisasi project (`eksa init`), jalankan server (`eksa run`), dan generate komponen secara instan.
16
+ * ๐Ÿ› ๏ธ **Powerful CLI**: Inisialisasi project (`eksa init`), jalankan server (`eksa run`), generate komponen, dan **auto-routing** otomatis.
17
17
  * ๐Ÿ’พ **Dynamic Database Engine**: Database SQLite otomatis dengan schema yang ditentukan oleh model Anda sendiri.
18
18
  * ๐Ÿงช **Built-in Testing**: Lingkungan pengujian otomatis siap pakai menggunakan RSpec dan `rack-test`.
19
19
  * ๐ŸŽจ **Asset Helpers**: Library bawaan untuk pengelolaan CSS dan JS yang lebih rapi.
20
20
  * ๐Ÿ” **Dynamic SEO Engine**: Penanganan otomatis file `robots.txt` dan `sitemap.xml`.
21
+ * ๐Ÿ‘ป **Aesthetic Error Pages**: Halaman 404 dengan desain Glassmorphism yang elegan secara native.
21
22
 
22
23
  ---
23
24
 
@@ -133,7 +133,7 @@
133
133
  <p class="text-white/30"># Build gem lokal</p>
134
134
  <p class="text-indigo-300">gem build eksa-framework.gemspec</p>
135
135
  <p class="text-white/30 mt-4"># Publish ke RubyGems / GitHub Packages</p>
136
- <p class="text-indigo-300">gem push eksa-framework-1.2.1.gem</p>
136
+ <p class="text-indigo-300">gem push eksa-framework-2.2.2.gem</p>
137
137
  </div>
138
138
  </section>
139
139
 
@@ -2,7 +2,7 @@
2
2
  <div class="flex flex-col md:flex-row justify-between items-start md:items-center mb-8 gap-4">
3
3
  <div>
4
4
  <span class="inline-block bg-indigo-500/20 text-indigo-200 text-xs font-bold px-3 py-1 rounded-full mb-3 border border-indigo-500/30">
5
- v1.2.1 Alpha
5
+ v2.2.2 Alpha
6
6
  </span>
7
7
  <h1 class="text-4xl font-extrabold tracking-tight">
8
8
  Halo, <span class="text-indigo-300"><%= @nama %></span>!
data/exe/eksa CHANGED
@@ -66,6 +66,23 @@ def generate_controller(name)
66
66
  index_view = File.join(view_dir, "index.html.erb")
67
67
  File.write(index_view, "<h1>#{class_name}#index</h1>\n<p>Temukan saya di #{index_view}</p>")
68
68
  puts " [OK] Created #{index_view}"
69
+
70
+ # Update config.ru with a new route
71
+ if File.exist?('config.ru')
72
+ config_content = File.read('config.ru')
73
+ route_line = %(app.add_route "/#{name}", #{class_name}Controller, :index)
74
+
75
+ unless config_content.include?(route_line)
76
+ if config_content.match?(/run app/)
77
+ new_content = config_content.gsub(/run app/, "#{route_line}\n\nrun app")
78
+ File.write('config.ru', new_content)
79
+ puts " [OK] Added route to config.ru"
80
+ else
81
+ File.open('config.ru', 'a') { |f| f.puts "\n#{route_line}" }
82
+ puts " [OK] Appended route to config.ru"
83
+ end
84
+ end
85
+ end
69
86
  end
70
87
 
71
88
  def generate_model(name)
data/lib/eksa/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Eksa
2
- VERSION = "1.2.1"
2
+ VERSION = "2.2.2"
3
3
  end
data/lib/eksa.rb CHANGED
@@ -68,7 +68,46 @@ module Eksa
68
68
  response.delete_cookie('eksa_flash') if flash_message
69
69
  response.finish
70
70
  else
71
- [404, { 'content-type' => 'text/html' }, ["<div style='font-family:sans-serif; text-align:center; padding-top:50px;'><h1>404</h1><p>Halaman tidak ditemukan di Eksa Framework.</p></div>"]]
71
+ html = <<~HTML
72
+ <!DOCTYPE html>
73
+ <html lang="id">
74
+ <head>
75
+ <meta charset="UTF-8">
76
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
77
+ <title>404 - Halaman Tidak Ditemukan</title>
78
+ <script src="https://cdn.tailwindcss.com"></script>
79
+ <link href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" rel="stylesheet">
80
+ <script src="https://unpkg.com/lucide@latest"></script>
81
+ <style>
82
+ body { background: radial-gradient(circle at top left, #1e1b4b 0%, #000000 100%); min-height: 100vh; color: white; font-family: sans-serif; display: flex; align-items: center; justify-content: center; overflow: hidden; margin: 0; }
83
+ .glass { background: rgba(255, 255, 255, 0.03); backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); }
84
+ .glow { position: absolute; width: 400px; height: 400px; background: radial-gradient(circle, rgba(79, 70, 229, 0.15) 0%, transparent 70%); z-index: -1; filter: blur(40px); }
85
+ </style>
86
+ </head>
87
+ <body>
88
+ <div class="glow" style="top: 0; left: 0; transform: translate(-50%, -50%);"></div>
89
+ <div class="glow" style="bottom: 0; right: 0; transform: translate(50%, 50%);"></div>
90
+ <div class="glass" style="max-width: 512px; width: 100%; padding: 48px; border-radius: 40px; text-align: center; animation: zoomIn 0.8s;">
91
+ <div style="margin-bottom: 32px; position: relative; display: inline-block;">
92
+ <div style="position: absolute; inset: 0; background: rgba(79, 70, 229, 0.2); filter: blur(3xl); border-radius: 9999px;"></div>
93
+ <div style="position: relative; background: rgba(79, 70, 229, 0.2); padding: 24px; border-radius: 24px; border: 1px solid rgba(99, 102, 241, 0.3);">
94
+ <i data-lucide="ghost" style="width: 64px; height: 64px; color: #a5b4fc;"></i>
95
+ </div>
96
+ </div>
97
+ <h1 style="font-size: 80px; font-weight: 900; margin: 0; letter-spacing: -0.05em; color: white; opacity: 0.9;">404</h1>
98
+ <h2 style="font-size: 24px; font-weight: 700; margin: 16px 0; color: rgba(255, 255, 255, 0.9);">Oops! Halaman Hilang.</h2>
99
+ <p style="color: rgba(255, 255, 255, 0.5); margin-bottom: 40px; line-height: 1.6;">Sepertinya halaman yang Anda cari tidak ada atau sudah berpindah alamat. Jangan khawatir, kita bisa kembali.</p>
100
+ <div style="display: flex; flex-direction: column; gap: 16px; justify-content: center;">
101
+ <a href="/" style="padding: 16px 32px; background: white; color: black; font-weight: 700; border-radius: 16px; text-decoration: none; display: flex; items-center: center; justify-content: center; gap: 8px;">
102
+ <i data-lucide="home" style="width: 20px; height: 20px;"></i> Kembali ke Beranda
103
+ </a>
104
+ </div>
105
+ </div>
106
+ <script>lucide.createIcons();</script>
107
+ </body>
108
+ </html>
109
+ HTML
110
+ [404, { 'content-type' => 'text/html' }, [html]]
72
111
  end
73
112
  end
74
113
  end
@@ -10,7 +10,7 @@ describe Eksa::Application do
10
10
  it "returns 404 for unknown routes" do
11
11
  get '/unknown'
12
12
  expect(last_response.status).to eq(404)
13
- expect(last_response.body).to include("Halaman tidak ditemukan")
13
+ expect(last_response.body).to include("Halaman Tidak Ditemukan")
14
14
  end
15
15
 
16
16
  it "can add and reach routes" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eksa-framework
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - IshikawaUta