tina4ruby 3.10.48 → 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 +23 -2
- data/lib/tina4/database/sqlite3_adapter.rb +1 -1
- data/lib/tina4/database.rb +4 -2
- data/lib/tina4/version.rb +1 -1
- metadata +1 -1
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
|
@@ -166,8 +166,9 @@ module Tina4
|
|
|
166
166
|
end
|
|
167
167
|
parser.parse!(argv)
|
|
168
168
|
|
|
169
|
-
# --no-browser from env
|
|
170
|
-
|
|
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/)
|
|
171
172
|
options[:no_browser] = true
|
|
172
173
|
end
|
|
173
174
|
|
|
@@ -1281,6 +1282,26 @@ module Tina4
|
|
|
1281
1282
|
].each do |subdir|
|
|
1282
1283
|
FileUtils.mkdir_p(File.join(dir, subdir))
|
|
1283
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
|
|
1284
1305
|
end
|
|
1285
1306
|
|
|
1286
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