readme_generator 1.0.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: 67b444019cd2d5154e470c0c3bca6d9ce3b1fe2e600dadb2f250dfdbf92ead2b
4
+ data.tar.gz: 2d4ee26f78c6ee16f79c8e85599893d8bb32ea1b1b3a6f26788f1418cb26b199
5
+ SHA512:
6
+ metadata.gz: 8e59c543b7bb53c87ee5d6511802f59cec3a854cb4ec3e42af5f1c947763fe8cd984ef58e35d1a85fe77296870127a10177115a36580e09354b0cdd3938d427c
7
+ data.tar.gz: 58d9669d8e49c0e559754f008752fc1393560981a512cbb8db01e5aa241e0eb52e962a218fd8363bfc6afc59b6e16ae4e3caf127d4b0085d30b0891d04b1bcfc
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Saud M.
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.
data/README.md ADDED
@@ -0,0 +1,62 @@
1
+ # README Generator
2
+
3
+ An intelligent Ruby CLI tool that analyzes your projects and generates comprehensive README.md files automatically.
4
+
5
+ ## Features
6
+
7
+ - **Smart Project Analysis**: Automatically detects project type (React, Next.js, Node.js, Python, etc.)
8
+ - **Package.json Parsing**: Extracts dependencies, scripts, author, and project metadata
9
+ - **Intelligent Template Selection**: Chooses optimal README template based on project structure
10
+ - **Multi-Framework Support**: Supports React, Next.js, Vue.js, Node.js, Python, Ruby, and more
11
+
12
+ ## Technical Implementation
13
+
14
+ - **JSON Processing**: Advanced parsing with error handling and data validation
15
+ - **File System Operations**: Efficient file I/O and path manipulation
16
+ - **Data Structures**: Complex hash manipulation and merging strategies
17
+ - **Template Engine**: Dynamic content generation using ERB templating
18
+ - **Error Management**: Robust exception handling with graceful fallbacks
19
+
20
+ ## Installation
21
+
22
+ ### Clone and Build
23
+ ```bash
24
+ git clone https://github.com/saud06/readme-generator.git
25
+ cd readme-generator
26
+ gem build readme_generator.gemspec
27
+ ```
28
+
29
+ ### macOS
30
+ ```bash
31
+ gem install ./readme_generator-1.0.0.gem
32
+ ```
33
+
34
+ ### Linux
35
+ ```bash
36
+ gem install --user-install ./readme_generator-1.0.0.gem
37
+ echo 'export PATH="$HOME/.gem/ruby/2.6.0/bin:$PATH"' >> ~/.bashrc
38
+ source ~/.bashrc
39
+ ```
40
+
41
+ ### Windows
42
+ ```bash
43
+ gem install --user-install ./readme_generator-1.0.0.gem
44
+ echo 'export PATH="$HOME/.gem/ruby/2.6.0/bin:$PATH"' >> ~/.bash_profile
45
+ source ~/.bash_profile
46
+ ```
47
+
48
+ ## Usage
49
+
50
+ Generate a README for the current directory:
51
+ ```bash
52
+ readme-gen
53
+ ```
54
+
55
+ Generate a README for a specific project:
56
+ ```bash
57
+ readme-gen /path/to/your/project
58
+ ```
59
+
60
+ ## License
61
+
62
+ MIT License
data/exe/readme-gen ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require_relative '../lib/readme_generator'
5
+
6
+ begin
7
+ ReadmeGenerator::CLI.start(ARGV)
8
+ rescue Interrupt
9
+ puts "\n\nExiting..."
10
+ exit 1
11
+ rescue StandardError => e
12
+ puts "Error: #{e.message}"
13
+ exit 1
14
+ end
@@ -0,0 +1,64 @@
1
+ require 'thor'
2
+
3
+ module ReadmeGenerator
4
+ class CLI < Thor
5
+ include Thor::Actions
6
+
7
+ def self.exit_on_failure?
8
+ true
9
+ end
10
+
11
+ desc 'version', 'Show version information'
12
+ def version
13
+ puts "README Generator v#{ReadmeGenerator::VERSION}"
14
+ end
15
+
16
+ desc 'generate [PATH]', 'Generate README.md for the project'
17
+ option :template, type: :string, aliases: '-t', desc: 'Template type (basic, nodejs, react, nextjs, vue, nuxtjs, python, flask, laravel)'
18
+ def generate(path = Dir.pwd)
19
+ project_path = File.expand_path(path)
20
+
21
+ unless Dir.exist?(project_path)
22
+ puts "Error: Directory '#{path}' does not exist."
23
+ exit 1
24
+ end
25
+
26
+ readme_path = File.join(project_path, 'README.md')
27
+ if File.exist?(readme_path)
28
+ print "README.md already exists. Overwrite? (y/N): "
29
+ return unless gets.chomp.downcase == 'y'
30
+ end
31
+
32
+ puts "Generating README.md..."
33
+
34
+ begin
35
+ generator = Generator.new(project_path, { template: options[:template] })
36
+ output_path = generator.generate
37
+
38
+ puts "✅ README.md generated successfully at: #{output_path}"
39
+ rescue StandardError => e
40
+ puts "❌ Error: #{e.message}"
41
+ exit 1
42
+ end
43
+ end
44
+
45
+ desc 'init', 'Create a basic README.md file'
46
+ def init
47
+ project_name = File.basename(Dir.pwd)
48
+
49
+ puts "Creating README.md for: #{project_name}"
50
+
51
+ readme_path = File.join(Dir.pwd, 'README.md')
52
+ if File.exist?(readme_path)
53
+ print "README.md already exists. Overwrite? (y/N): "
54
+ return unless gets.chomp.downcase == 'y'
55
+ end
56
+
57
+ generator = Generator.new(Dir.pwd, { project_name: project_name })
58
+ output_path = generator.generate
59
+
60
+ puts "✅ README.md created at: #{output_path}"
61
+ end
62
+
63
+ end
64
+ end
@@ -0,0 +1,6 @@
1
+ module ReadmeGenerator
2
+ class ConfigManager
3
+ # Simple config manager - not needed for basic version
4
+ # Keeping class for compatibility but removing complex features
5
+ end
6
+ end
@@ -0,0 +1,168 @@
1
+ require 'json'
2
+
3
+ module ReadmeGenerator
4
+ class Scanner
5
+ def initialize(project_path)
6
+ @project_path = File.expand_path(project_path)
7
+ end
8
+
9
+ def scan
10
+ base_info = {
11
+ name: File.basename(@project_path),
12
+ type: detect_project_type,
13
+ language: detect_project_language,
14
+ recommended_template: 'basic'
15
+ }
16
+
17
+ # Add enhanced package.json analysis for Node.js projects
18
+ if File.exist?(File.join(@project_path, 'package.json'))
19
+ package_info = analyze_package_json
20
+ base_info.merge!(package_info)
21
+ end
22
+
23
+ base_info
24
+ end
25
+
26
+ private
27
+
28
+ def detect_project_type
29
+ # Use file-based detection first (highest priority)
30
+ return 'nextjs' if File.exist?(File.join(@project_path, 'next.config.js'))
31
+ return 'nuxtjs' if File.exist?(File.join(@project_path, 'nuxt.config.js'))
32
+ return 'laravel' if File.exist?(File.join(@project_path, 'artisan'))
33
+ return 'flask' if File.exist?(File.join(@project_path, 'app.py'))
34
+
35
+ # For JavaScript projects, use smart dependency-based detection
36
+ if File.exist?(File.join(@project_path, 'package.json'))
37
+ return detect_js_framework_type
38
+ end
39
+
40
+ # Check for other languages
41
+ return 'python' if File.exist?(File.join(@project_path, 'requirements.txt'))
42
+ return 'ruby' if File.exist?(File.join(@project_path, 'Gemfile'))
43
+
44
+ 'basic'
45
+ end
46
+
47
+ # Smart JavaScript framework detection with priority system
48
+ def detect_js_framework_type
49
+ begin
50
+ package_content = File.read(File.join(@project_path, 'package.json'))
51
+ package_data = JSON.parse(package_content)
52
+ deps = (package_data['dependencies'] || {}).merge(package_data['devDependencies'] || {})
53
+
54
+ # Priority-based framework detection (most specific first)
55
+ return 'nextjs' if deps.key?('next')
56
+ return 'nuxtjs' if deps.key?('nuxt')
57
+
58
+ # Check for full-stack patterns (React + Express = nodejs template)
59
+ if deps.key?('react') && deps.key?('express')
60
+ return 'nodejs' # Full-stack app gets Node.js template
61
+ end
62
+
63
+ # Frontend frameworks
64
+ return 'react' if deps.key?('react')
65
+ return 'vue' if deps.key?('vue')
66
+
67
+ # Check for Node.js server indicators
68
+ if deps.key?('express') || deps.key?('koa') || deps.key?('fastify')
69
+ return 'nodejs'
70
+ end
71
+
72
+ # Default to nodejs for any package.json project
73
+ return 'nodejs'
74
+
75
+ rescue JSON::ParserError => e
76
+ puts "Warning: Could not parse package.json for framework detection - #{e.message}"
77
+ return 'nodejs' # Safe fallback
78
+ end
79
+ end
80
+
81
+ def detect_project_language
82
+ return 'JavaScript' if File.exist?(File.join(@project_path, 'package.json'))
83
+ return 'Python' if File.exist?(File.join(@project_path, 'requirements.txt'))
84
+ return 'PHP' if File.exist?(File.join(@project_path, 'composer.json'))
85
+ return 'Ruby' if File.exist?(File.join(@project_path, 'Gemfile'))
86
+ 'Unknown'
87
+ end
88
+
89
+ # Enhanced package.json analysis
90
+ def analyze_package_json
91
+ package_path = File.join(@project_path, 'package.json')
92
+
93
+ begin
94
+ # Read and parse the JSON file
95
+ package_content = File.read(package_path)
96
+ package_data = JSON.parse(package_content)
97
+
98
+ # Extract useful information using Ruby's safe navigation
99
+ {
100
+ description: package_data['description'] || 'A Node.js project',
101
+ version: package_data['version'] || '1.0.0',
102
+ author: extract_author_info(package_data['author']),
103
+ dependencies: analyze_dependencies(package_data['dependencies'] || {}),
104
+ scripts: extract_scripts(package_data['scripts'] || {}),
105
+ main_file: package_data['main'] || 'index.js',
106
+ keywords: package_data['keywords'] || []
107
+ }
108
+ rescue JSON::ParserError, Errno::ENOENT => e
109
+ # If JSON is malformed or file doesn't exist, return defaults
110
+ puts "Warning: Could not parse package.json - #{e.message}"
111
+ {
112
+ description: 'A Node.js project',
113
+ version: '1.0.0',
114
+ author: 'Unknown',
115
+ dependencies: [],
116
+ scripts: [],
117
+ main_file: 'index.js',
118
+ keywords: []
119
+ }
120
+ end
121
+ end
122
+
123
+ # Extract author information (can be string or object)
124
+ def extract_author_info(author_data)
125
+ case author_data
126
+ when String
127
+ author_data
128
+ when Hash
129
+ author_data['name'] || 'Unknown'
130
+ else
131
+ 'Unknown'
132
+ end
133
+ end
134
+
135
+ # Analyze dependencies to identify frameworks and tools
136
+ def analyze_dependencies(deps)
137
+ frameworks = []
138
+
139
+ # Check for popular frameworks and libraries
140
+ frameworks << 'React' if deps.key?('react')
141
+ frameworks << 'Vue.js' if deps.key?('vue')
142
+ frameworks << 'Angular' if deps.key?('@angular/core')
143
+ frameworks << 'Express.js' if deps.key?('express')
144
+ frameworks << 'Next.js' if deps.key?('next')
145
+ frameworks << 'Nuxt.js' if deps.key?('nuxt')
146
+ frameworks << 'TypeScript' if deps.key?('typescript')
147
+ frameworks << 'Webpack' if deps.key?('webpack')
148
+ frameworks << 'Vite' if deps.key?('vite')
149
+
150
+ frameworks
151
+ end
152
+
153
+ # Extract and categorize npm scripts
154
+ def extract_scripts(scripts)
155
+ important_scripts = []
156
+
157
+ # Look for common script patterns
158
+ important_scripts << { name: 'start', command: scripts['start'] } if scripts['start']
159
+ important_scripts << { name: 'dev', command: scripts['dev'] } if scripts['dev']
160
+ important_scripts << { name: 'build', command: scripts['build'] } if scripts['build']
161
+ important_scripts << { name: 'test', command: scripts['test'] } if scripts['test']
162
+ important_scripts << { name: 'lint', command: scripts['lint'] } if scripts['lint']
163
+
164
+ important_scripts
165
+ end
166
+
167
+ end
168
+ end
@@ -0,0 +1,34 @@
1
+ require 'erb'
2
+
3
+ module ReadmeGenerator
4
+ class TemplateBuilder
5
+ def initialize(project_info, options = {})
6
+ @project_info = project_info
7
+ @options = options
8
+ end
9
+
10
+ def build
11
+ # Smart template selection: Choose template based on project type
12
+ template_name = @options[:template] || @project_info[:type] || 'basic'
13
+ template_path = File.join(templates_dir, "#{template_name}.erb")
14
+
15
+ # Fall back to basic template if specified template doesn't exist
16
+ unless File.exist?(template_path)
17
+ template_path = File.join(templates_dir, 'basic.erb')
18
+ end
19
+
20
+ template_content = File.read(template_path)
21
+ erb = ERB.new(template_content)
22
+
23
+ # Simple binding with project name
24
+ project_name = @options[:project_name] || @project_info[:name] || 'My Project'
25
+ erb.result(binding)
26
+ end
27
+
28
+ private
29
+
30
+ def templates_dir
31
+ File.join(File.dirname(__FILE__), 'templates')
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,31 @@
1
+ # <%= project_name %>
2
+
3
+ A simple project created with README Generator.
4
+
5
+ ## Description
6
+
7
+ This is a basic project template. Add your project description here.
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ # Add installation instructions here
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ```bash
18
+ # Add usage examples here
19
+ ```
20
+
21
+ ## Contributing
22
+
23
+ 1. Fork the project
24
+ 2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
25
+ 3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
26
+ 4. Push to the branch (`git push origin feature/AmazingFeature`)
27
+ 5. Open a pull request
28
+
29
+ ## License
30
+
31
+ This project is licensed under the MIT License.
@@ -0,0 +1,54 @@
1
+ # <%= project_name %>
2
+
3
+ A Flask application created with README Generator.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install -r requirements.txt
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```bash
14
+ # Development server
15
+ flask run
16
+
17
+ # Or with Python
18
+ python app.py
19
+ ```
20
+
21
+ Open [http://localhost:5000](http://localhost:5000) to view it in the browser.
22
+
23
+ ## Environment Setup
24
+
25
+ ```bash
26
+ # Create .env file
27
+ echo "FLASK_APP=app.py" > .env
28
+ echo "FLASK_ENV=development" >> .env
29
+
30
+ # Set environment variables
31
+ export FLASK_APP=app.py
32
+ export FLASK_ENV=development
33
+ ```
34
+
35
+ ## Available Commands
36
+
37
+ ```bash
38
+ flask run # Start development server
39
+ flask shell # Start Flask shell
40
+ python -m pytest # Run tests
41
+ pip freeze # List dependencies
42
+ ```
43
+
44
+ ## Contributing
45
+
46
+ 1. Fork the project
47
+ 2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
48
+ 3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
49
+ 4. Push to the branch (`git push origin feature/AmazingFeature`)
50
+ 5. Open a pull request
51
+
52
+ ## License
53
+
54
+ This project is licensed under the MIT License.
@@ -0,0 +1,55 @@
1
+ # <%= project_name %>
2
+
3
+ A Laravel application created with README Generator.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ composer install
9
+ cp .env.example .env
10
+ php artisan key:generate
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```bash
16
+ php artisan serve
17
+ ```
18
+
19
+ Open [http://localhost:8000](http://localhost:8000) to view it in the browser.
20
+
21
+ ## Database Setup
22
+
23
+ ```bash
24
+ # Configure database in .env file
25
+ # Then run migrations
26
+ php artisan migrate
27
+ ```
28
+
29
+ ## Available Commands
30
+
31
+ ```bash
32
+ php artisan serve # Start development server
33
+ php artisan migrate # Run database migrations
34
+ php artisan make:model # Create a new model
35
+ php artisan make:controller # Create a new controller
36
+ composer install # Install dependencies
37
+ ```
38
+
39
+ ## Requirements
40
+
41
+ - PHP >= 8.0
42
+ - Composer
43
+ - MySQL/PostgreSQL (optional)
44
+
45
+ ## Contributing
46
+
47
+ 1. Fork the project
48
+ 2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
49
+ 3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
50
+ 4. Push to the branch (`git push origin feature/AmazingFeature`)
51
+ 5. Open a pull request
52
+
53
+ ## License
54
+
55
+ This project is licensed under the MIT License.
@@ -0,0 +1,54 @@
1
+ # <%= project_name %>
2
+
3
+ <%= @project_info[:description] || "A Next.js application created with README Generator." %>
4
+
5
+ <% if @project_info[:version] %>**Version:** <%= @project_info[:version] %><% end %>
6
+ <% if @project_info[:author] && @project_info[:author] != 'Unknown' %>**Author:** <%= @project_info[:author] %><% end %>
7
+
8
+ <% if @project_info[:dependencies] && !@project_info[:dependencies].empty? %>
9
+ ## Technologies Used
10
+
11
+ <% @project_info[:dependencies].each do |framework| %>- <%= framework %>
12
+ <% end %>
13
+ <% end %>
14
+
15
+ ## Installation
16
+
17
+ ```bash
18
+ npm install
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ ```bash
24
+ npm run dev # Start development server
25
+ npm run build # Build for production
26
+ npm start # Start production server
27
+ ```
28
+
29
+ Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
30
+
31
+ ## Available Scripts
32
+
33
+ ```bash
34
+ npm run dev # Runs the app in development mode
35
+ npm run build # Builds the app for production
36
+ npm start # Starts the production server
37
+ npm run lint # Runs ESLint
38
+ ```
39
+
40
+ ## Deployment
41
+
42
+ The easiest way to deploy your Next.js app is to use [Vercel](https://vercel.com/).
43
+
44
+ ## Contributing
45
+
46
+ 1. Fork the project
47
+ 2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
48
+ 3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
49
+ 4. Push to the branch (`git push origin feature/AmazingFeature`)
50
+ 5. Open a pull request
51
+
52
+ ## License
53
+
54
+ This project is licensed under the MIT License.
@@ -0,0 +1,56 @@
1
+ # <%= project_name %>
2
+
3
+ <%= @project_info[:description] || "A Node.js project created with README Generator." %>
4
+
5
+ <% if @project_info[:version] %>**Version:** <%= @project_info[:version] %><% end %>
6
+ <% if @project_info[:author] && @project_info[:author] != 'Unknown' %>**Author:** <%= @project_info[:author] %><% end %>
7
+
8
+ <% if @project_info[:dependencies] && !@project_info[:dependencies].empty? %>
9
+ ## Technologies Used
10
+
11
+ <% @project_info[:dependencies].each do |framework| %>- <%= framework %>
12
+ <% end %>
13
+ <% end %>
14
+
15
+ ## Installation
16
+
17
+ ```bash
18
+ npm install
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ ```javascript
24
+ const <%= project_name.gsub('-', '') %> = require('<%= project_name %>');
25
+
26
+ // Add usage examples here
27
+ ```
28
+
29
+ <% if @project_info[:scripts] && !@project_info[:scripts].empty? %>
30
+ ## Available Scripts
31
+
32
+ <% @project_info[:scripts].each do |script| %>```bash
33
+ npm run <%= script[:name] %> # <%= script[:command] %>
34
+ ```
35
+
36
+ <% end %>
37
+ <% else %>
38
+ ## Scripts
39
+
40
+ ```bash
41
+ npm start # Start the application
42
+ npm test # Run tests
43
+ ```
44
+ <% end %>
45
+
46
+ ## Contributing
47
+
48
+ 1. Fork the project
49
+ 2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
50
+ 3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
51
+ 4. Push to the branch (`git push origin feature/AmazingFeature`)
52
+ 5. Open a pull request
53
+
54
+ ## License
55
+
56
+ This project is licensed under the MIT License.
@@ -0,0 +1,44 @@
1
+ # <%= project_name %>
2
+
3
+ A Nuxt.js application created with README Generator.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```bash
14
+ npm run dev # Start development server
15
+ npm run build # Build for production
16
+ npm run start # Start production server
17
+ ```
18
+
19
+ Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
20
+
21
+ ## Available Scripts
22
+
23
+ ```bash
24
+ npm run dev # Start development server with hot reload
25
+ npm run build # Build the application for production
26
+ npm run start # Start production server
27
+ npm run generate # Generate static project
28
+ ```
29
+
30
+ ## Deployment
31
+
32
+ Deploy to [Netlify](https://netlify.com/) or [Vercel](https://vercel.com/) for static sites.
33
+
34
+ ## Contributing
35
+
36
+ 1. Fork the project
37
+ 2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
38
+ 3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
39
+ 4. Push to the branch (`git push origin feature/AmazingFeature`)
40
+ 5. Open a pull request
41
+
42
+ ## License
43
+
44
+ This project is licensed under the MIT License.
@@ -0,0 +1,51 @@
1
+ # <%= project_name %>
2
+
3
+ A Python project created with README Generator.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install -r requirements.txt
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```python
14
+ python main.py
15
+ ```
16
+
17
+ ## Virtual Environment (Recommended)
18
+
19
+ ```bash
20
+ # Create virtual environment
21
+ python -m venv venv
22
+
23
+ # Activate virtual environment
24
+ # On Windows:
25
+ venv\Scripts\activate
26
+ # On macOS/Linux:
27
+ source venv/bin/activate
28
+
29
+ # Install dependencies
30
+ pip install -r requirements.txt
31
+ ```
32
+
33
+ ## Available Scripts
34
+
35
+ ```bash
36
+ python main.py # Run the main application
37
+ python -m pytest # Run tests
38
+ python -m pip freeze # List installed packages
39
+ ```
40
+
41
+ ## Contributing
42
+
43
+ 1. Fork the project
44
+ 2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
45
+ 3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
46
+ 4. Push to the branch (`git push origin feature/AmazingFeature`)
47
+ 5. Open a pull request
48
+
49
+ ## License
50
+
51
+ This project is licensed under the MIT License.
@@ -0,0 +1,59 @@
1
+ # <%= project_name %>
2
+
3
+ <%= @project_info[:description] || "A React application created with README Generator." %>
4
+
5
+ <% if @project_info[:version] %>**Version:** <%= @project_info[:version] %><% end %>
6
+ <% if @project_info[:author] && @project_info[:author] != 'Unknown' %>**Author:** <%= @project_info[:author] %><% end %>
7
+
8
+ <% if @project_info[:dependencies] && !@project_info[:dependencies].empty? %>
9
+ ## Technologies Used
10
+
11
+ <% @project_info[:dependencies].each do |framework| %>- <%= framework %>
12
+ <% end %>
13
+ <% end %>
14
+
15
+ ## Installation
16
+
17
+ ```bash
18
+ npm install
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ ```bash
24
+ npm start # Start development server
25
+ npm run build # Build for production
26
+ ```
27
+
28
+ Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
29
+
30
+ <% if @project_info[:scripts] && !@project_info[:scripts].empty? %>
31
+ ## Available Scripts
32
+
33
+ <% @project_info[:scripts].each do |script| %>```bash
34
+ npm run <%= script[:name] %> # <%= script[:command] %>
35
+ ```
36
+
37
+ <% end %>
38
+ <% else %>
39
+ ## Available Scripts
40
+
41
+ ```bash
42
+ npm start # Runs the app in development mode
43
+ npm test # Launches the test runner
44
+ npm run build # Builds the app for production
45
+ npm run eject # Ejects from Create React App
46
+ ```
47
+ <% end %>
48
+
49
+ ## Contributing
50
+
51
+ 1. Fork the project
52
+ 2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
53
+ 3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
54
+ 4. Push to the branch (`git push origin feature/AmazingFeature`)
55
+ 5. Open a pull request
56
+
57
+ ## License
58
+
59
+ This project is licensed under the MIT License.
@@ -0,0 +1,39 @@
1
+ # <%= project_name %>
2
+
3
+ A Vue.js application created with README Generator.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```bash
14
+ npm run serve # Start development server
15
+ npm run build # Build for production
16
+ ```
17
+
18
+ Open [http://localhost:8080](http://localhost:8080) to view it in the browser.
19
+
20
+ ## Available Scripts
21
+
22
+ ```bash
23
+ npm run serve # Compiles and hot-reloads for development
24
+ npm run build # Compiles and minifies for production
25
+ npm run test # Run tests
26
+ npm run lint # Lints and fixes files
27
+ ```
28
+
29
+ ## Contributing
30
+
31
+ 1. Fork the project
32
+ 2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
33
+ 3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
34
+ 4. Push to the branch (`git push origin feature/AmazingFeature`)
35
+ 5. Open a pull request
36
+
37
+ ## License
38
+
39
+ This project is licensed under the MIT License.
@@ -0,0 +1,3 @@
1
+ module ReadmeGenerator
2
+ VERSION = '1.0.0'
3
+ end
@@ -0,0 +1,32 @@
1
+ require_relative 'readme_generator/version'
2
+ require_relative 'readme_generator/cli'
3
+ require_relative 'readme_generator/scanner'
4
+ require_relative 'readme_generator/template_builder'
5
+ require_relative 'readme_generator/config_manager'
6
+
7
+ module ReadmeGenerator
8
+ class Error < StandardError; end
9
+
10
+ # Main entry point for the README Generator
11
+ class Generator
12
+ attr_reader :project_path, :options
13
+
14
+ def initialize(project_path = Dir.pwd, options = {})
15
+ @project_path = File.expand_path(project_path)
16
+ @options = options
17
+ end
18
+
19
+ def generate(output_filename = 'README.md')
20
+ scanner = Scanner.new(project_path)
21
+ project_info = scanner.scan
22
+
23
+ template_builder = TemplateBuilder.new(project_info, options)
24
+ readme_content = template_builder.build
25
+
26
+ output_path = File.join(project_path, output_filename)
27
+ File.write(output_path, readme_content)
28
+
29
+ output_path
30
+ end
31
+ end
32
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: readme_generator
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Saud M.
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2025-09-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.2'
27
+ description: Generate README files for your projects with templates
28
+ email:
29
+ - saud.mn6@gmail.com
30
+ executables:
31
+ - readme-gen
32
+ extensions: []
33
+ extra_rdoc_files: []
34
+ files:
35
+ - LICENSE
36
+ - README.md
37
+ - exe/readme-gen
38
+ - lib/readme_generator.rb
39
+ - lib/readme_generator/cli.rb
40
+ - lib/readme_generator/config_manager.rb
41
+ - lib/readme_generator/scanner.rb
42
+ - lib/readme_generator/template_builder.rb
43
+ - lib/readme_generator/templates/basic.erb
44
+ - lib/readme_generator/templates/flask.erb
45
+ - lib/readme_generator/templates/laravel.erb
46
+ - lib/readme_generator/templates/nextjs.erb
47
+ - lib/readme_generator/templates/nodejs.erb
48
+ - lib/readme_generator/templates/nuxtjs.erb
49
+ - lib/readme_generator/templates/python.erb
50
+ - lib/readme_generator/templates/react.erb
51
+ - lib/readme_generator/templates/vue.erb
52
+ - lib/readme_generator/version.rb
53
+ homepage: https://github.com/saud06/readme-generator
54
+ licenses:
55
+ - MIT
56
+ metadata: {}
57
+ post_install_message:
58
+ rdoc_options: []
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: 2.6.0
66
+ required_rubygems_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ requirements: []
72
+ rubygems_version: 3.0.3.1
73
+ signing_key:
74
+ specification_version: 4
75
+ summary: An intelligent CLI tool to generate README.md files
76
+ test_files: []