easy_creds 1.0.1 → 1.0.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: e4de9acf2675f1cd6b624e7217d09d36ea2af3a502b1b799d6d5e578f542d719
4
- data.tar.gz: c7dac7a501ebfcc89a4aa3caa35bfc4fe817b374076a6c7a745271d6dc467303
3
+ metadata.gz: 875f25ae3bfbbaedf516bd6aa81c602339936854bd9601bad3b59fedce8510f6
4
+ data.tar.gz: 72ace424ddc5e12543c401e561d2ea04737b43b6528bc300a29a4b4b9dabadcf
5
5
  SHA512:
6
- metadata.gz: 6bb5396a44b65b2692b6a303196a98073fd2c42c97dcc21ca2fb4b512d05d6b2e2a8f5762f174d932914c16687b82ea072c5685ce5ac8b39d0f74751961931e4
7
- data.tar.gz: 9638ad3ce2c9165555d7a1a71aba4b816944cc8db2f5ab8505bda2edc3f75bb0ae9cad80047ff33f6c2e3109ca92478086a7ec6ea646cf796c9ebf2a97fb1100
6
+ metadata.gz: 07dd62777e61f759caca06f269eb6a2b237bb3021b0f1616f866b450a4c17fffe9f01acb0f5b21a87598089fda04b683617423a1b10a7ddb5426966378b2da69
7
+ data.tar.gz: 4164fe45f136cf8749e51d5c8caf9889087bfc3038e7154e9f80b67f8e90883f811b51694411f38f91846b94054d660047f2100f1d96639b978492d620f8e2d4
data/CHANGELOG.md CHANGED
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.0.3] - 2026-06-16
9
+
10
+ ### Fixed
11
+
12
+ - Railtie now loads the packaged rake file from `lib/tasks/easy_creds.rake`
13
+ instead of a non-existent `tasks/easy_creds.rake` (off-by-one relative path),
14
+ which raised `LoadError` and aborted `rails` whenever the gem was loaded in a
15
+ Rails app.
16
+ - Overlay/initializer now use `EasyCreds::Overlay.apply!(Rails.application.credentials,
17
+ Rails.root, Rails.env)`. The previous `apply!(Rails.application)` form called
18
+ `Rails.application.env`, which does not exist (`NoMethodError`), so the boot-time
19
+ overlay was silently skipped. `apply!` is now a plain 3-argument method.
20
+ - Added railtie and installer regression guard tests for both issues above.
21
+
8
22
  ## [1.0.1] - 2026-06-15
9
23
 
10
24
  ### Added
@@ -13,7 +13,7 @@ module EasyCreds
13
13
  # The local overlay is gitignored and never pushed to 1Password — use it for
14
14
  # machine-specific overrides (e.g. a local database URL different from staging).
15
15
  require 'easy_creds/overlay'
16
- EasyCreds::Overlay.apply!(Rails.application)
16
+ EasyCreds::Overlay.apply!(Rails.application.credentials, Rails.root, Rails.env)
17
17
  RUBY
18
18
 
19
19
  def initialize(root)
@@ -9,28 +9,18 @@ module EasyCreds
9
9
  module Overlay
10
10
  # Merge config/credentials/<env>_local.yml.enc on top of the base credentials.
11
11
  #
12
- # Accepts either a Rails application (the form the installer-generated
13
- # initializer uses) or the explicit (creds, root, env) triple:
12
+ # Call it from a Rails initializer with the credentials object, project root,
13
+ # and environment the values are pulled straight off the Rails globals:
14
14
  #
15
- # EasyCreds::Overlay.apply!(Rails.application)
16
15
  # EasyCreds::Overlay.apply!(Rails.application.credentials, Rails.root, Rails.env)
17
16
  #
18
- # @param app_or_creds [#credentials, #root, #env] a Rails application, or the
19
- # credentials object when root/env are supplied explicitly
20
- # @param root [String, Pathname, nil] project root (omit when passing an app)
21
- # @param env [String, Symbol, nil] environment name (omit when passing an app)
17
+ # @param creds [#public_send] the credentials object to mutate (e.g.
18
+ # Rails.application.credentials)
19
+ # @param root [String, Pathname] project root (Rails.root)
20
+ # @param env [String, Symbol] environment name (Rails.env)
22
21
  # @return [void]
23
- def self.apply!(app_or_creds, root = nil, env = nil)
24
- if root.nil? && env.nil?
25
- app = app_or_creds
26
- creds = app.credentials
27
- root = app.root
28
- env = app.env.to_s
29
- else
30
- creds = app_or_creds
31
- env = env.to_s
32
- end
33
-
22
+ def self.apply!(creds, root, env)
23
+ env = env.to_s
34
24
  enc = Pathname.new(root).join("config/credentials/#{env}_local.yml.enc")
35
25
  key = Pathname.new(root).join("config/credentials/#{env}_local.key")
36
26
 
@@ -5,6 +5,6 @@ module EasyCreds
5
5
  # Registers the credentials:sync, easy_creds:install, and easy_creds:onboard
6
6
  # rake tasks without booting the full Rails environment upfront.
7
7
  class Railtie < ::Rails::Railtie
8
- rake_tasks { load File.expand_path('../../tasks/easy_creds.rake', __dir__) }
8
+ rake_tasks { load File.expand_path('../tasks/easy_creds.rake', __dir__) }
9
9
  end
10
10
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EasyCreds
4
- VERSION = '1.0.1'
4
+ VERSION = '1.0.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_creds
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pawel Niemczyk
@@ -286,7 +286,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
286
286
  - !ruby/object:Gem::Version
287
287
  version: '0'
288
288
  requirements: []
289
- rubygems_version: 4.0.6
289
+ rubygems_version: 3.6.9
290
290
  specification_version: 4
291
291
  summary: Interactive TUI to sync encrypted credentials with 1Password
292
292
  test_files: []