rage-rb 1.21.0 → 1.21.1
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 +4 -0
- data/lib/rage/cli/skills.rb +56 -12
- data/lib/rage/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: faa71c4b50bb54ce6163c04fc5e734e812b60eb9dd1dc3a392c6e64fdfc735d0
|
|
4
|
+
data.tar.gz: 71a92667a83e26ccdb0c75c500880eb472a021ede32e39beddb00db32553d36b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cb86c7badba46ddf489838c768f0409fc8e3cbcc880b2c315f1fe58b4a85191d77a3f94421973ce26a5c7050e08f9864dbea63c7aa70e36176a2a6a5c8825233
|
|
7
|
+
data.tar.gz: 38f2e8c93f7306b802ae36439687fa98b85e6a8e8f06a6f505fb62d748ca6b71620181e51ccb7aec298ef0f927799d60770219a197f47fce731b96605f21f5d2
|
data/CHANGELOG.md
CHANGED
data/lib/rage/cli/skills.rb
CHANGED
|
@@ -14,8 +14,8 @@ class CLISkills < Thor
|
|
|
14
14
|
say "Downloading skills..."
|
|
15
15
|
install_skills(installation_path, skills_version)
|
|
16
16
|
|
|
17
|
-
say "
|
|
18
|
-
say "Skills are now available to your coding agent."
|
|
17
|
+
say "#{set_color("✓", :green)} Installed Rage skills #{set_color(skills_version, :bold)} to #{set_color(installation_path, :cyan)}."
|
|
18
|
+
say "#{set_color("✓", :green)} Skills are now available to your coding agent."
|
|
19
19
|
rescue => e
|
|
20
20
|
say_error(e)
|
|
21
21
|
end
|
|
@@ -40,17 +40,17 @@ class CLISkills < Thor
|
|
|
40
40
|
current_version = File.exist?(version_file) ? File.read(version_file).strip : nil
|
|
41
41
|
|
|
42
42
|
if current_version == skills_version
|
|
43
|
-
log "#{destination}: already up to date."
|
|
43
|
+
log "#{set_color(destination, :cyan)}: already up to date."
|
|
44
44
|
next
|
|
45
45
|
end
|
|
46
46
|
|
|
47
|
-
log "Updating #{destination}..."
|
|
47
|
+
log "Updating #{set_color(destination, :cyan)}..."
|
|
48
48
|
install_skills(destination, skills_version)
|
|
49
49
|
updated_paths << destination
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
if updated_paths.any?
|
|
53
|
-
log "
|
|
53
|
+
log "#{set_color("✓", :green)} Updated #{updated_paths.size} installation#{"s" if updated_paths.size > 1} to #{set_color(skills_version, :bold)}."
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
json_output(
|
|
@@ -87,7 +87,7 @@ class CLISkills < Thor
|
|
|
87
87
|
end
|
|
88
88
|
|
|
89
89
|
def say_error(error)
|
|
90
|
-
say "#{set_color("Error:", :red, :bold)} #{error.message}"
|
|
90
|
+
say "#{set_color("𐄂 Error:", :red, :bold)} #{error.message}"
|
|
91
91
|
debug { "#{error.class}: #{error.message}\n#{error.backtrace.join("\n")}" }
|
|
92
92
|
end
|
|
93
93
|
|
|
@@ -104,8 +104,16 @@ class CLISkills < Thor
|
|
|
104
104
|
["9", "Other", ".claude/skills"]
|
|
105
105
|
]
|
|
106
106
|
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
display_options = ([["Option", "Coding Agent", "Installation Path"]] + agent_options).map.with_index do |(option, agent, path), index|
|
|
108
|
+
if index == 0
|
|
109
|
+
[set_color(option, :bold), set_color(agent, :bold), set_color(path, :bold)]
|
|
110
|
+
else
|
|
111
|
+
[set_color(option, :bold), agent, set_color(path, :cyan)]
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
print_ansi_table(display_options)
|
|
116
|
+
agent_choice = ask(set_color("Select your coding agent (1-#{agent_options[-1][0]}):", :bold), default: "1")
|
|
109
117
|
|
|
110
118
|
installation_path = ".claude/skills"
|
|
111
119
|
|
|
@@ -116,10 +124,10 @@ class CLISkills < Thor
|
|
|
116
124
|
end
|
|
117
125
|
end
|
|
118
126
|
|
|
119
|
-
say "\
|
|
120
|
-
say "Destination: #{set_color(installation_path, :
|
|
127
|
+
say "\n#{set_color("Source:", :bold)} #{set_color("https://github.com/rage-rb/skills", :cyan)}"
|
|
128
|
+
say "#{set_color("Destination:", :bold)} #{set_color(installation_path, :cyan)}"
|
|
121
129
|
|
|
122
|
-
answer = ask("Proceed with installation? [Y/n]", default: "y")
|
|
130
|
+
answer = ask(set_color("? ", :green, :bold) + set_color("Proceed with installation? [Y/n]", :bold), default: "y")
|
|
123
131
|
unless answer.downcase.start_with?("y")
|
|
124
132
|
say "Installation cancelled."
|
|
125
133
|
return nil
|
|
@@ -229,10 +237,15 @@ class CLISkills < Thor
|
|
|
229
237
|
|
|
230
238
|
parsed_uri = URI(uri)
|
|
231
239
|
http = Net::HTTP.new(parsed_uri.host, parsed_uri.port)
|
|
232
|
-
http.use_ssl = parsed_uri.scheme == "https"
|
|
233
240
|
http.open_timeout = 5
|
|
234
241
|
http.read_timeout = 5
|
|
235
242
|
|
|
243
|
+
if parsed_uri.scheme == "https"
|
|
244
|
+
http.use_ssl = true
|
|
245
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
|
246
|
+
http.cert_store = OpenSSL::X509::Store.new.tap(&:set_default_paths)
|
|
247
|
+
end
|
|
248
|
+
|
|
236
249
|
response = http.request(Net::HTTP::Get.new(parsed_uri))
|
|
237
250
|
|
|
238
251
|
case response
|
|
@@ -243,5 +256,36 @@ class CLISkills < Thor
|
|
|
243
256
|
request(response["Location"], limit - 1)
|
|
244
257
|
end
|
|
245
258
|
end
|
|
259
|
+
|
|
260
|
+
# print a table stripping ANSI codes to ensure paddings are based on visible length
|
|
261
|
+
def print_ansi_table(rows)
|
|
262
|
+
return if rows.empty?
|
|
263
|
+
|
|
264
|
+
widths = rows.each_with_object([]) do |row, maxima|
|
|
265
|
+
row.each_with_index do |column, index|
|
|
266
|
+
visible_width = strip_ansi(column.to_s).size
|
|
267
|
+
maxima[index] = [maxima[index] || 0, visible_width].max
|
|
268
|
+
end
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
border = "+" + widths.map { |width| "-" * (width + 2) }.join("+") + "+"
|
|
272
|
+
say(border)
|
|
273
|
+
|
|
274
|
+
rows.each do |row|
|
|
275
|
+
formatted_cells = widths.each_index.map do |index|
|
|
276
|
+
cell = row[index].to_s
|
|
277
|
+
cell_padding = widths[index] - strip_ansi(cell).size
|
|
278
|
+
" #{cell}#{" " * cell_padding} "
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
say("|#{formatted_cells.join("|")}|")
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
say(border)
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
def strip_ansi(text)
|
|
288
|
+
text.gsub(/\e\[[0-9;]*m/, "")
|
|
289
|
+
end
|
|
246
290
|
end
|
|
247
291
|
end
|
data/lib/rage/version.rb
CHANGED