bake-test-external 0.3.0 → 0.3.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f3a6b374572b47af82e04f4b26b382a133c593cbcf43897fce5f47b2c3a106a1
4
- data.tar.gz: bbb34012fb4558a400eeb52cf6286ec946545f6e31aea54c38372e9a0bbc1f48
3
+ metadata.gz: 436b2f2def2f96fc9bcb105b293e068bf78b7a1343d4cece9d1c82601260eece
4
+ data.tar.gz: 2311ade76f8454a7cc535e8c7717e21b56ebbe92b4a419072def38c750bd1907
5
5
  SHA512:
6
- metadata.gz: 17f73204c2b1114d44e66146226126d1569938fcaf6cdb072f33bcfe6413d37562330fefb86348052eb2dc73c51e6e7636035409e156f16b7e52162e45548a12
7
- data.tar.gz: 810a9db3951a515617e8a38b0cb1290b384d7a91abb382ef39441d9d1ec33583e106bd1daa28e4e5a84fb5032eddc698bc680e1d7f8adb907b169d60ec25a89f
6
+ metadata.gz: 3619f8a89b6a4b7aab0e0962519f0ab28176314e70189d5917ef6008afceeb34dd960bcad22be6cc0569d6f850fe772cee491586d9190439ead1fcdbf6452932
7
+ data.tar.gz: fa462ccd174b03d27d06f368a91048ab50b2e5b0d8f3139598fb53b2dff4f32ebdae880031b89994ce8a495b245c828181f3327ab6b801af43cad8732a9d3e98
checksums.yaml.gz.sig CHANGED
Binary file
@@ -3,6 +3,7 @@
3
3
  # Released under the MIT License.
4
4
  # Copyright, 2022, by Samuel Williams.
5
5
  # Copyright, 2022, by Akshay Birajdar.
6
+ # Copyright, 2022, by Hiroaki Osawa.
6
7
 
7
8
  DEFAULT_EXTERNALS_PATH = 'config/external.yaml'
8
9
  DEFAULT_COMMAND = "bake test"
@@ -42,10 +43,14 @@ def find_gemspec(glob = "*.gemspec")
42
43
  end
43
44
 
44
45
  def clone_and_test(name, key, config)
46
+ path = clone_repository(name, key, config)
47
+ test_repository(path, config) or abort("External tests #{key} failed!")
48
+ end
49
+
50
+ def clone_repository(name, key, config)
45
51
  require 'fileutils'
46
52
 
47
53
  url = config[:url]
48
- command = config.fetch(:command, DEFAULT_COMMAND)
49
54
 
50
55
  path = "external/#{key}"
51
56
 
@@ -57,6 +62,10 @@ def clone_and_test(name, key, config)
57
62
  command << "--branch" << branch
58
63
  end
59
64
 
65
+ if tag = config[:tag]
66
+ command << "--tag" << tag
67
+ end
68
+
60
69
  command << url << path
61
70
  system(*command)
62
71
 
@@ -65,12 +74,13 @@ def clone_and_test(name, key, config)
65
74
 
66
75
  gemfile_paths = ["#{path}/Gemfile", "#{path}/gems.rb"]
67
76
  gemfile_path = gemfile_paths.find{|path| File.exist?(path)}
68
-
77
+
69
78
  File.open(gemfile_path, 'r+') do |file|
70
79
  pattern = /gem.*?['"]#{name}['"]/
71
80
  lines = file.grep_v(pattern)
72
81
 
73
82
  file.seek(0)
83
+ file.truncate(0)
74
84
  file.puts(lines)
75
85
  file.puts nil, "# Added by external testing:"
76
86
  file.puts("gem #{name.to_s.dump}, path: '../../'")
@@ -83,5 +93,11 @@ def clone_and_test(name, key, config)
83
93
  system("bundle", "install", chdir: path)
84
94
  end
85
95
 
86
- system(*command, chdir: path) or abort("External tests #{key} failed!")
96
+ return path
97
+ end
98
+
99
+ def test_repository(path, config)
100
+ command = config.fetch(:command, DEFAULT_COMMAND)
101
+
102
+ system(*command, chdir: path)
87
103
  end
@@ -6,7 +6,7 @@
6
6
  module Bake
7
7
  module Test
8
8
  module External
9
- VERSION = "0.3.0"
9
+ VERSION = "0.3.2"
10
10
  end
11
11
  end
12
12
  end
data/license.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  Copyright, 2022, by Samuel Williams.
4
4
  Copyright, 2022, by Akshay Birajdar.
5
+ Copyright, 2022, by Hiroaki Osawa.
5
6
 
6
7
  Permission is hereby granted, free of charge, to any person obtaining a copy
7
8
  of this software and associated documentation files (the "Software"), to deal
data/readme.md CHANGED
@@ -12,6 +12,7 @@ Add a file `config/external.yaml` to your project, and add entries like:
12
12
  bake:
13
13
  url: https://github.com/ioquatix/bake.git
14
14
  command: bundle exec rspec
15
+ # branch: optional-branch-name
15
16
  ```
16
17
 
17
18
  ``` bash
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,11 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bake-test-external
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  - Akshay Birajdar
9
+ - Hiroaki Osawa
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain:
@@ -38,7 +39,7 @@ cert_chain:
38
39
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
39
40
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
40
41
  -----END CERTIFICATE-----
41
- date: 2022-10-12 00:00:00.000000000 Z
42
+ date: 2022-10-13 00:00:00.000000000 Z
42
43
  dependencies:
43
44
  - !ruby/object:Gem::Dependency
44
45
  name: bake
metadata.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- U3�����L��0&TtX_4��*0nQ���,�#��f�������mO����gwJ�I+P ���7��Her�Qu����83��.�rq#�K�')J�#9��%�ǫ�=q�(�WE�,�O����0��{c��g,���J��Ȕ����%$~�Z�n��?��ʛ#7+!_+8�$l��U��~�k�^�ţ�0�(Rcjҥ>i�����
2
- ��%B�/�a��u��Ĭ�s�8_�~P='4��ܿ+��X|��+�[�Yaz4��Y�c^Z��h��5��� �����
1
+ IW�fȎ�}9��RNqVt5򽏔7eP/��}IC���n�;��R�� rL�E �JK �ʒ��b�\紖�iq�\(� �����ێ�����Z'�榘啔
2
+ �|:�K��Nb�s��p���;�=�(S�8������p�`�̗(ki��X'ph[w����{��e���Io��9����29'��̤�Fj�=�ɲ*�M�>�_ʣcb