bun_bo 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/bun_bo +0 -2
- data/lib/bun_bo.rb +10 -7
- data/lib/bun_bo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2515c4ea90ea2a3f96d7108c50a03a6251f9056a8662aaacfef32a1084929b7
|
4
|
+
data.tar.gz: 301210b6fd6b07d67c01ef9d5408ee94821d35a0620ab6c05dcd3d1c6c4b5892
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bd0dd8efeaf3b540163deb31981d5b7fc6608d652754542b23f83eaf02e6bee45a174d3a238b19c3fe96e41d8e20a563d85e72204bd2ca99baea19508e7d81d
|
7
|
+
data.tar.gz: fd710a8fd238c329c40dceba4838466105f78245d816c97eef5e0b339fc6ed05e7f09ec3e72e225c3b523c4ded0c180c1c5b9be20b0f6c1ee1ebac636ba1730b
|
data/exe/bun_bo
CHANGED
data/lib/bun_bo.rb
CHANGED
@@ -1,17 +1,20 @@
|
|
1
1
|
require "bun_bo/version"
|
2
|
+
require 'fileutils'
|
2
3
|
|
3
4
|
class BunBo
|
4
5
|
def run(input_path)
|
5
|
-
|
6
|
-
folder_path, file_name = File.split(input_path)
|
7
|
-
extension = File.extname(file_name)
|
8
|
-
base_name = File.basename(file_name, extension)
|
6
|
+
input_path = Pathname.new(input_path)
|
9
7
|
|
10
|
-
|
11
|
-
|
8
|
+
if input_path.file?
|
9
|
+
folder_path, file_name = input_path.split
|
10
|
+
extension = file_name.extname
|
11
|
+
base_name = file_name.basename(extension)
|
12
|
+
|
13
|
+
test_folder = folder_path.sub(/^(app|lib)/, 'spec')
|
14
|
+
test_path = test_folder.join("#{base_name}_spec").sub_ext(".rb")
|
12
15
|
|
13
16
|
FileUtils.mkdir_p(test_folder)
|
14
|
-
|
17
|
+
test_path.write('')
|
15
18
|
else
|
16
19
|
puts "File does not exists"
|
17
20
|
end
|
data/lib/bun_bo/version.rb
CHANGED