bundlegem 1.1.0 → 1.2.0.pre.rc.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.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +0 -1
  3. data/README.md +26 -37
  4. data/Rakefile +3 -5
  5. data/bin/bundlegem +45 -40
  6. data/bundlegem.gemspec +5 -11
  7. data/changelog +14 -3
  8. data/config/config +1 -1
  9. data/lib/bundlegem/cli/cli.rb +0 -4
  10. data/lib/bundlegem/cli/dir_to_template.rb +16 -13
  11. data/lib/bundlegem/cli/gem.rb +77 -158
  12. data/lib/bundlegem/strings.rb +1 -1
  13. data/lib/bundlegem/template_manager.rb +2 -2
  14. data/lib/bundlegem/templates/test_template/#{name}.rb.tt +1 -0
  15. data/lib/bundlegem/version.rb +1 -1
  16. data/lib/bundlegem.rb +13 -15
  17. data/spec/bundlegem_spec.rb +30 -29
  18. data/spec/data/variable_manifest_test.rb +1 -0
  19. data/spec/spec_helper.rb +1 -2
  20. data/spec/template_manager_spec.rb +1 -1
  21. metadata +7 -113
  22. data/.travis.yml +0 -3
  23. data/lib/bundlegem/cli.rb +0 -166
  24. data/lib/bundlegem/friendly_errors.rb +0 -79
  25. data/lib/bundlegem/templates/Executable +0 -16
  26. data/lib/bundlegem/templates/Executable.standalone +0 -12
  27. data/lib/bundlegem/templates/Gemfile +0 -4
  28. data/lib/bundlegem/templates/c_extension_gem/#{name}.gemspec.tt +0 -28
  29. data/lib/bundlegem/templates/c_extension_gem/.travis.yml.tt +0 -3
  30. data/lib/bundlegem/templates/c_extension_gem/CODE_OF_CONDUCT.md.tt +0 -13
  31. data/lib/bundlegem/templates/c_extension_gem/Gemfile.tt +0 -4
  32. data/lib/bundlegem/templates/c_extension_gem/LICENSE.txt.tt +0 -21
  33. data/lib/bundlegem/templates/c_extension_gem/README.md.tt +0 -39
  34. data/lib/bundlegem/templates/c_extension_gem/Rakefile.tt +0 -13
  35. data/lib/bundlegem/templates/c_extension_gem/bin/#{name}.tt +0 -3
  36. data/lib/bundlegem/templates/c_extension_gem/bin/console.tt +0 -14
  37. data/lib/bundlegem/templates/c_extension_gem/changelog.tt +0 -7
  38. data/lib/bundlegem/templates/c_extension_gem/ext/#{name}/#{name}.c.tt +0 -9
  39. data/lib/bundlegem/templates/c_extension_gem/ext/#{name}/#{name}.h.tt +0 -6
  40. data/lib/bundlegem/templates/c_extension_gem/ext/#{name}/extconf.rb.tt +0 -3
  41. data/lib/bundlegem/templates/c_extension_gem/gitignore.tt +0 -16
  42. data/lib/bundlegem/templates/c_extension_gem/lib/#{name}/version.rb.tt +0 -7
  43. data/lib/bundlegem/templates/c_extension_gem/lib/#{name}.rb.tt +0 -12
  44. data/lib/bundlegem/templates/c_extension_gem/rspec.tt +0 -2
  45. data/lib/bundlegem/templates/c_extension_gem/spec/#{name}_spec.rb.tt +0 -11
  46. data/lib/bundlegem/templates/c_extension_gem/spec/spec_helper.rb.tt +0 -2
  47. data/lib/bundlegem/templates/cli_gem/#{name}.gemspec.tt +0 -42
  48. data/lib/bundlegem/templates/cli_gem/CODE_OF_CONDUCT.md.tt +0 -13
  49. data/lib/bundlegem/templates/cli_gem/Gemfile.tt +0 -4
  50. data/lib/bundlegem/templates/cli_gem/LICENSE.txt.tt +0 -3
  51. data/lib/bundlegem/templates/cli_gem/README.md.tt +0 -38
  52. data/lib/bundlegem/templates/cli_gem/Rakefile.tt +0 -31
  53. data/lib/bundlegem/templates/cli_gem/bin/console.tt +0 -14
  54. data/lib/bundlegem/templates/cli_gem/changelog.tt +0 -7
  55. data/lib/bundlegem/templates/cli_gem/exe/#{name}.tt +0 -12
  56. data/lib/bundlegem/templates/cli_gem/ext/#{name}/#{name}.c.tt +0 -9
  57. data/lib/bundlegem/templates/cli_gem/ext/#{name}/#{name}.h.tt +0 -6
  58. data/lib/bundlegem/templates/cli_gem/ext/#{name}/extconf.rb.tt +0 -3
  59. data/lib/bundlegem/templates/cli_gem/gitignore.tt +0 -15
  60. data/lib/bundlegem/templates/cli_gem/lib/#{name}/config.rb.tt +0 -40
  61. data/lib/bundlegem/templates/cli_gem/lib/#{name}/constants.rb.tt +0 -9
  62. data/lib/bundlegem/templates/cli_gem/lib/#{name}/version.rb.tt +0 -7
  63. data/lib/bundlegem/templates/cli_gem/lib/#{name}.rb.tt +0 -26
  64. data/lib/bundlegem/templates/cli_gem/rspec.tt +0 -2
  65. data/lib/bundlegem/templates/cli_gem/spec/#{name}/config_spec.rb.tt +0 -25
  66. data/lib/bundlegem/templates/cli_gem/spec/#{name}_int.rb.tt +0 -16
  67. data/lib/bundlegem/templates/cli_gem/spec/#{name}_spec.rb.tt +0 -17
  68. data/lib/bundlegem/templates/cli_gem/spec/data/sample_data.json.tt +0 -1
  69. data/lib/bundlegem/templates/cli_gem/spec/spec_helper.rb.tt +0 -2
  70. data/lib/bundlegem/templates/newgem/#{name}.gemspec.tt +0 -33
  71. data/lib/bundlegem/templates/newgem/.gitignore.tt +0 -16
  72. data/lib/bundlegem/templates/newgem/.travis.yml.tt +0 -3
  73. data/lib/bundlegem/templates/newgem/CODE_OF_CONDUCT.md.tt +0 -13
  74. data/lib/bundlegem/templates/newgem/Gemfile.tt +0 -10
  75. data/lib/bundlegem/templates/newgem/LICENSE.txt.tt +0 -21
  76. data/lib/bundlegem/templates/newgem/README.md.tt +0 -41
  77. data/lib/bundlegem/templates/newgem/Rakefile.tt +0 -40
  78. data/lib/bundlegem/templates/newgem/bin/#{name}.tt +0 -3
  79. data/lib/bundlegem/templates/newgem/bin/console.tt +0 -14
  80. data/lib/bundlegem/templates/newgem/changelog.tt +0 -7
  81. data/lib/bundlegem/templates/newgem/lib/#{name}/version.rb.tt +0 -7
  82. data/lib/bundlegem/templates/newgem/lib/#{name}.rb.tt +0 -12
  83. data/lib/bundlegem/templates/newgem/rspec.tt +0 -2
  84. data/lib/bundlegem/templates/newgem/spec/#{name}_spec.rb.tt +0 -11
  85. 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: 59cedb35eb5e27205162bbf4cab34f99d0269f2becdaa7e0544b614bad7510eb
4
- data.tar.gz: 79334971e8ac017e651e5aeab129ede8e5be7b8ba4491fdcbed360d9286ce795
3
+ metadata.gz: 01cac2cb35073ac3d2fbcc5a3348f02d16c48c9e00fdbffe45f84a6eb751cdf5
4
+ data.tar.gz: aa46c0b2f3449e106a906b141edc6f899f03944ae2472274201a9c158e9dc7d4
5
5
  SHA512:
6
- metadata.gz: c728247b2e279c30b46efebb45d26f52cca5c052286bedc04a55f190b3c88242db8fe4b5e4ae7e22210c67c0fb84d2e80569b43da151d24e0a63b469925d7bfc
7
- data.tar.gz: cf6e1c50c39fa472fced36fc8175e716e43d7d61563f3e0efdce4a83ddecdc72733b0a956c9a111e1f1c568285d3e7d8171740af8d2864a7540b94b5a1b2df2a
6
+ metadata.gz: 1f75e66cfb9efc80e68853c85a25f3d98550094c84ef151b62d9d8fc0fd5c140d04ea45b5885e7f33fbca40a366b28312d8fb8866f3df7012b96057403738aef
7
+ data.tar.gz: dc4eb16a79fbc0bb119f53a5c04e5447297000891108c3c234dfdd88c332dd189d3e10d3b1f64e8df085952f0977512faf9a6b8b6cc13b3e84329ff8a59bce36
data/Gemfile CHANGED
@@ -1,4 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in bundlegem.gemspec
4
3
  gemspec
data/README.md CHANGED
@@ -1,33 +1,33 @@
1
1
  # BundleGem: A Gem Project Generator with User Defined Templates
2
2
  [![Gem Version](https://badge.fury.io/rb/bundlegem.svg)](https://badge.fury.io/rb/bundlegem)
3
3
 
4
- The goal of the project is to allow users to define templates in the most native form to all technologist: Directory Structures, short commands, and helpful commands which make the gem's usage completely visible!
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
- The benefits of using this repo to create gems rather than bundler is that you can choose to create 'classes' of gems. By classes, I mean that there are different types of 'gems', there are basic library gems, that are just code and can only be used from other code, there are command line application gems, those are gems that are run on the command line and include a binary file, and there are also web interface gems, those are gems which spin up a simple web interface and request that the user connect to it's server on what ever port it has spun up on. Depending on your field of specialty, you may be able to imagine other classes of gems that will aid you in your work.
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
- ### Configuration
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 project_name -t arduino
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
- ### List Available Templates
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
- MISC:
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
- EMBEDDED:
54
- arduino
47
+ ```
48
+ [user]
49
+ email = me@example.com
50
+ name = Me
51
+ repo-domain = github.com
55
52
  ```
56
53
 
57
- You'll find a project skeleton in ~/.bundlegem/templates/my_service that you can customize to your liking.
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-best-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/go-cli) for instance.
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', :current => true do
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 :default => :spec
38
- task :test => :spec
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
- # Exit cleanly from an early interrupt
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
- if ARGV.length < 1
11
- puts "Error: you need to specify a name for the project being created\n\n"
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
- if ARGV[0] == "--help"
17
- puts Bundlegem::HELP_MSG
18
- exit 0
19
- end
11
+ parser = OptionParser.new do |opts|
12
+ opts.banner = "Usage: #{File.basename($0)} [options] GEM_NAME"
20
13
 
21
- if ARGV[0] == "--list" or ARGV[0] == "-l"
22
- puts Bundlegem.list
23
- exit 0
24
- end
14
+ opts.on("-t", "--template TEMPLATE", "Specify a template") do |template|
15
+ options[:template] = template
16
+ end
25
17
 
26
- if ARGV[0] == "--version" or ARGV[0] == "-v"
27
- puts Bundlegem.version
28
- exit 0
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
- if ARGV[0] == "--install-best-templates"
32
- Bundlegem.install_best_templates
33
- exit 0
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
- if ARGV[0] == "--to-template"
37
- Bundlegem.dir_to_template
38
- exit 0
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
- options = {"bin"=>false, "ext"=>false, :coc=> false}
42
- gem_name = ""
43
- skip_i = -99
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 KNOW! ISN'T THAT LIKE WISHING FOR MORE WISHES!}
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
- "bug_tracker_uri" => "https://github.com/TheNotary/bundlegem/issues",
20
- "changelog_uri" => "https://github.com/TheNotary/bundlegem/releases/tag/v#{version}",
21
- "documentation_uri" => "https://api.rubyonrails.org/v#{version}/",
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,6 +1,17 @@
1
- ** Planned 0.1.x **
1
+ ** Planned 0.2.x **
2
2
  - TBD
3
3
 
4
+ ** 0.2.0 **
5
+ - Feature: hides stack trace when user is simply missing a bundlegem.yml file
6
+ - Feature: allows interpolation of template variables within bootstrap_command
7
+ - Feature: adds a 'config[:title]' variable
8
+ - Bugfix: fixes issue where .git and it's subfolders were being created from the source template repo which wasted time
9
+ - Bugfix: fixes a performance issue where shelling out to git check-ignored was being performed many times within high frequency loops
10
+ - Bugfix: fixes bug where not specifying the category of a template apparently causes the list function to crash
11
+ - Bugfix: Cleans out dependencies that are no longer used
12
+ - Bugfix: Cleaned out tons of dead code and addressed tech debt I've been putting off since 1.8.5
13
+ - Bugfix: Changes working directory before running bootstrap_commands
14
+
4
15
  ** 0.1.0 **
5
16
  - Feature: Drops .bundlegem file in favor of bundlegem.yml in templates
6
17
  - Feature: Introduces `--to-template` switch to add a `.tt` extension to all files in the current directory
@@ -41,12 +52,12 @@
41
52
  - Bugfix: fixes bug where I thought I was using something cool like figaro
42
53
  but was not
43
54
  - Bugfix: fixes bug where configuration wasn't loaded before running
44
- --install-best-templates
55
+ --install-public-templates
45
56
  - Bugfix: fixes bug where require pry was left in
46
57
 
47
58
  ** 0.0.7 **
48
59
 
49
- - Feature: Ability to load templates from github via --install-best-templates
60
+ - Feature: Ability to load templates from github via --install-public-templates
50
61
  - Feature: Make each user defined gem have a subfolder that is the exact
51
62
  project structure, so the readme for the gem can exist without fear of it
52
63
  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
- best_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
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
@@ -1,5 +1 @@
1
- # The namespace CLI is taken by the legacy code :(
2
- module Bundlegem::Cli
3
- end
4
-
5
1
  require 'bundlegem/cli/dir_to_template'
@@ -1,24 +1,27 @@
1
1
  require 'find'
2
2
 
3
3
 
4
- module Bundlegem::Cli::DirToTemplate
5
- class << self
4
+ module Bundlegem::CLI
5
+ module DirToTemplate
6
+ class << self
6
7
 
7
- def go
8
- validate_working_directory!
9
- file_enumerator = Find.find('.')
8
+ def go
9
+ validate_working_directory!
10
+ file_enumerator = Find.find('.')
10
11
 
11
- Bundlegem::Core::DirToTemplate.🧙🪄! file_enumerator
12
- end
12
+ Bundlegem::Core::DirToTemplate.🧙🪄! file_enumerator
13
+ end
13
14
 
14
- private
15
+ private
15
16
 
16
- def validate_working_directory!
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."
17
+ def validate_working_directory!
18
+ # check for the existence of a bundlegem.yml file which won't ordinarily exist
19
+ if !File.exist?("bundlegem.yml")
20
+ puts "error: bundlegem.yml file not found in current directory. Create it or run this command in the folder you thought you were in."
21
+ exit 1
22
+ end
20
23
  end
21
- end
22
24
 
25
+ end
23
26
  end
24
27
  end