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 +4 -4
- data/lib/speculate_about.rb +9 -5
- data/lib/speculations/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3d2e27062babfecbf03e34c59b76b495cbb1a9f27d3cbd0f4b23501d3be9181
|
4
|
+
data.tar.gz: bdde751f7fa2c532dc95551f06ecc22f44fba32ad0f70103371e1743f62ca347
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95b2fd95e73b0b95d8c9237200bdb86c198f8584987d1f0a54968b742b46c1a06ffff29eb6352962a14e54c9d9d7e047a02f98c57b78a8894fc5c14a4f941d8c
|
7
|
+
data.tar.gz: bc56ce52b6e4bc87fbff62c5fb5583ad6fe683b4dd78e18bc8b6d6da28bfbdedf46d3397e297c70878dff8633e3c8c0aa15cb89c871d01ff3c84a8c32c3ccf12
|
data/lib/speculate_about.rb
CHANGED
@@ -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,
|
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
|
23
|
-
|
24
|
-
|
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)
|
data/lib/speculations/version.rb
CHANGED
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.
|
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
|
+
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
|
66
|
+
rubygems_version: 3.1.2
|
67
67
|
signing_key:
|
68
68
|
specification_version: 4
|
69
69
|
summary: Extract RSpecs from Markdown
|