regen 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/lib/regen.rb +14 -6
- metadata +10 -11
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
ODk2ZjgwNjdjZTFiYTc3ZThjZThmMDcyOWJhMjY0ZDM2YjI4YTMyNw==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e6a79edaffc766dd439bd277518e19a394790476
|
4
|
+
data.tar.gz: 35e6f61a969efdecb18c8117d9088c8fc9af9fb6
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
NDA3YzU1NjA2OTZlMTc1OWVkMmU4M2QwYzI2MDkwMmJlNGNjZjcwODMxNTQ4
|
11
|
-
NGMzNTRhOWQ4OTQ4OTc3MDEyM2VmYzdjZTExM2IxYTBjMjgxYWU=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
MjU3NDg1NTc1ODUwMzk3MTVjMTA5OGMzZGM5N2U1ZDZiOTU2NmM5ZDUxOWNi
|
14
|
-
NGE2MzBiMmQzMTM0ZGNhMTBhNzA5NWY4ZDJiNDE5NTQwMmE3MzdlNjFjMzZj
|
15
|
-
Mjk2NjQwOWUxYjc0ODE0MjJhMjE5NjllNTc3ZjQ1ZGI4MWYzZGE=
|
6
|
+
metadata.gz: e2f092b9b3bed5176be45ac06206987c1aa9ae9c9cfbbcd41af07f8328ac23d31e8a978dda48367b09f37f4d0e0db876a657b7b4fbe5f9782234a9ef81c172f5
|
7
|
+
data.tar.gz: 82977d176b76d0608cc6d6fa27dff2b51360bac7f1f91e56f029c79b29cbb97b89d534ac3859b5488fbfabfd30b32f4ad882e478de333df382e0155f74119b6f
|
data/lib/regen.rb
CHANGED
@@ -6,7 +6,7 @@ options = {}
|
|
6
6
|
OptionParser.new do |opts|
|
7
7
|
opts.banner = "Usage: rgen.rb [options]"
|
8
8
|
|
9
|
-
opts.on("-c", "--config CONFIGFILE", "Specify Config file") do |c|
|
9
|
+
opts.on("-c", "--config CONFIGFILE", "Specify Config file (Defaults to regen.json)") do |c|
|
10
10
|
options[:config_file] = c
|
11
11
|
end
|
12
12
|
|
@@ -15,12 +15,20 @@ OptionParser.new do |opts|
|
|
15
15
|
end
|
16
16
|
end.parse!
|
17
17
|
|
18
|
-
options[:config_file] ||= "
|
18
|
+
options[:config_file] ||= "regen.json"
|
19
19
|
|
20
20
|
# Create the destination directory if it doesn't exist
|
21
21
|
raise 'A destination directory must be specified' unless options[:destination]
|
22
22
|
Dir.mkdir options[:destination] unless File.exists? options[:destination]
|
23
23
|
|
24
|
+
# Allow pointing to a Git repo for the config file
|
25
|
+
|
26
|
+
clones = []
|
27
|
+
if options[:config_file].match(/http|https/)
|
28
|
+
`git clone #{options[:config_file]} rgen_clone_tmp`
|
29
|
+
clones << options[:config_file]
|
30
|
+
end
|
31
|
+
|
24
32
|
file = File.read(options[:config_file])
|
25
33
|
data = JSON.parse(file)
|
26
34
|
|
@@ -43,9 +51,9 @@ Dir.chdir(start_dir)
|
|
43
51
|
Dir.mkdir "./rgen_tmp"
|
44
52
|
data["ignore"] ||= []
|
45
53
|
data["templates"] ||= []
|
46
|
-
data["templates"].each do |
|
47
|
-
if
|
48
|
-
`git clone #{
|
54
|
+
data["templates"].each do |template|
|
55
|
+
if template.match(/http|https/)
|
56
|
+
`git clone #{template} rgen_clone_tmp` unless clones.include?(template)
|
49
57
|
Dir.foreach("rgen_clone_tmp") do |x|
|
50
58
|
unless [".", ".."].include?(x)
|
51
59
|
FileUtils.mv("rgen_clone_tmp/#{x}", "rgen_tmp/") unless data["ignore"].include?(x)
|
@@ -53,7 +61,7 @@ data["templates"].each do |command|
|
|
53
61
|
end
|
54
62
|
FileUtils.remove_dir "rgen_clone_tmp"
|
55
63
|
else
|
56
|
-
`cp -R #{
|
64
|
+
`cp -R #{template} ./rgen_tmp/`
|
57
65
|
end
|
58
66
|
end
|
59
67
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: regen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joiey Seeley
|
@@ -14,28 +14,28 @@ dependencies:
|
|
14
14
|
name: pry-byebug
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 3.2.0
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 3.2.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: json
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 1.8.3
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 1.8.3
|
41
41
|
description: Quickly generate project boilerplate so you can get to work.
|
@@ -45,9 +45,9 @@ executables:
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
-
- lib/regen.rb
|
49
48
|
- bin/regen
|
50
|
-
|
49
|
+
- lib/regen.rb
|
50
|
+
homepage: https://github.com/bigtunacan/regen.git
|
51
51
|
licenses:
|
52
52
|
- MIT
|
53
53
|
metadata: {}
|
@@ -57,19 +57,18 @@ require_paths:
|
|
57
57
|
- lib
|
58
58
|
required_ruby_version: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- -
|
60
|
+
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '0'
|
63
63
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- -
|
65
|
+
- - ">="
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: '0'
|
68
68
|
requirements: []
|
69
69
|
rubyforge_project:
|
70
|
-
rubygems_version: 2.
|
70
|
+
rubygems_version: 2.4.8
|
71
71
|
signing_key:
|
72
72
|
specification_version: 4
|
73
73
|
summary: Regen
|
74
74
|
test_files: []
|
75
|
-
has_rdoc:
|