tina4ruby 3.10.47 → 3.10.50
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 +4 -4
- data/lib/tina4/cli.rb +28 -6
- data/lib/tina4/database/sqlite3_adapter.rb +1 -1
- data/lib/tina4/database.rb +4 -2
- data/lib/tina4/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: abf3c5a919a2ef3d8045a321ff7199560cc9d984afbbfce65517728b2f12ae3c
|
|
4
|
+
data.tar.gz: c7976150a47140a2585fd5adc19ccc66b6dbeaeeb38bdcdbf405bb239006acfe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8d2167a92355ee4d21810bd3999cd67993f48ab3be21ca7d2e85f83c5b51cfcc225a0d5db40213feecad93cb9548640fa3f80b06d43ede6bc0270fe06af98e07
|
|
7
|
+
data.tar.gz: 3afbe6fa4642493a511949cbf0f324224e1fccbedaaa1edd18790bbbb8fcfaf2c29f1d8bb0a13d4ec16f94b8c4234b1e4d41603b9194763a9c3dd9dce60b0d04
|
data/lib/tina4/cli.rb
CHANGED
|
@@ -155,18 +155,20 @@ module Tina4
|
|
|
155
155
|
# ── start ─────────────────────────────────────────────────────────────
|
|
156
156
|
|
|
157
157
|
def cmd_start(argv)
|
|
158
|
-
options = { port: nil, host: nil, dev: false, no_browser: false }
|
|
158
|
+
options = { port: nil, host: nil, dev: false, no_browser: false, production: false }
|
|
159
159
|
parser = OptionParser.new do |opts|
|
|
160
160
|
opts.banner = "Usage: tina4ruby start [options]"
|
|
161
161
|
opts.on("-p", "--port PORT", Integer, "Port (default: 7147)") { |v| options[:port] = v }
|
|
162
162
|
opts.on("-h", "--host HOST", "Host (default: 0.0.0.0)") { |v| options[:host] = v }
|
|
163
163
|
opts.on("-d", "--dev", "Enable dev mode with auto-reload") { options[:dev] = true }
|
|
164
|
+
opts.on("--production", "Use production server (Puma)") { options[:production] = true }
|
|
164
165
|
opts.on("--no-browser", "Do not open browser on start") { options[:no_browser] = true }
|
|
165
166
|
end
|
|
166
167
|
parser.parse!(argv)
|
|
167
168
|
|
|
168
|
-
# --no-browser from env
|
|
169
|
-
|
|
169
|
+
# --no-browser from env (TINA4_NO_BROWSER=true)
|
|
170
|
+
no_browser_env = ENV.fetch("TINA4_NO_BROWSER", "").downcase
|
|
171
|
+
if no_browser_env.match?(/\A(true|1|yes)\z/)
|
|
170
172
|
options[:no_browser] = true
|
|
171
173
|
end
|
|
172
174
|
|
|
@@ -197,9 +199,9 @@ module Tina4
|
|
|
197
199
|
|
|
198
200
|
is_debug = Tina4::Env.truthy?(ENV["TINA4_DEBUG"])
|
|
199
201
|
|
|
200
|
-
#
|
|
201
|
-
#
|
|
202
|
-
if
|
|
202
|
+
# Use Puma only when explicitly requested via --production flag
|
|
203
|
+
# WEBrick is used for development (supports dev toolbar/reload)
|
|
204
|
+
if options[:production]
|
|
203
205
|
begin
|
|
204
206
|
require "puma"
|
|
205
207
|
require "puma/configuration"
|
|
@@ -1280,6 +1282,26 @@ module Tina4
|
|
|
1280
1282
|
].each do |subdir|
|
|
1281
1283
|
FileUtils.mkdir_p(File.join(dir, subdir))
|
|
1282
1284
|
end
|
|
1285
|
+
|
|
1286
|
+
# Copy framework public assets into the project so they're visible
|
|
1287
|
+
framework_public = File.join(File.dirname(__FILE__), "public")
|
|
1288
|
+
project_public = File.join(dir, "src", "public")
|
|
1289
|
+
assets_to_copy = %w[
|
|
1290
|
+
css/tina4.css
|
|
1291
|
+
css/tina4.min.css
|
|
1292
|
+
js/tina4.min.js
|
|
1293
|
+
js/frond.min.js
|
|
1294
|
+
images/tina4-logo-icon.webp
|
|
1295
|
+
]
|
|
1296
|
+
assets_to_copy.each do |asset|
|
|
1297
|
+
src = File.join(framework_public, asset)
|
|
1298
|
+
dst = File.join(project_public, asset)
|
|
1299
|
+
FileUtils.mkdir_p(File.dirname(dst))
|
|
1300
|
+
if File.exist?(src) && !File.exist?(dst)
|
|
1301
|
+
FileUtils.cp(src, dst)
|
|
1302
|
+
puts " Copied #{asset}"
|
|
1303
|
+
end
|
|
1304
|
+
end
|
|
1283
1305
|
end
|
|
1284
1306
|
|
|
1285
1307
|
def create_sample_files(dir, project_name)
|
data/lib/tina4/database.rb
CHANGED
|
@@ -169,12 +169,14 @@ module Tina4
|
|
|
169
169
|
end
|
|
170
170
|
end
|
|
171
171
|
|
|
172
|
-
def fetch(sql, params = [], limit:
|
|
172
|
+
def fetch(sql, params = [], limit: 100, offset: nil)
|
|
173
173
|
offset ||= 0
|
|
174
174
|
drv = current_driver
|
|
175
175
|
|
|
176
176
|
effective_sql = sql
|
|
177
|
-
if
|
|
177
|
+
# Skip appending LIMIT if SQL already has one
|
|
178
|
+
has_limit = sql.upcase.split("--")[0].include?("LIMIT")
|
|
179
|
+
if limit && !has_limit
|
|
178
180
|
effective_sql = drv.apply_limit(effective_sql, limit, offset)
|
|
179
181
|
end
|
|
180
182
|
|
data/lib/tina4/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tina4ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.10.
|
|
4
|
+
version: 3.10.50
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tina4 Team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-04-
|
|
11
|
+
date: 2026-04-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rack
|