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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f4a6790bd37c0ab98951fbe00bee4ebcb3ceb150621e5f9dea2f55084faf134e
4
- data.tar.gz: f95b5d8a82477d7ec9d2585019e212c0de249875ff48353d98da26b63ae29b07
3
+ metadata.gz: 7be45e876b882bcf493707da8c8ce430a52371658b3ae56718efd7992b14a16d
4
+ data.tar.gz: 3ea1ee8aea9f87d25b511102d25905b67fe609f85de9eb52582b041bd2382385
5
5
  SHA512:
6
- metadata.gz: 34a9ef72b6310b1dfacf16cc49e41877ebd9c7899ed2f4bdcc37bcf4cb6eacb4abfdbb398848deafb8e1c2a81c55d2b8e0d3146e5b41bb658b73d50d98dea514
7
- data.tar.gz: 02c5d50f54bb79615644041b4788ac3e7427a1d5d38e116b36749881a9b6708dea580b6625ef7384aea7459b8d6ced3263392998ed68e8f8e629b9eb7373a884
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 += %W[
11
- #{root}/app/models
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
@@ -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
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Budget
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.3'
5
5
  end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Loader shim so Bundler auto-require of the gem name
4
+ # `lbyte-budget` loads the main library file `budget`.
5
+ require 'budget'
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.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: