job_spec 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/job_spec/render_as_markdown.rb +19 -3
- data/lib/job_spec/role.rb +3 -3
- data/lib/job_spec/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: baf6c46db69ad8de79584def5d8381f7bfbb78e0
|
4
|
+
data.tar.gz: 5c6fe728e4ff922858b94fb05f5a7340fc1f0cd4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f30cea6a08168757f14b5bc58be6413adc978c3ce5d69ced30c04dc6c3f1a1fd15ea4ef2c4aa74239ff8f27e5835120063aac20584b3afbf44a37472e0fa1027
|
7
|
+
data.tar.gz: 4fdb2cbb3b5e174f9fb796fd1c8853f3e084cd37c70ed980c72797a9d41d944c7374b77281d51a7047a4b07f72b6368a1063be30872d0cbec705032ef57da466
|
@@ -11,12 +11,28 @@ module JobSpec
|
|
11
11
|
markdown << "# #{role.name}"
|
12
12
|
markdown << role.description unless role.description.nil?
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
grouped_expectations.each do |group, expectations|
|
15
|
+
if group.nil?
|
16
|
+
markdown << '## Expectations' unless role.expectations.empty?
|
17
|
+
else
|
18
|
+
markdown << "## #{group}"
|
19
|
+
end
|
20
|
+
|
21
|
+
expectations.map(&:values).each do |(expectation, description)|
|
22
|
+
markdown << "### #{expectation[0].upcase}#{expectation[1..expectation.length]}"
|
23
|
+
markdown << description unless description.nil?
|
24
|
+
end
|
17
25
|
end
|
18
26
|
|
19
27
|
markdown.join("\n\n")
|
20
28
|
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
def grouped_expectations
|
33
|
+
role.expectations.group_by do |expectations|
|
34
|
+
expectations[:group]
|
35
|
+
end
|
36
|
+
end
|
21
37
|
end
|
22
38
|
end
|
data/lib/job_spec/role.rb
CHANGED
@@ -27,12 +27,12 @@ module JobSpec
|
|
27
27
|
@salary = @salary || range
|
28
28
|
end
|
29
29
|
|
30
|
-
def include(role_expectations)
|
31
|
-
@expectations.concat(role_expectations.to_a)
|
30
|
+
def include(role_expectations, as:)
|
31
|
+
@expectations.concat(role_expectations.to_a.map { |expectation| expectation.merge(group: as) })
|
32
32
|
end
|
33
33
|
|
34
34
|
def expected(expectation, description = nil)
|
35
|
-
@expectations << { expectation: expectation, description: description }
|
35
|
+
@expectations << { expectation: expectation, description: description, group: nil }
|
36
36
|
end
|
37
37
|
|
38
38
|
def expectations
|
data/lib/job_spec/version.rb
CHANGED