rhales 0.3.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: 9e468b139c203a063276ccd0f890b0b7439a7c4459a96f132ed1e53c01623b11
4
+ data.tar.gz: 786e0f95fa3d592b5451f7538d350f558f31545eb99973f5384bbde2fd474a99
5
+ SHA512:
6
+ metadata.gz: fd02c37df3e02b5e423eeb7a1929ca2393a98ee0c6569724256846cd168ffa5476e4d94e18cbd9fc28149d0f50ff957423fbd1c165fe0e30f83d281e6075ab04
7
+ data.tar.gz: 8b9f7d88831a6e78ae811a56a4fe0c95e1c8962011ebbbcb7927e4cfb6dbcde798f66e4a2998fb89fcf30f356c7d2ca3134548971b3721331aacad6f90e501d5
data/CLAUDE.locale.txt ADDED
@@ -0,0 +1,7 @@
1
+ Our own private local claude notes. Not read by claude or checked in.
2
+
3
+ https://claudelog.com/mechanics/plan-mode
4
+ https://handlebars-lang.github.io/spec/#sec-handlebars-specification-statements
5
+ https://github.com/jeremyevans/rodauth/tree/588b865cf70c7f327f0f24a4e277dfe787a6674f/doc
6
+ https://docs.anthropic.com/en/docs/claude-code/hooks#subagentstop
7
+ https://www.anthropic.com/engineering/claude-code-best-practices
data/CLAUDE.md ADDED
@@ -0,0 +1,90 @@
1
+ # Feature Implementation Guidelines
2
+
3
+ ## Common Commands
4
+ - Use bin/rackup to run the dev server
5
+ - bundle exec rspec spec/rhales/: Run test suite for current changes
6
+ - gem build rhales.gemspec: Build the gem
7
+ - bundle exec rspec spec/rhales/ --format documentation: Run tests with verbose output
8
+ - rake rhales:test: Run Rhales-specific tests
9
+ - rake rhales:validate: Validate template files
10
+ - git worktree add ../feature-name feature-branch: Create parallel workspace
11
+ - gh issue view [number]: Review GitHub issue details
12
+ - gh pr create: Create pull request with context-aware commit message
13
+
14
+ ## Workflow: Feature Implementation
15
+
16
+ ### 1. Research & Planning Phase
17
+ IMPORTANT: Always research and plan before coding. Use "think" or "think hard" for complex features.
18
+
19
+ - Read relevant files and documentation WITHOUT writing code yet
20
+ - Understand the two-layer data system (app, props)
21
+ - Review adapter interfaces and dependency injection patterns
22
+ - Create implementation plan in markdown file or GitHub issue
23
+ - Document security implications and edge cases
24
+
25
+ ### 2. Implementation Phase
26
+ Follow test-driven development when possible:
27
+
28
+ 1. Write RSpec tests first (mark with "TDD - no implementation yet")
29
+ 2. Confirm tests fail appropriately
30
+ 3. Commit tests
31
+ 4. Implement code to pass tests WITHOUT modifying tests
32
+ 5. Ensure no global state dependencies (OT.conf references)
33
+ 6. Verify HTML escaping and security measures
34
+ 7. Commit implementation
35
+
36
+ ### 3. Validation & Review
37
+ - Run full test suite: `bundle exec rspec spec/rhales/`
38
+ - Check for any global configuration usage
39
+ - Update README.md and CHANGELOG.md with changes
40
+ - Verify YARD documentation is complete
41
+ - Use `gh` to create descriptive pull request
42
+ - Address review comments in separate commits
43
+
44
+ ## Code Style
45
+ - CRITICAL: Make MINIMAL changes to existing patterns
46
+ - Preserve existing naming conventions and file organization
47
+ - Use existing utility functions - avoid duplication
48
+ - Use dependency injection over global state
49
+ - Maintain adapter interface compliance
50
+ - Keep context objects immutable
51
+ - Ensure proper HTML escaping in templates
52
+
53
+ ## Multi-Task Guidelines
54
+ For complex features requiring parallel work:
55
+ - Use git worktrees for independent components
56
+ - Keep adapter changes separate from core changes
57
+ - Use /clear between unrelated tasks to optimize context
58
+ - Document progress in CHANGELOG.md
59
+
60
+ ## Project-Specific Notes
61
+
62
+ ### Core Components to Consider
63
+ - **Configuration**: Block-based configuration with validation
64
+ - **Context**: Three-layer system with dot-notation access
65
+ - **Parsers**: Two manual recursive descent parsers, for .rue files and handlebars templates
66
+ - **Parser**: .rue file parsing with manual recursive descent
67
+ - **Rhales**: Handlebars-style template engine
68
+ - **Hydrator**: Client-side data injection with CSP support
69
+ - **Adapters**: Pluggable auth and session interfaces
70
+
71
+
72
+ ### Key File Locations
73
+ - **Core Logic**: `lib/rhales/`
74
+ - **Main Entry Point**: `lib/rhales.rb`
75
+ - **Unit & Integration Tests**: `spec/rhales/`
76
+ - **Gem Specification**: `rhales.gemspec`
77
+ - **Rake Tasks**: `Rakefile`
78
+
79
+ ### Key Patterns
80
+ - **Template Syntax**: Uses Handlebars-style syntax (e.g., `{{variable}}`, `{{#if condition}}...{{/if}}`, `{{> partial_name}}`)
81
+ - **Data Hydration**: Uses a `<data>` block in `.rue` files to define a JSON object for client-side hydration, which supports variable interpolation
82
+ - **Security**: Default HTML escaping, CSP nonce support for scripts, and CSRF token handling are built-in
83
+ - **Configuration**: All configuration is handled via an injected `Configuration` object, avoiding global state
84
+
85
+ ### Testing Patterns
86
+ - Mock adapters for auth/session testing
87
+ - Use fixtures in `spec/fixtures/templates/`
88
+ - Test all three context layers independently
89
+ - Verify template caching behavior
90
+ - Check false/nil handling explicitly
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-2025 Delano Mandelbaum
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.