rails_map 1.1.1 → 1.2.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 +4 -4
- data/.vscode/settings.json +2 -0
- data/AUTHENTICATION.md +10 -6
- data/CHANGELOG.md +28 -2
- data/CODE_OF_CONDUCT.md +129 -0
- data/CONTRIBUTING.md +211 -0
- data/QUICKSTART.md +16 -3
- data/README.md +12 -6
- data/RELEASE_QUICK_REFERENCE.md +114 -0
- data/RELEASE_SCRIPT_GUIDE.md +405 -0
- data/RUBYGEMS_IMPROVEMENTS.md +297 -0
- data/SECURITY.md +162 -0
- data/URL_CHANGE_SUMMARY.md +150 -0
- data/docs/index.html +1564 -1275
- data/lib/generators/rails_map/install_generator.rb +1 -1
- data/lib/generators/rails_map/templates/README +14 -12
- data/lib/rails_map/version.rb +1 -1
- data/release.sh +338 -0
- metadata +45 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 48342f6fbf73d56fd547dfd0565604fc58165a331b4890d2e22c4abc31838498
|
|
4
|
+
data.tar.gz: 32163fbc27d52a6615d639008f38dada8f16c64da83e80c8679b899db6003e68
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9d779878c8463a756d8817102cacb2c8c2f494f41247893aad4e450be8fd3a6800984d76286e7e701c48247e3ec2e12498ef8df2e06c01f88fd7c6c3f64bec47
|
|
7
|
+
data.tar.gz: 3d01c86330c56e2fd4d3b620d69ad1e068749ad3c1e1d3105cee1b2f4d5d2478bf765ffdb016aab08f205dbc4f394ea464dcb894962adf2feb1611eb068ffb43
|
data/AUTHENTICATION.md
CHANGED
|
@@ -9,7 +9,7 @@ This guide shows you how to protect your Rails documentation with authentication
|
|
|
9
9
|
In your `config/routes.rb`:
|
|
10
10
|
|
|
11
11
|
```ruby
|
|
12
|
-
mount RailsMap::Engine, at: '/
|
|
12
|
+
mount RailsMap::Engine, at: '/rails-map'
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
### 2. Create Configuration File
|
|
@@ -20,7 +20,7 @@ Create `config/initializers/rails_map.rb` in your Rails application:
|
|
|
20
20
|
RailsMap.configure do |config|
|
|
21
21
|
config.app_name = 'Your App Name'
|
|
22
22
|
config.theme_color = '#3B82F6'
|
|
23
|
-
|
|
23
|
+
|
|
24
24
|
# Add authentication
|
|
25
25
|
config.authenticate_with = proc {
|
|
26
26
|
# Your authentication logic here
|
|
@@ -37,12 +37,14 @@ If you don't use Devise, use the built-in authentication system.
|
|
|
37
37
|
**Setup:**
|
|
38
38
|
|
|
39
39
|
1. Install with authentication:
|
|
40
|
+
|
|
40
41
|
```bash
|
|
41
42
|
rails g rails_map:install
|
|
42
43
|
rails db:migrate
|
|
43
44
|
```
|
|
44
45
|
|
|
45
46
|
2. Create admin user(s):
|
|
47
|
+
|
|
46
48
|
```bash
|
|
47
49
|
rails c
|
|
48
50
|
RailsMap::User.create!(username: 'admin', password: 'your_secure_password')
|
|
@@ -50,13 +52,14 @@ RailsMap::User.create!(username: 'developer', password: 'another_password')
|
|
|
50
52
|
```
|
|
51
53
|
|
|
52
54
|
3. Enable in configuration:
|
|
55
|
+
|
|
53
56
|
```ruby
|
|
54
57
|
config.authenticate_with = proc {
|
|
55
58
|
RailsMap::Auth.authenticate(self)
|
|
56
59
|
}
|
|
57
60
|
```
|
|
58
61
|
|
|
59
|
-
4. Restart server and visit `/
|
|
62
|
+
4. Restart server and visit `/rails-map` - you'll be prompted for username/password
|
|
60
63
|
|
|
61
64
|
**Managing Users:**
|
|
62
65
|
|
|
@@ -141,7 +144,7 @@ config.authenticate_with = proc {
|
|
|
141
144
|
redirect_to login_path
|
|
142
145
|
return
|
|
143
146
|
end
|
|
144
|
-
|
|
147
|
+
|
|
145
148
|
# Check user role
|
|
146
149
|
unless current_user&.has_role?(:developer)
|
|
147
150
|
render plain: 'Unauthorized', status: :unauthorized
|
|
@@ -156,7 +159,7 @@ Restrict by IP address:
|
|
|
156
159
|
```ruby
|
|
157
160
|
config.authenticate_with = proc {
|
|
158
161
|
allowed_ips = ['127.0.0.1', '::1', '10.0.0.0/8']
|
|
159
|
-
|
|
162
|
+
|
|
160
163
|
unless allowed_ips.any? { |ip| IPAddr.new(ip).include?(request.remote_ip) }
|
|
161
164
|
render plain: 'Forbidden', status: :forbidden
|
|
162
165
|
end
|
|
@@ -168,7 +171,7 @@ config.authenticate_with = proc {
|
|
|
168
171
|
After configuring authentication:
|
|
169
172
|
|
|
170
173
|
1. Restart your Rails server
|
|
171
|
-
2. Visit `http://localhost:3000/
|
|
174
|
+
2. Visit `http://localhost:3000/rails-map`
|
|
172
175
|
3. You should be prompted to authenticate
|
|
173
176
|
|
|
174
177
|
## No Authentication (Development Only)
|
|
@@ -210,6 +213,7 @@ config.authenticate_with = proc {
|
|
|
210
213
|
### Helper Methods Not Available
|
|
211
214
|
|
|
212
215
|
The authentication block runs in the controller context, so you have access to:
|
|
216
|
+
|
|
213
217
|
- `request`
|
|
214
218
|
- `session`
|
|
215
219
|
- `cookies`
|
data/CHANGELOG.md
CHANGED
|
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
-
## [1.
|
|
8
|
+
## [1.2.0] - 2026-02-12
|
|
9
9
|
|
|
10
10
|
### Added
|
|
11
11
|
|
|
@@ -22,18 +22,44 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
22
22
|
- Support for simple permit pattern (`params.permit()`)
|
|
23
23
|
- Support for direct parameter access pattern (`params[:key]`)
|
|
24
24
|
- Parameter documentation in both live and static HTML documentation
|
|
25
|
+
- Enhanced release script with interactive version management
|
|
26
|
+
- Automatic version and CHANGELOG updates in release script
|
|
27
|
+
- Rollback support in release script if push fails
|
|
28
|
+
- Comprehensive community health files (CODE_OF_CONDUCT.md, CONTRIBUTING.md, SECURITY.md)
|
|
29
|
+
- GitHub issue and PR templates
|
|
30
|
+
- CI/CD workflow for automated testing across Ruby 2.7-3.3 and Rails 6.0-7.1
|
|
31
|
+
- Enhanced gemspec with detailed description and post-install message
|
|
32
|
+
- README badges for gem version, downloads, license, Ruby, and Rails versions
|
|
25
33
|
|
|
26
34
|
### Changed
|
|
27
35
|
|
|
36
|
+
- **BREAKING:** Default mount path changed from `/api-doc` to `/rails-map` for better branding
|
|
28
37
|
- Routes page now displays "Parameters" column instead of "Route Name" column
|
|
29
38
|
- Controller page now displays "Parameters" column instead of "Constraints" column
|
|
30
39
|
- Enhanced user experience with expandable parameter details
|
|
40
|
+
- Improved gemspec metadata with additional URIs (wiki, funding, documentation)
|
|
41
|
+
- Better Rails dependency specification (>= 5.0, < 8.0)
|
|
42
|
+
|
|
43
|
+
### Migration Guide
|
|
44
|
+
|
|
45
|
+
If upgrading from v1.1.x, update your routes file:
|
|
46
|
+
|
|
47
|
+
```ruby
|
|
48
|
+
# config/routes.rb
|
|
49
|
+
# Old:
|
|
50
|
+
mount RailsMap::Engine, at: '/api-doc'
|
|
51
|
+
|
|
52
|
+
# New:
|
|
53
|
+
mount RailsMap::Engine, at: '/rails-map'
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Then visit `http://localhost:3000/rails-map` instead of `/api-doc`.
|
|
31
57
|
|
|
32
58
|
## [1.1.0] - 2026-02-10
|
|
33
59
|
|
|
34
60
|
### Added
|
|
35
61
|
|
|
36
|
-
- Live documentation via Rails Engine mounting at `/
|
|
62
|
+
- Live documentation via Rails Engine mounting at `/rails-map`
|
|
37
63
|
- Built-in authentication system (no Devise required) with `RailsMap::User` model
|
|
38
64
|
- Generator for easy installation: `rails g rails_map:install [--skip-auth]`
|
|
39
65
|
- Authentication enabled by default for security
|
data/CODE_OF_CONDUCT.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity
|
|
10
|
+
and orientation.
|
|
11
|
+
|
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
+
diverse, inclusive, and healthy community.
|
|
14
|
+
|
|
15
|
+
## Our Standards
|
|
16
|
+
|
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
|
18
|
+
community include:
|
|
19
|
+
|
|
20
|
+
- Demonstrating empathy and kindness toward other people
|
|
21
|
+
- Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
+
- Giving and gracefully accepting constructive feedback
|
|
23
|
+
- Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
|
+
and learning from the experience
|
|
25
|
+
- Focusing on what is best not just for us as individuals, but for the
|
|
26
|
+
overall community
|
|
27
|
+
|
|
28
|
+
Examples of unacceptable behavior include:
|
|
29
|
+
|
|
30
|
+
- The use of sexualized language or imagery, and sexual attention or
|
|
31
|
+
advances of any kind
|
|
32
|
+
- Trolling, insulting or derogatory comments, and personal or political attacks
|
|
33
|
+
- Public or private harassment
|
|
34
|
+
- Publishing others' private information, such as a physical or email
|
|
35
|
+
address, without their explicit permission
|
|
36
|
+
- Other conduct which could reasonably be considered inappropriate in a
|
|
37
|
+
professional setting
|
|
38
|
+
|
|
39
|
+
## Enforcement Responsibilities
|
|
40
|
+
|
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
|
42
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
44
|
+
or harmful.
|
|
45
|
+
|
|
46
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
|
47
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
48
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
49
|
+
decisions when appropriate.
|
|
50
|
+
|
|
51
|
+
## Scope
|
|
52
|
+
|
|
53
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
|
54
|
+
an individual is officially representing the community in public spaces.
|
|
55
|
+
Examples of representing our community include using an official e-mail address,
|
|
56
|
+
posting via an official social media account, or acting as an appointed
|
|
57
|
+
representative at an online or offline event.
|
|
58
|
+
|
|
59
|
+
## Enforcement
|
|
60
|
+
|
|
61
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
62
|
+
reported to the community leaders responsible for enforcement at
|
|
63
|
+
arsh199820@gmail.com.
|
|
64
|
+
|
|
65
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
|
66
|
+
|
|
67
|
+
All community leaders are obligated to respect the privacy and security of the
|
|
68
|
+
reporter of any incident.
|
|
69
|
+
|
|
70
|
+
## Enforcement Guidelines
|
|
71
|
+
|
|
72
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
|
73
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
|
74
|
+
|
|
75
|
+
### 1. Correction
|
|
76
|
+
|
|
77
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
78
|
+
unprofessional or unwelcome in the community.
|
|
79
|
+
|
|
80
|
+
**Consequence**: A private, written warning from community leaders, providing
|
|
81
|
+
clarity around the nature of the violation and an explanation of why the
|
|
82
|
+
behavior was inappropriate. A public apology may be requested.
|
|
83
|
+
|
|
84
|
+
### 2. Warning
|
|
85
|
+
|
|
86
|
+
**Community Impact**: A violation through a single incident or series
|
|
87
|
+
of actions.
|
|
88
|
+
|
|
89
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
|
90
|
+
interaction with the people involved, including unsolicited interaction with
|
|
91
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
|
92
|
+
includes avoiding interactions in community spaces as well as external channels
|
|
93
|
+
like social media. Violating these terms may lead to a temporary or
|
|
94
|
+
permanent ban.
|
|
95
|
+
|
|
96
|
+
### 3. Temporary Ban
|
|
97
|
+
|
|
98
|
+
**Community Impact**: A serious violation of community standards, including
|
|
99
|
+
sustained inappropriate behavior.
|
|
100
|
+
|
|
101
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
|
102
|
+
communication with the community for a specified period of time. No public or
|
|
103
|
+
private interaction with the people involved, including unsolicited interaction
|
|
104
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
|
105
|
+
Violating these terms may lead to a permanent ban.
|
|
106
|
+
|
|
107
|
+
### 4. Permanent Ban
|
|
108
|
+
|
|
109
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
|
110
|
+
standards, including sustained inappropriate behavior, harassment of an
|
|
111
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
|
112
|
+
|
|
113
|
+
**Consequence**: A permanent ban from any sort of public interaction within
|
|
114
|
+
the community.
|
|
115
|
+
|
|
116
|
+
## Attribution
|
|
117
|
+
|
|
118
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
119
|
+
version 2.0, available at
|
|
120
|
+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
|
121
|
+
|
|
122
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
|
123
|
+
enforcement ladder](https://github.com/mozilla/diversity).
|
|
124
|
+
|
|
125
|
+
[homepage]: https://www.contributor-covenant.org
|
|
126
|
+
|
|
127
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
|
128
|
+
https://www.contributor-covenant.org/faq. Translations are available at
|
|
129
|
+
https://www.contributor-covenant.org/translations.
|
data/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# Contributing to RailsMap
|
|
2
|
+
|
|
3
|
+
First off, thank you for considering contributing to RailsMap! 🎉
|
|
4
|
+
|
|
5
|
+
It's people like you that make RailsMap such a great tool for the Rails community.
|
|
6
|
+
|
|
7
|
+
## Table of Contents
|
|
8
|
+
|
|
9
|
+
- [Code of Conduct](#code-of-conduct)
|
|
10
|
+
- [How Can I Contribute?](#how-can-i-contribute)
|
|
11
|
+
- [Development Setup](#development-setup)
|
|
12
|
+
- [Pull Request Process](#pull-request-process)
|
|
13
|
+
- [Style Guidelines](#style-guidelines)
|
|
14
|
+
- [Reporting Bugs](#reporting-bugs)
|
|
15
|
+
- [Suggesting Enhancements](#suggesting-enhancements)
|
|
16
|
+
|
|
17
|
+
## Code of Conduct
|
|
18
|
+
|
|
19
|
+
This project and everyone participating in it is governed by our [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
|
|
20
|
+
|
|
21
|
+
## How Can I Contribute?
|
|
22
|
+
|
|
23
|
+
### Reporting Bugs
|
|
24
|
+
|
|
25
|
+
Before creating bug reports, please check the [issue tracker](https://github.com/ArshdeepGrover/rails-map/issues) as you might find out that you don't need to create one. When you are creating a bug report, please include as many details as possible:
|
|
26
|
+
|
|
27
|
+
- **Use a clear and descriptive title**
|
|
28
|
+
- **Describe the exact steps to reproduce the problem**
|
|
29
|
+
- **Provide specific examples to demonstrate the steps**
|
|
30
|
+
- **Describe the behavior you observed and what behavior you expected**
|
|
31
|
+
- **Include screenshots if relevant**
|
|
32
|
+
- **Include your environment details:**
|
|
33
|
+
- Rails version
|
|
34
|
+
- Ruby version
|
|
35
|
+
- RailsMap version
|
|
36
|
+
- Operating system
|
|
37
|
+
|
|
38
|
+
### Suggesting Enhancements
|
|
39
|
+
|
|
40
|
+
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, please include:
|
|
41
|
+
|
|
42
|
+
- **Use a clear and descriptive title**
|
|
43
|
+
- **Provide a detailed description of the suggested enhancement**
|
|
44
|
+
- **Explain why this enhancement would be useful**
|
|
45
|
+
- **List any similar features in other tools**
|
|
46
|
+
|
|
47
|
+
### Pull Requests
|
|
48
|
+
|
|
49
|
+
We actively welcome your pull requests:
|
|
50
|
+
|
|
51
|
+
1. Fork the repo and create your branch from `main`
|
|
52
|
+
2. If you've added code that should be tested, add tests
|
|
53
|
+
3. Ensure the test suite passes
|
|
54
|
+
4. Make sure your code follows the existing style
|
|
55
|
+
5. Write a clear commit message
|
|
56
|
+
6. Submit your pull request!
|
|
57
|
+
|
|
58
|
+
## Development Setup
|
|
59
|
+
|
|
60
|
+
1. **Fork and clone the repository**
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
git clone https://github.com/YOUR_USERNAME/rails-map.git
|
|
64
|
+
cd rails-map
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
2. **Install dependencies**
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
bundle install
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
3. **Run tests**
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
bundle exec rake spec
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
4. **Test locally in a Rails app**
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# In your gemfile
|
|
83
|
+
gem 'rails_map', path: '/path/to/your/local/rails-map'
|
|
84
|
+
|
|
85
|
+
# Then
|
|
86
|
+
bundle install
|
|
87
|
+
rails g rails_map:install
|
|
88
|
+
rails server
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Pull Request Process
|
|
92
|
+
|
|
93
|
+
1. **Update documentation** - Update the README.md with details of changes if applicable
|
|
94
|
+
2. **Update CHANGELOG.md** - Add your changes under the "Unreleased" section
|
|
95
|
+
3. **Follow the style guidelines** - Ensure your code follows Ruby and Rails conventions
|
|
96
|
+
4. **Write tests** - Add tests for new features or bug fixes
|
|
97
|
+
5. **Keep commits clean** - Use clear, descriptive commit messages
|
|
98
|
+
6. **One feature per PR** - Keep pull requests focused on a single feature or fix
|
|
99
|
+
|
|
100
|
+
### Commit Message Guidelines
|
|
101
|
+
|
|
102
|
+
- Use the present tense ("Add feature" not "Added feature")
|
|
103
|
+
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
|
|
104
|
+
- Limit the first line to 72 characters or less
|
|
105
|
+
- Reference issues and pull requests liberally after the first line
|
|
106
|
+
|
|
107
|
+
Examples:
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
Add parameter detection for nested routes
|
|
111
|
+
|
|
112
|
+
- Extract nested parameters from controller actions
|
|
113
|
+
- Add tests for nested parameter detection
|
|
114
|
+
- Update documentation
|
|
115
|
+
|
|
116
|
+
Fixes #123
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Style Guidelines
|
|
120
|
+
|
|
121
|
+
### Ruby Style Guide
|
|
122
|
+
|
|
123
|
+
- Follow the [Ruby Style Guide](https://rubystyle.guide/)
|
|
124
|
+
- Use 2 spaces for indentation (no tabs)
|
|
125
|
+
- Keep lines under 120 characters
|
|
126
|
+
- Use meaningful variable and method names
|
|
127
|
+
- Add comments for complex logic
|
|
128
|
+
|
|
129
|
+
### Code Organization
|
|
130
|
+
|
|
131
|
+
- Keep methods small and focused
|
|
132
|
+
- Follow Single Responsibility Principle
|
|
133
|
+
- Use descriptive names for classes and modules
|
|
134
|
+
- Organize code logically within files
|
|
135
|
+
|
|
136
|
+
### Testing
|
|
137
|
+
|
|
138
|
+
- Write tests for new features
|
|
139
|
+
- Ensure existing tests pass
|
|
140
|
+
- Aim for good test coverage
|
|
141
|
+
- Use descriptive test names
|
|
142
|
+
|
|
143
|
+
## Project Structure
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
rails-map/
|
|
147
|
+
├── app/ # Rails engine views and controllers
|
|
148
|
+
│ ├── controllers/
|
|
149
|
+
│ ├── models/
|
|
150
|
+
│ └── views/
|
|
151
|
+
├── lib/ # Core library code
|
|
152
|
+
│ ├── generators/ # Rails generators
|
|
153
|
+
│ ├── rails_map/
|
|
154
|
+
│ │ ├── parsers/ # Route and model parsers
|
|
155
|
+
│ │ └── generators/ # HTML generators
|
|
156
|
+
│ └── rails_map.rb
|
|
157
|
+
├── templates/ # HTML templates
|
|
158
|
+
├── spec/ # Tests
|
|
159
|
+
└── docs/ # Documentation
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Areas for Contribution
|
|
163
|
+
|
|
164
|
+
We especially welcome contributions in these areas:
|
|
165
|
+
|
|
166
|
+
### High Priority
|
|
167
|
+
|
|
168
|
+
- [ ] Additional parameter detection patterns
|
|
169
|
+
- [ ] Support for more Rails versions
|
|
170
|
+
- [ ] Performance improvements
|
|
171
|
+
- [ ] Better error handling
|
|
172
|
+
- [ ] More comprehensive tests
|
|
173
|
+
|
|
174
|
+
### Medium Priority
|
|
175
|
+
|
|
176
|
+
- [ ] Additional themes and customization options
|
|
177
|
+
- [ ] Export to different formats (JSON, Markdown, etc.)
|
|
178
|
+
- [ ] Integration with API documentation tools
|
|
179
|
+
- [ ] Internationalization (i18n)
|
|
180
|
+
|
|
181
|
+
### Nice to Have
|
|
182
|
+
|
|
183
|
+
- [ ] Interactive API testing
|
|
184
|
+
- [ ] Request/response examples
|
|
185
|
+
- [ ] API versioning support
|
|
186
|
+
- [ ] GraphQL support
|
|
187
|
+
- [ ] WebSocket documentation
|
|
188
|
+
|
|
189
|
+
## Questions?
|
|
190
|
+
|
|
191
|
+
Feel free to:
|
|
192
|
+
|
|
193
|
+
- Open an issue with the "question" label
|
|
194
|
+
- Reach out to the maintainers
|
|
195
|
+
- Check existing issues and discussions
|
|
196
|
+
|
|
197
|
+
## Recognition
|
|
198
|
+
|
|
199
|
+
Contributors will be recognized in:
|
|
200
|
+
|
|
201
|
+
- The CHANGELOG.md file
|
|
202
|
+
- GitHub contributors page
|
|
203
|
+
- Project documentation
|
|
204
|
+
|
|
205
|
+
## License
|
|
206
|
+
|
|
207
|
+
By contributing, you agree that your contributions will be licensed under the MIT License.
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
Thank you for contributing to RailsMap! 🚀
|
data/QUICKSTART.md
CHANGED
|
@@ -23,18 +23,21 @@ bundle install
|
|
|
23
23
|
### Default Installation (With Authentication - Recommended)
|
|
24
24
|
|
|
25
25
|
1. Run the generator:
|
|
26
|
+
|
|
26
27
|
```bash
|
|
27
28
|
rails g rails_map:install
|
|
28
29
|
rails db:migrate
|
|
29
30
|
```
|
|
30
31
|
|
|
31
32
|
This automatically:
|
|
33
|
+
|
|
32
34
|
- ✅ Creates `config/initializers/rails_map.rb` with auth enabled
|
|
33
35
|
- ✅ Mounts the engine in `config/routes.rb`
|
|
34
36
|
- ✅ Creates user migration
|
|
35
37
|
- ✅ Adds `/doc/api` to `.gitignore`
|
|
36
38
|
|
|
37
39
|
2. Create an admin user:
|
|
40
|
+
|
|
38
41
|
```bash
|
|
39
42
|
rails c
|
|
40
43
|
RailsMap::User.create!(username: 'admin', password: 'your_secure_password')
|
|
@@ -42,11 +45,12 @@ exit
|
|
|
42
45
|
```
|
|
43
46
|
|
|
44
47
|
3. Start your server:
|
|
48
|
+
|
|
45
49
|
```bash
|
|
46
50
|
rails s
|
|
47
51
|
```
|
|
48
52
|
|
|
49
|
-
4. Visit `http://localhost:3000/
|
|
53
|
+
4. Visit `http://localhost:3000/rails-map` and login with your credentials
|
|
50
54
|
|
|
51
55
|
**That's it!** 🎉 Secure by default!
|
|
52
56
|
|
|
@@ -55,16 +59,18 @@ rails s
|
|
|
55
59
|
### Skip Authentication (Development Only)
|
|
56
60
|
|
|
57
61
|
1. Run the generator with --skip-auth flag:
|
|
62
|
+
|
|
58
63
|
```bash
|
|
59
64
|
rails g rails_map:install --skip-auth
|
|
60
65
|
```
|
|
61
66
|
|
|
62
67
|
2. Start your server:
|
|
68
|
+
|
|
63
69
|
```bash
|
|
64
70
|
rails s
|
|
65
71
|
```
|
|
66
72
|
|
|
67
|
-
3. Visit: `http://localhost:3000/
|
|
73
|
+
3. Visit: `http://localhost:3000/rails-map`
|
|
68
74
|
|
|
69
75
|
**No authentication required!** Use only in development.
|
|
70
76
|
|
|
@@ -95,22 +101,26 @@ config.include_timestamps = false
|
|
|
95
101
|
## Managing Users (Built-in Auth)
|
|
96
102
|
|
|
97
103
|
### Create User
|
|
104
|
+
|
|
98
105
|
```ruby
|
|
99
106
|
RailsMap::User.create!(username: 'developer', password: 'password123')
|
|
100
107
|
```
|
|
101
108
|
|
|
102
109
|
### Change Password
|
|
110
|
+
|
|
103
111
|
```ruby
|
|
104
112
|
user = RailsMap::User.find_by(username: 'developer')
|
|
105
113
|
user.update!(password: 'new_password')
|
|
106
114
|
```
|
|
107
115
|
|
|
108
116
|
### Delete User
|
|
117
|
+
|
|
109
118
|
```ruby
|
|
110
119
|
RailsMap::User.find_by(username: 'developer').destroy
|
|
111
120
|
```
|
|
112
121
|
|
|
113
122
|
### List All Users
|
|
123
|
+
|
|
114
124
|
```ruby
|
|
115
125
|
RailsMap::User.all.pluck(:username)
|
|
116
126
|
```
|
|
@@ -129,16 +139,19 @@ Files are generated in `doc/api/` by default.
|
|
|
129
139
|
|
|
130
140
|
## Troubleshooting
|
|
131
141
|
|
|
132
|
-
### Can't access /
|
|
142
|
+
### Can't access /rails-map
|
|
143
|
+
|
|
133
144
|
- Make sure you've mounted the engine in `config/routes.rb`
|
|
134
145
|
- Restart your Rails server
|
|
135
146
|
|
|
136
147
|
### Authentication not working
|
|
148
|
+
|
|
137
149
|
- Verify you've run migrations: `rails db:migrate`
|
|
138
150
|
- Check that you've created a user
|
|
139
151
|
- Ensure authentication is enabled in the initializer
|
|
140
152
|
|
|
141
153
|
### Controllers with slashes not showing
|
|
154
|
+
|
|
142
155
|
- Update the gem to the latest version
|
|
143
156
|
- The route constraint issue has been fixed
|
|
144
157
|
|
data/README.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Rails Map
|
|
2
2
|
|
|
3
|
+
[](https://badge.fury.io/rb/rails_map)
|
|
4
|
+
[](https://rubygems.org/gems/rails_map)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://www.ruby-lang.org)
|
|
7
|
+
[](https://rubyonrails.org)
|
|
8
|
+
|
|
3
9
|
🌐 **[Homepage](https://rails-map.netlify.app)** | 📦 **[RubyGems](https://rubygems.org/gems/rails_map)** | 🐙 **[GitHub](https://github.com/ArshdeepGrover/rails-map)**
|
|
4
10
|
|
|
5
11
|
Automatically generates interactive API documentation for Rails by mapping routes, controllers, and models. Zero configuration—just install and go.
|
|
@@ -47,11 +53,11 @@ RAILS_MAP_PASSWORD=your_secure_password
|
|
|
47
53
|
This automatically:
|
|
48
54
|
|
|
49
55
|
- ✅ Creates `config/initializers/rails_map.rb` with authentication enabled
|
|
50
|
-
- ✅ Mounts the engine at `/
|
|
56
|
+
- ✅ Mounts the engine at `/rails-map`
|
|
51
57
|
- ✅ Adds `/doc/api` to `.gitignore`
|
|
52
58
|
- ✅ Uses default credentials (admin/password) if ENV variables not set
|
|
53
59
|
|
|
54
|
-
Start your server and visit `http://localhost:3000/
|
|
60
|
+
Start your server and visit `http://localhost:3000/rails-map` - you'll be prompted to login!
|
|
55
61
|
|
|
56
62
|
### Setup Without Authentication
|
|
57
63
|
|
|
@@ -64,10 +70,10 @@ rails g rails_map:install --skip-auth
|
|
|
64
70
|
This will:
|
|
65
71
|
|
|
66
72
|
- ✅ Create the configuration file (auth disabled)
|
|
67
|
-
- ✅ Mount the engine at `/
|
|
73
|
+
- ✅ Mount the engine at `/rails-map`
|
|
68
74
|
- ✅ Add `/doc/api` to `.gitignore`
|
|
69
75
|
|
|
70
|
-
Start your server and visit `/
|
|
76
|
+
Start your server and visit `/rails-map` - no login required!
|
|
71
77
|
|
|
72
78
|
## Usage
|
|
73
79
|
|
|
@@ -76,10 +82,10 @@ Start your server and visit `/api-doc` - no login required!
|
|
|
76
82
|
Mount the engine in your `config/routes.rb`:
|
|
77
83
|
|
|
78
84
|
```ruby
|
|
79
|
-
mount RailsMap::Engine, at: '/
|
|
85
|
+
mount RailsMap::Engine, at: '/rails-map'
|
|
80
86
|
```
|
|
81
87
|
|
|
82
|
-
Then visit `http://localhost:3000/
|
|
88
|
+
Then visit `http://localhost:3000/rails-map` in your browser to see live documentation.
|
|
83
89
|
|
|
84
90
|
### Static HTML Generation
|
|
85
91
|
|