Skip to content

Commit c355471

Browse files
metaskillsjfuss
authored andcommitted
fix: Add .git to Ruby workflow ignore pattern. (#130)
1 parent 475b0e8 commit c355471

File tree

5 files changed

+17
-1
lines changed

5 files changed

+17
-1
lines changed

aws_lambda_builders/workflows/ruby_bundler/workflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class RubyBundlerWorkflow(BaseWorkflow):
2121
dependency_manager="bundler",
2222
application_framework=None)
2323

24-
EXCLUDED_FILES = (".aws-sam")
24+
EXCLUDED_FILES = (".aws-sam", ".git")
2525

2626
def __init__(self,
2727
source_dir,

tests/integration/workflows/ruby_bundler/test_ruby.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ def test_builds_project_with_dependencies(self):
4646
output_files = set(os.listdir(self.artifacts_dir))
4747
self.assertEquals(expected_files, output_files)
4848

49+
def test_builds_project_and_ignores_excluded_files(self):
50+
source_dir = os.path.join(self.TEST_DATA_FOLDER, "excluded-files")
51+
self.builder.build(source_dir, self.artifacts_dir, self.scratch_dir,
52+
os.path.join(source_dir, "Gemfile"),
53+
runtime=self.runtime)
54+
expected_files = {"handler.rb", "Gemfile", "Gemfile.lock", ".bundle", "vendor"}
55+
output_files = set(os.listdir(self.artifacts_dir))
56+
self.assertEquals(expected_files, output_files)
57+
4958
def test_fails_if_bundler_cannot_resolve_dependencies(self):
5059
source_dir = os.path.join(self.TEST_DATA_FOLDER, "broken-deps")
5160
with self.assertRaises(WorkflowFailedError) as ctx:

tests/integration/workflows/ruby_bundler/testdata/excluded-files/.aws-sam/.keep

Whitespace-only changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
source 'https://rubygems.org'
2+
3+
# This shouldn't even need to exist, that's a pending feature request.
4+
# If no dependencies, leave blank.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
def handle(event:,context:)
2+
"Hello!"
3+
end

0 commit comments

Comments
 (0)