footprinted 0.2.0 → 0.2.1

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: e0a6166d8616c0c1204631e17bc3ecf5c09cbff6fc94a38ee892061f2679b8c2
4
- data.tar.gz: '0783420c75bf7f3736b0b4fcd84484281353f07d9fb89c1773066d25cb44dab7'
3
+ metadata.gz: 2969bfdd4365c5aa27fe37a0a74d77283ad0b0053c221442496fd837fd210bfa
4
+ data.tar.gz: 37992d2955029ec6b2e03aa841bb5f06f5d0acf868819ffd2ac56bbc2b38b6de
5
5
  SHA512:
6
- metadata.gz: ff0f0e67acc390309d8d8491f43efa63d001ae58f72768d041b88f5842a231d76a444d129067dad4daffda702a5cd9d377d08be51c87cd9c76d079fb3f937a79
7
- data.tar.gz: ff2e6a3705a726900cc0c4bca87ec9c07ca635f3a1ff02f67464affce02a9f5d179fca9f33714c1b7cf5ba1f80577770362ed94a0a9f342709f17e672fedf403
6
+ metadata.gz: e72627f90b0b0357ef8fffccbea1c1ae6204ccbc45144f5f992dbfdb3cc4d6716413ea173f22996412eea7f49023f6078c6841f67324b5a76ab40e18ad4d99f6
7
+ data.tar.gz: 88ef984e78aa8b40fd634e4beb7be934dd3187aa2d8391b1da754cd981b64a6e48766211239d20264c87948300b0abfbf0037500189d8f0332e6616142afcccb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.1] - 2026-02-09
4
+
5
+ - Fix async mode: change Railtie to Engine so `TrackJob` is autoloaded
6
+
3
7
  ## [0.2.0] - 2026-02-08
4
8
 
5
9
  **Full rewrite.** Breaking changes from v0.1.0.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- footprinted (0.2.0)
4
+ footprinted (0.2.1)
5
5
  rails (>= 7.0)
6
6
  trackdown (~> 0.3)
7
7
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- footprinted (0.2.0)
4
+ footprinted (0.2.1)
5
5
  rails (>= 7.0)
6
6
  trackdown (~> 0.3)
7
7
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Footprinted
4
- class Railtie < Rails::Railtie
4
+ class Engine < Rails::Engine
5
5
  initializer "footprinted.initialize" do
6
6
  ActiveSupport.on_load(:active_record) do
7
7
  extend Footprinted::Model
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Footprinted
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
data/lib/footprinted.rb CHANGED
@@ -25,4 +25,4 @@ module Footprinted
25
25
  end
26
26
  end
27
27
 
28
- require "footprinted/railtie" if defined?(Rails)
28
+ require "footprinted/engine" if defined?(Rails)
@@ -1,25 +1,46 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rails/generators/base'
4
- require 'rails/generators/active_record'
3
+ require "rails/generators/base"
4
+ require "rails/generators/active_record"
5
5
 
6
6
  module Footprinted
7
7
  module Generators
8
8
  class InstallGenerator < Rails::Generators::Base
9
9
  include ActiveRecord::Generators::Migration
10
10
 
11
- source_root File.expand_path('templates', __dir__)
11
+ source_root File.expand_path("templates", __dir__)
12
12
 
13
- def self.next_migration_number(dir)
14
- ActiveRecord::Generators::Base.next_migration_number(dir)
13
+ def self.next_migration_number(dirname)
14
+ next_migration_number = current_migration_number(dirname) + 1
15
+ ActiveRecord::Migration.next_migration_number(next_migration_number)
15
16
  end
16
17
 
17
18
  def create_migration_file
18
- migration_template 'create_footprinted_footprints.rb.erb', File.join(db_migrate_path, "create_footprinted_footprints.rb")
19
+ migration_template "create_footprinted_footprints.rb.erb",
20
+ File.join(db_migrate_path, "create_footprinted_footprints.rb")
19
21
  end
20
22
 
21
23
  def create_initializer
22
- template 'footprinted.rb', 'config/initializers/footprinted.rb'
24
+ template "footprinted.rb", "config/initializers/footprinted.rb"
25
+ end
26
+
27
+ def display_post_install_message
28
+ say "\n🎉 The `footprinted` gem has been successfully installed!", :green
29
+ say "\nTo complete the setup:"
30
+ say " 1. Run `rails db:migrate` to create the footprints table."
31
+ say " ⚠️ You must run migrations before starting your app!", :yellow
32
+ say "\n 2. Add `include Footprinted::Model` to any model you want to track:"
33
+ say " class Product < ApplicationRecord"
34
+ say " include Footprinted::Model"
35
+ say " end"
36
+ say "\n 3. Create footprints from your controllers or services:"
37
+ say " product.footprints.create!("
38
+ say " ip: request.remote_ip,"
39
+ say " event_type: 'page_view',"
40
+ say " occurred_at: Time.current"
41
+ say " )"
42
+ say "\nSee the footprinted README for detailed usage and examples.", :cyan
43
+ say "Happy tracking! 👣\n", :green
23
44
  end
24
45
 
25
46
  private
@@ -27,7 +48,6 @@ module Footprinted
27
48
  def migration_version
28
49
  "[#{ActiveRecord::VERSION::STRING.to_f}]"
29
50
  end
30
-
31
51
  end
32
52
  end
33
53
  end
@@ -1,4 +1,4 @@
1
- class CreateFootprintedFootprints < ActiveRecord::Migration<%%= migration_version %>
1
+ class CreateFootprintedFootprints < ActiveRecord::Migration<%= migration_version %>
2
2
  def change
3
3
  primary_key_type, foreign_key_type = primary_and_foreign_key_types
4
4
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: footprinted
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - rameerez
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-02-08 00:00:00.000000000 Z
10
+ date: 2026-02-09 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rails
@@ -64,9 +64,9 @@ files:
64
64
  - gemfiles/rails_8.1.gemfile.lock
65
65
  - lib/footprinted.rb
66
66
  - lib/footprinted/configuration.rb
67
+ - lib/footprinted/engine.rb
67
68
  - lib/footprinted/footprint.rb
68
69
  - lib/footprinted/model.rb
69
- - lib/footprinted/railtie.rb
70
70
  - lib/footprinted/version.rb
71
71
  - lib/generators/footprinted/install_generator.rb
72
72
  - lib/generators/footprinted/templates/create_footprinted_footprints.rb.erb