bundlegem 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/bundlegem +1 -1
- data/lib/bundlegem.rb +18 -16
- data/lib/bundlegem/cli/gem.rb +0 -1
- data/lib/bundlegem/configurator.rb +5 -5
- data/lib/bundlegem/version.rb +1 -1
- data/spec/bundlegem_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e5e797b5856b222d593bf5b5e8916bd616f66f1
|
4
|
+
data.tar.gz: 5839b9e9cd73a5252259e22b8049a8de2ba296b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1ce5dc9007921c797c56d8717d1c4a97feb68ea56d420dfdd97cb09f598278945a61ed36fba122ab2fb62e722610d1a5c54d9ffb25c5d8bf05b1cc697702808
|
7
|
+
data.tar.gz: d36b8764acd21cb34d9e5b2db1b6c690eeb75b33ed9383eea394577d07ac133d7eeec07c79b614e9a0b45c9763413e35b8f730a26b5f0a3a6040fa76adf4ad6d
|
data/bin/bundlegem
CHANGED
data/lib/bundlegem.rb
CHANGED
@@ -32,6 +32,24 @@ module Bundlegem
|
|
32
32
|
mark_default_template(output_string, configurator.default_template)
|
33
33
|
end
|
34
34
|
|
35
|
+
def install_best_templates
|
36
|
+
configurator = Configurator.new
|
37
|
+
config_file_data = configurator.config_file_data
|
38
|
+
puts "Downloading templates from the following locations: \n #{config_file_data['best_templates'].split(" ").join("\n ")}"
|
39
|
+
config_file_data['best_templates'].split.each do |url|
|
40
|
+
uri = URI.parse(url)
|
41
|
+
template_folder_name = File.basename(uri.path).sub(/\.git$/, "")
|
42
|
+
if !File.exists?("#{ENV['HOME']}/.bundlegem/templates/#{template_folder_name}")
|
43
|
+
cmd = "cd #{ENV['HOME']}/.bundlegem/templates && git clone #{url}"
|
44
|
+
cmd += " 2> /dev/null" if $test_env
|
45
|
+
`#{cmd}`
|
46
|
+
else
|
47
|
+
# TODO:
|
48
|
+
# Prompt to update the repo if they have a clean working state.
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
35
53
|
def gem(options, gem_name)
|
36
54
|
require 'bundlegem/cli'
|
37
55
|
require 'bundlegem/cli/gem'
|
@@ -112,22 +130,6 @@ module Bundlegem
|
|
112
130
|
end
|
113
131
|
end
|
114
132
|
|
115
|
-
def install_best_templates
|
116
|
-
puts "Downloading templates from the following locations: #{ENV['best_templates']}"
|
117
|
-
ENV['best_templates'].split.each do |url|
|
118
|
-
uri = URI.parse(url)
|
119
|
-
template_folder_name = File.basename(uri.path).sub(/\.git$/, "")
|
120
|
-
if !File.exists?(template_folder_name)
|
121
|
-
cmd = "cd #{ENV['HOME']}/.bundlegem/templates && git clone #{url}"
|
122
|
-
cmd += " 2> /dev/null" if $test_env
|
123
|
-
`#{cmd}`
|
124
|
-
else
|
125
|
-
# TODO:
|
126
|
-
# Prompt to update the repo if they have a clean working state.
|
127
|
-
end
|
128
|
-
end
|
129
|
-
end
|
130
|
-
|
131
133
|
end
|
132
134
|
|
133
135
|
end
|
data/lib/bundlegem/cli/gem.rb
CHANGED
@@ -4,7 +4,7 @@ require 'yaml'
|
|
4
4
|
module Bundlegem
|
5
5
|
|
6
6
|
class Configurator
|
7
|
-
attr_accessor :user_defined_templates, :user_downloaded_templates
|
7
|
+
attr_accessor :user_defined_templates, :user_downloaded_templates, :config_file_data
|
8
8
|
|
9
9
|
def initialize
|
10
10
|
@config_directory_root = "#{ENV['HOME']}/.bundlegem"
|
@@ -17,16 +17,16 @@ module Bundlegem
|
|
17
17
|
@user_downloaded_templates = get_user_downloaded_templates
|
18
18
|
|
19
19
|
# load configurations from config file
|
20
|
-
@
|
20
|
+
@config_file_data = YAML.load_file @config_file
|
21
21
|
end
|
22
22
|
|
23
23
|
def default_template
|
24
|
-
@
|
24
|
+
@config_file_data["default_template"]
|
25
25
|
end
|
26
26
|
|
27
27
|
def default_template=(val)
|
28
|
-
@
|
29
|
-
File.write(@config_file, "# Comments made to this file will not be preserved\n#{YAML.dump(@
|
28
|
+
@config_file_data["default_template"] = val
|
29
|
+
File.write(@config_file, "# Comments made to this file will not be preserved\n#{YAML.dump(@config_file_data)}")
|
30
30
|
end
|
31
31
|
|
32
32
|
def built_in_templates
|
data/lib/bundlegem/version.rb
CHANGED
data/spec/bundlegem_spec.rb
CHANGED
@@ -32,7 +32,7 @@ describe Bundlegem do
|
|
32
32
|
expect(list_output.include?(category)).to be true
|
33
33
|
end
|
34
34
|
|
35
|
-
#
|
35
|
+
# This bulids the default gem template
|
36
36
|
it "can generate the default built-in gem fine" do
|
37
37
|
options = {"bin"=>false, "ext"=>false, :coc=> false}
|
38
38
|
gem_name = "tmp_gem"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bundlegem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TheNotary
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|