serverspec_launcher 0.4.1 → 0.4.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9c1afe040d8228a04805687615aa41ff1b14bb30bad7fe0a7542d1d23ef9f1e
|
4
|
+
data.tar.gz: 2ff2e59ee8b060157648635d0c397441f41bc9108b302e0eed83bd7962c5ec24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14e5a182ad429e5910315d8220cb2cdf3b277a3dc34afaef953ec833fcbb546c198a93019f3344f65dcd7d73e029963c44ba2478e676831736257fd696bcf21f
|
7
|
+
data.tar.gz: e4c7781fdfbfcb12975449842c8f5233ab89494713ced8d16f707d25e0fe535a8f7577b2b618c0719e55d4e9a131e1cb9d165592b3c5391ec5af93e49526e86b
|
@@ -4,13 +4,13 @@ require 'serverspec_launcher/version'
|
|
4
4
|
# Generates the rakefile that will bring in the serverspec tasks
|
5
5
|
class GemspecGenerator
|
6
6
|
|
7
|
-
def initialize(
|
8
|
-
path = root_path ? "#{root_path}/" : ''
|
7
|
+
def initialize(options = {})
|
8
|
+
path = options[:root_path] ? "#{options[:root_path]}/" : ''
|
9
9
|
@template_path = File.expand_path('../../../../templates', __FILE__)
|
10
10
|
@project_name = Dir.pwd.split('/')[-1]
|
11
11
|
@gemspec_file = "#{path}#{@project_name}.gemspec"
|
12
|
-
@name = '<Your Name>'
|
13
|
-
@email = '<Your email>'
|
12
|
+
@name = options[:name] || '<Your Name>'
|
13
|
+
@email = options[:email] || '<Your email>'
|
14
14
|
end
|
15
15
|
|
16
16
|
def gemspec_template
|
data/lib/serverspec_launcher.rb
CHANGED
@@ -28,8 +28,8 @@ module ServerspecLauncher
|
|
28
28
|
properties.generate
|
29
29
|
end
|
30
30
|
|
31
|
-
def self.generate_gemspec
|
32
|
-
gemspec = GemspecGenerator.new
|
31
|
+
def self.generate_gemspec(options = {})
|
32
|
+
gemspec = GemspecGenerator.new options
|
33
33
|
gemspec.generate
|
34
34
|
end
|
35
35
|
|
@@ -47,8 +47,16 @@ module ServerspecLauncher
|
|
47
47
|
|
48
48
|
def self.create_repo
|
49
49
|
if which 'git'
|
50
|
+
name = `git config user.name`.chomp
|
51
|
+
email = `git config user.email`.chomp
|
52
|
+
|
50
53
|
system('git init .') unless Dir.exists? '.git'
|
54
|
+
return {
|
55
|
+
name: name == '' ? nil : name,
|
56
|
+
email: email == '' ? nil : email,
|
57
|
+
}
|
51
58
|
end
|
59
|
+
{}
|
52
60
|
end
|
53
61
|
|
54
62
|
def self.check_args(args)
|
@@ -64,8 +72,9 @@ module ServerspecLauncher
|
|
64
72
|
generate_spec_helper
|
65
73
|
generate_rakefile
|
66
74
|
generate_rolespec
|
67
|
-
generate_gemspec
|
68
|
-
|
75
|
+
generate_gemspec create_repo
|
76
|
+
|
77
|
+
|
69
78
|
end
|
70
79
|
|
71
80
|
def self.process_command(args)
|
data/templates/gemspec.rb.erb
CHANGED
@@ -7,8 +7,8 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
8
|
spec.name = '<%= @project_name %>'
|
9
9
|
spec.version = '0.1.0'
|
10
|
-
spec.authors = [<%= @name %>]
|
11
|
-
spec.email = [<%= @email %>>]
|
10
|
+
spec.authors = ['<%= @name %>']
|
11
|
+
spec.email = ['<%= @email %>>']
|
12
12
|
|
13
13
|
spec.summary = "TODO: "
|
14
14
|
spec.description = "TODO: "
|