linear-cli 0.9.17 → 0.9.18

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: e5c0d2c4f9191fcb285234522569f47e6e4b437338563fa8b14a801480c92b4a
4
- data.tar.gz: b023995d7242b5e02af60bf6e9fb7d9013660f9cfc31dcbd5d53003e529f8974
3
+ metadata.gz: fdfa5217a71c9c72e813abafa1d9b84173f7cc84fbba9346ade9ff9b9a4a656a
4
+ data.tar.gz: 306e2f48788f60e3f89b721bfa31116dc671897e57d6279f7de32cbb430f45b8
5
5
  SHA512:
6
- metadata.gz: 15030e014db1cd76294da2f3967cdbb69ad2964f752ee8213776e373d6b22fe31c2266e4818862156d0c4839a7bbbdc5bee31e6420cbe63e3cec2c5da7b4e279
7
- data.tar.gz: c8113509fd3f9315c952cf4d970f3b78e730cf987209f9005d9d2b6fb6213b1666607c3c724b998dec62228b413b598797a8d0477fab180ca90e4005d0775f1c
6
+ metadata.gz: e8a499e75976dd0877fa02d93b2f2a911b521633e917d702fad681e0e378e9d5b1fa0d79706b9fb54ecae910f32bd78dcfeb6c1c5fa6c5ff9bc63e3d601b90c4
7
+ data.tar.gz: 4967fc24d83629772911e084a4210c10bfa1dfb379fa56ca4e48df9f26e9dcbb700809f73a26b1001533e3fd893680cdb954acd5853c13369f302030c45e6847
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rubyists
4
4
  module Linear
5
- VERSION = '0.9.17'
5
+ VERSION = '0.9.18'
6
6
  end
7
7
  end
@@ -36,7 +36,7 @@ module Rubyists
36
36
  def cancel_issue(issue, **options)
37
37
  reason = reason_for(options[:reason], four: "cancelling #{issue.identifier} - #{issue.title}")
38
38
  issue_comment issue, reason
39
- cancel_state = cancel_state_for(issue)
39
+ cancel_state = cancelled_state_for(issue)
40
40
  issue.close! state: cancel_state, trash: options[:trash]
41
41
  prompt.ok "#{issue.identifier} was cancelled"
42
42
  end
@@ -70,9 +70,10 @@ module Rubyists
70
70
  prompt.ok "#{issue.identifier} was attached to #{project.name}"
71
71
  end
72
72
 
73
- def update_issue(issue, **options)
73
+ def update_issue(issue, **options) # rubocop:disable Metrics/AbcSize
74
74
  issue_comment(issue, options[:comment]) if options[:comment]
75
75
  return close_issue(issue, **options) if options[:close]
76
+ return cancel_issue(issue, **options) if options[:cancel]
76
77
  return issue_pr(issue) if options[:pr]
77
78
  return attach_project(issue, options[:project]) if options[:project]
78
79
  return if options[:comment]
@@ -66,16 +66,22 @@ module Rubyists
66
66
  def close_mutation(close_state, trash: false)
67
67
  id_for_this = identifier
68
68
  input = { stateId: close_state.id }
69
- input[:trash] = true if trash
69
+ input[:trashed] = true if trash
70
70
  mutation { issueUpdate(id: id_for_this, input:) { issue { ___ Issue.full_fragment } } }
71
71
  end
72
72
 
73
- def close!(state: nil, trash: false)
73
+ def close!(state: nil, trash: false) # rubocop:disable Metrics/MethodLength
74
74
  logger.warn "Using first completed state found: #{completed_states.first}" if state.nil?
75
75
  state ||= completed_states.first
76
76
  query_data = Api.query close_mutation(state, trash:)
77
+ unless query_data.respond_to?(:dig)
78
+ raise SmellsBad, "Unknown response (#{query_data || "NULL"}) updating #{self} to #{state}, trash: #{trash}"
79
+ end
80
+
77
81
  updated = query_data.dig(:issueUpdate, :issue)
78
- raise SmellsBad, "Unknown response for issue close: #{data} (should have :issueUpdate key)" if updated.nil?
82
+ if updated.nil?
83
+ raise SmellsBad, "Unknown response for issue close: #{query_data} (should have :issueUpdate key)"
84
+ end
79
85
 
80
86
  @data = @updated_data = updated
81
87
  self
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linear-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.17
4
+ version: 0.9.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tj (bougyman) Vanderpoel