bundlegem 1.2.0.pre.rc.1 → 1.2.0.pre.rc.3
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 +1 -0
- data/lib/bundlegem/core/dir_to_template.rb +1 -1
- data/lib/bundlegem/version.rb +1 -1
- data/lib/bundlegem.rb +23 -2
- data/spec/bundlegem_spec.rb +7 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4252af56659600bd023b9ec5b8a28a7120e82c798efec10a5c570a6000865125
|
4
|
+
data.tar.gz: 260746958c0274cf6a41477127c692ef89a12aae42e1cd717c6bb7670fd6ec2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf8adae7692ad36fd5cf991af02c67c878e256e141d0023e8b4700139cbd0e681bfb1fd9afefb70f53b4aba19f243a338775a309f7e9e740ac13b3599158a0c9
|
7
|
+
data.tar.gz: '09d7bdfb4faa2a1daca23b1c0b5ce3fb20e2d024f5a0e69d7adea81b6dfdd97888a1915b9bb5caa11367737b9dbeb53b024d500d436d8d410638af471cb32223'
|
data/changelog
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
- TBD
|
3
3
|
|
4
4
|
** 0.2.0 **
|
5
|
+
- Feature: improves stdout feedback to enhance UX
|
5
6
|
- Feature: hides stack trace when user is simply missing a bundlegem.yml file
|
6
7
|
- Feature: allows interpolation of template variables within bootstrap_command
|
7
8
|
- Feature: adds a 'config[:title]' variable
|
data/lib/bundlegem/version.rb
CHANGED
data/lib/bundlegem.rb
CHANGED
@@ -23,12 +23,20 @@ module Bundlegem
|
|
23
23
|
available_templates = configurator.collect_user_defined_templates
|
24
24
|
|
25
25
|
available_templates = group_hashes_by_key(available_templates)
|
26
|
-
|
26
|
+
output = convert_grouped_hashes_to_output(available_templates)
|
27
27
|
|
28
|
-
|
28
|
+
if output.empty?
|
29
|
+
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"
|
31
|
+
empty_output_msg += "bundlegem --install-public-templates"
|
32
|
+
return empty_output_msg
|
33
|
+
end
|
34
|
+
|
35
|
+
mark_default_template(output, configurator.default_template)
|
29
36
|
end
|
30
37
|
|
31
38
|
def install_public_templates
|
39
|
+
validate_git_is_installed!
|
32
40
|
configurator = Configurator.new
|
33
41
|
config_file_data = configurator.config_file_data
|
34
42
|
puts "Downloading templates from the following locations: \n #{config_file_data['public_templates'].split(" ").join("\n ")}"
|
@@ -45,6 +53,19 @@ module Bundlegem
|
|
45
53
|
end
|
46
54
|
end
|
47
55
|
|
56
|
+
def validate_git_is_installed!
|
57
|
+
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
|
58
|
+
ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
|
59
|
+
exts.each do |ext|
|
60
|
+
exe = File.join(path, "git#{ext}")
|
61
|
+
return if File.executable?(exe) && !File.directory?(exe)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
puts "Error: `git` command not found. Please install Git and ensure it's in your PATH."
|
66
|
+
exit 1
|
67
|
+
end
|
68
|
+
|
48
69
|
def dir_to_template
|
49
70
|
puts CLI::DirToTemplate.go
|
50
71
|
end
|
data/spec/bundlegem_spec.rb
CHANGED
@@ -16,6 +16,13 @@ describe Bundlegem do
|
|
16
16
|
|
17
17
|
# List
|
18
18
|
|
19
|
+
it 'gives the user a helpful output when there are no templates installed' do
|
20
|
+
list_output = Bundlegem.list
|
21
|
+
|
22
|
+
expect(list_output).to start_with "You have no templates."
|
23
|
+
expect(File).to exist("#{ENV['HOME']}/.bundlegem")
|
24
|
+
end
|
25
|
+
|
19
26
|
it 'creates a config file if needed and lists properly' do
|
20
27
|
create_user_defined_template
|
21
28
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bundlegem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.0.pre.rc.
|
4
|
+
version: 1.2.0.pre.rc.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TheNotary
|
@@ -116,9 +116,9 @@ licenses:
|
|
116
116
|
- MIT
|
117
117
|
metadata:
|
118
118
|
bug_tracker_uri: https://github.com/TheNotary/bundlegem/issues
|
119
|
-
changelog_uri: https://github.com/TheNotary/bundlegem/releases/tag/v1.2.0-rc.
|
120
|
-
documentation_uri: https://api.rubyonrails.org/v1.2.0-rc.
|
121
|
-
source_code_uri: https://github.com/TheNotary/bundlegem/tree/v1.2.0-rc.
|
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
|
122
122
|
rdoc_options: []
|
123
123
|
require_paths:
|
124
124
|
- lib
|