linear-cli 0.8.2 → 0.8.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -2
- data/changelog/0.8.4/added_version_command.yml +4 -0
- data/changelog/0.8.4/tag.yml +1 -0
- data/changelog/0.8.6/fixed_completion_for_lc_alias.yml +4 -0
- data/changelog/0.8.6/tag.yml +1 -0
- data/exe/scripts/lc.sh +4 -0
- data/lib/linear/cli/caller.rb +9 -6
- data/lib/linear/cli/version.rb +1 -1
- data/lib/linear/cli.rb +30 -3
- data/lib/linear/commands/version.rb +27 -0
- data/lib/linear.rb +4 -10
- data/oci/Containerfile +2 -2
- 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: ab8ebfb7eabbfc9974cadc1255b77882b07a5b77b7311b7c28f32ab05cc6d36d
|
4
|
+
data.tar.gz: 4a113e8634b37e1cce2a0eb8f42319dfbe17dcf799da754cbdc3070464101d82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6509b777cc1629deac09377df81239df88639480f28910bf84c84504f050a2536dffc2229438a8e6555dccab423410ed02cc7deb039caa7170fd5cb946ca63d
|
7
|
+
data.tar.gz: 64b15071808806cd2358b50e3768f1297e0dd09ce461640c14266c5329e4d75e160042438e93700f999b4e78214256874a10ae33369dfc3394922f6077f95235
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
## [Unreleased]
|
4
4
|
|
5
|
+
## [0.8.6] - 2024-02-06
|
6
|
+
### Fixed
|
7
|
+
- Fixed completion for lc alias (@bougyman)
|
8
|
+
|
9
|
+
## [0.8.4] - 2024-02-06
|
10
|
+
### Added
|
11
|
+
- Added version command (@bougyman)
|
12
|
+
|
5
13
|
## [0.8.1] - 2024-02-06
|
6
14
|
### Fixed
|
7
15
|
- Fixed problem with setting verbosity (@bougyman)
|
@@ -59,8 +67,10 @@
|
|
59
67
|
### Added
|
60
68
|
- Added new changelog management system (changelog-rb) (@bougyman)
|
61
69
|
|
62
|
-
[Unreleased]: https://github.com/rubyists/linear-cli/compare/0.8.
|
63
|
-
[0.8.
|
70
|
+
[Unreleased]: https://github.com/rubyists/linear-cli/compare/0.8.6...HEAD
|
71
|
+
[0.8.6]: https://github.com/rubyists/linear-cli/compare/v0.8.4...0.8.6
|
72
|
+
[0.8.4]: https://github.com/rubyists/linear-cli/compare/v0.8.1...v0.8.4
|
73
|
+
[0.8.1]: https://github.com/rubyists/linear-cli/compare/v0.8.0...v0.8.1
|
64
74
|
[0.8.0]: https://github.com/rubyists/linear-cli/compare/v0.7.7...v0.8.0
|
65
75
|
[0.7.7]: https://github.com/rubyists/linear-cli/compare/v0.7.5...v0.7.7
|
66
76
|
[0.7.5]: https://github.com/rubyists/linear-cli/compare/v0.7.3...v0.7.5
|
@@ -0,0 +1 @@
|
|
1
|
+
date: 2024-02-06
|
@@ -0,0 +1 @@
|
|
1
|
+
date: 2024-02-06
|
data/exe/scripts/lc.sh
CHANGED
@@ -3,6 +3,10 @@ if [ "$#" -eq 0 ]; then
|
|
3
3
|
printf "No subcommand provided, defaulting to 'lc issue list'\nlc --help to see subcommands\n" >&2
|
4
4
|
exec linear-cli issue list
|
5
5
|
fi
|
6
|
+
if [[ "$*" =~ --version ]]
|
7
|
+
then
|
8
|
+
exec linear-cli version
|
9
|
+
fi
|
6
10
|
if [[ "$*" =~ --help|-h ]]
|
7
11
|
then
|
8
12
|
printf "Each subcommand has its own help, use 'lc <subcommand> --help' to see it\n" >&2
|
data/lib/linear/cli/caller.rb
CHANGED
@@ -26,15 +26,18 @@ module Rubyists
|
|
26
26
|
logger.trace "Calling #{self.class} with #{method_args}"
|
27
27
|
super(**method_args)
|
28
28
|
rescue SmellsBad => e
|
29
|
-
|
30
|
-
|
29
|
+
TTY::Prompt.new.error e.message
|
30
|
+
TTY::Prompt.new.error '** This smells bad! Bailing. **'
|
31
|
+
exit 22
|
31
32
|
rescue NotFoundError => e
|
32
|
-
|
33
|
+
TTY::Prompt.new.error e.message
|
34
|
+
TTY::Prompt.new.error '** Record not found, Cannot Continue **'
|
33
35
|
exit 66
|
34
36
|
rescue StandardError => e
|
35
|
-
|
36
|
-
|
37
|
-
|
37
|
+
TTY::Prompt.new.error "What the heck is this? #{e}"
|
38
|
+
TTY::Prompt.new.error '** WTH? Cannot Continue **'
|
39
|
+
logger.error e.backtrace.join("\n") if debug.positive?
|
40
|
+
exit 88
|
38
41
|
end
|
39
42
|
end
|
40
43
|
end
|
data/lib/linear/cli/version.rb
CHANGED
data/lib/linear/cli.rb
CHANGED
@@ -7,6 +7,31 @@ require 'semantic_logger'
|
|
7
7
|
require 'tty-markdown'
|
8
8
|
require 'tty-prompt'
|
9
9
|
|
10
|
+
module Dry
|
11
|
+
class CLI
|
12
|
+
module Completion
|
13
|
+
# Monkeypatching the Generator just to add our 'lc' alias :(
|
14
|
+
class Generator
|
15
|
+
def call(shell:, include_aliases: false, out: StringIO.new) # rubocop:disable Metrics/MethodLength
|
16
|
+
raise ArgumentError, 'Unknown shell' unless SUPPORTED_SHELLS.include?(shell)
|
17
|
+
|
18
|
+
if shell == ZSH
|
19
|
+
out.puts '# enable bash completion support, see https://github.com/dannyben/completely#completions-in-zsh'
|
20
|
+
out.puts 'autoload -Uz +X compinit && compinit'
|
21
|
+
out.puts 'autoload -Uz +X bashcompinit && bashcompinit'
|
22
|
+
end
|
23
|
+
|
24
|
+
out.puts Completely::Completions.new(
|
25
|
+
Input.new(@registry, @program_name).call(include_aliases:)
|
26
|
+
).script
|
27
|
+
out.puts 'complete -F _linear-cli_completions lc'
|
28
|
+
out.string
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
10
35
|
# The Rubyists module is the top-level namespace for all Rubyists projects
|
11
36
|
module Rubyists
|
12
37
|
module Linear
|
@@ -54,12 +79,13 @@ module Rubyists
|
|
54
79
|
end
|
55
80
|
end
|
56
81
|
|
57
|
-
|
82
|
+
# Load CLI Helpers/libraries
|
83
|
+
Pathname.new(__dir__).join('cli').glob('*.rb').each do |file|
|
58
84
|
require file.expand_path
|
59
85
|
end
|
60
86
|
|
61
|
-
# Load all our commands
|
62
|
-
Pathname.new(
|
87
|
+
# Load all our commands and subcommands
|
88
|
+
Pathname.new(__dir__).join('commands').glob('*.rb').each do |file|
|
63
89
|
require file.expand_path
|
64
90
|
end
|
65
91
|
|
@@ -67,6 +93,7 @@ module Rubyists
|
|
67
93
|
# Open this back up to register 3rd party/other commands
|
68
94
|
module CLI
|
69
95
|
register 'completion', Dry::CLI::Completion::Command[self]
|
96
|
+
# NOTE: We have monkeypatched the Generator to add our 'lc' alias
|
70
97
|
end
|
71
98
|
end
|
72
99
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'semantic_logger'
|
4
|
+
|
5
|
+
module Rubyists
|
6
|
+
# Namespace for Linear
|
7
|
+
module Linear
|
8
|
+
M :user
|
9
|
+
# Namespace for CLI
|
10
|
+
module CLI
|
11
|
+
Version = Class.new Dry::CLI::Command
|
12
|
+
# The Version command
|
13
|
+
class Version
|
14
|
+
include SemanticLogger::Loggable
|
15
|
+
include Rubyists::Linear::CLI::CommonOptions
|
16
|
+
|
17
|
+
desc 'Show version'
|
18
|
+
|
19
|
+
def call(**)
|
20
|
+
logger.debug 'Version called'
|
21
|
+
TTY::Prompt.new.say Rubyists::Linear::VERSION
|
22
|
+
end
|
23
|
+
end
|
24
|
+
register 'version', Version, aliases: %w[v]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/linear.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'pathname'
|
4
|
+
require 'semantic_logger'
|
5
|
+
SemanticLogger.default_level = :info
|
6
|
+
SemanticLogger.add_appender(io: $stderr, formatter: :color)
|
4
7
|
|
5
8
|
# Add the / operator for path separation
|
6
9
|
class Pathname
|
@@ -12,6 +15,7 @@ end
|
|
12
15
|
module Rubyists
|
13
16
|
# Namespace for Linear classes
|
14
17
|
module Linear
|
18
|
+
include SemanticLogger::Loggable
|
15
19
|
# rubocop:disable Layout/SpaceAroundOperators
|
16
20
|
ROOT = (Pathname(__FILE__)/'../..').expand_path
|
17
21
|
LIBROOT = ROOT/:lib/:linear
|
@@ -42,16 +46,6 @@ module Rubyists
|
|
42
46
|
@verbosity ||= 0
|
43
47
|
end
|
44
48
|
|
45
|
-
def self.logger
|
46
|
-
return @logger if @logger
|
47
|
-
|
48
|
-
require 'semantic_logger'
|
49
|
-
|
50
|
-
SemanticLogger.default_level = :info
|
51
|
-
SemanticLogger.add_appender(io: $stderr, formatter: :color)
|
52
|
-
@logger = SemanticLogger['Rubyists::Linear']
|
53
|
-
end
|
54
|
-
|
55
49
|
def self.verbosity=(debug)
|
56
50
|
return verbosity unless debug
|
57
51
|
|
data/oci/Containerfile
CHANGED
@@ -12,7 +12,7 @@ RUN apk --update add bash ruby-dev build-base git sqlite-dev
|
|
12
12
|
WORKDIR $APP_ROOT
|
13
13
|
|
14
14
|
COPY . $APP_ROOT
|
15
|
-
RUN bundle install && bundle exec rake build
|
15
|
+
RUN gem i semantic_logger && bundle install && bundle exec rake build
|
16
16
|
|
17
17
|
CMD %w[bundle exec lc]
|
18
18
|
|
@@ -28,5 +28,5 @@ RUN apk --update --no-cache add $PACKAGES
|
|
28
28
|
COPY --from=build-env /app/pkg /tmp
|
29
29
|
RUN ls /tmp/*.gem && gem install /tmp/*.gem
|
30
30
|
|
31
|
-
CMD
|
31
|
+
CMD ["bundle", "exec", "lc"]
|
32
32
|
|
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.8.
|
4
|
+
version: 0.8.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tj (bougyman) Vanderpoel
|
@@ -238,6 +238,10 @@ files:
|
|
238
238
|
- changelog/0.8.0/tag.yml
|
239
239
|
- changelog/0.8.1/fixed_problem_with_setting_verbosity.yml
|
240
240
|
- changelog/0.8.1/tag.yml
|
241
|
+
- changelog/0.8.4/added_version_command.yml
|
242
|
+
- changelog/0.8.4/tag.yml
|
243
|
+
- changelog/0.8.6/fixed_completion_for_lc_alias.yml
|
244
|
+
- changelog/0.8.6/tag.yml
|
241
245
|
- changelog/unreleased/.gitkeep
|
242
246
|
- cinemas/listings.cinema
|
243
247
|
- cinemas/listings.cinema.gif
|
@@ -270,6 +274,7 @@ files:
|
|
270
274
|
- lib/linear/commands/issue/update.rb
|
271
275
|
- lib/linear/commands/team.rb
|
272
276
|
- lib/linear/commands/team/list.rb
|
277
|
+
- lib/linear/commands/version.rb
|
273
278
|
- lib/linear/commands/whoami.rb
|
274
279
|
- lib/linear/exceptions.rb
|
275
280
|
- lib/linear/fragments.rb
|