plan_my_stuff 1.1.1 → 1.2.0

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: c0f31d5e29ef0651a4df50d4072a36aad245cd679a5180d1216fc44e271b6a4e
4
- data.tar.gz: 6296f1f8a9aad8f09da7bb2f2b5c579b716f6a82c3f8f93f2369487c759e254b
3
+ metadata.gz: bacd3474e480b36db577d70c215ad0bd440c6b2384319644047ca18f25385324
4
+ data.tar.gz: 68f011246630794f39094af3a6d09287fc58c35d68082bedb724a0e9c7cd264a
5
5
  SHA512:
6
- metadata.gz: 4a297c9e689b711e111d90f810f0e21aa484f089c309ea13e7ae8223798416aacd3ba11d81c18f4a3cd9d57574d00c782d4e24aaf295d686f0a76a23b3ed852f
7
- data.tar.gz: ca412ab09db968c32247c1d41072f66663b316bd2285e5455c149c6f88c9158a31de8a46533b41a42f94258ac0212f5e854667d1cc4c9c00de7311d490a426c5
6
+ metadata.gz: ae377f254278d231a437f6ab882c739f372bda399927c8adb1e1df7fa0858a648bf7d7a4c604acddc0471d6eb16b99113e21d811c71fbe374b6e7bf609e99cc6
7
+ data.tar.gz: '0498c86327fc8423021e1f5be08409303f4ba12f328cdf7df705f8b3b6d68456ac885c20befc38d50ef12512a42dd48a589ee8df59b84791ccf835f4e77a509b'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.2.0
4
+
5
+ ### Added
6
+
7
+ - Add support for using IO when uploading files
8
+
9
+ ### Changed
10
+
11
+ - Fix docs in `PlanMyStuff::Issue.update!` for `:issue_type` to allow passing of a `Symbol`
12
+
13
+ ## 1.1.2
14
+
15
+ ### Fixed
16
+
17
+ - Incorrect default for `config.eager_load_controllers_on_boot` (should be `false` not `true`)
18
+ - `Configuration#repo_nickname_for` no longer produces a space for underscored `config.repos` keys (e.g. `:some_name`
19
+ now resolves to `"SomeName"` instead of `"Some Name"`), which previously broke URL routing
20
+
3
21
  ## 1.1.1
4
22
 
5
23
  ### Fixed
@@ -414,7 +432,7 @@ Official release.
414
432
 
415
433
  ### Documented
416
434
 
417
- - `designs/g9/` documents the design pivot from inline-base64 (body
435
+ - Issue #9 documents the design pivot from inline-base64 (body
418
436
  size capped) through sibling-repo (rejected) to the chosen
419
437
  side-branch approach.
420
438
 
@@ -487,7 +505,7 @@ Official release.
487
505
 
488
506
  ### Breaking
489
507
 
490
- - `config.should_send_request` and `config.job_classes` accessors — declared but never wired up. The request gateway that would honor them is deferred (see `requirements/09_request_gateway.md` and `designs/init/gem_mvp_deferred_notes.md`); they will return when the gateway lands
508
+ - `config.should_send_request` and `config.job_classes` accessors — declared but never wired up. The request gateway that would honor them is deferred (tracked in issue #12); they will return when the gateway lands
491
509
 
492
510
  ### Added
493
511
 
@@ -574,12 +592,6 @@ Official release.
574
592
  - Items at `Ready for Release`, `Release in Progress`, or `Completed` are no longer removed when an unassign webhook fires
575
593
  - Pending-approvals guard runs before `ProjectItem.create!` in the assignment flow so the webhook no longer leaves orphan items when `Pipeline.take!`'s approval guard would otherwise raise
576
594
 
577
- ### Documented
578
-
579
- - `designs/pipeline_cleanup/plan.md` — full design + bug-to-fix mapping
580
- - `requirements/08_release_pipeline.md` updated to reflect the new flow
581
- - `requirements/tasks.md` — T-PC-001 added under Phase 14
582
-
583
595
  ## 0.5.1
584
596
 
585
597
  ### Fixed
data/README.md CHANGED
@@ -713,9 +713,6 @@ On a successful AWS deployment the gem completes each matching item individually
713
713
  (release-notes mailer, Slack summary, changelog generator) get one clean "deployment finished" signal
714
714
  without debouncing the per-item events.
715
715
 
716
- See `designs/release_cycle/plan.md` for the full design, including the `projects_v2_item` path that fires
717
- `Pipeline.take!` when a human drags an item to Started on github.com.
718
-
719
716
  ### "Take" button
720
717
 
721
718
  The mounted UI exposes a **Take** button on pipeline issues that calls `Pipeline.take!` and assigns the current user. Your app's user-id -> GitHub login mapping is provided by `config.github_login_for` (a hash keyed by user id).
@@ -26,8 +26,8 @@ PlanMyStuff.configure do |config|
26
26
 
27
27
  # Human-readable prefix used as the `Issue#to_param` so URLs read
28
28
  # `/issues/Element-1234` instead of `/issues/1234`. Missing keys fall back
29
- # to `key.to_s.titleize`; only repos whose key doesn't titleize cleanly
30
- # need an entry.
29
+ # to `key.to_s.titleize.delete(' ')`; only repos whose key doesn't titleize
30
+ # cleanly need an entry.
31
31
  # config.repo_nicknames = { safety: 'Compliance' }
32
32
 
33
33
  # --------------------------------------------------------------------------
@@ -222,7 +222,7 @@ PlanMyStuff.configure do |config|
222
222
  # the constant. Opt in if the host app probes engine controllers via
223
223
  # `defined?` in dev mode.
224
224
  #
225
- # config.eager_load_controllers_on_boot = true
225
+ # config.eager_load_controllers_on_boot = false
226
226
 
227
227
  # --------------------------------------------------------------------------
228
228
  # Release pipeline
@@ -30,8 +30,9 @@ module PlanMyStuff
30
30
  # @param repo [PlanMyStuff::Repo] source issues repo (used to namespace the path)
31
31
  # @param issue_number [Integer]
32
32
  # @param files [Array] mix of already-uploaded +PlanMyStuff::Attachment+ instances, uploaded-file objects
33
- # responding to +#path+ and +#original_filename+ (e.g. Rails +ActionDispatch::Http::UploadedFile+), and
34
- # String/Pathname paths to local files
33
+ # responding to +#path+ and +#original_filename+ (e.g. Rails +ActionDispatch::Http::UploadedFile+),
34
+ # String/Pathname paths to local files, and +{filename:, io:}+ Hashes wrapping an already in-memory
35
+ # readable (e.g. an S3 SDK response body)
35
36
  #
36
37
  # @return [Array<PlanMyStuff::Attachment>]
37
38
  #
@@ -83,11 +84,30 @@ module PlanMyStuff
83
84
  [leaf_filename(entry.original_filename), File.binread(entry.path)]
84
85
  elsif entry.is_a?(String) || entry.is_a?(Pathname)
85
86
  [File.basename(entry), File.binread(entry)]
87
+ elsif entry.is_a?(Hash) && entry[:io].present?
88
+ [leaf_filename(entry[:filename]), read_io(entry[:io])]
86
89
  else
87
90
  raise(ArgumentError, "Unsupported attachment entry: #{entry.inspect}")
88
91
  end
89
92
  end
90
93
 
94
+ # Rewinds +io+ first (if possible) so callers who already read from it for another purpose (e.g.
95
+ # content-type sniffing) still get the full bytes.
96
+ #
97
+ # @raise [ArgumentError] If the IO object doesn't respond to `:read`
98
+ #
99
+ # @param io [#read]
100
+ #
101
+ # @return [String] raw bytes
102
+ #
103
+ def read_io(io)
104
+ raise(ArgumentError, 'Attachment IO must respond to `#read`') unless io.respond_to?(:read)
105
+
106
+ io.rewind if io.respond_to?(:rewind)
107
+
108
+ io.read
109
+ end
110
+
91
111
  # Strips directory components (both POSIX and Windows separators) from a browser-supplied filename so
92
112
  # values like +"../../secret.txt"+ or +"C:\\fakepath\\photo.jpg"+ cannot leak into stored metadata or
93
113
  # later download paths.
@@ -367,8 +367,8 @@ module PlanMyStuff
367
367
  attr_accessor :repos
368
368
 
369
369
  # Human-readable repo names used as the +to_param+ prefix on +PlanMyStuff::Issue+ instances. Symbol-keyed
370
- # against +repos+ -- missing keys fall back to +key.to_s.titleize+, so only entries that diverge from a simple
371
- # +titleize+ of the key (e.g. +:safety+ -> +"Compliance"+) need to be listed.
370
+ # against +repos+ -- missing keys fall back to +key.to_s.titleize.delete(' ')+, so only entries that diverge
371
+ # from a simple +titleize+ of the key (e.g. +:safety+ -> +"Compliance"+) need to be listed.
372
372
  #
373
373
  # @return [Hash{Symbol => String}]
374
374
  #
@@ -520,14 +520,14 @@ module PlanMyStuff
520
520
  end
521
521
 
522
522
  # Human-readable nickname for a repo key, used as the +to_param+ prefix on +PlanMyStuff::Issue+ instances. Falls
523
- # back to +key.to_s.titleize+ when no explicit entry exists in +repo_nicknames+.
523
+ # back to +key.to_s.titleize.delete(' ')+ when no explicit entry exists in +repo_nicknames+.
524
524
  #
525
525
  # @param key [Symbol, String]
526
526
  #
527
527
  # @return [String]
528
528
  #
529
529
  def repo_nickname_for(key)
530
- repo_nicknames[key&.to_sym] || key.to_s.titleize
530
+ repo_nicknames[key&.to_sym] || key.to_s.titleize.delete(' ')
531
531
  end
532
532
 
533
533
  private
@@ -209,9 +209,9 @@ module PlanMyStuff
209
209
  # @param labels [Array<String>, nil]
210
210
  # @param state [Symbol, nil] :open or :closed
211
211
  # @param assignees [Array<String>, String, nil] GitHub logins
212
- # @param issue_type [String, nil] GitHub issue type name. Pass a String to set, +nil+ to clear, or omit the
213
- # kwarg to leave the current type untouched. (+nil+-vs-omitted is differentiated by the private
214
- # +ISSUE_TYPE_UNCHANGED+ sentinel.)
212
+ # @param issue_type [String, Symbol, nil] GitHub issue type name. Pass a String to set, +nil+ to clear, or omit
213
+ # the kwarg to leave the current type untouched. (+nil+-vs-omitted is differentiated by the private
214
+ # +ISSUE_TYPE_UNCHANGED+ sentinel.). A `Symbol` will map shortcut names to the proper GitHub name.
215
215
  # @param issue_fields [Hash{String,Symbol => Object,nil}, nil] GitHub Issue Field values to apply after the
216
216
  # PATCH (or instead of it, when no other attrs are provided). Delegates to +#set_issue_fields!+, so the same
217
217
  # coercion rules and +IssueFieldsNotEnabledError+ behavior apply. +nil+ or an empty hash is a no-op.
@@ -3,8 +3,8 @@
3
3
  module PlanMyStuff
4
4
  module VERSION
5
5
  MAJOR = 1
6
- MINOR = 1
7
- TINY = 1
6
+ MINOR = 2
7
+ TINY = 0
8
8
 
9
9
  # Set PRE to nil unless it's a pre-release (beta, rc, etc.)
10
10
  PRE = nil
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plan_my_stuff
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brands Insurance
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-06-19 00:00:00.000000000 Z
11
+ date: 2026-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails