bundlegem 1.2.0.pre.rc.3 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4252af56659600bd023b9ec5b8a28a7120e82c798efec10a5c570a6000865125
4
- data.tar.gz: 260746958c0274cf6a41477127c692ef89a12aae42e1cd717c6bb7670fd6ec2a
3
+ metadata.gz: 75ed9eaea5c4e2c9cba58d155ec1323b3756d38f8d2d0c67382d8113f7868183
4
+ data.tar.gz: 4b7641e480e6817f9a376fdbc18115276444fec3cd67ed754cf1c1486b9ebc55
5
5
  SHA512:
6
- metadata.gz: bf8adae7692ad36fd5cf991af02c67c878e256e141d0023e8b4700139cbd0e681bfb1fd9afefb70f53b4aba19f243a338775a309f7e9e740ac13b3599158a0c9
7
- data.tar.gz: '09d7bdfb4faa2a1daca23b1c0b5ce3fb20e2d024f5a0e69d7adea81b6dfdd97888a1915b9bb5caa11367737b9dbeb53b024d500d436d8d410638af471cb32223'
6
+ metadata.gz: 907e4dc05d6d5933420125dcc6336669052cbc45bf0b64fc0509f4f6798b9b800b39c81498c46baf898b26da3ce041368b9aee7bfe729f40889555ed1e65e2e0
7
+ data.tar.gz: d298e506be31ce5122a0b9d737fe35655d9e91f53babb689080236cfea28571a9b6a6833c66aac2d270673410f9c61fed50f6a0ee0c2c3a8361a18df04403e32
data/README.md CHANGED
@@ -51,36 +51,57 @@ Configuration is optional and comes from your gitconfig file. At the user level
51
51
  repo-domain = github.com
52
52
  ```
53
53
 
54
- #### Create Your Own Template
55
-
56
- You can create a new template for a project class you expect to use more than once:
54
+ Alternatively, run these commands:
57
55
 
58
56
  ```
59
- $ bundlegem --newtemplate
60
- Specify a name for your gem template: my_service
61
- Specify description:
62
- Specify template tag name [MISC]:
63
- Cloning base project structure into ~/.bundlegem/templates/my_service
64
- ...
65
- Complete!
57
+ git config --global user.email your-public-gh@email.com
58
+ git config --global user.name YOUR_GH_NAME
59
+ git config --global user.repo-domain github.com
60
+ ```
61
+
62
+ ## Create Your Own Template
63
+
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...
73
+
66
74
  ```
75
+ $ echo "category: frontend" > bundlegem.yml
76
+ $ echo "purpose: frontend" >> bundlegem.yml
77
+ $ echo "language: javascript" >> bundlegem.yml
67
78
 
68
- You can now get to work making changes to the my_service gem. All you need to know is that any file that ends in .tt in that folder will be copied into new projects when you create a new project based on that template, however the .tt extension will obviously be stripped out of the resulting file name.
79
+ $ bundlegem --to-template
80
+ ```
69
81
 
70
- ### Categorizing Your Template
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.
71
83
 
72
- Also, 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, I'll show you an example:
84
+ #### Categorizing Your Template
73
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).
74
87
 
75
- ### Customizing Your Own Templates
88
+ #### Customizing Your Own Templates
76
89
 
77
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.
78
91
 
79
- You'll get a good idea as to the possibilities by inspecting the files in [templates](https://github.com/TheNotary/bundlegem/tree/master/lib/bundlegem/templates/cli_gem). Check out the [reference](/spec/data/variable_manifest_test.rb) test file to see what kind of interpolations are possible.
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).
80
101
 
81
- Quick Tips:
102
+ #### Quick Tips Regarding Project Templates
82
103
 
83
104
  - Files ending with a `.tt` extension will by written to new projects
105
+ - Running `bundlegem --cheat-sheet` will list off available template variables
84
106
  - File **names** containing `#{name}` will have that symbol replaced by the project name defined on the CLI
85
- - Within files, use `<%=config[:namespaced_path]%>` to have that reinterpreted as just the file name with underscores
86
- - 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 "Error: you need to specify a name for the project being created\n\n"
53
+ puts parser
49
54
  puts Bundlegem::HELP_MSG
50
55
  exit 1
51
56
  end
@@ -0,0 +1,14 @@
1
+
2
+
3
+ module Bundlegem::CLI
4
+ module CheatSheet
5
+ class << self
6
+
7
+ def go
8
+ gem_root = File.expand_path("../../../..", __FILE__)
9
+ File.read("#{gem_root}/spec/data/variable_manifest_test.rb").lines[3..-1].join
10
+ end
11
+
12
+ end
13
+ end
14
+ end
@@ -1 +1,2 @@
1
1
  require 'bundlegem/cli/dir_to_template'
2
+ require 'bundlegem/cli/cheat_sheet'
@@ -40,7 +40,10 @@ module Bundlegem::CLI
40
40
  end
41
41
 
42
42
  if git_user_name.empty?
43
- raise "git config user.name didn't return a value. Please double check your username configurations in ~/.gitconfig"
43
+ puts "Error: git config user.name didn't return a value. You'll probably want to make sure that's configured with your github username:"
44
+ puts ""
45
+ puts "git config --global user.name YOUR_GH_NAME"
46
+ exit 1
44
47
  else
45
48
  # git_repo_path = provider.com/user/name
46
49
  git_repo_path = "#{git_repo_domain}/#{git_user_name}/#{name}".downcase # downcasing for languages like go that are creative
@@ -49,6 +52,8 @@ module Bundlegem::CLI
49
52
  # git_repo_url = https://provider.com/user/name
50
53
  git_repo_url = "https://#{git_repo_domain}/#{git_user_name}/#{name}"
51
54
 
55
+ image_path = "#{git_user_name}/#{name}".downcase
56
+
52
57
  config = {
53
58
  :name => name,
54
59
  :title => title,
@@ -67,6 +72,7 @@ module Bundlegem::CLI
67
72
  :git_repo_domain => git_repo_domain,
68
73
  :git_repo_url => git_repo_url,
69
74
  :git_repo_path => git_repo_path,
75
+ :image_path => image_path,
70
76
  :template => @options[:template],
71
77
  :test => @options[:test],
72
78
  :ext => @options[:ext],
@@ -18,3 +18,4 @@ config[:email]: <%= config[:email] %>
18
18
  config[:git_repo_domain]: <%= config[:git_repo_domain] %>
19
19
  config[:git_repo_url]: <%= config[:git_repo_url] %>
20
20
  config[:git_repo_path]: <%= config[:git_repo_path] %>
21
+ config[:image_path]: <%= config[:image_path] %>
@@ -1,3 +1,3 @@
1
1
  module Bundlegem
2
- VERSION = "1.2.0-rc.3"
2
+ VERSION = "1.2.1"
3
3
  end
data/lib/bundlegem.rb CHANGED
@@ -17,6 +17,10 @@ module Bundlegem
17
17
  Bundlegem::VERSION
18
18
  end
19
19
 
20
+ def cheat_sheet
21
+ CLI::CheatSheet.go
22
+ end
23
+
20
24
  # lists available templates
21
25
  def list
22
26
  configurator = Configurator.new
@@ -27,7 +31,7 @@ module Bundlegem
27
31
 
28
32
  if output.empty?
29
33
  empty_output_msg = "You have no templates. You can install the public example templates with\n"
30
- empty_output_msg += "the below command\n\n"
34
+ empty_output_msg += "the below command:\n\n"
31
35
  empty_output_msg += "bundlegem --install-public-templates"
32
36
  return empty_output_msg
33
37
  end
@@ -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
@@ -18,3 +18,4 @@ config[:email]: you@example.com
18
18
  config[:git_repo_domain]: github.com
19
19
  config[:git_repo_url]: https://github.com/Test/good-dog
20
20
  config[:git_repo_path]: github.com/test/good-dog
21
+ config[:image_path]: test/good-dog
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.0.pre.rc.3
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-08-11 00:00:00.000000000 Z
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.0-rc.3
120
- documentation_uri: https://api.rubyonrails.org/v1.2.0-rc.3/
121
- source_code_uri: https://github.com/TheNotary/bundlegem/tree/v1.2.0-rc.3
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