speculate_about 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5abf0f1d0b408b81d4b2b9644eeaaca4137bcf0180f298bb94145b275a847ecd
4
- data.tar.gz: a040f692852c90de48d3d1a758ecda31ce8a3d1f36920ce44145d396f7666aca
3
+ metadata.gz: a3d2e27062babfecbf03e34c59b76b495cbb1a9f27d3cbd0f4b23501d3be9181
4
+ data.tar.gz: bdde751f7fa2c532dc95551f06ecc22f44fba32ad0f70103371e1743f62ca347
5
5
  SHA512:
6
- metadata.gz: d6d2d63515ade99e8eaac787572359c3b707301263d4ebbee6ce3df03546426262202e092eef337239cf9a82e92096e8fa7318756b405f46900c0514fd1d1d4c
7
- data.tar.gz: 5ca6224cf00ab3ee4cd13d8ba2df5cfc83bcc7d516a018435f097ed509f94a27cc2ec9df054a2cc43b2215a3399a0b79c4279c00b01b9fd27181e0c0ac905597
6
+ metadata.gz: 95b2fd95e73b0b95d8c9237200bdb86c198f8584987d1f0a54968b742b46c1a06ffff29eb6352962a14e54c9d9d7e047a02f98c57b78a8894fc5c14a4f941d8c
7
+ data.tar.gz: bc56ce52b6e4bc87fbff62c5fb5583ad6fe683b4dd78e18bc8b6d6da28bfbdedf46d3397e297c70878dff8633e3c8c0aa15cb89c871d01ff3c84a8c32c3ccf12
@@ -7,7 +7,7 @@ module SpeculateAbout
7
7
  paths = _find_files(file, File.dirname( caller.first ))
8
8
  raise ArgumentError, "no files found for pattern #{file}" if paths.empty?
9
9
  paths.each do |path|
10
- code = _compile path, file
10
+ code = _compile path, _readable(path)
11
11
  ENV["SPECULATE_ABOUT_DEBUG"] ? _show(code, path) : instance_eval(code, path)
12
12
  end
13
13
  end
@@ -19,10 +19,9 @@ module SpeculateAbout
19
19
  ast = Speculations::Parser.new.parse_from_file(path, file)
20
20
  ast.to_code
21
21
  end
22
- def _show(code, path)
23
- message = "Generated code for #{path}"
24
- _underline(message)
25
- puts code
22
+ def _readable(path)
23
+ d = File.dirname(path)
24
+ File.join(File.basename(d), File.basename(path))
26
25
  end
27
26
  def _find_files file, local_path
28
27
  [Dir.pwd, local_path]
@@ -30,6 +29,11 @@ module SpeculateAbout
30
29
  Dir.glob(File.join(dir, file))
31
30
  end
32
31
  end
32
+ def _show(code, path)
33
+ message = "Generated code for #{path}"
34
+ _underline(message)
35
+ puts code
36
+ end
33
37
  def _underline(message, ul: "=")
34
38
  puts message
35
39
  puts message.gsub(/./, ul)
@@ -1,3 +1,3 @@
1
1
  module SpeculateAbout
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: speculate_about
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Dober
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-11 00:00:00.000000000 Z
11
+ date: 2020-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -63,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
63
  - !ruby/object:Gem::Version
64
64
  version: '0'
65
65
  requirements: []
66
- rubygems_version: 3.2.0.rc.1
66
+ rubygems_version: 3.1.2
67
67
  signing_key:
68
68
  specification_version: 4
69
69
  summary: Extract RSpecs from Markdown