bundlegem 1.1.1 → 1.2.0.pre.rc.2
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/Gemfile +0 -1
- data/README.md +26 -37
- data/Rakefile +3 -5
- data/bin/bundlegem +45 -40
- data/bundlegem.gemspec +5 -11
- data/changelog +14 -3
- data/config/config +1 -1
- data/lib/bundlegem/cli/cli.rb +0 -4
- data/lib/bundlegem/cli/dir_to_template.rb +25 -13
- data/lib/bundlegem/cli/gem.rb +75 -158
- data/lib/bundlegem/strings.rb +1 -1
- data/lib/bundlegem/template_manager.rb +2 -2
- data/lib/bundlegem/templates/test_template/#{name}.rb.tt +1 -0
- data/lib/bundlegem/version.rb +1 -1
- data/lib/bundlegem.rb +27 -15
- data/spec/bundlegem_spec.rb +30 -29
- data/spec/data/variable_manifest_test.rb +1 -0
- data/spec/spec_helper.rb +1 -2
- data/spec/template_manager_spec.rb +1 -1
- metadata +7 -113
- data/.travis.yml +0 -3
- data/lib/bundlegem/cli.rb +0 -166
- data/lib/bundlegem/friendly_errors.rb +0 -79
- data/lib/bundlegem/templates/Executable +0 -16
- data/lib/bundlegem/templates/Executable.standalone +0 -12
- data/lib/bundlegem/templates/Gemfile +0 -4
- data/lib/bundlegem/templates/c_extension_gem/#{name}.gemspec.tt +0 -28
- data/lib/bundlegem/templates/c_extension_gem/.travis.yml.tt +0 -3
- data/lib/bundlegem/templates/c_extension_gem/CODE_OF_CONDUCT.md.tt +0 -13
- data/lib/bundlegem/templates/c_extension_gem/Gemfile.tt +0 -4
- data/lib/bundlegem/templates/c_extension_gem/LICENSE.txt.tt +0 -21
- data/lib/bundlegem/templates/c_extension_gem/README.md.tt +0 -39
- data/lib/bundlegem/templates/c_extension_gem/Rakefile.tt +0 -13
- data/lib/bundlegem/templates/c_extension_gem/bin/#{name}.tt +0 -3
- data/lib/bundlegem/templates/c_extension_gem/bin/console.tt +0 -14
- data/lib/bundlegem/templates/c_extension_gem/changelog.tt +0 -7
- data/lib/bundlegem/templates/c_extension_gem/ext/#{name}/#{name}.c.tt +0 -9
- data/lib/bundlegem/templates/c_extension_gem/ext/#{name}/#{name}.h.tt +0 -6
- data/lib/bundlegem/templates/c_extension_gem/ext/#{name}/extconf.rb.tt +0 -3
- data/lib/bundlegem/templates/c_extension_gem/gitignore.tt +0 -16
- data/lib/bundlegem/templates/c_extension_gem/lib/#{name}/version.rb.tt +0 -7
- data/lib/bundlegem/templates/c_extension_gem/lib/#{name}.rb.tt +0 -12
- data/lib/bundlegem/templates/c_extension_gem/rspec.tt +0 -2
- data/lib/bundlegem/templates/c_extension_gem/spec/#{name}_spec.rb.tt +0 -11
- data/lib/bundlegem/templates/c_extension_gem/spec/spec_helper.rb.tt +0 -2
- data/lib/bundlegem/templates/cli_gem/#{name}.gemspec.tt +0 -42
- data/lib/bundlegem/templates/cli_gem/CODE_OF_CONDUCT.md.tt +0 -13
- data/lib/bundlegem/templates/cli_gem/Gemfile.tt +0 -4
- data/lib/bundlegem/templates/cli_gem/LICENSE.txt.tt +0 -3
- data/lib/bundlegem/templates/cli_gem/README.md.tt +0 -38
- data/lib/bundlegem/templates/cli_gem/Rakefile.tt +0 -31
- data/lib/bundlegem/templates/cli_gem/bin/console.tt +0 -14
- data/lib/bundlegem/templates/cli_gem/changelog.tt +0 -7
- data/lib/bundlegem/templates/cli_gem/exe/#{name}.tt +0 -12
- data/lib/bundlegem/templates/cli_gem/ext/#{name}/#{name}.c.tt +0 -9
- data/lib/bundlegem/templates/cli_gem/ext/#{name}/#{name}.h.tt +0 -6
- data/lib/bundlegem/templates/cli_gem/ext/#{name}/extconf.rb.tt +0 -3
- data/lib/bundlegem/templates/cli_gem/gitignore.tt +0 -15
- data/lib/bundlegem/templates/cli_gem/lib/#{name}/config.rb.tt +0 -40
- data/lib/bundlegem/templates/cli_gem/lib/#{name}/constants.rb.tt +0 -9
- data/lib/bundlegem/templates/cli_gem/lib/#{name}/version.rb.tt +0 -7
- data/lib/bundlegem/templates/cli_gem/lib/#{name}.rb.tt +0 -26
- data/lib/bundlegem/templates/cli_gem/rspec.tt +0 -2
- data/lib/bundlegem/templates/cli_gem/spec/#{name}/config_spec.rb.tt +0 -25
- data/lib/bundlegem/templates/cli_gem/spec/#{name}_int.rb.tt +0 -16
- data/lib/bundlegem/templates/cli_gem/spec/#{name}_spec.rb.tt +0 -17
- data/lib/bundlegem/templates/cli_gem/spec/data/sample_data.json.tt +0 -1
- data/lib/bundlegem/templates/cli_gem/spec/spec_helper.rb.tt +0 -2
- data/lib/bundlegem/templates/newgem/#{name}.gemspec.tt +0 -33
- data/lib/bundlegem/templates/newgem/.gitignore.tt +0 -16
- data/lib/bundlegem/templates/newgem/.travis.yml.tt +0 -3
- data/lib/bundlegem/templates/newgem/CODE_OF_CONDUCT.md.tt +0 -13
- data/lib/bundlegem/templates/newgem/Gemfile.tt +0 -10
- data/lib/bundlegem/templates/newgem/LICENSE.txt.tt +0 -21
- data/lib/bundlegem/templates/newgem/README.md.tt +0 -41
- data/lib/bundlegem/templates/newgem/Rakefile.tt +0 -40
- data/lib/bundlegem/templates/newgem/bin/#{name}.tt +0 -3
- data/lib/bundlegem/templates/newgem/bin/console.tt +0 -14
- data/lib/bundlegem/templates/newgem/changelog.tt +0 -7
- data/lib/bundlegem/templates/newgem/lib/#{name}/version.rb.tt +0 -7
- data/lib/bundlegem/templates/newgem/lib/#{name}.rb.tt +0 -12
- data/lib/bundlegem/templates/newgem/rspec.tt +0 -2
- data/lib/bundlegem/templates/newgem/spec/#{name}_spec.rb.tt +0 -11
- data/lib/bundlegem/templates/newgem/spec/spec_helper.rb.tt +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d3396aa291659923937258c81aefb04741601ccc6dce52f5863617fa6309dfb
|
4
|
+
data.tar.gz: 136b3cc175a67d535bf51a2c501e216f30e55aca1b6cbd4ea19a6917a7e7f123
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38537a96e14f9ad0793d5758011cf41666667ee7674b0ab8f4cff559a9405a4959fcf9c44effa1c3473d318f86c53a18cc20b355dfdcc3e674255aa0fbfebec4
|
7
|
+
data.tar.gz: b662bfcd7fb5a56e75e7e7834da3b0f91accdcd734e5b2f1ad689ea3b35140e5beadce725089b6460abb2b17b75c92933fd53e1af477f85e63835e6db9a3951d
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,33 +1,33 @@
|
|
1
1
|
# BundleGem: A Gem Project Generator with User Defined Templates
|
2
2
|
[](https://badge.fury.io/rb/bundlegem)
|
3
3
|
|
4
|
-
|
4
|
+
BundleGem allow users to define project templates in the most native form to all technologist: Directory Structures, short commands, and helpful commands that make the tool's usage completely visible!
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
All of these 'classes of gems' as I refer to them, start out with a different code base, consistent with all other gems of the same class. This 'class based' approach to gem creation is different from the adaptive approach that other gem generators are based on.
|
9
|
-
|
10
|
-
The most beneficial aspect of this gem is that it allows you to specify exactly how you want your 'default starting gem' to look, rather than rely on what someone else thought would be generally helpful.
|
6
|
+
Programming often involves a lot of boilerplate and configuration "boot strapping" before you can get going actually writing any code. To automate this aspect of creating new projects and microservices, bundlegem allows you to run a simple command `bundlegem -t my-c-embedded-template project-name` and it will clone a template you've made with exact specifications, update the names of files and references within the files to match your project name, run any commands specified in your template. What once would have been a 5-10 minute distraction of remembering and implementing all those little patterns, testing dependencies, and pipeline definitions now happens immediately with a single command.
|
11
7
|
|
8
|
+
The most beneficial aspect of BundleGem is that it allows you to specify exactly how you want your 'default starting project' to look, rather than rely on what someone else thought would be generally helpful.
|
12
9
|
|
13
10
|
### Installation
|
14
11
|
|
15
|
-
First install it:
|
16
12
|
```
|
17
13
|
gem install bundlegem
|
14
|
+
bundlegem --install-public-templates
|
18
15
|
```
|
19
16
|
|
20
|
-
|
17
|
+
#### List Available Templates
|
21
18
|
|
22
|
-
Configuration comes from your gitconfig. At the user level, this is set at `~/.gitconfig`. These are the recommended minimal configurations to get the default templates to work ok:
|
23
|
-
|
24
|
-
```
|
25
|
-
[user]
|
26
|
-
email = me@example.com
|
27
|
-
name = Me
|
28
|
-
repo-domain = github.com
|
29
19
|
```
|
20
|
+
$ bundlegem -l
|
21
|
+
PREDEFINED:
|
22
|
+
default - A basic ruby gem
|
23
|
+
service - A gem that allows installation as a service to run as a daemon
|
24
|
+
|
25
|
+
MISC:
|
26
|
+
my_service -
|
30
27
|
|
28
|
+
EMBEDDED:
|
29
|
+
arduino
|
30
|
+
```
|
31
31
|
|
32
32
|
### Usage
|
33
33
|
|
@@ -35,29 +35,23 @@ These commands will create a new gem named `project_name` in `/tmp/project_name`
|
|
35
35
|
|
36
36
|
```
|
37
37
|
$ cd /tmp
|
38
|
-
$ bundlegem
|
38
|
+
$ bundlegem -t arduino project_name
|
39
39
|
```
|
40
40
|
|
41
|
+
You'll find a project skeleton in ~/.bundlegem/templates/my_service that you can customize to your liking.
|
41
42
|
|
42
|
-
###
|
43
|
-
|
44
|
-
```
|
45
|
-
$ bundlegem --list
|
46
|
-
PREDEFINED:
|
47
|
-
default - A basic ruby gem
|
48
|
-
service - A gem that allows installation as a service to run as a daemon
|
43
|
+
### Configuration
|
49
44
|
|
50
|
-
|
51
|
-
my_service -
|
45
|
+
Configuration is optional and comes from your gitconfig file. At the user level, this is set at `~/.gitconfig`. These are the recommended minimal configurations to get the default templates to work ok:
|
52
46
|
|
53
|
-
|
54
|
-
|
47
|
+
```
|
48
|
+
[user]
|
49
|
+
email = me@example.com
|
50
|
+
name = Me
|
51
|
+
repo-domain = github.com
|
55
52
|
```
|
56
53
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
## Create Your Own Template
|
54
|
+
#### Create Your Own Template
|
61
55
|
|
62
56
|
You can create a new template for a project class you expect to use more than once:
|
63
57
|
|
@@ -80,7 +74,7 @@ Also, you can specify the `category` of the gem by editing the bundlegem.yml fil
|
|
80
74
|
|
81
75
|
### Customizing Your Own Templates
|
82
76
|
|
83
|
-
Place your own templates in `~/.bunglegem/templates`. You can populate it with examples by running `bundlegem --install-
|
77
|
+
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.
|
84
78
|
|
85
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.
|
86
80
|
|
@@ -90,8 +84,3 @@ Quick Tips:
|
|
90
84
|
- File **names** containing `#{name}` will have that symbol replaced by the project name defined on the CLI
|
91
85
|
- Within files, use `<%=config[:namespaced_path]%>` to have that reinterpreted as just the file name with underscores
|
92
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.
|
93
|
-
|
94
|
-
|
95
|
-
## Gem Backstory
|
96
|
-
|
97
|
-
A lot of the code here was extracted from Bundler's `bundle gem` command, so credits to the Bundler folks. Originally I planned to make the new features accessible to the Bundler team and went out of my way to keep the code as similar to their project as possible, but ultimately realized two thing. First they don't want to grow the project creation feature because good tools should do a single thing very well (manage dependencies), not many things (manage dependencies and also do random other helpful stuff). And second Bundler is a profoundly common dependency meaning every change is enormously high stakes.
|
data/Rakefile
CHANGED
@@ -22,7 +22,7 @@ RSpec::Core::RakeTask.new(:spec) do |t|
|
|
22
22
|
t.rspec_opts = %w(-fd -c)
|
23
23
|
end
|
24
24
|
|
25
|
-
# this is for running tests that you've marked current... eg: it 'should work', :
|
25
|
+
# this is for running tests that you've marked current... eg: it 'should work', current: true do
|
26
26
|
RSpec::Core::RakeTask.new(:current) do |spec|
|
27
27
|
spec.pattern = 'spec/**/*_spec.rb'
|
28
28
|
spec.rspec_opts = ['--tag current']
|
@@ -34,7 +34,5 @@ RSpec::Core::RakeTask.new(:c) do |spec|
|
|
34
34
|
spec.rspec_opts = ['--tag current']
|
35
35
|
end
|
36
36
|
|
37
|
-
task
|
38
|
-
task
|
39
|
-
|
40
|
-
|
37
|
+
task default: :spec
|
38
|
+
task test: :spec
|
data/bin/bundlegem
CHANGED
@@ -1,57 +1,62 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
4
|
-
Signal.trap("INT") { exit 1 }
|
3
|
+
require 'optparse'
|
5
4
|
require 'bundler'
|
6
5
|
require 'bundlegem'
|
7
|
-
# require 'bundlergem/friendly_errors'
|
8
6
|
|
9
7
|
|
10
|
-
|
11
|
-
|
12
|
-
puts Bundlegem::HELP_MSG
|
13
|
-
exit 1
|
14
|
-
end
|
8
|
+
Signal.trap("INT") { exit 1 }
|
9
|
+
options = { bin: false, ext: false, coc: false }
|
15
10
|
|
16
|
-
|
17
|
-
|
18
|
-
exit 0
|
19
|
-
end
|
11
|
+
parser = OptionParser.new do |opts|
|
12
|
+
opts.banner = "Usage: #{File.basename($0)} [options] GEM_NAME"
|
20
13
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
end
|
14
|
+
opts.on("-t", "--template TEMPLATE", "Specify a template") do |template|
|
15
|
+
options[:template] = template
|
16
|
+
end
|
25
17
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
end
|
18
|
+
opts.on("-l", "--list", "List available templates") do
|
19
|
+
puts Bundlegem.list
|
20
|
+
exit
|
21
|
+
end
|
22
|
+
|
23
|
+
opts.on("-v", "--version", "Show version") do
|
24
|
+
puts Bundlegem.version
|
25
|
+
exit
|
26
|
+
end
|
30
27
|
|
31
|
-
|
32
|
-
|
33
|
-
|
28
|
+
opts.on("--install-public-templates", "Install public templates") do
|
29
|
+
Bundlegem.install_public_templates
|
30
|
+
exit
|
31
|
+
end
|
32
|
+
|
33
|
+
opts.on("--to-template", "Convert directory to template") do
|
34
|
+
Bundlegem.dir_to_template
|
35
|
+
exit
|
36
|
+
end
|
37
|
+
|
38
|
+
opts.on("--help", "Show help") do
|
39
|
+
puts opts
|
40
|
+
puts Bundlegem::HELP_MSG
|
41
|
+
exit
|
42
|
+
end
|
34
43
|
end
|
35
44
|
|
36
|
-
|
37
|
-
|
38
|
-
|
45
|
+
parser.parse!
|
46
|
+
|
47
|
+
if ARGV.empty?
|
48
|
+
puts "Error: you need to specify a name for the project being created\n\n"
|
49
|
+
puts Bundlegem::HELP_MSG
|
50
|
+
exit 1
|
39
51
|
end
|
40
52
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
# Loop over CLI parameters
|
46
|
-
ARGV.each_with_index do |arg, i|
|
47
|
-
next if skip_i == i
|
48
|
-
if arg == "-t" or arg == "--template" # the item after this specifies the template to use
|
49
|
-
options.merge!({"template" => ARGV[i+1]})
|
50
|
-
skip_i = i+1
|
51
|
-
next
|
52
|
-
elsif !(arg =~ /^-/) # this must be what they want as the gem_name
|
53
|
-
gem_name = arg
|
54
|
-
end
|
53
|
+
if ARGV.length > 1
|
54
|
+
puts "Error: there were unrecognized parameters specified in command"
|
55
|
+
puts Bundlegem::HELP_MSG
|
56
|
+
exit 1
|
55
57
|
end
|
56
58
|
|
59
|
+
|
60
|
+
# fyi parser.parse! splices options out of ARGV, so gem_name doesn't need to be specified first
|
61
|
+
gem_name = ARGV.first
|
57
62
|
Bundlegem.gem(options, gem_name)
|
data/bundlegem.gemspec
CHANGED
@@ -11,28 +11,22 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.authors = ["TheNotary"]
|
12
12
|
s.email = ["no@mail.plz"]
|
13
13
|
s.summary = %q{This gem makes more gems!}
|
14
|
-
s.description = %q{ This is a gem for making more gems! I
|
14
|
+
s.description = %q{ This is a gem for making more gems! I know! It's like asking a genie for more wishes but it actually works!}
|
15
15
|
s.homepage = "https://github.com/thenotary/bundlegem"
|
16
16
|
s.license = "MIT"
|
17
17
|
|
18
|
-
s.metadata =
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
"source_code_uri" => "https://github.com/TheNotary/bundlegem/tree/v#{version}",
|
23
|
-
}
|
18
|
+
s.metadata["bug_tracker_uri"] = "https://github.com/TheNotary/bundlegem/issues"
|
19
|
+
s.metadata["changelog_uri"] = "https://github.com/TheNotary/bundlegem/releases/tag/v#{version}"
|
20
|
+
s.metadata["documentation_uri"] = "https://api.rubyonrails.org/v#{version}/"
|
21
|
+
s.metadata["source_code_uri"] = "https://github.com/TheNotary/bundlegem/tree/v#{version}"
|
24
22
|
|
25
23
|
s.files = `git ls-files -z`.split("\x0")
|
26
24
|
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
27
25
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
28
26
|
s.require_paths = ["lib"]
|
29
27
|
|
30
|
-
s.add_dependency "thor", "0.19.1"
|
31
28
|
s.add_dependency "bundler", "~> 2.5"
|
32
|
-
s.add_dependency "ostruct"
|
33
|
-
s.add_dependency "reline"
|
34
29
|
|
35
|
-
#s.add_development_dependency "bundler"#, "~> 1.8"
|
36
30
|
s.add_development_dependency "rake", "~> 13.2"
|
37
31
|
s.add_development_dependency "rspec"
|
38
32
|
s.add_development_dependency "pry"
|
data/changelog
CHANGED
@@ -1,5 +1,16 @@
|
|
1
|
-
** Planned 0.
|
1
|
+
** Planned 0.2.x **
|
2
2
|
- TBD
|
3
|
+
|
4
|
+
** 0.2.0 **
|
5
|
+
- Feature: improves stdout feedback to enhance UX
|
6
|
+
- Feature: hides stack trace when user is simply missing a bundlegem.yml file
|
7
|
+
- Feature: allows interpolation of template variables within bootstrap_command
|
8
|
+
- Feature: adds a 'config[:title]' variable
|
9
|
+
- Bugfix: fixes issue where .git and it's subfolders were being created from the source template repo which wasted time
|
10
|
+
- Bugfix: fixes a performance issue where shelling out to git check-ignored was being performed many times within high frequency loops
|
11
|
+
- Bugfix: fixes bug where not specifying the category of a template apparently causes the list function to crash
|
12
|
+
- Bugfix: Cleans out dependencies that are no longer used
|
13
|
+
- Bugfix: Cleaned out tons of dead code and addressed tech debt I've been putting off since 1.8.5
|
3
14
|
- Bugfix: Changes working directory before running bootstrap_commands
|
4
15
|
|
5
16
|
** 0.1.0 **
|
@@ -42,12 +53,12 @@
|
|
42
53
|
- Bugfix: fixes bug where I thought I was using something cool like figaro
|
43
54
|
but was not
|
44
55
|
- Bugfix: fixes bug where configuration wasn't loaded before running
|
45
|
-
--install-
|
56
|
+
--install-public-templates
|
46
57
|
- Bugfix: fixes bug where require pry was left in
|
47
58
|
|
48
59
|
** 0.0.7 **
|
49
60
|
|
50
|
-
- Feature: Ability to load templates from github via --install-
|
61
|
+
- Feature: Ability to load templates from github via --install-public-templates
|
51
62
|
- Feature: Make each user defined gem have a subfolder that is the exact
|
52
63
|
project structure, so the readme for the gem can exist without fear of it
|
53
64
|
being copied into new projects
|
data/config/config
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
# Comments made to this file will not be preserved
|
2
2
|
---
|
3
3
|
default_template: cli_gem
|
4
|
-
|
4
|
+
public_templates: https://github.com/TheNotary/template-ruby-cli-gem https://github.com/TheNotary/template-arduino.git https://github.com/TheNotary/template-docker-repo.git https://github.com/TheNotary/template-html-css-js.git https://github.com/TheNotary/template-java-gradle-cli-app
|
data/lib/bundlegem/cli/cli.rb
CHANGED
@@ -1,24 +1,36 @@
|
|
1
1
|
require 'find'
|
2
2
|
|
3
3
|
|
4
|
-
module Bundlegem::
|
5
|
-
|
4
|
+
module Bundlegem::CLI
|
5
|
+
module DirToTemplate
|
6
|
+
class << self
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
8
|
+
# returns the list of templates currently available as a well formatted string
|
9
|
+
def go
|
10
|
+
validate_working_directory!
|
11
|
+
file_enumerator = Find.find('.')
|
10
12
|
|
11
|
-
|
12
|
-
end
|
13
|
+
output = Bundlegem::Core::DirToTemplate.🧙🪄! file_enumerator
|
13
14
|
|
14
|
-
|
15
|
+
if output.empty?
|
16
|
+
output = "You have no templates. You can install the public example templates with\n"
|
17
|
+
output += "the below command\n\n"
|
18
|
+
output += "bundlegem --install-public-templates"
|
19
|
+
end
|
15
20
|
|
16
|
-
|
17
|
-
# check for the existence of a bundlegem.yml file which won't ordinarily exist
|
18
|
-
if !File.exist?("bundlegem.yml")
|
19
|
-
raise "error: bundlegem.yml file not found in current directory. Create it or run this command in the folder you thought you were in."
|
21
|
+
output
|
20
22
|
end
|
21
|
-
end
|
22
23
|
|
24
|
+
private
|
25
|
+
|
26
|
+
def validate_working_directory!
|
27
|
+
# check for the existence of a bundlegem.yml file which won't ordinarily exist
|
28
|
+
if !File.exist?("bundlegem.yml")
|
29
|
+
puts "error: bundlegem.yml file not found in current directory. Create it or run this command in the folder you thought you were in."
|
30
|
+
exit 1
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
23
35
|
end
|
24
36
|
end
|