bundlegem 1.2.0 → 1.2.1
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/README.md +31 -18
- data/bin/bundlegem +7 -2
- data/lib/bundlegem/cli/cheat_sheet.rb +14 -0
- data/lib/bundlegem/cli/cli.rb +1 -0
- data/lib/bundlegem/cli/gem.rb +3 -0
- data/lib/bundlegem/templates/test_template/#{name}.rb.tt +1 -0
- data/lib/bundlegem/version.rb +1 -1
- data/lib/bundlegem.rb +4 -0
- data/spec/bundlegem_spec.rb +8 -0
- data/spec/data/variable_manifest_test.rb +1 -0
- metadata +6 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 75ed9eaea5c4e2c9cba58d155ec1323b3756d38f8d2d0c67382d8113f7868183
|
|
4
|
+
data.tar.gz: 4b7641e480e6817f9a376fdbc18115276444fec3cd67ed754cf1c1486b9ebc55
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 907e4dc05d6d5933420125dcc6336669052cbc45bf0b64fc0509f4f6798b9b800b39c81498c46baf898b26da3ce041368b9aee7bfe729f40889555ed1e65e2e0
|
|
7
|
+
data.tar.gz: d298e506be31ce5122a0b9d737fe35655d9e91f53babb689080236cfea28571a9b6a6833c66aac2d270673410f9c61fed50f6a0ee0c2c3a8361a18df04403e32
|
data/README.md
CHANGED
|
@@ -59,36 +59,49 @@ git config --global user.name YOUR_GH_NAME
|
|
|
59
59
|
git config --global user.repo-domain github.com
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
## Create Your Own Template
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
###### Overview
|
|
65
|
+
- Define the project in a repo as you normally would
|
|
66
|
+
- Commit the project once it's building/ testing the way you'd like
|
|
67
|
+
- Add a `bundlegem.yml` file to the template to make it available for use
|
|
68
|
+
- Run `bundlegem --to-template` which adds a `.tt` suffix to the files
|
|
69
|
+
- Add any template variables to the project. See: `bundlegem --cheat-sheet`
|
|
70
|
+
- Use the template to kick off a new project, `bundlegem -t my-template first-test`
|
|
71
|
+
|
|
72
|
+
To create your own template, just create a new project using the technologies you'd like. Place this project in `~/.bundlegem/templates/my-template`. Once it's done, it's a good idea to create a git commit. Then run something to the effect...
|
|
65
73
|
|
|
66
74
|
```
|
|
67
|
-
$ bundlegem
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
Specify template tag name [MISC]:
|
|
71
|
-
Cloning base project structure into ~/.bundlegem/templates/my_service
|
|
72
|
-
...
|
|
73
|
-
Complete!
|
|
74
|
-
```
|
|
75
|
+
$ echo "category: frontend" > bundlegem.yml
|
|
76
|
+
$ echo "purpose: frontend" >> bundlegem.yml
|
|
77
|
+
$ echo "language: javascript" >> bundlegem.yml
|
|
75
78
|
|
|
76
|
-
|
|
79
|
+
$ bundlegem --to-template
|
|
80
|
+
```
|
|
77
81
|
|
|
78
|
-
|
|
82
|
+
Change the bundlegem.yml contents to what makes sense for your template. The `--to-template` command will add a `.tt` to the end of all the files in the project. To keep you and I safe, it will only run if there is a `bundlegem.yml` file in the current directory.
|
|
79
83
|
|
|
80
|
-
|
|
84
|
+
#### Categorizing Your Template
|
|
81
85
|
|
|
86
|
+
You can specify the `category` of the gem by editing the `bundlegem.yml` file in each template's root. Categories are just used for organizing the output when you run `bundlegem --list`. Here's an [example](https://github.com/TheNotary/template-html-css-js/blob/main/bundlegem.yml).
|
|
82
87
|
|
|
83
|
-
|
|
88
|
+
#### Customizing Your Own Templates
|
|
84
89
|
|
|
85
90
|
Place your own templates in `~/.bunglegem/templates`. You can populate it with examples by running `bundlegem --install-public-templates` which will effectively clone down a few sample git repos into the templates folder for you such as [Go-cli](https://github.com/TheNotary/template-go-cli) for instance.
|
|
86
91
|
|
|
87
|
-
You'll get a good idea as to the possibilities by inspecting the
|
|
92
|
+
You'll get a good idea as to the possibilities by inspecting the various templates I've opensourced under my github org, e.g. [template-ruby-cli-gem](https://github.com/TheNotary/template-ruby-cli-gem).
|
|
93
|
+
|
|
94
|
+
To pull up a list of available variables, run this command
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
$ bundlegem --cheat-sheet
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
If you would find additional variables handy, set me up with a PR and assuming it seems widely helpful, I'll merge it right as soon as I can. The implementation for the variables is largely found in [gem.rb](https://github.com/TheNotary/bundlegem/blob/main/lib/bundlegem/cli/gem.rb#L59).
|
|
88
101
|
|
|
89
|
-
Quick Tips
|
|
102
|
+
#### Quick Tips Regarding Project Templates
|
|
90
103
|
|
|
91
104
|
- Files ending with a `.tt` extension will by written to new projects
|
|
105
|
+
- Running `bundlegem --cheat-sheet` will list off available template variables
|
|
92
106
|
- File **names** containing `#{name}` will have that symbol replaced by the project name defined on the CLI
|
|
93
|
-
-
|
|
94
|
-
- Have a look [under the hood](https://github.com/TheNotary/bundlegem/blob/master/lib/bundlegem/cli/gem.rb#L30-L43) to see other options and the context where the ERB.new takes place.
|
|
107
|
+
- Example: within a `.tt` file, use `<%=config[:namespaced_path]%>` to have that reinterpreted as just the file name with underscores
|
data/bin/bundlegem
CHANGED
|
@@ -20,6 +20,11 @@ parser = OptionParser.new do |opts|
|
|
|
20
20
|
exit
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
+
opts.on("-c", "--cheat-sheet", "Show list of variables available in templates") do
|
|
24
|
+
puts Bundlegem.cheat_sheet
|
|
25
|
+
exit
|
|
26
|
+
end
|
|
27
|
+
|
|
23
28
|
opts.on("-v", "--version", "Show version") do
|
|
24
29
|
puts Bundlegem.version
|
|
25
30
|
exit
|
|
@@ -35,7 +40,7 @@ parser = OptionParser.new do |opts|
|
|
|
35
40
|
exit
|
|
36
41
|
end
|
|
37
42
|
|
|
38
|
-
opts.on("--help", "Show help") do
|
|
43
|
+
opts.on(nil, "--help", "Show help") do
|
|
39
44
|
puts opts
|
|
40
45
|
puts Bundlegem::HELP_MSG
|
|
41
46
|
exit
|
|
@@ -45,7 +50,7 @@ end
|
|
|
45
50
|
parser.parse!
|
|
46
51
|
|
|
47
52
|
if ARGV.empty?
|
|
48
|
-
puts
|
|
53
|
+
puts parser
|
|
49
54
|
puts Bundlegem::HELP_MSG
|
|
50
55
|
exit 1
|
|
51
56
|
end
|
data/lib/bundlegem/cli/cli.rb
CHANGED
data/lib/bundlegem/cli/gem.rb
CHANGED
|
@@ -52,6 +52,8 @@ module Bundlegem::CLI
|
|
|
52
52
|
# git_repo_url = https://provider.com/user/name
|
|
53
53
|
git_repo_url = "https://#{git_repo_domain}/#{git_user_name}/#{name}"
|
|
54
54
|
|
|
55
|
+
image_path = "#{git_user_name}/#{name}".downcase
|
|
56
|
+
|
|
55
57
|
config = {
|
|
56
58
|
:name => name,
|
|
57
59
|
:title => title,
|
|
@@ -70,6 +72,7 @@ module Bundlegem::CLI
|
|
|
70
72
|
:git_repo_domain => git_repo_domain,
|
|
71
73
|
:git_repo_url => git_repo_url,
|
|
72
74
|
:git_repo_path => git_repo_path,
|
|
75
|
+
:image_path => image_path,
|
|
73
76
|
:template => @options[:template],
|
|
74
77
|
:test => @options[:test],
|
|
75
78
|
:ext => @options[:ext],
|
data/lib/bundlegem/version.rb
CHANGED
data/lib/bundlegem.rb
CHANGED
data/spec/bundlegem_spec.rb
CHANGED
|
@@ -14,6 +14,14 @@ describe Bundlegem do
|
|
|
14
14
|
expect(Bundlegem::VERSION).not_to be nil
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
+
it 'has a cheat sheet it will share' do
|
|
18
|
+
output = Bundlegem.cheat_sheet
|
|
19
|
+
|
|
20
|
+
expect(output).to include("config[:name]: good-dog")
|
|
21
|
+
expect(output).to include("config[:screamcase_name]: GOOD_DOG")
|
|
22
|
+
expect(output).to include("config[:image_path]: test/good-dog")
|
|
23
|
+
end
|
|
24
|
+
|
|
17
25
|
# List
|
|
18
26
|
|
|
19
27
|
it 'gives the user a helpful output when there are no templates installed' do
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bundlegem
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- TheNotary
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2025-
|
|
10
|
+
date: 2025-10-30 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: bundler
|
|
@@ -85,6 +85,7 @@ files:
|
|
|
85
85
|
- changelog
|
|
86
86
|
- config/config
|
|
87
87
|
- lib/bundlegem.rb
|
|
88
|
+
- lib/bundlegem/cli/cheat_sheet.rb
|
|
88
89
|
- lib/bundlegem/cli/cli.rb
|
|
89
90
|
- lib/bundlegem/cli/dir_to_template.rb
|
|
90
91
|
- lib/bundlegem/cli/gem.rb
|
|
@@ -116,9 +117,9 @@ licenses:
|
|
|
116
117
|
- MIT
|
|
117
118
|
metadata:
|
|
118
119
|
bug_tracker_uri: https://github.com/TheNotary/bundlegem/issues
|
|
119
|
-
changelog_uri: https://github.com/TheNotary/bundlegem/releases/tag/v1.2.
|
|
120
|
-
documentation_uri: https://api.rubyonrails.org/v1.2.
|
|
121
|
-
source_code_uri: https://github.com/TheNotary/bundlegem/tree/v1.2.
|
|
120
|
+
changelog_uri: https://github.com/TheNotary/bundlegem/releases/tag/v1.2.1
|
|
121
|
+
documentation_uri: https://api.rubyonrails.org/v1.2.1/
|
|
122
|
+
source_code_uri: https://github.com/TheNotary/bundlegem/tree/v1.2.1
|
|
122
123
|
rdoc_options: []
|
|
123
124
|
require_paths:
|
|
124
125
|
- lib
|