gjp 0.37.0 → 0.38.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.
Files changed (56) hide show
  1. data/.rubocop.yml +3 -0
  2. data/.rubocop_todo.yml +0 -130
  3. data/Rakefile +2 -2
  4. data/gjp.gemspec +2 -2
  5. data/integration-tests/commons.sh +1 -1
  6. data/lib/gjp.rb +12 -12
  7. data/lib/gjp/ant_runner.rb +2 -2
  8. data/lib/gjp/archiver.rb +13 -11
  9. data/lib/gjp/commands/ant.rb +1 -1
  10. data/lib/gjp/commands/base.rb +25 -26
  11. data/lib/gjp/commands/{download-maven-source-jars.rb → download_maven_source_jars.rb} +0 -0
  12. data/lib/gjp/commands/{dry-run.rb → dry_run.rb} +0 -0
  13. data/lib/gjp/commands/finish.rb +0 -1
  14. data/lib/gjp/commands/{generate-all.rb → generate_all.rb} +3 -4
  15. data/lib/gjp/commands/{generate-kit-archive.rb → generate_kit_archive.rb} +0 -1
  16. data/lib/gjp/commands/{generate-kit-spec.rb → generate_kit_spec.rb} +0 -1
  17. data/lib/gjp/commands/{generate-package-archive.rb → generate_package_archive.rb} +1 -2
  18. data/lib/gjp/commands/{generate-package-script.rb → generate_package_script.rb} +1 -2
  19. data/lib/gjp/commands/{generate-package-spec.rb → generate_package_spec.rb} +3 -4
  20. data/lib/gjp/commands/{get-pom.rb → get_pom.rb} +10 -9
  21. data/lib/gjp/commands/{get-source.rb → get_source.rb} +4 -5
  22. data/lib/gjp/commands/init.rb +0 -1
  23. data/lib/gjp/commands/{list-kit-missing-sources.rb → list_kit_missing_sources.rb} +1 -2
  24. data/lib/gjp/commands/{move-jars-to-kit.rb → move_jars_to_kit.rb} +0 -1
  25. data/lib/gjp/commands/mvn.rb +1 -2
  26. data/lib/gjp/git.rb +16 -14
  27. data/lib/gjp/kit_checker.rb +6 -6
  28. data/lib/gjp/kit_runner.rb +2 -2
  29. data/lib/gjp/kit_spec_adapter.rb +1 -2
  30. data/lib/gjp/logger.rb +16 -13
  31. data/lib/gjp/main.rb +0 -1
  32. data/lib/gjp/maven_runner.rb +2 -2
  33. data/lib/gjp/maven_website.rb +14 -14
  34. data/lib/gjp/package_spec_adapter.rb +9 -8
  35. data/lib/gjp/pom.rb +13 -14
  36. data/lib/gjp/pom_getter.rb +18 -16
  37. data/lib/gjp/project.rb +21 -22
  38. data/lib/gjp/script_generator.rb +8 -8
  39. data/lib/gjp/source_getter.rb +3 -3
  40. data/lib/gjp/spec_generator.rb +3 -3
  41. data/lib/gjp/template_manager.rb +2 -2
  42. data/lib/gjp/version.rb +1 -1
  43. data/lib/gjp/version_matcher.rb +32 -35
  44. data/spec/lib/archiver_spec.rb +3 -3
  45. data/spec/lib/git_spec.rb +1 -1
  46. data/spec/lib/kit_checker_spec.rb +10 -10
  47. data/spec/lib/pom_getter_spec.rb +2 -3
  48. data/spec/lib/pom_spec.rb +2 -3
  49. data/spec/lib/project_spec.rb +10 -10
  50. data/spec/lib/script_generator_spec.rb +1 -2
  51. data/spec/lib/source_getter_spec.rb +0 -1
  52. data/spec/lib/spec_generator_spec.rb +0 -1
  53. data/spec/lib/template_manager_spec.rb +1 -1
  54. data/spec/lib/version_matcher_spec.rb +8 -9
  55. data/spec/spec_helper.rb +0 -3
  56. metadata +13 -13
@@ -56,7 +56,7 @@ describe Gjp::Archiver do
56
56
  describe "#archive_kit" do
57
57
  it "archives a kit package files, not incrementally" do
58
58
  @project.from_directory do
59
- File.open(File.join("kit","kit_test"), "w") { |io| io.puts "test content" }
59
+ File.open(File.join("kit", "kit_test"), "w") { |io| io.puts "test content" }
60
60
  end
61
61
  @project.finish(false)
62
62
 
@@ -67,7 +67,7 @@ describe Gjp::Archiver do
67
67
  end
68
68
  it "archives a kit package files incrementally" do
69
69
  @project.from_directory do
70
- File.open(File.join("kit","kit_test"), "w") { |io| io.puts "test content" }
70
+ File.open(File.join("kit", "kit_test"), "w") { |io| io.puts "test content" }
71
71
  end
72
72
  @project.finish(false)
73
73
 
@@ -77,7 +77,7 @@ describe Gjp::Archiver do
77
77
  end
78
78
 
79
79
  @project.from_directory do
80
- File.open(File.join("kit","kit_test2"), "w") { |io| io.puts "test content" }
80
+ File.open(File.join("kit", "kit_test2"), "w") { |io| io.puts "test content" }
81
81
  end
82
82
 
83
83
  archiver.archive_kit(false)
data/spec/lib/git_spec.rb CHANGED
@@ -81,7 +81,7 @@ describe Gjp::Git do
81
81
  file.write "test"
82
82
  end
83
83
  Dir.mkdir("subdir")
84
- File.open(File.join("subdir","file3"), "w") do |file|
84
+ File.open(File.join("subdir", "file3"), "w") do |file|
85
85
  file.write "test"
86
86
  end
87
87
 
@@ -21,7 +21,7 @@ describe Gjp::KitChecker do
21
21
  @project.from_directory("kit") do
22
22
  FileUtils.touch("top_level")
23
23
  FileUtils.mkdir_p("directory")
24
- FileUtils.touch(File.join("directory","in_directory"))
24
+ FileUtils.touch(File.join("directory", "in_directory"))
25
25
  Zip::File.open("zipped.zip", Zip::File::CREATE) do |zipfile|
26
26
  Dir[File.join("directory", "**", "**")].each do |file|
27
27
  zipfile.add(file.sub("/directory", ""), file)
@@ -45,7 +45,7 @@ describe Gjp::KitChecker do
45
45
  ["path/to/ClassOne.java", nil],
46
46
  ["path/to/ClassTwo.java", "path/to/archive.jar"],
47
47
  ["ClassThree.java", "another_archive.jar"],
48
- ["path/to/CompiledClass.class", "yet_another.jar"],
48
+ ["path/to/CompiledClass.class", "yet_another.jar"]
49
49
  ]
50
50
 
51
51
  class_names = @kit_checker.source_class_names(all_files)
@@ -63,7 +63,7 @@ describe Gjp::KitChecker do
63
63
  ["path/to/ClassOne.class", nil],
64
64
  ["path/to/ClassTwo.class", "path/to/archive.jar"],
65
65
  ["ClassThree.class", "another_archive.jar"],
66
- ["path/to/SourceClass.java", "yet_another.jar"],
66
+ ["path/to/SourceClass.java", "yet_another.jar"]
67
67
  ]
68
68
 
69
69
  classes = @kit_checker.compiled_classes(all_files)
@@ -79,17 +79,17 @@ describe Gjp::KitChecker do
79
79
  it "returns a list of jars wich source files are missing" do
80
80
  @project.from_directory("kit") do
81
81
  FileUtils.mkdir_p("package1")
82
- FileUtils.touch(File.join("package1","UnsourcedClass.class"))
82
+ FileUtils.touch(File.join("package1", "UnsourcedClass.class"))
83
83
 
84
84
  FileUtils.mkdir_p("package2")
85
- FileUtils.touch(File.join("package2","SourcedClass.java"))
85
+ FileUtils.touch(File.join("package2", "SourcedClass.java"))
86
86
  Zip::File.open("zipped-source-2.jar", Zip::File::CREATE) do |zipfile|
87
87
  Dir[File.join("package2", "**", "**")].each do |file|
88
88
  zipfile.add(file.sub("/package2", ""), file)
89
89
  end
90
90
  end
91
- FileUtils.rm(File.join("package2","SourcedClass.java"))
92
- FileUtils.touch(File.join("package2","SourcedClass.class"))
91
+ FileUtils.rm(File.join("package2", "SourcedClass.java"))
92
+ FileUtils.touch(File.join("package2", "SourcedClass.class"))
93
93
  Zip::File.open("zipped-2.jar", Zip::File::CREATE) do |zipfile|
94
94
  Dir[File.join("package2", "**", "**")].each do |file|
95
95
  zipfile.add(file.sub("/package2", ""), file)
@@ -97,8 +97,8 @@ describe Gjp::KitChecker do
97
97
  end
98
98
 
99
99
  FileUtils.mkdir_p("package3")
100
- FileUtils.touch(File.join("package3","SourcedSameArchive.java"))
101
- FileUtils.touch(File.join("package3","SourcedSameArchive.class"))
100
+ FileUtils.touch(File.join("package3", "SourcedSameArchive.java"))
101
+ FileUtils.touch(File.join("package3", "SourcedSameArchive.class"))
102
102
  Zip::File.open("zipped-3.zip", Zip::File::CREATE) do |zipfile|
103
103
  Dir[File.join("package3", "**", "**")].each do |file|
104
104
  zipfile.add(file.sub("/package3", ""), file)
@@ -107,7 +107,7 @@ describe Gjp::KitChecker do
107
107
  end
108
108
 
109
109
  unsourced = @kit_checker.unsourced_archives
110
- unsourced.length().should eq 1
110
+ unsourced.length.should eq 1
111
111
 
112
112
  unsourced.first[:archive].should be_nil
113
113
  unsourced.first[:class_names].should include "package1.UnsourcedClass"
@@ -23,7 +23,7 @@ describe Gjp::PomGetter do
23
23
  File.exist?(path).should be_true
24
24
  FileUtils.rm(path)
25
25
  end
26
-
26
+
27
27
  it "gets the pom from a heuristic" do
28
28
  dir_path = File.join("spec", "data", "nailgun")
29
29
  jar_path = File.join(dir_path, "nailgun-0.7.1.jar")
@@ -31,7 +31,6 @@ describe Gjp::PomGetter do
31
31
  status.should eq :found_via_heuristic
32
32
  File.exist?(path).should be_true
33
33
  FileUtils.rm(path)
34
- end
34
+ end
35
35
  end
36
36
  end
37
-
data/spec/lib/pom_spec.rb CHANGED
@@ -31,7 +31,7 @@ describe Gjp::Pom do
31
31
 
32
32
  describe "#description" do
33
33
  it "reads the description" do
34
- pom.description.should eq "Commons Logging is a thin adapter allowing configurable bridging to other,\n " +
34
+ pom.description.should eq "Commons Logging is a thin adapter allowing configurable bridging to other,\n " \
35
35
  "well known logging systems."
36
36
  end
37
37
  end
@@ -56,7 +56,7 @@ describe Gjp::Pom do
56
56
 
57
57
  describe "#scm_connection" do
58
58
  it "reads the SCM connection address" do
59
- pom.scm_connection.should eq "scm:svn:http://svn.apache.org/repos/asf/commons/proper/" +
59
+ pom.scm_connection.should eq "scm:svn:http://svn.apache.org/repos/asf/commons/proper/" \
60
60
  "logging/tags/commons-logging-1.1.1"
61
61
  end
62
62
  end
@@ -67,4 +67,3 @@ describe Gjp::Pom do
67
67
  end
68
68
  end
69
69
  end
70
-
@@ -17,7 +17,7 @@ describe Gjp::Project do
17
17
 
18
18
  describe "#is_project" do
19
19
  it "checks if a directory is a gjp project or not" do
20
- Gjp::Project.is_project(@project_path).should be_true
20
+ Gjp::Project.is_project(@project_path).should be_true
21
21
  Gjp::Project.is_project(File.join(@project_path, "..")).should be_false
22
22
  end
23
23
  end
@@ -92,10 +92,10 @@ describe Gjp::Project do
92
92
  describe "#init" do
93
93
  it "inits a new project" do
94
94
  kit_path = File.join(@project_path, "kit")
95
- Dir.exists?(kit_path).should be_true
95
+ Dir.exist?(kit_path).should be_true
96
96
 
97
97
  src_path = File.join(@project_path, "src")
98
- Dir.exists?(src_path).should be_true
98
+ Dir.exist?(src_path).should be_true
99
99
  end
100
100
  end
101
101
 
@@ -116,14 +116,14 @@ describe Gjp::Project do
116
116
  @project.from_directory do
117
117
  `touch kit/test`
118
118
 
119
- @project.take_snapshot "test", :revertable
119
+ @project.take_snapshot "test", :revertable
120
120
 
121
121
  `git rev-list --all`.split("\n").length.should eq 2
122
- @project.latest_tag(:revertable).should eq "revertable_1"
122
+ @project.latest_tag(:revertable).should eq "revertable_1"
123
123
  end
124
124
  end
125
125
  end
126
-
126
+
127
127
  describe "#finish" do
128
128
  it "ends the current dry-run phase after a successful build" do
129
129
  @project.from_directory do
@@ -149,7 +149,7 @@ describe Gjp::Project do
149
149
  File.read("src/abc/test").should eq "A\n"
150
150
 
151
151
  `git diff-tree --no-commit-id --name-only -r HEAD~`.split("\n").should include("src/abc/test2")
152
- File.exists?("src/abc/test2").should be_false
152
+ File.exist?("src/abc/test2").should be_false
153
153
  end
154
154
  end
155
155
  it "ends the current dry-run phase after a failed build" do
@@ -177,10 +177,10 @@ describe Gjp::Project do
177
177
  @project.from_directory do
178
178
  `git rev-list --all`.split("\n").length.should eq 2
179
179
  File.read("src/abc/test").should eq "A\n"
180
- File.exists?("src/abc/test2").should be_false
180
+ File.exist?("src/abc/test2").should be_false
181
181
 
182
182
  File.read("kit/test").should eq "A\n"
183
- File.exists?("kit/test2").should be_false
183
+ File.exist?("kit/test2").should be_false
184
184
  end
185
185
  end
186
186
  end
@@ -203,7 +203,7 @@ describe Gjp::Project do
203
203
  `git diff-tree --no-commit-id --name-only -r HEAD`.split("\n").should include("src/test")
204
204
  `git cat-file tag gjp_dry_run_started_1 | tail -1`.should include("src")
205
205
  end
206
- end
206
+ end
207
207
  end
208
208
 
209
209
  describe "#get_produced_files" do
@@ -41,7 +41,7 @@ describe Gjp::ScriptGenerator do
41
41
 
42
42
  lines.should include("#!/bin/bash\n")
43
43
  lines.should include("cd somewhere significant\n")
44
- lines.should include("$PROJECT_PREFIX/kit/mvn/bin/mvn -Dmaven.repo.local=$PROJECT_PREFIX/kit/m2 " +
44
+ lines.should include("$PROJECT_PREFIX/kit/mvn/bin/mvn -Dmaven.repo.local=$PROJECT_PREFIX/kit/m2 " \
45
45
  "-s$PROJECT_PREFIX/kit/m2/settings.xml -o --options\n"
46
46
  )
47
47
 
@@ -64,4 +64,3 @@ describe Gjp::ScriptGenerator do
64
64
  end
65
65
  end
66
66
  end
67
-
@@ -34,4 +34,3 @@ describe Gjp::SourceGetter do
34
34
  end
35
35
  end
36
36
  end
37
-
@@ -109,7 +109,6 @@ describe Gjp::SpecGenerator do
109
109
  `touch src/test/out/test#{i}.jar`
110
110
  end
111
111
 
112
-
113
112
  @project.finish(false)
114
113
  end
115
114
 
@@ -34,7 +34,7 @@ describe Gjp::TemplateManager do
34
34
  destination_path = destination.path
35
35
  destination.unlink
36
36
 
37
- class WorldClass
37
+ class WorldClass
38
38
  def world_property
39
39
  "World!"
40
40
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "spec_helper"
4
4
 
5
- describe Gjp::VersionMatcher do
5
+ describe Gjp::VersionMatcher do
6
6
  let(:version_matcher) { Gjp::VersionMatcher.new }
7
7
 
8
8
  describe "#split_version" do
@@ -17,28 +17,28 @@ describe Gjp::VersionMatcher do
17
17
  it "computes chunk distances" do
18
18
  version_matcher.chunk_distance(nil, "1").should eq(1)
19
19
  version_matcher.chunk_distance("alpha", nil).should eq(5)
20
-
20
+
21
21
  version_matcher.chunk_distance("1", "1").should eq(0)
22
22
  version_matcher.chunk_distance("1", "9").should eq(8)
23
23
  version_matcher.chunk_distance("1", "999").should eq(99)
24
24
 
25
25
  version_matcher.chunk_distance("snap", "SNAP").should eq(0)
26
26
  version_matcher.chunk_distance("snap", "snippete").should eq(5)
27
- version_matcher.chunk_distance("snap", "l"*999).should eq(99)
28
-
27
+ version_matcher.chunk_distance("snap", "l" * 999).should eq(99)
28
+
29
29
  version_matcher.chunk_distance("1", "SNAP").should eq(4)
30
-
30
+
31
31
  version_matcher.chunk_distance("0", "10").should eq(10)
32
32
  version_matcher.chunk_distance("0", "9").should eq(9)
33
33
  end
34
34
  end
35
-
35
+
36
36
  describe "#best_match" do
37
37
  it "finds the best match" do
38
38
  my_version = "1.0"
39
39
  available_versions = ["1.0", "1", "2.0", "1.0.1", "4.5.6.7.8"]
40
40
  version_matcher.best_match(my_version, available_versions).should eq("1.0")
41
-
41
+
42
42
  available_versions = ["3.0", "2.0", "1.0.1"]
43
43
  version_matcher.best_match(my_version, available_versions).should eq("1.0.1")
44
44
 
@@ -47,7 +47,7 @@ describe Gjp::VersionMatcher do
47
47
 
48
48
  available_versions = ["1.10", "1.9", "2.0", "3.0.1"]
49
49
  version_matcher.best_match(my_version, available_versions).should eq("1.9")
50
-
50
+
51
51
  my_version = "1.snap"
52
52
  available_versions = ["1.snap", "1"]
53
53
  version_matcher.best_match(my_version, available_versions).should eq("1.snap")
@@ -62,4 +62,3 @@ describe Gjp::VersionMatcher do
62
62
  end
63
63
  end
64
64
  end
65
-
data/spec/spec_helper.rb CHANGED
@@ -1,9 +1,6 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  require "gjp"
4
- require "gjp/logger"
5
-
6
- Gjp::Logger.log.level = ::Logger::DEBUG
7
4
 
8
5
  # custom mock methods
9
6
  module Gjp
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gjp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.37.0
4
+ version: 0.38.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -164,20 +164,20 @@ files:
164
164
  - lib/gjp/archiver.rb
165
165
  - lib/gjp/commands/ant.rb
166
166
  - lib/gjp/commands/base.rb
167
- - lib/gjp/commands/download-maven-source-jars.rb
168
- - lib/gjp/commands/dry-run.rb
167
+ - lib/gjp/commands/download_maven_source_jars.rb
168
+ - lib/gjp/commands/dry_run.rb
169
169
  - lib/gjp/commands/finish.rb
170
- - lib/gjp/commands/generate-all.rb
171
- - lib/gjp/commands/generate-kit-archive.rb
172
- - lib/gjp/commands/generate-kit-spec.rb
173
- - lib/gjp/commands/generate-package-archive.rb
174
- - lib/gjp/commands/generate-package-script.rb
175
- - lib/gjp/commands/generate-package-spec.rb
176
- - lib/gjp/commands/get-pom.rb
177
- - lib/gjp/commands/get-source.rb
170
+ - lib/gjp/commands/generate_all.rb
171
+ - lib/gjp/commands/generate_kit_archive.rb
172
+ - lib/gjp/commands/generate_kit_spec.rb
173
+ - lib/gjp/commands/generate_package_archive.rb
174
+ - lib/gjp/commands/generate_package_script.rb
175
+ - lib/gjp/commands/generate_package_spec.rb
176
+ - lib/gjp/commands/get_pom.rb
177
+ - lib/gjp/commands/get_source.rb
178
178
  - lib/gjp/commands/init.rb
179
- - lib/gjp/commands/list-kit-missing-sources.rb
180
- - lib/gjp/commands/move-jars-to-kit.rb
179
+ - lib/gjp/commands/list_kit_missing_sources.rb
180
+ - lib/gjp/commands/move_jars_to_kit.rb
181
181
  - lib/gjp/commands/mvn.rb
182
182
  - lib/gjp/git.rb
183
183
  - lib/gjp/kit_checker.rb