plan_my_stuff 0.21.1 → 0.22.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: 4eda8634e75b318cd847d512405f71d4ffe2b0d7a6beccd6404912a6c64f1c2b
4
- data.tar.gz: 80c7edb2a0e861c3dc0f76b06ae23232bde0ed52d04f4cdada69bd29aa8107dd
3
+ metadata.gz: d44fbaa2722319a0d586bf8f947222aa76f74462b5516f516f34b87b89ff6211
4
+ data.tar.gz: 05eaab50eaca5856a19cd68f796b1b4170cb750a6bb8c78566c003a576707122
5
5
  SHA512:
6
- metadata.gz: 3336630d6d5ee6b8bad51fdfa08a647aa58933e0f30a36241fd137a4d3f5b67656386d36fd0990d289499a7cf2643469e32c1642d4f2d5811be5fc671ea9d420
7
- data.tar.gz: 15db293bc2203d60ca7e2b5d102035b1a8d064a74b84666e13d0fbcad1ab15dbe576f02af2f7582c56c9f65246dbb23e41043f6036e304801722c40890c463fc
6
+ metadata.gz: afbbeca592468025940d1b98eae3c93da09ca79a5406afe5d500f93e8d1803c59d8ced137c81b1e05297678de17920681756983cd0b2a4c253900897f4d5d9b5
7
+ data.tar.gz: 95ca844953334f3d514c1b530cac5837307b3b735975c18256ab09ad408e1e4aea1f964de8d43ffe4c6b74bdf17284f93d8f114f7e47c4ecb37484023278b28e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.22.0
4
+
5
+ ### Added
6
+
7
+ - `Issue#add_to_priority_list!(priority:)` and `Issue#remove_from_priority_list!` - first-class setters that
8
+ mirror the `#priority_list?` / `#priority_list_priority` readers. Each writes both `Priority List` and
9
+ `Priority List Priority` in a single mutation so the two fields cannot drift apart (closes #80).
10
+
11
+ ### Changed
12
+
13
+ - `IssueMetadata#priority_list` / `#priority_list_priority` deprecation message now points callers at the new
14
+ `Issue#add_to_priority_list!` / `#remove_from_priority_list!` pair instead of raw `set_issue_fields!`.
15
+
3
16
  ## 0.21.1
4
17
 
5
18
  ### Added
@@ -842,6 +842,35 @@ module PlanMyStuff
842
842
  issue_fields['Priority List Priority']
843
843
  end
844
844
 
845
+ # Adds this issue to the Priority List at the given priority (or re-prioritizes if already listed). Sets
846
+ # +Priority List+ and +Priority List Priority+ together in a single +setIssueFieldValue+ mutation so the two
847
+ # fields never drift out of sync.
848
+ #
849
+ # @raise [PlanMyStuff::IssueFieldsNotEnabledError] when +config.issue_fields_enabled+ is +false+
850
+ #
851
+ # @param priority [Integer]
852
+ #
853
+ # @return [self]
854
+ #
855
+ def add_to_priority_list!(priority:)
856
+ raise(ArgumentError, 'Priority must be an integer') unless priority.is_a?(Integer)
857
+
858
+ set_issue_fields!('Priority List' => 'Yes', 'Priority List Priority' => priority)
859
+ end
860
+
861
+ alias update_priority_list_priority! add_to_priority_list!
862
+
863
+ # Removes this issue from the Priority List. Clears both +Priority List+ and +Priority List Priority+ in a single
864
+ # +setIssueFieldValue+ mutation so the two fields never drift out of sync.
865
+ #
866
+ # @raise [PlanMyStuff::IssueFieldsNotEnabledError] when +config.issue_fields_enabled+ is +false+
867
+ #
868
+ # @return [self]
869
+ #
870
+ def remove_from_priority_list!
871
+ set_issue_fields!('Priority List' => nil, 'Priority List Priority' => nil)
872
+ end
873
+
845
874
  # Bulk-updates GitHub Issue Field values in a single +setIssueFieldValue+ mutation. Each key is the field display
846
875
  # name; values are coerced to the right input fragment based on the field's type. Passing +nil+ as a value clears
847
876
  # that field.
@@ -5,7 +5,8 @@ module PlanMyStuff
5
5
  PRIORITY_LIST_METADATA_DEPRECATION =
6
6
  'PlanMyStuff: IssueMetadata#priority_list / #priority_list_priority are deprecated. priority_list moved to ' \
7
7
  "GitHub Issue Fields ('Priority List' single_select, 'Priority List Priority' number) in 0.20.0. Reads " \
8
- 'now come from issue_fields; legacy writes forward to set_issue_fields! on save. The metadata accessors ' \
8
+ 'now come from Issue#priority_list? / #priority_list_priority; for writes, use ' \
9
+ 'Issue#add_to_priority_list!(priority: N) and Issue#remove_from_priority_list!. The metadata accessors ' \
9
10
  'will be removed in 1.0.0.'
10
11
 
11
12
  # @return [Time, nil] first support action timestamp, nil until set
@@ -201,7 +202,7 @@ module PlanMyStuff
201
202
  @priority_list
202
203
  end
203
204
 
204
- # @deprecated Use +Issue#update!(issue_fields: { 'Priority List' => 'Yes' })+. Removed in 1.0.0.
205
+ # @deprecated Use +Issue#add_to_priority_list!(priority: N)+ / +Issue#remove_from_priority_list!+. Removed in 1.0.0.
205
206
  #
206
207
  # @param value [Object]
207
208
  #
@@ -231,7 +232,7 @@ module PlanMyStuff
231
232
  @priority_list_priority
232
233
  end
233
234
 
234
- # @deprecated Use +Issue#update!(issue_fields: { 'Priority List Priority' => N })+. Removed in 1.0.0.
235
+ # @deprecated Use +Issue#add_to_priority_list!(priority: N)+ / +Issue#remove_from_priority_list!+. Removed in 1.0.0.
235
236
  #
236
237
  # @param value [Object]
237
238
  #
@@ -3,8 +3,8 @@
3
3
  module PlanMyStuff
4
4
  module VERSION
5
5
  MAJOR = 0
6
- MINOR = 21
7
- TINY = 1
6
+ MINOR = 22
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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plan_my_stuff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.1
4
+ version: 0.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brands Insurance