Skip to content

Commit

Permalink
Update commons-collections
Browse files Browse the repository at this point in the history
  • Loading branch information
nodeg committed Dec 19, 2024
1 parent c4fb262 commit ed996a5
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ networkless build.
First, grab the sources:

```bash
wget https://archive.apache.org/dist/commons/collections/source/commons-collections4-4.4-src.tar.gz
wget https://archive.apache.org/dist/commons/collections/source/commons-collections4-4.5.0-M2-src.tar.gz
```

Second, create a new `tetra` project named `commons-collections` based on those sources:
Expand Down
1 change: 1 addition & 0 deletions lib/tetra.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
require "tetra/facades/tar"

# main internal classes
require "tetra/constants"
require "tetra/version"
require "tetra/project_initer"
require "tetra/project"
Expand Down
6 changes: 6 additions & 0 deletions lib/tetra/constants.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# encoding: UTF-8

# base module for tetra
module Tetra
CCOLLECTIONS = "commons-collections4-4.5.0-M2-src".freeze
end
Binary file removed spec/data/commons-collections4-4.4-src.tar.gz
Binary file not shown.
Binary file removed spec/data/commons-collections4-4.4-src.zip
Binary file not shown.
Binary file not shown.
Binary file added spec/data/commons-collections4-4.5.0-M2-src.zip
Binary file not shown.
8 changes: 4 additions & 4 deletions spec/lib/coarse/generate_all_subcommand_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

describe "`tetra generate-all`", type: :aruba do
it "generates specs and tarballs for a sample package, source archive workflow" do
archive_contents = File.read(File.join("spec", "data", "commons-collections4-4.4-src.zip"))
archive_contents = File.read(File.join("spec", "data", CCOLLECTIONS))
write_file("commons-collections.zip", archive_contents)

# init project
run_simple("tetra init commons-collections commons-collections.zip")
cd(File.join("commons-collections", "src", "commons-collections4-4.4-src"))
cd(File.join("commons-collections", "src", CCOLLECTIONS))

# first dry-run, all normal
@aruba_timeout_seconds = 240
Expand Down Expand Up @@ -58,7 +58,7 @@
end

it "generates specs and tarballs for a sample package, manual source workflow" do
archive_contents = File.read(File.join("spec", "data", "commons-collections4-4.4-src.zip"))
archive_contents = File.read(File.join("spec", "data", "#{CCOLLECTIONS}.zip"))
write_file("commons-collections.zip", archive_contents)

# init project
Expand All @@ -79,7 +79,7 @@
expect(output_from("tetra change-sources ../commons-collections.zip")).to include("New sources committed")

# second dry-run, all normal
cd(File.join("src", "commons-collections4-4.4-src"))
cd(File.join("src", CCOLLECTIONS))
@aruba_timeout_seconds = 240
run_interactive("tetra dry-run")
type("mvn package -DskipTests")
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/coarse/generate_spec_subcommand_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

describe "`tetra generate-spec`", type: :aruba do
it "outputs a warning if source files are not found" do
archive_contents = File.read(File.join("spec", "data", "commons-collections4-4.4-src.zip"))
archive_contents = File.read(File.join("spec", "data", "#{CCOLLECTIONS}.zip"))
write_file("commons-collections.zip", archive_contents)

run_simple("tetra init --no-archive commons-collections")
cd("commons-collections")

cd("src")
run_simple("unzip ../../commons-collections.zip")
cd("commons-collections4-4.4-src")
cd(CCOLLECTIONS)

run_simple("tetra change-sources --no-archive")
expect(output_from("tetra change-sources --no-archive")).to include("New sources committed")
Expand Down
12 changes: 6 additions & 6 deletions spec/lib/coarse/init_subcommand_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
end

it "inits a new project with a zip source file" do
archive_contents = File.read(File.join("spec", "data", "commons-collections4-4.4-src.zip"))
archive_contents = File.read(File.join("spec", "data", "#{CCOLLECTIONS}.zip"))
write_file("commons-collections.zip", archive_contents)

run_simple("tetra init commons-collections commons-collections.zip")
Expand All @@ -48,8 +48,8 @@
cd("commons-collections")
check_directory_presence([".git", "kit", "src", "packages"], true)

check_directory_presence([File.join("src", "commons-collections4-4.4-src")], true)
check_file_presence([File.join("src", "commons-collections4-4.4-src", "pom.xml")], true)
check_directory_presence([File.join("src", CCOLLECTIONS)], true)
check_file_presence([File.join("src", CCOLLECTIONS, "pom.xml")], true)

check_file_presence([File.join("packages", "commons-collections", "commons-collections.zip")], true)

Expand All @@ -58,7 +58,7 @@
end

it "inits a new project with a tar source file" do
archive_contents = File.read(File.join("spec", "data", "commons-collections4-4.4-src.tar.gz"))
archive_contents = File.read(File.join("spec", "data", "#{CCOLLECTIONS}.tar.gz"))
write_file("commons-collections.tar.gz", archive_contents)

run_simple("tetra init commons-collections commons-collections.tar.gz")
Expand All @@ -74,8 +74,8 @@
cd("commons-collections")
check_directory_presence([".git", "kit", "src", "packages"], true)

check_directory_presence([File.join("src", "commons-collections4-4.4-src")], true)
check_file_presence([File.join("src", "commons-collections4-4.4-src", "pom.xml")], true)
check_directory_presence([File.join("src", CCOLLECTIONS)], true)
check_file_presence([File.join("src", CCOLLECTIONS, "pom.xml")], true)

check_file_presence([File.join("packages", "commons-collections", "commons-collections.tar.gz")], true)

Expand Down
4 changes: 2 additions & 2 deletions spec/lib/fine/tar_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
describe Tetra::Tar do
include Tetra::Mockers

let(:zipfile) { File.join("spec", "data", "commons-collections4-4.4-src.tar.gz") }
let(:zipfile) { File.join("spec", "data", "#{CCOLLECTIONS}.tar.gz") }
let(:tar) { Tetra::Tar.new }

describe "#decompress" do
Expand All @@ -15,7 +15,7 @@

files = Find.find(dir).to_a

expect(files).to include("#{dir}/commons-collections4-4.4-src/DEVELOPERS-GUIDE.html")
expect(files).to include("#{dir}/#{CCOLLECTIONS}/DEVELOPERS-GUIDE.html")
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/fine/unzip_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
describe Tetra::Unzip do
include Tetra::Mockers

let(:zipfile) { File.join("spec", "data", "commons-collections4-4.4-src.zip") }
let(:zipfile) { File.join("spec", "data", "#{CCOLLECTIONS}.zip") }
let(:unzip) { Tetra::Unzip.new }

describe "#decompress" do
Expand All @@ -15,7 +15,7 @@

files = Find.find(dir).to_a

expect(files).to include("#{dir}/commons-collections4-4.4-src/DEVELOPERS-GUIDE.html")
expect(files).to include("#{dir}/#{CCOLLECTIONS}/DEVELOPERS-GUIDE.html")
end
end
end
Expand Down

0 comments on commit ed996a5

Please sign in to comment.