crimson-knight's picture
Amber framework demo knowledge pack: train/valid pairs + two 50-item eval sets
f879505 verified
Raw
History Blame Contribute Delete
8.04 kB
{"messages": [{"role": "user", "content": "Fill in the blank from the Amber framework docs (From Source): Download and install ____ **NOTE:** At the time of this writing, v1.4.1 is the current stable release, but you should use the most recent tag in place of that."}, {"role": "assistant", "content": "amber"}]}
{"messages": [{"role": "user", "content": "Choose the correct option to complete this Amber docs statement (Add A Jennifer Initializer to Configuration): With your ____ in place, we need to inform Amber about Jennifer and tell the framework how we would like to configure the ORM.\nOptions:\nA) postgres\nB) user_join\nC) bin/myapp\nD) config/database.yml\nReply with the letter of the correct option."}, {"role": "assistant", "content": "D"}]}
{"messages": [{"role": "user", "content": "In the Amber docs section 'Set Encryption Key', complete this statement: Amber adds it by default to your ____ file."}, {"role": "assistant", "content": "The missing term is .gitignore."}]}
{"messages": [{"role": "user", "content": "In the Amber docs section 'returns => :production', complete this statement: ``` Alternatively, you can use built in environment helpers such as ____, `Amber.env.test?`, and `Amber.env.production?` to check the environment value."}, {"role": "assistant", "content": "The missing term is Amber.env.development?."}]}
{"messages": [{"role": "user", "content": "In the Amber docs section 'Excluding and Including Actions', complete this statement: Sometimes you want to use ____ as a shortcut for defining routes, and with that you don't want to define routes for actions that don't exist yet."}, {"role": "assistant", "content": "The missing term is resources."}]}
{"messages": [{"role": "user", "content": "Choose the correct option to complete this Amber docs statement (Can't connect to database): Then, ensure your database is running and the ____ is well specified on `config/environments/{your-enviroment-file}.yml`, or on `DATABASE_URL` environment variable.\nOptions:\nA) Amber.settings.secrets\nB) slang\nC) .to_s\nD) database_url\nReply with the letter of the correct option."}, {"role": "assistant", "content": "D"}]}
{"messages": [{"role": "user", "content": "Fill in the blank from the Amber framework docs (Encrypted Environment Settings): It contains a ____ that is used to decrypt your encrypted environment settings."}, {"role": "assistant", "content": "secret_key_base"}]}
{"messages": [{"role": "user", "content": "In the Amber docs section '7. Print hidden objects', complete this statement: You can unhide them using the ____ method and a temporary debugging variable, like this: This trick allows showing the `bar_hello_to_s` variable inside the debugger tool."}, {"role": "assistant", "content": "The missing term is .to_s."}]}
{"messages": [{"role": "user", "content": "Fill in the blank from the Amber framework docs (Joins): Also there are two shortcuts for left and right joins: > For now Jennifer provides manual aliasing as a second argument for ____ and automatic when using `#includes` and `#with` methods."}, {"role": "assistant", "content": "#join"}]}
{"messages": [{"role": "user", "content": "In the Amber docs section 'Resources', complete this statement: Let’s add a resource to the ____ Then go to the root of your project, and run `amber routes` This will output the standard matrix of HTTP verbs, controller, action, pipeline, scope, and URI pattern."}, {"role": "assistant", "content": "The missing term is config/routes.cr."}]}
{"messages": [{"role": "user", "content": "Choose the correct option to complete this Amber docs statement (Rendering an Action's Template from Another Controller): If you want to render a template from an entirely different controller from the one that contains the action code, You can accomplish that with ____, which accepts the full path \\(relative to `src/views`\\) of the template to render.\nOptions:\nA) StaticController\nB) watch\nC) Validator::ValidationFailed\nD) render\nReply with the letter of the correct option."}, {"role": "assistant", "content": "D"}]}
{"messages": [{"role": "user", "content": "Choose the correct option to complete this Amber docs statement (The Test Environment): By default every Amber application generates with three environments: ____, `test` and `production`.\nOptions:\nA) --release\nB) index.ecr\nC) development\nD) from\nReply with the letter of the correct option."}, {"role": "assistant", "content": "C"}]}
{"messages": [{"role": "user", "content": "Fill in the blank from the Amber framework docs (Initializers): For example, to initialize a ____ mailer: ```ruby"}, {"role": "assistant", "content": "Quartz"}]}
{"messages": [{"role": "user", "content": "Choose the correct option to complete this Amber docs statement (Hello World): First create a ____ file and add this: Then add a new route in your `config/routes.cr` file:\nOptions:\nA) --back\nB) src/controllers/hello_controller.cr\nC) handle_joined\nD) #errors\nReply with the letter of the correct option."}, {"role": "assistant", "content": "B"}]}
{"messages": [{"role": "user", "content": "In the Amber docs section 'Validation API', complete this statement: ____ Input must be valid otherwise raises an error."}, {"role": "assistant", "content": "The missing term is #validate!."}]}
{"messages": [{"role": "user", "content": "Choose the correct option to complete this Amber docs statement (Find): An object can be retrieved by id using ____ \\(returns `T?`\\) and `find!` \\(returns `T` or raise `RecordNotFound` exception\\) methods.\nOptions:\nA) chat_room:\nB) .first\nC) find\nD) before_save\nReply with the letter of the correct option."}, {"role": "assistant", "content": "C"}]}
{"messages": [{"role": "user", "content": "Fill in the blank from the Amber framework docs (Rendering Content): In most cases, the ____ method does the heavy lifting of rendering your application's content for use by a browser."}, {"role": "assistant", "content": "Controller::Base#render"}]}
{"messages": [{"role": "user", "content": "Choose the correct option to complete this Amber docs statement (Finding Layouts): To find the current layout, Amber first looks for a file in ____ with the same base name as the controller.\nOptions:\nA) before_save\nB) ./src/controller/api_controller.cr\nC) src/views/layouts\nD) .distinct\nReply with the letter of the correct option."}, {"role": "assistant", "content": "C"}]}
{"messages": [{"role": "user", "content": "In the Amber docs section 'Add Amber dependency', complete this statement: First you require to add the ____ shard dependency in your `shard.yml` file: Then execute `shards install` :"}, {"role": "assistant", "content": "The missing term is amber."}]}
{"messages": [{"role": "user", "content": "Fill in the blank from the Amber framework docs (Eager load): If you are sure that at least one entity in the database satisfies your query, you can call ____."}, {"role": "assistant", "content": ".first!"}]}
{"messages": [{"role": "user", "content": "Fill in the blank from the Amber framework docs (Query DSL): However, some methods can only be used at the end of a chain (such as ____ or `.pluck`)."}, {"role": "assistant", "content": ".first"}]}
{"messages": [{"role": "user", "content": "In the Amber docs section 'Can't build my amber project', complete this statement: Then, ensure to install all development packages for ____ `git`, `yaml`, `libevent`, and `sqlite3`, `postgresql`, or `mysql`."}, {"role": "assistant", "content": "The missing term is openssl."}]}
{"messages": [{"role": "user", "content": "Fill in the blank from the Amber framework docs (The `web` container): You can see the webpack configuration in the ____ directory to see what assets are compiled."}, {"role": "assistant", "content": "config/webpack"}]}
{"messages": [{"role": "user", "content": "In the Amber docs section '1. Generate Blogsy App', complete this statement: The ____ will automatically install project dependencies."}, {"role": "assistant", "content": "The missing term is --deps."}]}