foobara-empty-ruby-project-generator 1.0.5 → 1.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 +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +61 -26
- data/src/generators/gemspec_generator.rb +4 -0
- data/src/manifests/project_config.rb +6 -2
- data/src/write_empty_ruby_project_to_disk.rb +3 -1
- data/templates/README.md.erb +1 -1
- data/templates/boot/finish.rb.erb +2 -0
- data/templates/gemspec.gemspec.erb +1 -1
- metadata +9 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7e4a3e6022876d316da2d1151570016cefcc0a3e264fab8914f80c98a5884702
|
|
4
|
+
data.tar.gz: 2dcf65b9a6c3d55816a52c02258492544168f89debb55a1839ded3935460c976
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '08542c35392d879154eb195d4ecf98a05d950d4a52857e3d05f4835a1c89454f798a038768cb34c0088b1e483ff939b161630610e6abbc8e01d1b1cc396daec7'
|
|
7
|
+
data.tar.gz: ddf08ce714ecd6f0c1b42f0674c1c8890930ad06a6801d5da9691e5a4d68506ba3335d80567ac314b2d409eded691681222d3816515fa6d1882919bcdf241150
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [1.1.0] - 2026-10-10
|
|
2
|
+
|
|
3
|
+
- Add Foobara.start! to finish.rb.erb template
|
|
4
|
+
- Eliminate an annoying deprecation warning
|
|
5
|
+
- Use current Foobara version in generated gemspec
|
|
6
|
+
- Set created GitHub repo's description to the --description value
|
|
7
|
+
- Put the correct project name in README.md.erb output
|
|
8
|
+
|
|
1
9
|
## [1.0.5] - 2026-09-15
|
|
2
10
|
|
|
3
11
|
- Adds ./local_data to generated .gitignore
|
data/README.md
CHANGED
|
@@ -1,49 +1,84 @@
|
|
|
1
1
|
# Foobara::EmptyRubyProjectGenerator
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Generates an empty Ruby project with RuboCop, RSpec, and GitHub Actions already wired up, so you can focus on writing your gem's code rather than setting up boilerplate code.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
into a gem. Put your Ruby code in the file `lib/foobara/empty_ruby_project_generator`. To experiment with that code,
|
|
7
|
-
run `bin/console` for an interactive prompt.
|
|
5
|
+
The generated project is ideally meant to be used with Foobara however, it can also be used for non-Foobara projects by deleting Foobara-specific parts after generation.
|
|
8
6
|
|
|
9
7
|
## Installation
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with
|
|
13
|
-
instructions to install your gem from git if you don't plan to release to RubyGems.org.
|
|
9
|
+
The `foobara-empty-ruby-project-generator` is part of the `foob` family of code generators. Installing the `foob` gem will therefore automatically bring in this generator along with all other foobara generators eliminating the need to install the `foobara-empty-ruby-project-generator` gem separately.
|
|
14
10
|
|
|
15
|
-
Install the gem
|
|
11
|
+
Install the gem directly in the terminal:
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
`$ gem install foob`
|
|
18
14
|
|
|
19
|
-
|
|
15
|
+
Or add it to your Gemfile:
|
|
20
16
|
|
|
21
|
-
|
|
17
|
+
`$ bundle add foob`
|
|
22
18
|
|
|
23
19
|
## Usage
|
|
24
20
|
|
|
25
|
-
|
|
21
|
+
Run the generator to create a new project:
|
|
26
22
|
|
|
27
|
-
|
|
23
|
+
`$ foob g ruby-project -n NAME [options]`
|
|
28
24
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
bundle config set disable_local_branch_check true
|
|
32
|
-
```
|
|
25
|
+
The `-n` flag represents the name of the project to be generated and is required. It accepts either a plain project name or a name in the
|
|
26
|
+
`org/project` format:
|
|
33
27
|
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
- **Individual account:** `-n my-gem` — creates a project with a single
|
|
29
|
+
module e.g. `MyGem`
|
|
30
|
+
- **Organization:** `-n my-org/my-gem` — creates a project with a nested
|
|
31
|
+
module e.g. `MyOrg::MyGem` and uses `my-org` as the GitHub organization
|
|
36
32
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
For a full list of available options run:
|
|
34
|
+
|
|
35
|
+
`$ foob g ruby-project --help`
|
|
36
|
+
|
|
37
|
+
or
|
|
38
|
+
|
|
39
|
+
`$ foob help ruby-project`
|
|
40
|
+
|
|
41
|
+
**Commonly used options:**
|
|
42
|
+
|
|
43
|
+
| Flag | Description |
|
|
44
|
+
|------|-------------|
|
|
45
|
+
| `-n, --name` | Project name or org/project (required) |
|
|
46
|
+
| `-d, --description` | Project description. Defaults to `"No description. Add one."` |
|
|
47
|
+
| `-a, --author-names` | Author name(s) |
|
|
48
|
+
| `--author-emails` | Author email(s) |
|
|
49
|
+
| `-l, --license` | One of: `MIT`, `Apache-2.0`, `MPL-2.0`, `Apache-2.0 OR MIT` |
|
|
50
|
+
| `-u, --use-git` | Initialize a git repository |
|
|
51
|
+
| `--push-to-github` | Create a private GitHub repo and push to it |
|
|
52
|
+
| `-o, --output-directory` | Where to generate the project. Defaults to the project name |
|
|
53
|
+
|
|
54
|
+
**Example:**
|
|
55
|
+
|
|
56
|
+
`$ foob g ruby-project -n my-org/my-gem -d "Does something useful" -l MIT --use-git`
|
|
57
|
+
|
|
58
|
+
The above generator example when run will put the project in the `my-org/my-gem` folder.
|
|
59
|
+
|
|
60
|
+
Upon running the generator, all projects will have the following structure:
|
|
61
|
+
|
|
62
|
+
- `lib/` - Contains all files that are loaded via `require` and based on the name you provided when generating the project, this folder will be structured as either `lib/my_org/my_gem.rb` for an organisation project name OR `lib/my_gem.rb` for a plain project name.
|
|
63
|
+
|
|
64
|
+
- `src/` - Contains your ruby gem code. This is a Foobara-specific convention whereby instead of putting all your code in the `lib/` folder, the actual implementation code lives in `src/` folder while the `lib/` folder is reserved for code that can be required.
|
|
65
|
+
|
|
66
|
+
If you used the `foobara-empty-ruby-project-generator` gem to generate a non-Foobara Ruby project, you can delete the `src/` folder and place all your code in the `lib/` folder as well as delete any associated Foobara-specific parts.
|
|
40
67
|
|
|
41
68
|
## Contributing
|
|
42
69
|
|
|
43
|
-
|
|
44
|
-
|
|
70
|
+
Contributions in the form of PRs and issues are always welcome.
|
|
71
|
+
|
|
72
|
+
To work on an existing issue or submit a PR:
|
|
73
|
+
|
|
74
|
+
1. Fork the repo and clone it to your local machine
|
|
75
|
+
2. Run `bundle install` to install dependencies
|
|
76
|
+
3. Run `rake` to ensure that everything works as expected before making any changes.
|
|
77
|
+
4. Implement your changes and add tests where applicable
|
|
78
|
+
5. Re-run `rake` to make sure that all tests and rubocop pass.
|
|
79
|
+
6. Commit, push to GitHub and open a PR for review
|
|
45
80
|
|
|
46
81
|
## License
|
|
47
82
|
|
|
48
|
-
This project is licensed under your choice of the Apache-2.0 license or
|
|
49
|
-
See [LICENSE.txt](LICENSE.txt) for more info
|
|
83
|
+
This project is licensed under your choice of the Apache-2.0 license or
|
|
84
|
+
the MIT license. See [LICENSE.txt](LICENSE.txt) for more info.
|
|
@@ -38,8 +38,12 @@ module Foobara
|
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
def org_slash_project_kebab(organization_name = self.organization_name, project_name = self.project_name)
|
|
41
|
-
org_part =
|
|
42
|
-
|
|
41
|
+
org_part = if organization_name
|
|
42
|
+
Util.kebab_case(organization_name)&.gsub("::", "-")
|
|
43
|
+
end
|
|
44
|
+
project_part = if project_name
|
|
45
|
+
Util.kebab_case(project_name).gsub("::", "-")
|
|
46
|
+
end
|
|
43
47
|
|
|
44
48
|
if org_part.nil? || org_part.empty?
|
|
45
49
|
project_part
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
require "fileutils"
|
|
2
2
|
require "extract_repo"
|
|
3
|
+
require "shellwords"
|
|
3
4
|
require_relative "generate_empty_ruby_project"
|
|
4
5
|
|
|
5
6
|
module Foobara
|
|
@@ -197,7 +198,8 @@ module Foobara
|
|
|
197
198
|
|
|
198
199
|
puts "pushing to github..."
|
|
199
200
|
|
|
200
|
-
|
|
201
|
+
description = Shellwords.escape(project_config.description)
|
|
202
|
+
cmd = "gh repo create --private #{project_config.org_slash_project_kebab} --description #{description}"
|
|
201
203
|
exit_status = run_cmd_and_write_output(cmd, raise_if_fails: false)
|
|
202
204
|
|
|
203
205
|
unless exit_status&.success?
|
data/templates/README.md.erb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
TODO: Delete this and the text below, and describe your gem
|
|
4
4
|
|
|
5
5
|
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library
|
|
6
|
-
into a gem. Put your Ruby code in the file `lib
|
|
6
|
+
into a gem. Put your Ruby code in the file `lib/<%= org_slash_project_underscore %>.rb`. To experiment with that code,
|
|
7
7
|
run `bin/console` for an interactive prompt.
|
|
8
8
|
|
|
9
9
|
|
|
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
|
23
23
|
"CHANGELOG.md"
|
|
24
24
|
]
|
|
25
25
|
|
|
26
|
-
spec.add_dependency "foobara", ">=
|
|
26
|
+
spec.add_dependency "foobara", ">= <%= current_foobara_version %>", "< 2.0.0"
|
|
27
27
|
|
|
28
28
|
spec.require_paths = ["lib"]
|
|
29
29
|
spec.metadata["rubygems_mfa_required"] = "true"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: foobara-empty-ruby-project-generator
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Miles Georgi
|
|
@@ -29,7 +29,7 @@ dependencies:
|
|
|
29
29
|
requirements:
|
|
30
30
|
- - ">="
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: 0.
|
|
32
|
+
version: 0.7.3
|
|
33
33
|
- - "<"
|
|
34
34
|
- !ruby/object:Gem::Version
|
|
35
35
|
version: 2.0.0
|
|
@@ -39,7 +39,7 @@ dependencies:
|
|
|
39
39
|
requirements:
|
|
40
40
|
- - ">="
|
|
41
41
|
- !ruby/object:Gem::Version
|
|
42
|
-
version: 0.
|
|
42
|
+
version: 0.7.3
|
|
43
43
|
- - "<"
|
|
44
44
|
- !ruby/object:Gem::Version
|
|
45
45
|
version: 2.0.0
|
|
@@ -47,6 +47,9 @@ dependencies:
|
|
|
47
47
|
name: foobara-files-generator
|
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
|
49
49
|
requirements:
|
|
50
|
+
- - ">="
|
|
51
|
+
- !ruby/object:Gem::Version
|
|
52
|
+
version: 0.2.4
|
|
50
53
|
- - "<"
|
|
51
54
|
- !ruby/object:Gem::Version
|
|
52
55
|
version: 2.0.0
|
|
@@ -54,6 +57,9 @@ dependencies:
|
|
|
54
57
|
prerelease: false
|
|
55
58
|
version_requirements: !ruby/object:Gem::Requirement
|
|
56
59
|
requirements:
|
|
60
|
+
- - ">="
|
|
61
|
+
- !ruby/object:Gem::Version
|
|
62
|
+
version: 0.2.4
|
|
57
63
|
- - "<"
|
|
58
64
|
- !ruby/object:Gem::Version
|
|
59
65
|
version: 2.0.0
|