pear-programmer 0.1.12 → 0.1.14
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/lib/cli/actions.rb +17 -1
- data/lib/cli/display.rb +24 -2
- data/lib/cli/version.rb +1 -1
- data/lib/cli.rb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3e4ead88db6cef9e8063b2a627b5c66a1fa4dfda6f80cdba00b7a11769217b5
|
4
|
+
data.tar.gz: 6798d45ebd3eb5d7fef17d99276ed1f2db3fef26d3509952b6efdab7af48d6a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64e60bb73f8ac05d4727a359a40fb4dadca3b29673b99bf48602deb9e71479cbf6fcf990638210956fcf70e531dd4ad9ea6aae47d499795e23f942495903426f
|
7
|
+
data.tar.gz: ab37fceebb1c160fd3d254f970f76b58c35fd2d51c42769c29a4081842b3e541846fd49b08b7591341688414a57647726caf91d2c9622ad53084f39c6585a6b9
|
data/lib/cli/actions.rb
CHANGED
@@ -34,6 +34,8 @@ module Cli
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def self.check_cli_version
|
37
|
+
return if PairProgrammer::Configuration.development?
|
38
|
+
|
37
39
|
versions = PairProgrammer::Api::System.versions
|
38
40
|
if versions["cli"] != Cli::Version::VERSION
|
39
41
|
Cli::Display.info_message("A new version of the CLI is available, installing update")
|
@@ -70,6 +72,7 @@ module Cli
|
|
70
72
|
config = Cli::Configuration.new
|
71
73
|
context = config.default_context
|
72
74
|
id = PairProgrammer::Api::Coder.create([], context, requirements, "remember")
|
75
|
+
|
73
76
|
run_coder({ id: id })
|
74
77
|
end
|
75
78
|
|
@@ -78,6 +81,19 @@ module Cli
|
|
78
81
|
config = Cli::Configuration.new
|
79
82
|
context = config.default_context
|
80
83
|
id = PairProgrammer::Api::Coder.create([], context, requirements, "recall")
|
84
|
+
|
85
|
+
run_coder({ id: id })
|
86
|
+
end
|
87
|
+
|
88
|
+
def self.create_and_run_recipe(options)
|
89
|
+
recipe = options[:recipe]
|
90
|
+
raise "Recipe cannot be blank" if recipe.nil? || recipe.empty?
|
91
|
+
|
92
|
+
requirements = Cli::Display.get_input("requirements: ")
|
93
|
+
config = Cli::Configuration.new
|
94
|
+
context = config.default_context
|
95
|
+
id = PairProgrammer::Api::Coder.create([], context, requirements, recipe)
|
96
|
+
|
81
97
|
run_coder({ id: id })
|
82
98
|
end
|
83
99
|
|
@@ -102,7 +118,7 @@ module Cli
|
|
102
118
|
end
|
103
119
|
|
104
120
|
id = PairProgrammer::Api::Coder.create(tasks, context, requirements, nil)
|
105
|
-
Cli::Display.success_message("
|
121
|
+
Cli::Display.success_message("Created and run starting")
|
106
122
|
|
107
123
|
run_coder({ id: id })
|
108
124
|
end
|
data/lib/cli/display.rb
CHANGED
@@ -47,9 +47,31 @@ module Cli
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
+
# def self.get_input(input)
|
51
|
+
# print(input.colorize(mode: :bold))
|
52
|
+
# lines = []
|
53
|
+
# while (line = STDIN.gets&.chomp) != ""
|
54
|
+
# lines << line
|
55
|
+
# end
|
56
|
+
# lines.join("\n")
|
57
|
+
# end
|
58
|
+
|
59
|
+
# def self.get_input(input)
|
60
|
+
# print(input.colorize(mode: :bold))
|
61
|
+
# lines = []
|
62
|
+
# begin
|
63
|
+
# while line = STDIN.readline&.chomp
|
64
|
+
# lines << line
|
65
|
+
# end
|
66
|
+
# rescue EOFError
|
67
|
+
# end
|
68
|
+
# lines.join("\n")
|
69
|
+
# end
|
70
|
+
|
50
71
|
def self.get_input(input)
|
51
|
-
|
52
|
-
|
72
|
+
prompt = TTY::Prompt.new
|
73
|
+
lines = prompt.multiline(input.colorize(mode: :bold))
|
74
|
+
lines.join("\n")
|
53
75
|
end
|
54
76
|
|
55
77
|
def self.success_message(message)
|
data/lib/cli/version.rb
CHANGED
data/lib/cli.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pear-programmer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Edelstein
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: open3
|