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 +4 -4
- data/CHANGELOG.md +4 -0
- data/gemfiles/rails_7.2.gemfile.lock +1 -1
- data/gemfiles/rails_8.1.gemfile.lock +1 -1
- data/lib/footprinted/{railtie.rb → engine.rb} +1 -1
- data/lib/footprinted/version.rb +1 -1
- data/lib/footprinted.rb +1 -1
- data/lib/generators/footprinted/install_generator.rb +28 -8
- data/lib/generators/footprinted/templates/create_footprinted_footprints.rb.erb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2969bfdd4365c5aa27fe37a0a74d77283ad0b0053c221442496fd837fd210bfa
|
|
4
|
+
data.tar.gz: 37992d2955029ec6b2e03aa841bb5f06f5d0acf868819ffd2ac56bbc2b38b6de
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e72627f90b0b0357ef8fffccbea1c1ae6204ccbc45144f5f992dbfdb3cc4d6716413ea173f22996412eea7f49023f6078c6841f67324b5a76ab40e18ad4d99f6
|
|
7
|
+
data.tar.gz: 88ef984e78aa8b40fd634e4beb7be934dd3187aa2d8391b1da754cd981b64a6e48766211239d20264c87948300b0abfbf0037500189d8f0332e6616142afcccb
|
data/CHANGELOG.md
CHANGED
data/lib/footprinted/version.rb
CHANGED
data/lib/footprinted.rb
CHANGED
|
@@ -1,25 +1,46 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require
|
|
4
|
-
require
|
|
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(
|
|
11
|
+
source_root File.expand_path("templates", __dir__)
|
|
12
12
|
|
|
13
|
-
def self.next_migration_number(
|
|
14
|
-
|
|
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
|
|
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
|
|
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
|
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.
|
|
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-
|
|
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
|