easy_ml 0.2.0.pre.rc17 → 0.2.0.pre.rc18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +84 -0
  3. data/lib/easy_ml/version.rb +1 -1
  4. metadata +2 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7330b3eb57cbaf909207a8542b3ceb97676b4e3f51fc2c1016c624d335b7dc71
4
- data.tar.gz: cface5aa4a8870bcd01f5416521df6365aee1cbe2adc32bff01f09670de9a0f8
3
+ metadata.gz: 5756619381485dd3d8610ec98f4e8ec059631294ccc66ff0cd28644dbf421140
4
+ data.tar.gz: 8d7cbb411f2c73c3ef0fa7bdf3cd1c5d57095c427a0b12438a170e8bd8aa73e5
5
5
  SHA512:
6
- metadata.gz: 84ac456fb4bc6df47bd3f209da6bab75dc8421416fafe525bc1a4b38621d709f39940afe2ede94f8693721befc9059fbfbc5b0b41974a3ca18a990481a8e2b82
7
- data.tar.gz: 5a6a5457cbfcaebc214ee1ee62cd5e292247ed01c6aa16faabdda017b6bc6062395281c1fd952ebd19bd37a8363bda296eecd5382925d50494b1dcbb8a8dd90c
6
+ metadata.gz: 1c2e32c59da8de236e38ed08d5742ac813cfd9c568cbf77b1cd9d90c76248dc7e2a8af5747fd0b2b87aeeee1e015af5ea24ca02662d26e3a8e3b5d6d732c5c8b
7
+ data.tar.gz: cd817219954f021b66b14471e396517546c1f757d3122b8328d2ff41e8ef2af343dc0df7411f69c2ffcc0b6d3de23f53806e8f5a0df5437d2b303ee0a381af58
data/Rakefile ADDED
@@ -0,0 +1,84 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "sprockets/railtie"
4
+ require "bundler/gem_tasks"
5
+ require "rspec/core/rake_task"
6
+ require "resque/tasks"
7
+
8
+ RSpec::Core::RakeTask.new(:spec)
9
+
10
+ require "rubocop/rake_task"
11
+
12
+ RuboCop::RakeTask.new
13
+
14
+ task default: %i[spec rubocop]
15
+
16
+ Bundler.require(:default)
17
+
18
+ # Load your gem's code
19
+ require_relative "lib/easy_ml"
20
+
21
+ # Load the annotate tasks
22
+ require "annotate/annotate_models"
23
+
24
+ task :environment do
25
+ require "combustion"
26
+ require "sprockets"
27
+ Combustion.path = "spec/internal"
28
+ Combustion.initialize! :active_record do |config|
29
+ config.assets = ActiveSupport::OrderedOptions.new # Stub to avoid errors
30
+ config.assets.enabled = false # Set false since assets are handled by Vite
31
+ end
32
+ EasyML::Engine.eager_load!
33
+ end
34
+
35
+ namespace :easy_ml do
36
+ task annotate_models: :environment do
37
+ model_dir = File.expand_path("app/models", EasyML::Engine.root)
38
+ $LOAD_PATH.unshift(model_dir) unless $LOAD_PATH.include?(model_dir)
39
+
40
+ AnnotateModels.do_annotations(
41
+ is_rake: true,
42
+ model_dir: [EasyML::Engine.root.join("app/models/easy_ml").to_s],
43
+ root_dir: [EasyML::Engine.root.join("app/models/easy_ml").to_s],
44
+ include_modules: true, # Include modules/namespaces in the annotation
45
+ )
46
+ end
47
+
48
+ task :create_test_migrations do
49
+ require "combustion"
50
+ require "rails/generators"
51
+ require_relative "lib/easy_ml/railtie/generators/migration/migration_generator"
52
+
53
+ db_files = Dir.glob(EasyML::Engine.root.join("spec/internal/db/migrate/**/*"))
54
+
55
+ FileUtils.rm(db_files)
56
+ Rails::Generators.invoke("easy_ml:migration", [], { destination_root: EasyML::Engine.root.join("spec/internal") })
57
+ end
58
+ end
59
+
60
+ task :environment do
61
+ # Force the application to load (Rails or standalone app setup)
62
+ require File.expand_path("config/environment", __dir__)
63
+ end
64
+
65
+ # Ensure resque:work depends on :environment
66
+ namespace :resque do
67
+ desc "Start a Resque worker"
68
+ task :easy_ml => [:preload, :setup] do
69
+ require "resque"
70
+
71
+ begin
72
+ worker = Resque::Worker.new
73
+ rescue Resque::NoQueueError
74
+ abort "set QUEUE env var, e.g. $ QUEUE=critical,high rake resque:work"
75
+ end
76
+
77
+ worker.prepare
78
+ worker.log "Starting worker #{worker}"
79
+ worker.work(ENV["INTERVAL"] || 5) # interval, will block
80
+ end
81
+ end
82
+
83
+ task "resque:work" => :environment
84
+ task "resque:workers" => :environment
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EasyML
4
- VERSION = "0.2.0-rc17"
4
+ VERSION = "0.2.0-rc18"
5
5
 
6
6
  module Version
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_ml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.pre.rc17
4
+ version: 0.2.0.pre.rc18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Shollenberger
@@ -437,6 +437,7 @@ executables: []
437
437
  extensions: []
438
438
  extra_rdoc_files: []
439
439
  files:
440
+ - Rakefile
440
441
  - app/.vite/manifest-assets.json
441
442
  - app/.vite/manifest.json
442
443
  - app/controllers/easy_ml/application_controller.rb