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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c12d564be4137cf8c9784a96dd33aca81872412b6e04563bbaecf17c06fa2ad6
4
- data.tar.gz: 26246b8cab442bfd6406cb696d66e89c8d3ca8bcd387b7ed538e03b5526421c0
3
+ metadata.gz: abf3c5a919a2ef3d8045a321ff7199560cc9d984afbbfce65517728b2f12ae3c
4
+ data.tar.gz: c7976150a47140a2585fd5adc19ccc66b6dbeaeeb38bdcdbf405bb239006acfe
5
5
  SHA512:
6
- metadata.gz: b4b5118f7a247839c941e6c412b9647d8eb6090435ac8924d2479b05ed7e84df51e3e1d907843d3e0a183e2e930197682fb0a7af20389ac5c483ba620af13201
7
- data.tar.gz: c26ff09a7fdb9132839c57fc42699fb338d9b4c917e055c9807156b6e13fab1117375b7334cd5c61e3aaff030523615a5dde3119aedd0206bc00435b824b5264
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
- if ENV.fetch("TINA4_OPEN_BROWSER", "").downcase.match?(/\A(false|0|no)\z/)
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)
@@ -38,7 +38,7 @@ module Tina4
38
38
  end
39
39
 
40
40
  # Paginated fetch
41
- def fetch(sql, limit = nil, offset = nil)
41
+ def fetch(sql, limit = 100, offset = nil)
42
42
  effective_sql = sql
43
43
  if limit
44
44
  effective_sql = "#{sql} LIMIT #{limit}"
@@ -169,12 +169,14 @@ module Tina4
169
169
  end
170
170
  end
171
171
 
172
- def fetch(sql, params = [], limit: nil, offset: nil)
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 limit
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tina4
4
- VERSION = "3.10.48"
4
+ VERSION = "3.10.50"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tina4ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.10.48
4
+ version: 3.10.50
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tina4 Team