linear-cli 0.9.2 → 0.9.4
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 +4 -4
- data/CHANGELOG.md +12 -2
- data/changelog/0.9.3/fixed_probblem_with_tempfile_for_editing_operations.yml +4 -0
- data/changelog/0.9.3/tag.yml +1 -0
- data/changelog/0.9.4/fixed_issue_with_canceled_issues_showing_up_in_lcls.yml +4 -0
- data/changelog/0.9.4/tag.yml +1 -0
- data/lib/linear/cli/sub_commands.rb +4 -4
- data/lib/linear/cli/version.rb +1 -1
- data/lib/linear/cli/what_for.rb +3 -3
- data/lib/linear/cli.rb +3 -1
- data/lib/linear/models/comment.rb +31 -0
- data/lib/linear/models/issue/class_methods.rb +2 -1
- data/lib/linear/models/issue.rb +12 -3
- metadata +6 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 459cfc694409e9f569943bcb817c349f227804c8fe065d9be1477a40adff7c33
|
4
|
+
data.tar.gz: 30013d6fd8b64af8ec527ea855561d1dbecd0afc43179df6a264a391ab67fb11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0432a0d1df1a9f3cc2265438ac7ed37b8d335c9bec47bae11c303c51d9ba5f2e9c225d86d314a1b7a42621e62a4e2f2c0443e6d8606c6725db11b404a2d730a
|
7
|
+
data.tar.gz: b164919a840f1618cc19172ff0014b7b5d05c8e560a9f2fd133db95474ac95638512d35b4288fe142b08e0cc22b45be5485c8c81640ace9b86db467583bad05d
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
## [Unreleased]
|
4
4
|
|
5
|
+
## [0.9.4] - 2024-02-07
|
6
|
+
### Fixed
|
7
|
+
- Fixed issue with canceled issues showing up in lcls (@bougyman)
|
8
|
+
|
9
|
+
## [0.9.3] - 2024-02-07
|
10
|
+
### Fixed
|
11
|
+
- Fixed probblem with tempfile for editing operations (@bougyman)
|
12
|
+
|
5
13
|
## [0.9.1] - 2024-02-06
|
6
14
|
### Fixed
|
7
15
|
- Fixed wrapper to be more normal about help when listing leaf commands (@bougyman)
|
@@ -75,8 +83,10 @@
|
|
75
83
|
### Added
|
76
84
|
- Added new changelog management system (changelog-rb) (@bougyman)
|
77
85
|
|
78
|
-
[Unreleased]: https://github.com/rubyists/linear-cli/compare/0.9.
|
79
|
-
[0.9.
|
86
|
+
[Unreleased]: https://github.com/rubyists/linear-cli/compare/0.9.4...HEAD
|
87
|
+
[0.9.4]: https://github.com/rubyists/linear-cli/compare/v0.9.3...0.9.4
|
88
|
+
[0.9.3]: https://github.com/rubyists/linear-cli/compare/v0.9.1...v0.9.3
|
89
|
+
[0.9.1]: https://github.com/rubyists/linear-cli/compare/v0.9.0...v0.9.1
|
80
90
|
[0.9.0]: https://github.com/rubyists/linear-cli/compare/v0.8.6...v0.9.0
|
81
91
|
[0.8.6]: https://github.com/rubyists/linear-cli/compare/v0.8.4...v0.8.6
|
82
92
|
[0.8.4]: https://github.com/rubyists/linear-cli/compare/v0.8.1...v0.8.4
|
@@ -0,0 +1 @@
|
|
1
|
+
date: 2024-02-07
|
@@ -0,0 +1 @@
|
|
1
|
+
date: 2024-02-07
|
@@ -21,10 +21,6 @@ module Rubyists
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def choose_a_team!(teams)
|
24
|
-
prompt.on(:keypress) do |event|
|
25
|
-
prompt.trigger(:keydown) if event.value == 'j'
|
26
|
-
prompt.trigger(:keyup) if event.value == 'k'
|
27
|
-
end
|
28
24
|
key = prompt.select('Choose a team', teams.to_h { |t| [t.name, t.key] })
|
29
25
|
Rubyists::Linear::Team.find key
|
30
26
|
end
|
@@ -50,6 +46,10 @@ module Rubyists
|
|
50
46
|
git.current_branch
|
51
47
|
end
|
52
48
|
|
49
|
+
def branch_for(branch_name)
|
50
|
+
git.branches.local.detect { |b| b.name == branch_name } || git.branch(branch_name)
|
51
|
+
end
|
52
|
+
|
53
53
|
# Horrible way to do this, but it is working for now
|
54
54
|
def pull_or_push_new_branch!(branch_name)
|
55
55
|
git.pull
|
data/lib/linear/cli/version.rb
CHANGED
data/lib/linear/cli/what_for.rb
CHANGED
@@ -51,7 +51,7 @@ module Rubyists
|
|
51
51
|
answer = prompt.ask("#{question}: ('-' to open an editor)", default: '-')
|
52
52
|
return answer unless answer == '-'
|
53
53
|
|
54
|
-
answer = editor_for [
|
54
|
+
answer = editor_for [question.downcase, '.md']
|
55
55
|
raise SmellsBad, "No content provided for #{question}" if answer.empty?
|
56
56
|
|
57
57
|
answer
|
@@ -78,11 +78,11 @@ module Rubyists
|
|
78
78
|
projects.select { |p| p.match_score?(search_term).positive? }.sort_by { |p| p.match_score?(search_term) }
|
79
79
|
end
|
80
80
|
|
81
|
-
def project_for(team, project = nil)
|
81
|
+
def project_for(team, project = nil) # rubocop:disable Metrics/AbcSize
|
82
82
|
projects = team.projects
|
83
83
|
return nil if projects.empty?
|
84
84
|
|
85
|
-
possibles = project_scores(projects, project)
|
85
|
+
possibles = project ? project_scores(projects, project) : []
|
86
86
|
return ask_for_projects(projects, search: project) if possibles.empty?
|
87
87
|
|
88
88
|
first = possibles.first
|
data/lib/linear/cli.rb
CHANGED
@@ -24,6 +24,7 @@ module Dry
|
|
24
24
|
out.puts Completely::Completions.new(
|
25
25
|
Input.new(@registry, @program_name).call(include_aliases:)
|
26
26
|
).script
|
27
|
+
# Here is the only change in our monkeypatch! Lame, right?
|
27
28
|
out.puts 'complete -F _linear-cli_completions lc'
|
28
29
|
out.string
|
29
30
|
end
|
@@ -44,6 +45,7 @@ module Rubyists
|
|
44
45
|
return @prompt if @prompt
|
45
46
|
|
46
47
|
@prompt = TTY::Prompt.new
|
48
|
+
# This gives ex/vim style navigation to menus
|
47
49
|
@prompt.on(:keypress) do |event|
|
48
50
|
@prompt.trigger(:keydown) if event.value == 'j'
|
49
51
|
@prompt.trigger(:keyup) if event.value == 'k'
|
@@ -92,8 +94,8 @@ module Rubyists
|
|
92
94
|
module Linear
|
93
95
|
# Open this back up to register 3rd party/other commands
|
94
96
|
module CLI
|
95
|
-
register 'completion', Dry::CLI::Completion::Command[self]
|
96
97
|
# NOTE: We have monkeypatched the Generator to add our 'lc' alias
|
98
|
+
register 'completion', Dry::CLI::Completion::Command[self]
|
97
99
|
end
|
98
100
|
end
|
99
101
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'gqli'
|
4
|
+
|
5
|
+
module Rubyists
|
6
|
+
# Namespace for Linear
|
7
|
+
module Linear
|
8
|
+
M :base_model
|
9
|
+
Comment = Class.new(BaseModel)
|
10
|
+
# The Comment class represents a Linear issue comment.
|
11
|
+
class Comment
|
12
|
+
include SemanticLogger::Loggable
|
13
|
+
|
14
|
+
Base = fragment('BaseComment', 'Comment') do
|
15
|
+
id
|
16
|
+
body
|
17
|
+
url
|
18
|
+
createdAt
|
19
|
+
updatedAt
|
20
|
+
end
|
21
|
+
|
22
|
+
def to_s
|
23
|
+
format('%<id>-12s %<url>s', id:, url:)
|
24
|
+
end
|
25
|
+
|
26
|
+
def inspection
|
27
|
+
format('id: "%<id>s" url: "%<url>s"', id:, url:)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Rubyists
|
4
4
|
# Namespace for Linear
|
5
5
|
module Linear
|
6
|
-
M :user, :team
|
6
|
+
M :user, :team, :comment
|
7
7
|
# The Issue class represents a Linear issue.
|
8
8
|
class Issue
|
9
9
|
# Class methods for Issue
|
@@ -21,6 +21,7 @@ module Rubyists
|
|
21
21
|
___ Base
|
22
22
|
assignee { ___ User.full_fragment }
|
23
23
|
team { ___ Team.full_fragment }
|
24
|
+
comments { nodes { ___ Comment.base_fragment } }
|
24
25
|
end
|
25
26
|
end
|
26
27
|
|
data/lib/linear/models/issue.rb
CHANGED
@@ -13,9 +13,10 @@ module Rubyists
|
|
13
13
|
include SemanticLogger::Loggable
|
14
14
|
extend ClassMethods
|
15
15
|
many_to_one :assignee, :User
|
16
|
-
many_to_one :team
|
16
|
+
many_to_one :team
|
17
|
+
one_to_many :comments
|
17
18
|
|
18
|
-
BASIC_FILTER = { completedAt: { null: true } }.freeze
|
19
|
+
BASIC_FILTER = { completedAt: { null: true }, canceledAt: { null: true } }.freeze
|
19
20
|
|
20
21
|
Base = fragment('BaseIssue', 'Issue') do
|
21
22
|
id
|
@@ -117,9 +118,17 @@ module Rubyists
|
|
117
118
|
"Description was unparsable: #{description}\n"
|
118
119
|
end
|
119
120
|
|
121
|
+
def display_comments
|
122
|
+
comments.map { |c| "--- #{c.createdAt} ---\n#{TTY::Markdown.parse(c.body)}" }.join("\n")
|
123
|
+
end
|
124
|
+
|
120
125
|
def full
|
121
126
|
sep = '-' * to_s.length
|
122
|
-
format("%<to_s>s\n%<sep>s\n%<description>s\n",
|
127
|
+
format("%<to_s>s\n%<sep>s\n%<description>s\n%<comments>s",
|
128
|
+
sep:,
|
129
|
+
to_s:,
|
130
|
+
description: parsed_description,
|
131
|
+
comments: display_comments)
|
123
132
|
end
|
124
133
|
|
125
134
|
def display(options)
|
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.
|
4
|
+
version: 0.9.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tj (bougyman) Vanderpoel
|
@@ -246,6 +246,10 @@ files:
|
|
246
246
|
- changelog/0.9.0/tag.yml
|
247
247
|
- changelog/0.9.1/fixed_wrapper_to_be_more_normal_about_help_when_listing_leaf_commands.yml
|
248
248
|
- changelog/0.9.1/tag.yml
|
249
|
+
- changelog/0.9.3/fixed_probblem_with_tempfile_for_editing_operations.yml
|
250
|
+
- changelog/0.9.3/tag.yml
|
251
|
+
- changelog/0.9.4/fixed_issue_with_canceled_issues_showing_up_in_lcls.yml
|
252
|
+
- changelog/0.9.4/tag.yml
|
249
253
|
- changelog/unreleased/.gitkeep
|
250
254
|
- cinemas/listings.cinema
|
251
255
|
- cinemas/listings.cinema.gif
|
@@ -285,6 +289,7 @@ files:
|
|
285
289
|
- lib/linear/models/base_model.rb
|
286
290
|
- lib/linear/models/base_model/class_methods.rb
|
287
291
|
- lib/linear/models/base_model/method_magic.rb
|
292
|
+
- lib/linear/models/comment.rb
|
288
293
|
- lib/linear/models/issue.rb
|
289
294
|
- lib/linear/models/issue/class_methods.rb
|
290
295
|
- lib/linear/models/label.rb
|