easy_ml 0.2.0.pre.rc21 → 0.2.0.pre.rc22

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: f0de4170b55d8d6e28cc09ac68421cbee2f0c441e6fb89e86207620fef642ee3
4
- data.tar.gz: 86e5b583cc202827bc3d2d9ea89fd4dd13f1d95f729ad5ae8d43936a66fe1a2f
3
+ metadata.gz: 385baa11d22ec55a9c9289d728bd4364b0d1b8499f158601effccd2339654626
4
+ data.tar.gz: 95fcc5235d6d179a0c55aad21e9488631b854be9ff0986e4bb4bc503745f1498
5
5
  SHA512:
6
- metadata.gz: 1d066503c36f9daee59ad93a89b6f35ff6c211602181030036edc31b7ece52276fd252a7a85b549263a180f4ec85f86a04e498440f217b6431d8da0225d9de0e
7
- data.tar.gz: c9c69540e6fbbedd688517226cffc757938933317952f9318189200a259dbc5b0963de6dfaa330741ea50387d290980176837f78ea80de04ea5e76b8d8f1c794
6
+ metadata.gz: 54643fa38a5f7a9eb4b9229d10687a331d3c2841a4ed08f8fece86a43daa0bd0c7ad4eeb442592479cfe60c175e73970a8bbd76232f475d5e79cfea7e323817b
7
+ data.tar.gz: 8ea4be5cebf9c849fbc17b4e0a78d8e8b831b916ca6d9107ce4474b7e865529de4d7f560cb5e4d5cdbfad6733cd9dd1fe19605277409ca31004f8790ff5b263e
@@ -72,9 +72,9 @@ module EasyML
72
72
  # Start sync in background to avoid blocking
73
73
  datasource.refresh_async
74
74
 
75
- redirect_to easy_ml_datasources_path(host: request.host), notice: "Datasource is syncing..."
75
+ redirect_to easy_ml_datasources_path, notice: "Datasource is syncing..."
76
76
  rescue ActiveRecord::RecordNotFound
77
- redirect_to easy_ml_datasources_path(host: request.host), error: "Datasource not found..."
77
+ redirect_to easy_ml_datasources_path, error: "Datasource not found..."
78
78
  end
79
79
 
80
80
  private
@@ -93,12 +93,22 @@ module EasyML
93
93
  end
94
94
 
95
95
  def set_root_dir
96
- write_attribute(:root_dir, root_dir)
96
+ bump_version
97
+ write_attribute(:root_dir, default_root_dir)
98
+ end
99
+
100
+ def default_root_dir
101
+ File.join("datasets", underscored_name, version).to_s
97
102
  end
98
103
 
99
104
  def root_dir
100
- bump_version
101
- EasyML::Engine.root_dir.join("datasets").join(underscored_name).join(version).to_s
105
+ persisted = read_attribute(:root_dir)
106
+
107
+ if persisted.present? && !persisted.blank?
108
+ EasyML::Engine.root_dir.join(persisted).to_s
109
+ else
110
+ default_root_dir
111
+ end
102
112
  end
103
113
 
104
114
  def destructively_cleanup!
@@ -89,9 +89,12 @@ module EasyML
89
89
 
90
90
  def root_dir
91
91
  persisted = read_attribute(:root_dir)
92
- return persisted if persisted.present? && !persisted.to_s.blank?
93
92
 
94
- default_root_dir
93
+ if persisted.present? && !persisted.blank?
94
+ EasyML::Engine.root_dir.join(persisted).to_s
95
+ else
96
+ default_root_dir
97
+ end
95
98
  end
96
99
 
97
100
  def refresh_async
@@ -156,7 +159,7 @@ module EasyML
156
159
 
157
160
  def default_root_dir
158
161
  folder = name.gsub(/\s{2,}/, " ").split(" ").join("_").downcase
159
- EasyML::Engine.root_dir.join("datasources").join(folder)
162
+ File.join("datasources", folder)
160
163
  end
161
164
 
162
165
  def set_root_dir
@@ -484,11 +484,21 @@ module EasyML
484
484
  end
485
485
 
486
486
  def set_root_dir
487
- write_attribute(:root_dir, root_dir)
487
+ write_attribute(:root_dir, default_root_dir)
488
488
  end
489
489
 
490
490
  def root_dir
491
- EasyML::Engine.root_dir.join("models").join(underscored_name).to_s
491
+ persisted = read_attribute(:root_dir)
492
+
493
+ if persisted.present? && !persisted.blank?
494
+ EasyML::Engine.root_dir.join(persisted).to_s
495
+ else
496
+ default_root_dir
497
+ end
498
+ end
499
+
500
+ def default_root_dir
501
+ File.join("models", underscored_name).to_s
492
502
  end
493
503
 
494
504
  def load_model(force: false)
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EasyML
4
- VERSION = "0.2.0-rc21"
4
+ VERSION = "0.2.0-rc22"
5
5
 
6
6
  module Version
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_ml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.pre.rc21
4
+ version: 0.2.0.pre.rc22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Shollenberger
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-01-08 00:00:00.000000000 Z
11
+ date: 2025-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord