lbyte-budget 0.1.1 → 0.1.3
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 +14 -0
- data/README.md +24 -0
- data/lib/budget/engine.rb +11 -4
- data/lib/budget/line_item.rb +0 -2
- data/lib/budget/payment.rb +0 -2
- data/lib/budget/version.rb +1 -1
- data/lib/lbyte-budget.rb +5 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7be45e876b882bcf493707da8c8ce430a52371658b3ae56718efd7992b14a16d
|
|
4
|
+
data.tar.gz: 3ea1ee8aea9f87d25b511102d25905b67fe609f85de9eb52582b041bd2382385
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f86ac7f713ac4f16ce02f58616178d380edf169203ee80e25605dc15d11dbd66d2a134aa751b6c8d41e1cbd5bcabd2824a2bba1edc473bc3d6ac522a53810679
|
|
7
|
+
data.tar.gz: 223a576c042c97e00b483361a14b7fef4d0b38f1b97c309b9c2882adc0f9c3d90826cd7de5e85abdc118411f54ba7e4f8930a5b84563ebeb5b33598218807726
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.1.3] - 2025-12-28
|
|
4
|
+
|
|
5
|
+
- Fix duplicate constant initialization warnings for CATEGORIES and PAYMENT_METHODS
|
|
6
|
+
- Improve eager loading of models in test environment using require_relative
|
|
7
|
+
- Better Rails test suite integration and model availability
|
|
8
|
+
|
|
9
|
+
## [0.1.2] - 2025-12-28
|
|
10
|
+
|
|
11
|
+
- Maintenance release
|
|
12
|
+
|
|
13
|
+
## [0.1.1] - 2025-12-28
|
|
14
|
+
|
|
15
|
+
- Bug fixes and improvements
|
|
16
|
+
|
|
3
17
|
## [0.1.0] - 2025-11-29
|
|
4
18
|
|
|
5
19
|
- Initial release
|
data/README.md
CHANGED
|
@@ -339,6 +339,30 @@ Run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
|
339
339
|
|
|
340
340
|
To install this gem onto your local machine, run `bundle exec rake install`.
|
|
341
341
|
|
|
342
|
+
## Releasing a New Version
|
|
343
|
+
|
|
344
|
+
To release a new version of the gem:
|
|
345
|
+
|
|
346
|
+
1. **Update the version number** in [lib/budget/version.rb](lib/budget/version.rb)
|
|
347
|
+
2. **Update the CHANGELOG** in [CHANGELOG.md](CHANGELOG.md) with the new version and release notes
|
|
348
|
+
3. **Build the gem**:
|
|
349
|
+
```bash
|
|
350
|
+
gem build budget.gemspec
|
|
351
|
+
```
|
|
352
|
+
4. **Push to RubyGems** (requires authentication):
|
|
353
|
+
```bash
|
|
354
|
+
gem push lbyte-budget-X.X.X.gem
|
|
355
|
+
```
|
|
356
|
+
Note: You'll need to enter your OTP code if MFA is enabled.
|
|
357
|
+
5. **Commit and tag the release**:
|
|
358
|
+
```bash
|
|
359
|
+
git add lib/budget/version.rb CHANGELOG.md
|
|
360
|
+
git commit -m "Bump version to X.X.X"
|
|
361
|
+
git tag vX.X.X
|
|
362
|
+
git push origin main
|
|
363
|
+
git push origin vX.X.X
|
|
364
|
+
```
|
|
365
|
+
|
|
342
366
|
## Testing
|
|
343
367
|
|
|
344
368
|
The Budget gem includes comprehensive test coverage:
|
data/lib/budget/engine.rb
CHANGED
|
@@ -7,10 +7,8 @@ module Budget
|
|
|
7
7
|
isolate_namespace Budget
|
|
8
8
|
|
|
9
9
|
# Ensure app directory is in autoload paths
|
|
10
|
-
config.autoload_paths
|
|
11
|
-
|
|
12
|
-
#{root}/app/controllers
|
|
13
|
-
]
|
|
10
|
+
config.autoload_paths << "#{root}/app/models"
|
|
11
|
+
config.autoload_paths << "#{root}/app/controllers"
|
|
14
12
|
|
|
15
13
|
# Add views path for JBuilder templates
|
|
16
14
|
config.paths['app/views'] ||= []
|
|
@@ -21,5 +19,14 @@ module Budget
|
|
|
21
19
|
g.fixture_replacement :factory_bot
|
|
22
20
|
g.factory_bot dir: 'spec/factories'
|
|
23
21
|
end
|
|
22
|
+
|
|
23
|
+
# Ensure models are loaded for associations in consuming apps
|
|
24
|
+
initializer 'budget.eager_load_models', before: :set_autoload_paths do
|
|
25
|
+
if Rails.env.development? || Rails.env.test?
|
|
26
|
+
require_relative '../app/models/budget/quote'
|
|
27
|
+
require_relative '../app/models/budget/line_item'
|
|
28
|
+
require_relative '../app/models/budget/payment'
|
|
29
|
+
end
|
|
30
|
+
end
|
|
24
31
|
end
|
|
25
32
|
end
|
data/lib/budget/line_item.rb
CHANGED
|
@@ -6,8 +6,6 @@ module Budget
|
|
|
6
6
|
class LineItem
|
|
7
7
|
attr_accessor :description, :price, :category, :quantity
|
|
8
8
|
|
|
9
|
-
CATEGORIES = %w[lente montura tratamiento accesorio servicio other].freeze
|
|
10
|
-
|
|
11
9
|
def initialize(description:, price:, category: 'other', quantity: 1)
|
|
12
10
|
@description = description
|
|
13
11
|
@price = price.to_f
|
data/lib/budget/payment.rb
CHANGED
|
@@ -6,8 +6,6 @@ module Budget
|
|
|
6
6
|
class Payment
|
|
7
7
|
attr_accessor :amount, :payment_date, :payment_method, :notes
|
|
8
8
|
|
|
9
|
-
PAYMENT_METHODS = %w[efectivo tarjeta transferencia cheque other].freeze
|
|
10
|
-
|
|
11
9
|
def initialize(amount:, payment_date: nil, payment_method: 'efectivo', notes: nil)
|
|
12
10
|
@amount = amount.to_f
|
|
13
11
|
@payment_date = payment_date || Time.now
|
data/lib/budget/version.rb
CHANGED
data/lib/lbyte-budget.rb
ADDED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lbyte-budget
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ruben Paz Chuspe
|
|
@@ -85,6 +85,7 @@ files:
|
|
|
85
85
|
- lib/budget/version.rb
|
|
86
86
|
- lib/generators/budget/INSTALL
|
|
87
87
|
- lib/generators/budget/install_generator.rb
|
|
88
|
+
- lib/lbyte-budget.rb
|
|
88
89
|
- sig/budget.rbs
|
|
89
90
|
homepage: https://github.com/rubenpazch/lbyte-budget
|
|
90
91
|
licenses:
|