maven-helper-script 0.1.6 → 0.2.0
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 +7 -0
- data/.document +4 -4
- data/Gemfile +7 -7
- data/Gemfile.lock +58 -19
- data/LICENSE.txt +20 -20
- data/VERSION +1 -1
- data/bin/m +5 -5
- data/lib/project_home_finder.rb +40 -40
- data/lib/script_runner.rb +67 -67
- data/maven-helper-script.gemspec +72 -71
- data/test/argument_parser_spec.rb +12 -12
- data/test/configuration_checker_map_spec.rb +5 -5
- data/test/configuration_checker_spec.rb +5 -5
- data/test/invalid_command_exception_spec.rb +2 -2
- data/test/project_home_finder_spec.rb +22 -22
- data/travis.yml +4 -4
- metadata +20 -31
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a26b6db1b94b9a474bf0c60744d35c471c6fde2b
|
4
|
+
data.tar.gz: 6c67546a38c714d6d0a92a41681f876a19f93762
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f16fba758a26bd495536564c8355d234a928f74cca4806931b4c8e842663f42e8112aa835ac43ee049ed2ad79cd27f0aae2d1199a05e9b2e91e9cc97267e3c0f
|
7
|
+
data.tar.gz: 4bf3f5780a2b6c94d51e1142d15ae4da23a0173faea759c3b85a9e58691c45ef25f076c021fad87553c9dbf7cc5f4af7a83118939b4c003c49109ea42897b130
|
data/.document
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
lib/**/*.rb
|
2
|
-
bin/*
|
3
|
-
LICENSE.txt
|
4
|
-
README.rdoc
|
1
|
+
lib/**/*.rb
|
2
|
+
bin/*
|
3
|
+
LICENSE.txt
|
4
|
+
README.rdoc
|
data/Gemfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
source "http://rubygems.org"
|
2
|
-
|
3
|
-
group :development do
|
4
|
-
gem
|
5
|
-
gem
|
6
|
-
gem
|
7
|
-
end
|
1
|
+
source "http://rubygems.org"
|
2
|
+
|
3
|
+
group :development do
|
4
|
+
gem 'rdoc', '~> 4.2'
|
5
|
+
gem 'jeweler', '~> 2.0'
|
6
|
+
gem 'rspec', '~> 3.2'
|
7
|
+
end
|
data/Gemfile.lock
CHANGED
@@ -1,30 +1,69 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
addressable (2.3.8)
|
5
|
+
builder (3.2.2)
|
6
|
+
descendants_tracker (0.0.4)
|
7
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
8
|
+
diff-lcs (1.2.5)
|
9
|
+
faraday (0.9.1)
|
10
|
+
multipart-post (>= 1.2, < 3)
|
11
|
+
git (1.2.9.1)
|
12
|
+
github_api (0.12.3)
|
13
|
+
addressable (~> 2.3)
|
14
|
+
descendants_tracker (~> 0.0.4)
|
15
|
+
faraday (~> 0.8, < 0.10)
|
16
|
+
hashie (>= 3.3)
|
17
|
+
multi_json (>= 1.7.5, < 2.0)
|
18
|
+
nokogiri (~> 1.6.3)
|
19
|
+
oauth2
|
20
|
+
hashie (3.4.1)
|
21
|
+
highline (1.7.2)
|
22
|
+
jeweler (2.0.1)
|
23
|
+
builder
|
24
|
+
bundler (>= 1.0)
|
8
25
|
git (>= 1.2.5)
|
26
|
+
github_api
|
27
|
+
highline (>= 1.6.15)
|
28
|
+
nokogiri (>= 1.5.10)
|
9
29
|
rake
|
10
30
|
rdoc
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
31
|
+
jwt (1.4.1)
|
32
|
+
mini_portile (0.6.2)
|
33
|
+
multi_json (1.11.0)
|
34
|
+
multi_xml (0.5.5)
|
35
|
+
multipart-post (2.0.0)
|
36
|
+
nokogiri (1.6.6.2)
|
37
|
+
mini_portile (~> 0.6.0)
|
38
|
+
oauth2 (1.0.0)
|
39
|
+
faraday (>= 0.8, < 0.10)
|
40
|
+
jwt (~> 1.0)
|
41
|
+
multi_json (~> 1.3)
|
42
|
+
multi_xml (~> 0.5)
|
43
|
+
rack (~> 1.2)
|
44
|
+
rack (1.6.0)
|
45
|
+
rake (10.4.2)
|
46
|
+
rdoc (4.2.0)
|
47
|
+
rspec (3.2.0)
|
48
|
+
rspec-core (~> 3.2.0)
|
49
|
+
rspec-expectations (~> 3.2.0)
|
50
|
+
rspec-mocks (~> 3.2.0)
|
51
|
+
rspec-core (3.2.3)
|
52
|
+
rspec-support (~> 3.2.0)
|
53
|
+
rspec-expectations (3.2.1)
|
54
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
55
|
+
rspec-support (~> 3.2.0)
|
56
|
+
rspec-mocks (3.2.1)
|
57
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
58
|
+
rspec-support (~> 3.2.0)
|
59
|
+
rspec-support (3.2.2)
|
60
|
+
thread_safe (0.3.5)
|
23
61
|
|
24
62
|
PLATFORMS
|
63
|
+
ruby
|
25
64
|
x86-mingw32
|
26
65
|
|
27
66
|
DEPENDENCIES
|
28
|
-
jeweler (~>
|
29
|
-
rdoc (~>
|
30
|
-
rspec (~> 2
|
67
|
+
jeweler (~> 2.0)
|
68
|
+
rdoc (~> 4.2)
|
69
|
+
rspec (~> 3.2)
|
data/LICENSE.txt
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
Copyright (c) 2012 to the original authors
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1
|
+
Copyright (c) 2012 to the original authors
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/bin/m
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
3
|
-
require 'script_runner'
|
4
|
-
|
5
|
-
MavenHelperScript::ScriptRunner.new().run(ARGV)
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
3
|
+
require 'script_runner'
|
4
|
+
|
5
|
+
MavenHelperScript::ScriptRunner.new().run(ARGV)
|
data/lib/project_home_finder.rb
CHANGED
@@ -1,41 +1,41 @@
|
|
1
|
-
require "pathname"
|
2
|
-
|
3
|
-
module MavenHelperScript
|
4
|
-
|
5
|
-
class ProjectHomeFinder
|
6
|
-
public
|
7
|
-
def findProjectDirectory(file)
|
8
|
-
@originalPath = Pathname.new(File.expand_path(file))
|
9
|
-
@path = @originalPath
|
10
|
-
found = false
|
11
|
-
|
12
|
-
while !found
|
13
|
-
found = foundProjectArtifacts(File.join(@path))
|
14
|
-
if !found
|
15
|
-
if !outOfDirectoriesToCheck @path
|
16
|
-
@path = @path.parent
|
17
|
-
else
|
18
|
-
raise MavenHelperScript::MissingProjectFolderException.new
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
File.join(@path)
|
24
|
-
end
|
25
|
-
|
26
|
-
private
|
27
|
-
def outOfDirectoriesToCheck(currentPath)
|
28
|
-
currentPath == currentPath.parent
|
29
|
-
end
|
30
|
-
|
31
|
-
def foundProjectArtifacts(file)
|
32
|
-
FileTest.exist?(File.join(file, 'm.yml')) && FileTest.exist?(File.join(file, 'pom.xml'))
|
33
|
-
end
|
34
|
-
|
35
|
-
end
|
36
|
-
|
37
|
-
class MissingProjectFolderException < Exception
|
38
|
-
end
|
39
|
-
|
40
|
-
|
1
|
+
require "pathname"
|
2
|
+
|
3
|
+
module MavenHelperScript
|
4
|
+
|
5
|
+
class ProjectHomeFinder
|
6
|
+
public
|
7
|
+
def findProjectDirectory(file)
|
8
|
+
@originalPath = Pathname.new(File.expand_path(file))
|
9
|
+
@path = @originalPath
|
10
|
+
found = false
|
11
|
+
|
12
|
+
while !found
|
13
|
+
found = foundProjectArtifacts(File.join(@path))
|
14
|
+
if !found
|
15
|
+
if !outOfDirectoriesToCheck @path
|
16
|
+
@path = @path.parent
|
17
|
+
else
|
18
|
+
raise MavenHelperScript::MissingProjectFolderException.new
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
File.join(@path)
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
def outOfDirectoriesToCheck(currentPath)
|
28
|
+
currentPath == currentPath.parent
|
29
|
+
end
|
30
|
+
|
31
|
+
def foundProjectArtifacts(file)
|
32
|
+
FileTest.exist?(File.join(file, 'm.yml')) && FileTest.exist?(File.join(file, 'pom.xml'))
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
class MissingProjectFolderException < Exception
|
38
|
+
end
|
39
|
+
|
40
|
+
|
41
41
|
end
|
data/lib/script_runner.rb
CHANGED
@@ -1,67 +1,67 @@
|
|
1
|
-
require 'argument_parser'
|
2
|
-
require 'project_home_finder'
|
3
|
-
|
4
|
-
module MavenHelperScript
|
5
|
-
|
6
|
-
class ScriptRunner
|
7
|
-
LINE = "\n-------------------------------------------------------------------------------\n\n"
|
8
|
-
|
9
|
-
def run(args)
|
10
|
-
finder = MavenHelperScript::ProjectHomeFinder.new
|
11
|
-
|
12
|
-
file = File.expand_path(".")
|
13
|
-
projectFolder = finder.findProjectDirectory(file)
|
14
|
-
|
15
|
-
parser = MavenHelperScript::ArgumentParser.new(projectFolder)
|
16
|
-
|
17
|
-
commands = parser.parse(args)
|
18
|
-
|
19
|
-
successful = true
|
20
|
-
i = 0
|
21
|
-
|
22
|
-
while successful && i < commands.length
|
23
|
-
command = commands[i]
|
24
|
-
puts LINE
|
25
|
-
puts "#{command}"
|
26
|
-
puts LINE
|
27
|
-
|
28
|
-
successful = system command
|
29
|
-
i += 1
|
30
|
-
end
|
31
|
-
|
32
|
-
if successful
|
33
|
-
puts LINE
|
34
|
-
puts "Successfully executed the following commands: "
|
35
|
-
commands.each do |command|
|
36
|
-
puts " - " << command
|
37
|
-
end
|
38
|
-
puts LINE
|
39
|
-
else
|
40
|
-
puts LINE
|
41
|
-
puts "Failed executing command: " << command
|
42
|
-
puts LINE
|
43
|
-
end
|
44
|
-
|
45
|
-
rescue MavenHelperScript::InvalidCommandException => e
|
46
|
-
puts "Unable to process command: " << e.failedCommand
|
47
|
-
puts "\nFound Commands: "
|
48
|
-
|
49
|
-
e.commands.each do |key, value|
|
50
|
-
puts "\t" << key << " : " << value
|
51
|
-
end
|
52
|
-
|
53
|
-
puts "\nUse valid combinations of the commands above."
|
54
|
-
|
55
|
-
rescue MavenHelperScript::MissingProjectFolderException => e
|
56
|
-
puts "Unable to locate project folder in this directory or any above it."
|
57
|
-
puts "\nA valid project folder must contain:"
|
58
|
-
puts "\tAn m.yml file."
|
59
|
-
puts "\tA pom.xml file.\n"
|
60
|
-
end
|
61
|
-
|
62
|
-
end
|
63
|
-
|
64
|
-
end
|
65
|
-
|
66
|
-
|
67
|
-
|
1
|
+
require 'argument_parser'
|
2
|
+
require 'project_home_finder'
|
3
|
+
|
4
|
+
module MavenHelperScript
|
5
|
+
|
6
|
+
class ScriptRunner
|
7
|
+
LINE = "\n-------------------------------------------------------------------------------\n\n"
|
8
|
+
|
9
|
+
def run(args)
|
10
|
+
finder = MavenHelperScript::ProjectHomeFinder.new
|
11
|
+
|
12
|
+
file = File.expand_path(".")
|
13
|
+
projectFolder = finder.findProjectDirectory(file)
|
14
|
+
|
15
|
+
parser = MavenHelperScript::ArgumentParser.new(projectFolder)
|
16
|
+
|
17
|
+
commands = parser.parse(args)
|
18
|
+
|
19
|
+
successful = true
|
20
|
+
i = 0
|
21
|
+
|
22
|
+
while successful && i < commands.length
|
23
|
+
command = commands[i]
|
24
|
+
puts LINE
|
25
|
+
puts "#{command}"
|
26
|
+
puts LINE
|
27
|
+
|
28
|
+
successful = system command
|
29
|
+
i += 1
|
30
|
+
end
|
31
|
+
|
32
|
+
if successful
|
33
|
+
puts LINE
|
34
|
+
puts "Successfully executed the following commands: "
|
35
|
+
commands.each do |command|
|
36
|
+
puts " - " << command
|
37
|
+
end
|
38
|
+
puts LINE
|
39
|
+
else
|
40
|
+
puts LINE
|
41
|
+
puts "Failed executing command: " << command
|
42
|
+
puts LINE
|
43
|
+
end
|
44
|
+
|
45
|
+
rescue MavenHelperScript::InvalidCommandException => e
|
46
|
+
puts "Unable to process command: " << e.failedCommand
|
47
|
+
puts "\nFound Commands: "
|
48
|
+
|
49
|
+
e.commands.each do |key, value|
|
50
|
+
puts "\t" << key << " : " << value
|
51
|
+
end
|
52
|
+
|
53
|
+
puts "\nUse valid combinations of the commands above."
|
54
|
+
|
55
|
+
rescue MavenHelperScript::MissingProjectFolderException => e
|
56
|
+
puts "Unable to locate project folder in this directory or any above it."
|
57
|
+
puts "\nA valid project folder must contain:"
|
58
|
+
puts "\tAn m.yml file."
|
59
|
+
puts "\tA pom.xml file.\n"
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
65
|
+
|
66
|
+
|
67
|
+
|
data/maven-helper-script.gemspec
CHANGED
@@ -1,71 +1,72 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
s.
|
9
|
-
|
10
|
-
|
11
|
-
s.
|
12
|
-
s.
|
13
|
-
s.
|
14
|
-
s.
|
15
|
-
s.
|
16
|
-
s.
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
"
|
24
|
-
"
|
25
|
-
"
|
26
|
-
"
|
27
|
-
"
|
28
|
-
"
|
29
|
-
"
|
30
|
-
"
|
31
|
-
"lib/
|
32
|
-
"lib/
|
33
|
-
"lib/
|
34
|
-
"
|
35
|
-
"
|
36
|
-
"
|
37
|
-
"sample-mvn-project/
|
38
|
-
"sample-mvn-project/pom.xml",
|
39
|
-
"
|
40
|
-
"
|
41
|
-
"test/
|
42
|
-
"test/
|
43
|
-
"test/
|
44
|
-
"test/
|
45
|
-
"test/
|
46
|
-
"
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
s.
|
51
|
-
s.
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
s.add_development_dependency(%q<
|
59
|
-
s.add_development_dependency(%q<
|
60
|
-
|
61
|
-
|
62
|
-
s.add_dependency(%q<
|
63
|
-
s.add_dependency(%q<
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
s.add_dependency(%q<
|
68
|
-
s.add_dependency(%q<
|
69
|
-
|
70
|
-
end
|
71
|
-
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: maven-helper-script 0.2.0 ruby lib
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = "maven-helper-script"
|
9
|
+
s.version = "0.2.0"
|
10
|
+
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib"]
|
13
|
+
s.authors = ["benkiefer"]
|
14
|
+
s.date = "2015-04-29"
|
15
|
+
s.description = "Execute your complex maven commands faster with the shortened helper syntax. See the rdoc for more details and examples."
|
16
|
+
s.email = "ben.a.kiefer@gmail.com"
|
17
|
+
s.executables = ["m"]
|
18
|
+
s.extra_rdoc_files = [
|
19
|
+
"LICENSE.txt",
|
20
|
+
"README.rdoc"
|
21
|
+
]
|
22
|
+
s.files = [
|
23
|
+
".document",
|
24
|
+
"Gemfile",
|
25
|
+
"Gemfile.lock",
|
26
|
+
"LICENSE.txt",
|
27
|
+
"README.rdoc",
|
28
|
+
"Rakefile",
|
29
|
+
"VERSION",
|
30
|
+
"bin/m",
|
31
|
+
"lib/argument_parser.rb",
|
32
|
+
"lib/configuration_checker.rb",
|
33
|
+
"lib/invalid_command_exception.rb",
|
34
|
+
"lib/project_home_finder.rb",
|
35
|
+
"lib/script_runner.rb",
|
36
|
+
"maven-helper-script.gemspec",
|
37
|
+
"sample-mvn-project/m.yml",
|
38
|
+
"sample-mvn-project/other/pom.xml",
|
39
|
+
"sample-mvn-project/parent/pom.xml",
|
40
|
+
"sample-mvn-project/pom.xml",
|
41
|
+
"test/argument_parser_spec.rb",
|
42
|
+
"test/configuration_checker_map_spec.rb",
|
43
|
+
"test/configuration_checker_spec.rb",
|
44
|
+
"test/invalid_command_exception_spec.rb",
|
45
|
+
"test/m.yml",
|
46
|
+
"test/map.yml",
|
47
|
+
"test/project_home_finder_spec.rb",
|
48
|
+
"travis.yml"
|
49
|
+
]
|
50
|
+
s.homepage = "http://benkiefer.github.io/maven-helper-script"
|
51
|
+
s.rubygems_version = "2.4.6"
|
52
|
+
s.summary = "Ruby gem to simplify maven command execution"
|
53
|
+
|
54
|
+
if s.respond_to? :specification_version then
|
55
|
+
s.specification_version = 4
|
56
|
+
|
57
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
58
|
+
s.add_development_dependency(%q<rdoc>, ["~> 4.2"])
|
59
|
+
s.add_development_dependency(%q<jeweler>, ["~> 2.0"])
|
60
|
+
s.add_development_dependency(%q<rspec>, ["~> 3.2"])
|
61
|
+
else
|
62
|
+
s.add_dependency(%q<rdoc>, ["~> 4.2"])
|
63
|
+
s.add_dependency(%q<jeweler>, ["~> 2.0"])
|
64
|
+
s.add_dependency(%q<rspec>, ["~> 3.2"])
|
65
|
+
end
|
66
|
+
else
|
67
|
+
s.add_dependency(%q<rdoc>, ["~> 4.2"])
|
68
|
+
s.add_dependency(%q<jeweler>, ["~> 2.0"])
|
69
|
+
s.add_dependency(%q<rspec>, ["~> 3.2"])
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
@@ -12,40 +12,40 @@ describe MavenHelperScript::ArgumentParser do
|
|
12
12
|
it "should convert command and module then append parent pom" do
|
13
13
|
args = Array['ci', 'p']
|
14
14
|
result = @parser.parse(args)
|
15
|
-
result.length.
|
16
|
-
result[0].
|
15
|
+
expect(result.length).to eq 1
|
16
|
+
expect(result[0]).to eq 'mvn clean install -pl parent -f ' << @expectedPom << @expectedArgs
|
17
17
|
end
|
18
18
|
|
19
19
|
|
20
20
|
it "should convert command, use given module, then append parent pom" do
|
21
21
|
args = Array['ci', 'parent']
|
22
22
|
result = @parser.parse(args)
|
23
|
-
result.length.
|
24
|
-
result[0].
|
23
|
+
expect(result.length).to eq 1
|
24
|
+
expect(result[0]).to eq 'mvn clean install -pl parent -f ' << @expectedPom << @expectedArgs
|
25
25
|
end
|
26
26
|
|
27
27
|
it "should convert command, module, append parent pom, and apply specialty arguments" do
|
28
28
|
args = Array['ci', 'p', '-o']
|
29
29
|
result = @parser.parse(args)
|
30
|
-
result.length.
|
31
|
-
result[0].
|
30
|
+
expect(result.length).to eq 1
|
31
|
+
expect(result[0]).to eq 'mvn clean install -pl parent -f ' << @expectedPom << @expectedArgs << " -o"
|
32
32
|
end
|
33
33
|
|
34
34
|
it "should convert multiple arguments" do
|
35
35
|
args = Array['ci', 'p', 'ci', 'p']
|
36
36
|
result = @parser.parse(args)
|
37
|
-
result.length.
|
38
|
-
result[0].
|
39
|
-
result[1].
|
37
|
+
expect(result.length).to eq 2
|
38
|
+
expect(result[0]).to eq 'mvn clean install -pl parent -f ' << @expectedPom << @expectedArgs
|
39
|
+
expect(result[1]).to eq 'mvn clean install -pl parent -f ' << @expectedPom << @expectedArgs
|
40
40
|
end
|
41
41
|
|
42
42
|
it "should convert multiple arguments and append special commands" do
|
43
43
|
args = Array['ci', 'p', 'ci', 'p', '-o', '-blah']
|
44
44
|
result = @parser.parse(args)
|
45
|
-
result.length.
|
45
|
+
expect(result.length).to eq 2
|
46
46
|
expected = 'mvn clean install -pl parent -f ' << @expectedPom << @expectedArgs << " -o" << " -blah"
|
47
|
-
result[0].
|
48
|
-
result[1].
|
47
|
+
expect(result[0]).to eq expected
|
48
|
+
expect(result[1]).to eq expected
|
49
49
|
end
|
50
50
|
|
51
51
|
|
@@ -8,15 +8,15 @@ describe MavenHelperScript::ConfigurationChecker do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
it "should find module by mapping" do
|
11
|
-
@checker.checkForModule("p").
|
11
|
+
expect(@checker.checkForModule("p")).to eq "parent"
|
12
12
|
end
|
13
13
|
|
14
14
|
it "should send back mapping name when no module found, assume that is the correct module name" do
|
15
|
-
@checker.checkForModule("boo").
|
15
|
+
expect(@checker.checkForModule("boo")).to eq "boo"
|
16
16
|
end
|
17
17
|
|
18
18
|
it "should find command using first characters when not a plugin execution" do
|
19
|
-
@checker.checkForCommand("ci").
|
19
|
+
expect(@checker.checkForCommand("ci")).to eq "clean install"
|
20
20
|
end
|
21
21
|
|
22
22
|
it "should blow up if you can't find the other part of a command" do
|
@@ -24,7 +24,7 @@ describe MavenHelperScript::ConfigurationChecker do
|
|
24
24
|
end
|
25
25
|
|
26
26
|
it "should find plugin execution" do
|
27
|
-
@checker.checkForCommand("jr").
|
27
|
+
expect(@checker.checkForCommand("jr")).to eq "jetty:run"
|
28
28
|
end
|
29
29
|
|
30
30
|
it "should blow up when can't find command" do
|
@@ -33,7 +33,7 @@ describe MavenHelperScript::ConfigurationChecker do
|
|
33
33
|
|
34
34
|
it "should return all command arguments" do
|
35
35
|
args = Array['-ff', '-DskipTests']
|
36
|
-
expect
|
36
|
+
expect(@checker.checkForArguments()).to eq args
|
37
37
|
end
|
38
38
|
|
39
39
|
end
|
@@ -8,19 +8,19 @@ describe MavenHelperScript::ConfigurationChecker do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
it "should find module by mapping" do
|
11
|
-
@checker.checkForModule("p").
|
11
|
+
expect(@checker.checkForModule("p")).to eq "parent"
|
12
12
|
end
|
13
13
|
|
14
14
|
it "should send back mapping name when no module found, assume that is the correct module name" do
|
15
|
-
@checker.checkForModule("boo").
|
15
|
+
expect(@checker.checkForModule("boo")).to eq "boo"
|
16
16
|
end
|
17
17
|
|
18
18
|
it "should find command using first characters when not a plugin execution" do
|
19
|
-
@checker.checkForCommand("ci").
|
19
|
+
expect(@checker.checkForCommand("ci")).to eq "clean install"
|
20
20
|
end
|
21
21
|
|
22
22
|
it "should find plugin execution" do
|
23
|
-
@checker.checkForCommand("jr").
|
23
|
+
expect(@checker.checkForCommand("jr")).to eq "jetty:run"
|
24
24
|
end
|
25
25
|
|
26
26
|
it "should blow up when can't find command" do
|
@@ -29,7 +29,7 @@ describe MavenHelperScript::ConfigurationChecker do
|
|
29
29
|
|
30
30
|
it "should return all command arguments" do
|
31
31
|
args = Array['-ff', '-DskipTests']
|
32
|
-
expect
|
32
|
+
expect(@checker.checkForArguments()).to eq args
|
33
33
|
end
|
34
34
|
|
35
35
|
end
|
@@ -9,8 +9,8 @@ describe MavenHelperScript::InvalidCommandException do
|
|
9
9
|
end
|
10
10
|
|
11
11
|
it "should print command mapping" do
|
12
|
-
@error.commands.
|
13
|
-
@error.failedCommand.
|
12
|
+
expect(@error.commands).to eq @commands
|
13
|
+
expect(@error.failedCommand).to eq "boom"
|
14
14
|
end
|
15
15
|
|
16
16
|
end
|
@@ -1,23 +1,23 @@
|
|
1
|
-
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
2
|
-
require "project_home_finder"
|
3
|
-
|
4
|
-
describe MavenHelperScript::ProjectHomeFinder do
|
5
|
-
before(:each) do
|
6
|
-
@mvnProjectFolder = File.expand_path(File.join(File.dirname(__FILE__), "..", "sample-mvn-project"))
|
7
|
-
@finder = MavenHelperScript::ProjectHomeFinder.new()
|
8
|
-
end
|
9
|
-
|
10
|
-
it "should find project folder from sub folder" do
|
11
|
-
@finder.findProjectDirectory(File.join(@mvnProjectFolder, "other")).
|
12
|
-
@finder.findProjectDirectory(File.join(@mvnProjectFolder, "parent")).
|
13
|
-
end
|
14
|
-
|
15
|
-
it "should find project folder from project folder" do
|
16
|
-
@finder.findProjectDirectory(File.join(@mvnProjectFolder)).
|
17
|
-
end
|
18
|
-
|
19
|
-
it "should blow up when can't find project folder" do
|
20
|
-
expect { @finder.findProjectDirectory(File.join(@mvnProjectFolder, "..")) }.to raise_error(MavenHelperScript::MissingProjectFolderException)
|
21
|
-
end
|
22
|
-
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
2
|
+
require "project_home_finder"
|
3
|
+
|
4
|
+
describe MavenHelperScript::ProjectHomeFinder do
|
5
|
+
before(:each) do
|
6
|
+
@mvnProjectFolder = File.expand_path(File.join(File.dirname(__FILE__), "..", "sample-mvn-project"))
|
7
|
+
@finder = MavenHelperScript::ProjectHomeFinder.new()
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should find project folder from sub folder" do
|
11
|
+
expect(@finder.findProjectDirectory(File.join(@mvnProjectFolder, "other"))).to eq @mvnProjectFolder
|
12
|
+
expect(@finder.findProjectDirectory(File.join(@mvnProjectFolder, "parent"))).to eq @mvnProjectFolder
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should find project folder from project folder" do
|
16
|
+
expect(@finder.findProjectDirectory(File.join(@mvnProjectFolder))).to eq @mvnProjectFolder
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should blow up when can't find project folder" do
|
20
|
+
expect { @finder.findProjectDirectory(File.join(@mvnProjectFolder, "..")) }.to raise_error(MavenHelperScript::MissingProjectFolderException)
|
21
|
+
end
|
22
|
+
|
23
23
|
end
|
data/travis.yml
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
language: ruby
|
2
|
-
|
3
|
-
rvm:
|
4
|
-
- 1.9.3
|
1
|
+
language: ruby
|
2
|
+
|
3
|
+
rvm:
|
4
|
+
- 1.9.3
|
metadata
CHANGED
@@ -1,64 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maven-helper-script
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- benkiefer
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2015-04-29 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rdoc
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- - ~>
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version: '
|
19
|
+
version: '4.2'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- - ~>
|
24
|
+
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
26
|
+
version: '4.2'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: jeweler
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- - ~>
|
31
|
+
- - "~>"
|
36
32
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
33
|
+
version: '2.0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- - ~>
|
38
|
+
- - "~>"
|
44
39
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
40
|
+
version: '2.0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: rspec
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- - ~>
|
45
|
+
- - "~>"
|
52
46
|
- !ruby/object:Gem::Version
|
53
|
-
version: 2
|
47
|
+
version: '3.2'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- - ~>
|
52
|
+
- - "~>"
|
60
53
|
- !ruby/object:Gem::Version
|
61
|
-
version: 2
|
54
|
+
version: '3.2'
|
62
55
|
description: Execute your complex maven commands faster with the shortened helper
|
63
56
|
syntax. See the rdoc for more details and examples.
|
64
57
|
email: ben.a.kiefer@gmail.com
|
@@ -69,7 +62,7 @@ extra_rdoc_files:
|
|
69
62
|
- LICENSE.txt
|
70
63
|
- README.rdoc
|
71
64
|
files:
|
72
|
-
- .document
|
65
|
+
- ".document"
|
73
66
|
- Gemfile
|
74
67
|
- Gemfile.lock
|
75
68
|
- LICENSE.txt
|
@@ -97,29 +90,25 @@ files:
|
|
97
90
|
- travis.yml
|
98
91
|
homepage: http://benkiefer.github.io/maven-helper-script
|
99
92
|
licenses: []
|
93
|
+
metadata: {}
|
100
94
|
post_install_message:
|
101
95
|
rdoc_options: []
|
102
96
|
require_paths:
|
103
97
|
- lib
|
104
98
|
required_ruby_version: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
99
|
requirements:
|
107
|
-
- -
|
100
|
+
- - ">="
|
108
101
|
- !ruby/object:Gem::Version
|
109
102
|
version: '0'
|
110
|
-
segments:
|
111
|
-
- 0
|
112
|
-
hash: -861051821
|
113
103
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
|
-
none: false
|
115
104
|
requirements:
|
116
|
-
- -
|
105
|
+
- - ">="
|
117
106
|
- !ruby/object:Gem::Version
|
118
107
|
version: '0'
|
119
108
|
requirements: []
|
120
109
|
rubyforge_project:
|
121
|
-
rubygems_version:
|
110
|
+
rubygems_version: 2.4.6
|
122
111
|
signing_key:
|
123
|
-
specification_version:
|
112
|
+
specification_version: 4
|
124
113
|
summary: Ruby gem to simplify maven command execution
|
125
114
|
test_files: []
|