-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move around logic; get rendering of prompts working
- Loading branch information
Showing
10 changed files
with
68 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
{ | ||
"rubyLsp.formatter": "rubocop", | ||
} | ||
"[erb]": { | ||
"editor.defaultFormatter": "Shopify.ruby-lsp" | ||
}, | ||
"[ruby]": { | ||
"editor.defaultFormatter": "Shopify.ruby-lsp", | ||
"editor.formatOnSave": true, | ||
"editor.tabSize": 2, | ||
"editor.insertSpaces": true, | ||
"editor.semanticHighlighting.enabled": true, | ||
"editor.formatOnType": true, | ||
"editor.wordSeparators": "`~@#$%^&*()-=+[{]}\\|;:'\",.<>/" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,8 @@ | ||
<h1>Action Prompt Preview</h1> | ||
<h1>Action Prompt Preview</h1> | ||
<div> | ||
<%= @preview_class.name %> | ||
</div> | ||
<div> | ||
<%= @prompt_output %> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,4 @@ | ||
require "test_helper" | ||
|
||
class ActionPrompt::BaseTest < ActiveSupport::TestCase | ||
test "hello world" do | ||
result = ActionPrompt.render("hello_world") | ||
assert_equal "You are a helpful assistant who replies with, \"Hello, world!\"", result | ||
end | ||
|
||
test "a template with a variable" do | ||
result = ActionPrompt.render("hello_somebody", locals: { name: "John" }) | ||
assert_equal "You are a helpful assistant who replies with, \"Hello, John!\"", result | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
class HelloWorldPreview < ActionPrompt::Preview | ||
def hello_world | ||
ActivePrompt.render("hello_world") | ||
render("hello_world") | ||
end | ||
|
||
def hello_somebody | ||
ActivePrompt.render("hello_somebody", locals: { name: "Lenny" }) | ||
render("hello_somebody", locals: { name: "Lenny" }) | ||
end | ||
end |