pear-programmer 0.1.8 → 0.1.9

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: 0e89ef92554568da8cee9fd9937b37e762e739ca74f1fb193fe9d78da27bb9c3
4
- data.tar.gz: 237a2335e54942a3b0d2ed8fe3951a433da6f282eaf20e661ec00e8b13e27590
3
+ metadata.gz: a283d4c891d368dc2e993708b00ea90fbb1f86f5e68765bd9f0d18b7b0567121
4
+ data.tar.gz: 8095247c090ed086de1eb1759c9c358c62ca9bd3312c06fba7917daf847aa1c4
5
5
  SHA512:
6
- metadata.gz: 1d30fc2ee809af15b640b1769ec7d0c20b80cc35e1bfa85c514b0552c0bd474da7fad86c0a5e87ddcdc9fc00adb7f955325d2951bb7c2e1a855c9454ad913673
7
- data.tar.gz: 2a88cba029765641c7b8e7e170ac308e42eaa7586b8e447a9cc8222c91e228b9ed4779fd8b67e04b33f3cf93e0066df2c8d7f8fa00964cdf515460e71454d639
6
+ metadata.gz: 0e7cca90087e744d99049e53ca930e42a77dfa578042cd0487b620613a0d2a7d439fd11b7e65c8b45914a1718230daae4d3b2f36183369ae97b5d5f9aa04d50f
7
+ data.tar.gz: 657d5a54741dfc1454a3c5d463f8de7b3da702b826b7b6ff448b158a7686b183f65bb1ab8965ea817d4294b68d964f20f6385f1b5cce38164ada954ad088b234
data/lib/cli/actions.rb CHANGED
@@ -190,7 +190,7 @@ module Cli
190
190
  Cli::Display.info_message("retrying...")
191
191
  next
192
192
  end
193
- PairProgrammer::Api::Coder.append_output(id, output)
193
+ PairProgrammer::Api::Coder.append_output(id, output, system_message["command"])
194
194
  end
195
195
  end
196
196
  end
data/lib/cli/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Cli
2
2
  module Version
3
- VERSION = "0.1.8"
3
+ VERSION = "0.1.9"
4
4
  end
5
5
  end
@@ -29,10 +29,11 @@ module PairProgrammer
29
29
  Client.new.post('/api/v1/coder/run', body)
30
30
  end
31
31
 
32
- def self.append_output(id, output)
32
+ def self.append_output(id, output, command_name)
33
33
  body = {
34
34
  id: id,
35
- output: output
35
+ output: output,
36
+ command: command_name
36
37
  }
37
38
  Client.new.post('/api/v1/coder/append_output', body)
38
39
  end
@@ -71,6 +71,7 @@ module PairProgrammer
71
71
  File.open(file_path, 'w') do |file|
72
72
  file_content.each { |line| file.puts(line) }
73
73
  end
74
+ "file updated"
74
75
  when "yarn"
75
76
  run_shell "cd #{PairProgrammer::Configuration.root} && yarn #{arguments["command"]}"
76
77
  when "mv"
@@ -90,12 +91,13 @@ module PairProgrammer
90
91
  File.open(file_path, "w") do |file|
91
92
  file.puts(arguments["content"])
92
93
  end
94
+ "file updated"
93
95
  when "create_directory"
94
96
  directory_path = PairProgrammer::Configuration.absolute_path(arguments["directory_path"])
95
- FileUtils.mkdir_p(directory_path)
97
+ FileUtils.mkdir_p(directory_path) || "directory created"
96
98
  when "delete_file"
97
99
  file_path = PairProgrammer::Configuration.absolute_path(arguments["file_path"])
98
- File.delete(file_path)
100
+ File.delete(file_path) || "file_deleted"
99
101
  when "view_changes"
100
102
  # TODO
101
103
  when "delete_lines"
@@ -109,13 +111,13 @@ module PairProgrammer
109
111
  lines.delete_if.with_index { |line, index| line_numbers.include?(index) }
110
112
 
111
113
  # Write the modified contents back to the file
112
- File.write(file_path, lines.join)
114
+ File.write(file_path, lines.join) || "lines deleted"
113
115
  when "rspec"
114
116
  file_path = PairProgrammer::Configuration.absolute_path(arguments["file_path"])
115
117
  run_shell "cd #{PairProgrammer::Configuration.root} && rspec #{file_path}}"
116
118
  when "ask_question"
117
119
  puts arguments["question"]
118
- STDIN.gets.chomp
120
+ STDIN.gets.chomp || ''
119
121
  when "read_file"
120
122
  file_path = PairProgrammer::Configuration.absolute_path(arguments["file_path"])
121
123
  if File.exist?(file_path)
@@ -126,7 +128,7 @@ module PairProgrammer
126
128
  when "create_file"
127
129
  # TODO return response if file is already created
128
130
  file_path = PairProgrammer::Configuration.absolute_path(arguments["file_path"])
129
- FileUtils.touch(file_path)
131
+ FileUtils.touch(file_path) || "file created"
130
132
  else
131
133
  raise "Invalid command: #{command}"
132
134
  end
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.8
4
+ version: 0.1.9
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-06-21 00:00:00.000000000 Z
11
+ date: 2023-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: open3