referral_box 0.1.8 โ 0.1.10
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 +23 -0
- data/README.md +8 -21
- data/lib/generators/referral_box/install/install_generator.rb +28 -5
- data/lib/referral_box/version.rb +1 -1
- data/logo.jpg +0 -0
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d6e2e49dbfde531e80573570a7ee6c0e7ba707997920dc4f6dd9ea6c447bd6ad
|
|
4
|
+
data.tar.gz: 1501ce0c99a129b3b154f552a9d3640924022601daf6e24ad07e40603e117091
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: becaa95fde3504a013960827352dabf9d07d9d912e6bbaae8360d2798ef0a84ebabc29d983ce29fc84ac320766d34060662677d278968ed4c2536caa6ed674f8
|
|
7
|
+
data.tar.gz: ec0c083bca561f17554cfb570044f6b28a58597e65fe969fc72510e9473b4d74c27cebd8183f46e7d632743ee589e5dfff1a76bdc788cf5d3a7638389f29190f
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.1.10] - 2025-01-XX
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **Repository Migration**: Successfully migrated code from Referral_box to LoyaltyRef-Referral_box repository
|
|
14
|
+
- **Enhanced Documentation**: Added loyalty_ref_gem_docs.md with comprehensive usage examples
|
|
15
|
+
- **Logo Integration**: Added ReferralBox logo for better branding
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
- **Repository Structure**: Updated repository URLs and references
|
|
19
|
+
- **Version Bump**: Incremented to version 0.1.10 for new release
|
|
20
|
+
|
|
21
|
+
## [0.1.9] - 2025-01-XX
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
- **Logo**: Added ReferralBox logo to the gem and README
|
|
25
|
+
- **Better Model Injection**: Improved generator to handle different model inheritance patterns
|
|
26
|
+
- **Manual Instructions**: Clear instructions when automatic model injection fails
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
- **Generator Issues**: Fixed "File unchanged" error by improving model method injection logic
|
|
30
|
+
- **Model Detection**: Better handling of models that inherit from different base classes
|
|
31
|
+
- **User Experience**: Clearer error messages and manual setup instructions
|
|
32
|
+
|
|
10
33
|
## [0.1.8] - 2025-01-XX
|
|
11
34
|
|
|
12
35
|
### Added
|
data/README.md
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
# ReferralBox ๐ฆ
|
|
2
|
+
**PLEASE VISIT THIS**
|
|
3
|
+
GEM BEEN Updated
|
|
4
|
+
https://github.com/KapilDevPal/Referral_box
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
2
9
|
|
|
3
10
|
A flexible Ruby gem for building loyalty and referral systems in Rails apps.
|
|
4
11
|
|
|
@@ -145,26 +152,6 @@ end
|
|
|
145
152
|
* Social sharing for referral links
|
|
146
153
|
|
|
147
154
|
---
|
|
148
|
-
|
|
149
|
-
## ๐ Folder Structure (Gem)
|
|
150
|
-
|
|
151
|
-
```
|
|
152
|
-
lib/
|
|
153
|
-
โโโ referral_box.rb
|
|
154
|
-
โโโ referral_box/
|
|
155
|
-
โ โโโ engine.rb
|
|
156
|
-
โ โโโ configuration.rb
|
|
157
|
-
โ โโโ version.rb
|
|
158
|
-
โ โโโ models/
|
|
159
|
-
โ โ โโโ transaction.rb
|
|
160
|
-
โ โ โโโ referral_log.rb
|
|
161
|
-
โ โโโ controllers/
|
|
162
|
-
โ โโโ dashboard_controller.rb
|
|
163
|
-
app/views/referral_box/dashboard/
|
|
164
|
-
โโโ index.html.erb
|
|
165
|
-
โโโ show.html.erb
|
|
166
|
-
```
|
|
167
|
-
|
|
168
155
|
---
|
|
169
156
|
|
|
170
157
|
## ๐งช Usage Examples
|
|
@@ -191,4 +178,4 @@ PRs are welcome ๐ โ help improve the gem or suggest features.
|
|
|
191
178
|
|
|
192
179
|
## ๐ License
|
|
193
180
|
|
|
194
|
-
MIT ยฉ 2025 Kapil Pal
|
|
181
|
+
MIT ยฉ 2025 Kapil Dev Pal(Rails To Rescue)
|
|
@@ -59,18 +59,30 @@ module ReferralBox
|
|
|
59
59
|
model_file = "app/models/#{@model_class.underscore}.rb"
|
|
60
60
|
|
|
61
61
|
if File.exist?(model_file)
|
|
62
|
-
# Check if methods already exist
|
|
63
62
|
content = File.read(model_file)
|
|
63
|
+
|
|
64
|
+
# Check if methods already exist
|
|
64
65
|
if content.include?('has_many :referral_box_transactions')
|
|
65
66
|
puts "ReferralBox methods already exist in #{@model_class} model."
|
|
66
67
|
else
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
# Try to inject after the class definition
|
|
69
|
+
if content.match(/class #{@model_class}\s+<\s+ApplicationRecord/)
|
|
70
|
+
inject_into_file model_file, after: "class #{@model_class} < ApplicationRecord" do
|
|
71
|
+
"\n " + generate_model_methods(@model_class)
|
|
72
|
+
end
|
|
73
|
+
puts "Added ReferralBox methods to #{@model_class} model."
|
|
74
|
+
elsif content.match(/class #{@model_class}\s+<\s+ActiveRecord::Base/)
|
|
75
|
+
inject_into_file model_file, after: "class #{@model_class} < ActiveRecord::Base" do
|
|
76
|
+
"\n " + generate_model_methods(@model_class)
|
|
77
|
+
end
|
|
78
|
+
puts "Added ReferralBox methods to #{@model_class} model."
|
|
79
|
+
else
|
|
80
|
+
# If we can't find the class definition, show manual instructions
|
|
81
|
+
show_manual_model_instructions(@model_class)
|
|
69
82
|
end
|
|
70
|
-
puts "Added ReferralBox methods to #{@model_class} model."
|
|
71
83
|
end
|
|
72
84
|
else
|
|
73
|
-
|
|
85
|
+
show_manual_model_instructions(@model_class)
|
|
74
86
|
end
|
|
75
87
|
end
|
|
76
88
|
end
|
|
@@ -89,6 +101,17 @@ module ReferralBox
|
|
|
89
101
|
|
|
90
102
|
private
|
|
91
103
|
|
|
104
|
+
def show_manual_model_instructions(model_class)
|
|
105
|
+
puts "\n" + "="*60
|
|
106
|
+
puts "Manual Model Setup Required"
|
|
107
|
+
puts "="*60
|
|
108
|
+
puts "\nPlease manually add the following methods to your #{model_class} model:"
|
|
109
|
+
puts "\nFile: app/models/#{model_class.underscore}.rb"
|
|
110
|
+
puts "\nAdd this inside your #{model_class} class:"
|
|
111
|
+
puts "\n" + generate_model_methods(model_class)
|
|
112
|
+
puts "\n" + "="*60
|
|
113
|
+
end
|
|
114
|
+
|
|
92
115
|
def update_initializer_with_model(model_class)
|
|
93
116
|
initializer_path = "config/initializers/referral_box.rb"
|
|
94
117
|
|
data/lib/referral_box/version.rb
CHANGED
data/logo.jpg
ADDED
|
Binary file
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: referral_box
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kapil Dev Pal
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-08-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -185,6 +185,7 @@ files:
|
|
|
185
185
|
- lib/referral_box/models/referral_log.rb
|
|
186
186
|
- lib/referral_box/models/transaction.rb
|
|
187
187
|
- lib/referral_box/version.rb
|
|
188
|
+
- logo.jpg
|
|
188
189
|
homepage: https://github.com/KapilDevPal/referral_box
|
|
189
190
|
licenses:
|
|
190
191
|
- MIT
|
|
@@ -207,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
207
208
|
- !ruby/object:Gem::Version
|
|
208
209
|
version: '0'
|
|
209
210
|
requirements: []
|
|
210
|
-
rubygems_version: 3.
|
|
211
|
+
rubygems_version: 3.4.19
|
|
211
212
|
signing_key:
|
|
212
213
|
specification_version: 4
|
|
213
214
|
summary: A flexible Ruby gem for building loyalty and referral systems in Rails apps
|