question_kit 0.1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 37b2cc86be99b7513693957fd7e67cd9f19209c47ab31678836acfc0a8332661
4
+ data.tar.gz: 882bc674404e1cf01084da328595a14a0deff0096c96a775648ba97e54960d7a
5
+ SHA512:
6
+ metadata.gz: f51ba58ee9eafbeaa9faa1539f617c5bbddb09bf0248a35462537323f5fda0131968c725ec4f867de5f671ee472443067dce5b3ac2b4085cc6f076ee6dd69a46
7
+ data.tar.gz: c7be35b2bbe19282322aa576353a6a7ee50f3f1479b42e787e1688f3884d220d01812a2bec116446bc655262346642bb4236c910dd39da2826a1666b9f9eab83
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright TODO: Write your name
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,2 @@
1
+ # question_kit
2
+ Shared question and game layer between easy_flow and alembic
data/Rakefile ADDED
@@ -0,0 +1,5 @@
1
+ require "bundler/setup"
2
+
3
+ require "bundler/gem_tasks"
4
+
5
+ require "the_local/rake"
@@ -0,0 +1,4 @@
1
+ module QuestionKit
2
+ class Railtie < ::Rails::Railtie
3
+ end
4
+ end
@@ -0,0 +1,3 @@
1
+ module QuestionKit
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,7 @@
1
+ require "easy_flow"
2
+ require "question_kit/version"
3
+ require "question_kit/railtie"
4
+
5
+ module QuestionKit
6
+ # Your code goes here...
7
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :question_kit do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: question_kit-develop
3
+ description: Use PROACTIVELY for reading which question_kit version a host app has loaded, and for checking that version before code relies on a question_kit release — MUST BE USED instead of reading Gem.loaded_specs, parsing Gemfile.lock, or comparing version strings by hand.
4
+ tools: Bash, Read, Write, Edit, Grep
5
+ scope: shared question and answer rules for easy_flow quizzes — what an answer to a question step is worth, which answers are right, and how a quiz is built
6
+ ---
7
+
8
+ This local writes host app code against question_kit's declared interface only, and follows these steps exactly.
9
+
10
+ ## What question_kit is
11
+
12
+ A Rails gem for apps that run quizzes as easy_flow flows, meant to hold the rules those apps share: what an answer to a question step is worth, which answers are right, and how a quiz is built. Today its only code-facing interface is its version constant. Use this local when host app code needs to know which question_kit release is loaded. Building the quiz flow, its question steps, runs and answers belongs to the easy_flow locals.
13
+
14
+ ## Interface
15
+
16
+ - `QuestionKit::VERSION` — a string such as `"0.1.0"` naming the question_kit release loaded in the host app.
17
+
18
+ ## How to use it
19
+
20
+ 1. Confirm question_kit is in the host app's `Gemfile.lock`. If it is not, hand the work to `question_kit-install` and stop.
21
+ 2. In the file that reads the version, require the gem explicitly at the top:
22
+
23
+ ```ruby
24
+ require "question_kit"
25
+ ```
26
+
27
+ This also loads easy_flow, so no separate `require "easy_flow"` is needed.
28
+ 3. Read the version where it is needed:
29
+
30
+ ```ruby
31
+ QuestionKit::VERSION
32
+ ```
33
+
34
+ 4. When code depends on a release, compare with `Gem::Version`, never with string comparison:
35
+
36
+ ```ruby
37
+ Gem::Version.new(QuestionKit::VERSION) >= Gem::Version.new("0.2.0")
38
+ ```
39
+
40
+ 5. Ask the developer what the app does when the loaded version is older than the one its code needs: raise at boot, log a warning, or skip the feature. Do not pick one.
41
+ 6. If the check runs at boot, put it in an initializer under `config/initializers/` in the host app. Otherwise put it beside the code that depends on the release.
42
+ 7. Write a test in the host app that asserts the app's own behaviour for each branch of the check, and run it.
43
+
44
+ ## Conventions
45
+
46
+ - Never hard-code the version string in host app code. Read `QuestionKit::VERSION`.
47
+ - Never assign to or redefine `QuestionKit::VERSION`.
48
+ - question_kit has no scoring, right-answer or quiz-building methods yet. Do not invent calls for them. If the developer asks for that behaviour, say the gem does not offer it and ask whether to build it in the host app or wait for question_kit to add it.
49
+ - Adding the gem, and upgrading it, belongs to `question_kit-install`.
50
+ - Flows, step types, runs and answers belong to the easy_flow locals.
@@ -0,0 +1,49 @@
1
+ ---
2
+ name: question_kit-info
3
+ description: Use to learn what question_kit offers — shared rules for easy_flow quizzes, covering what an answer to a question step is worth, which answers are right, and how a quiz is built.
4
+ tools: Read
5
+ scope: shared question and answer rules for easy_flow quizzes — what an answer to a question step is worth, which answers are right, and how a quiz is built
6
+ ---
7
+
8
+ This local explains question_kit and makes no changes.
9
+
10
+ ## What question_kit is
11
+
12
+ question_kit is a Rails gem for apps that run quizzes as easy_flow flows. Each
13
+ quiz question is an easy_flow question step. The gem is meant to hold the rules
14
+ those apps share: what an answer to a question step is worth, which answers are
15
+ right, and how a quiz is built. With the rules in one gem, each app does not
16
+ keep its own copy.
17
+
18
+ Today the gem holds none of those rules yet. It loads easy_flow into the host
19
+ app and reports its own version, and nothing more. Reach for it when an app
20
+ runs easy_flow quizzes and should follow the shared rules as they are added.
21
+ Until then, it is only a dependency to put in place.
22
+
23
+ ## Interface
24
+
25
+ This local documents no commands. The other two locals cover everything the
26
+ gem exposes:
27
+
28
+ - The install local, `question_kit-install`, adds the gem to a host app.
29
+ - The develop local, `question_kit-develop`, covers the code a host app writes against the gem.
30
+
31
+ Anything about building or running the flows themselves, such as the canvas,
32
+ step types, runs and answers, belongs to easy_flow. The easy_flow locals cover
33
+ that.
34
+
35
+ ## How to use it
36
+
37
+ - To add question_kit to an app, use `question_kit-install`.
38
+ - To write code that uses question_kit, use `question_kit-develop`.
39
+ - To build the quiz flow or a question step, use the easy_flow locals.
40
+
41
+ ## Conventions
42
+
43
+ - **Quiz** — an easy_flow flow whose steps ask the visitor questions.
44
+ - **Question step** — one easy_flow step that asks one question and records the
45
+ visitor's answer.
46
+ - **Worth** — what an answer is worth toward the quiz's result.
47
+ - **Right answer** — an answer the quiz counts as correct for its question.
48
+ - **Host app** — the Rails app that installs question_kit and easy_flow and runs
49
+ the quizzes.
@@ -0,0 +1,44 @@
1
+ ---
2
+ name: question_kit-install
3
+ description: Use to hook question_kit into a project — adding the gem to the host app's Gemfile and installing it alongside easy_flow.
4
+ tools: Bash, Read, Edit
5
+ scope: shared question and answer rules for easy_flow quizzes — what an answer to a question step is worth, which answers are right, and how a quiz is built
6
+ ---
7
+
8
+ This local follows these steps exactly and invents none.
9
+
10
+ ## What question_kit is
11
+
12
+ A Rails gem holding the shared quiz rules for apps that run quizzes as easy_flow flows, hooked in when a host app runs easy_flow quizzes.
13
+
14
+ ## Interface
15
+
16
+ - `gem "question_kit"` — the Gemfile line that adds question_kit, and with it easy_flow, to the host app.
17
+
18
+ ## How to use it
19
+
20
+ 1. Check the host app's Rails version in `Gemfile.lock`. question_kit needs Rails 8.1.3 or later, so stop and tell the developer if the app is older.
21
+ 2. Check `Gemfile.lock` for easy_flow. question_kit needs easy_flow 0.35 or a later 0.x release. If the app pins an easy_flow version outside that range, ask the developer whether to move the pin before going on.
22
+ 3. Add the gem to the host app's `Gemfile`:
23
+
24
+ ```ruby
25
+ gem "question_kit"
26
+ ```
27
+
28
+ 4. Run:
29
+
30
+ ```
31
+ bundle install
32
+ ```
33
+
34
+ This edits `Gemfile.lock` and brings in easy_flow if the app did not have it.
35
+ 5. Check whether easy_flow is already hooked into the app: its migrations copied and run, its engine mounted, and its hosts declared. If any of that is missing, hand the work to `easy_flow-install`, and ask the developer which hosts to declare rather than picking them.
36
+
37
+ question_kit has no generator, no initializer, no migrations and no routes of its own. Requiring the gem loads easy_flow, so the host app needs no separate `require "easy_flow"`.
38
+
39
+ ## Conventions
40
+
41
+ - After install, run `bundle list | grep -E "question_kit|easy_flow"` and confirm both gems are listed.
42
+ - After a `bundle update question_kit`, check `Gemfile.lock` again for the easy_flow version it brought in, and run `easy_flow-install` for any new easy_flow migrations.
43
+ - Setting up easy_flow itself, its hosts, step types and admin pages belongs to `easy_flow-install`.
44
+ - Writing code against question_kit belongs to `question_kit-develop`.
@@ -0,0 +1,12 @@
1
+ scope: shared question and answer rules for easy_flow quizzes — what an answer to a question step is worth, which answers are right, and how a quiz is built
2
+
3
+ install:
4
+ - gem "question_kit"
5
+
6
+ develop:
7
+ - QuestionKit::VERSION
8
+
9
+ sources:
10
+ - question_kit.gemspec
11
+ - lib/question_kit.rb
12
+ - lib/question_kit/version.rb
metadata ADDED
@@ -0,0 +1,86 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: question_kit
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - tylercschneider
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2026-11-10 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 8.1.3
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 8.1.3
27
+ - !ruby/object:Gem::Dependency
28
+ name: easy_flow
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.35'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.35'
41
+ description: QuestionKit holds the rules for what an answer to an easy_flow question
42
+ step is worth, which answers are right, and how a quiz is built, so apps share them
43
+ rather than each keeping a copy.
44
+ email:
45
+ - tylercschneider@gmail.com
46
+ executables: []
47
+ extensions: []
48
+ extra_rdoc_files: []
49
+ files:
50
+ - MIT-LICENSE
51
+ - README.md
52
+ - Rakefile
53
+ - lib/question_kit.rb
54
+ - lib/question_kit/railtie.rb
55
+ - lib/question_kit/version.rb
56
+ - lib/tasks/question_kit_tasks.rake
57
+ - the_local/agents/question_kit-develop.md
58
+ - the_local/agents/question_kit-info.md
59
+ - the_local/agents/question_kit-install.md
60
+ - the_local/interface.yml
61
+ homepage: https://github.com/DYB-Development/question_kit
62
+ licenses:
63
+ - MIT
64
+ metadata:
65
+ homepage_uri: https://github.com/DYB-Development/question_kit
66
+ source_code_uri: https://github.com/DYB-Development/question_kit
67
+ post_install_message:
68
+ rdoc_options: []
69
+ require_paths:
70
+ - lib
71
+ required_ruby_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ required_rubygems_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ requirements: []
82
+ rubygems_version: 3.5.16
83
+ signing_key:
84
+ specification_version: 4
85
+ summary: Shared question and answer rules for apps that run easy_flow quizzes.
86
+ test_files: []