Skip to content

Commit b464784

Browse files
authored
Aligns file structure to top-level package with run command (#19)
1 parent 0e2b7fa commit b464784

19 files changed

Lines changed: 60 additions & 67 deletions

bundle/build.go renamed to build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package bundle
1+
package bundleinstall
22

33
import (
44
"time"
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package bundle_test
1+
package bundleinstall_test
22

33
import (
44
"bytes"
@@ -11,8 +11,8 @@ import (
1111

1212
"github.com/paketo-buildpacks/packit"
1313
"github.com/paketo-buildpacks/packit/chronos"
14-
"github.com/paketo-community/bundle-install/bundle"
15-
"github.com/paketo-community/bundle-install/bundle/fakes"
14+
bundleinstall "github.com/paketo-community/bundle-install"
15+
"github.com/paketo-community/bundle-install/fakes"
1616
"github.com/sclevine/spec"
1717

1818
. "github.com/onsi/gomega"
@@ -49,14 +49,14 @@ func testBuild(t *testing.T, context spec.G, it spec.S) {
4949
installProcess = &fakes.InstallProcess{}
5050

5151
buffer = bytes.NewBuffer(nil)
52-
logEmitter := bundle.NewLogEmitter(buffer)
52+
logEmitter := bundleinstall.NewLogEmitter(buffer)
5353

5454
timeStamp = time.Now()
5555
clock = chronos.NewClock(func() time.Time {
5656
return timeStamp
5757
})
5858

59-
build = bundle.Build(installProcess, logEmitter, clock)
59+
build = bundleinstall.Build(installProcess, logEmitter, clock)
6060
})
6161

6262
it.After(func() {
@@ -154,7 +154,7 @@ func testBuild(t *testing.T, context spec.G, it spec.S) {
154154
context("when the layer directory cannot be removed", func() {
155155
var layerDir string
156156
it.Before(func() {
157-
layerDir = filepath.Join(layersDir, bundle.LayerNameGems)
157+
layerDir = filepath.Join(layersDir, bundleinstall.LayerNameGems)
158158
Expect(os.MkdirAll(filepath.Join(layerDir, "baller"), os.ModePerm)).To(Succeed())
159159
Expect(os.Chmod(layerDir, 0000)).To(Succeed())
160160
})

buildpack.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ api = "0.2"
55
name = "Bundle Install Buildpack"
66

77
[metadata]
8-
include_files = ["bin/build", "bin/detect", "buildpack.toml"]
8+
include_files = ["bin/build", "bin/detect", "bin/run", "buildpack.toml"]
99
pre_package = "./scripts/build.sh"
1010

1111
[[stacks]]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package bundle
1+
package bundleinstall
22

33
import (
44
"bytes"
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package bundle_test
1+
package bundleinstall_test
22

33
import (
44
"errors"
@@ -8,8 +8,8 @@ import (
88
"testing"
99

1010
"github.com/paketo-buildpacks/packit/pexec"
11-
"github.com/paketo-community/bundle-install/bundle"
12-
"github.com/paketo-community/bundle-install/bundle/fakes"
11+
bundleinstall "github.com/paketo-community/bundle-install"
12+
"github.com/paketo-community/bundle-install/fakes"
1313
"github.com/sclevine/spec"
1414

1515
. "github.com/onsi/gomega"
@@ -25,7 +25,7 @@ func testBundleInstallProcess(t *testing.T, context spec.G, it spec.S) {
2525
executions []pexec.Execution
2626
executable *fakes.Executable
2727

28-
installProcess bundle.BundleInstallProcess
28+
installProcess bundleinstall.BundleInstallProcess
2929
)
3030

3131
it.Before(func() {
@@ -44,7 +44,7 @@ func testBundleInstallProcess(t *testing.T, context spec.G, it spec.S) {
4444
path = os.Getenv("PATH")
4545
os.Setenv("PATH", "/some/bin")
4646

47-
installProcess = bundle.NewBundleInstallProcess(executable)
47+
installProcess = bundleinstall.NewBundleInstallProcess(executable)
4848
})
4949

5050
it.After(func() {

cmd/build/main.go

Lines changed: 0 additions & 18 deletions
This file was deleted.

cmd/detect/main.go

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package bundle
1+
package bundleinstall
22

33
const (
44
GemsDependency = "gems"

bundle/detect.go renamed to detect.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package bundle
1+
package bundleinstall
22

33
import (
44
"fmt"
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
package bundle_test
1+
package bundleinstall_test
22

33
import (
44
"errors"
5+
"io/ioutil"
56
"os"
67
"path/filepath"
78
"testing"
89

9-
"io/ioutil"
10-
1110
"github.com/paketo-buildpacks/packit"
12-
"github.com/paketo-community/bundle-install/bundle"
13-
"github.com/paketo-community/bundle-install/bundle/fakes"
11+
bundleinstall "github.com/paketo-community/bundle-install"
12+
"github.com/paketo-community/bundle-install/fakes"
1413
"github.com/sclevine/spec"
1514

1615
. "github.com/onsi/gomega"
@@ -35,7 +34,7 @@ func testDetect(t *testing.T, context spec.G, it spec.S) {
3534

3635
gemfileParser = &fakes.VersionParser{}
3736

38-
detect = bundle.Detect(gemfileParser)
37+
detect = bundleinstall.Detect(gemfileParser)
3938
})
4039

4140
it.After(func() {
@@ -54,13 +53,13 @@ func testDetect(t *testing.T, context spec.G, it spec.S) {
5453
Requires: []packit.BuildPlanRequirement{
5554
{
5655
Name: "bundler",
57-
Metadata: bundle.BuildPlanMetadata{
56+
Metadata: bundleinstall.BuildPlanMetadata{
5857
Build: true,
5958
},
6059
},
6160
{
6261
Name: "mri",
63-
Metadata: bundle.BuildPlanMetadata{
62+
Metadata: bundleinstall.BuildPlanMetadata{
6463
Build: true,
6564
},
6665
},
@@ -85,14 +84,14 @@ func testDetect(t *testing.T, context spec.G, it spec.S) {
8584
Requires: []packit.BuildPlanRequirement{
8685
{
8786
Name: "bundler",
88-
Metadata: bundle.BuildPlanMetadata{
87+
Metadata: bundleinstall.BuildPlanMetadata{
8988
Build: true,
9089
},
9190
},
9291
{
9392
Name: "mri",
9493
Version: "2.6.x",
95-
Metadata: bundle.BuildPlanMetadata{
94+
Metadata: bundleinstall.BuildPlanMetadata{
9695
Build: true,
9796
},
9897
},

0 commit comments

Comments
 (0)