salesforce_certification_calculator 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/README.md +6 -3
- data/Rakefile +1 -1
- data/lib/salesforce_certification_calculator/exam.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: d3e2c79e3592dc37772b3e758787237aee2a59eb61fdf6bb79e69a2922fb409c
|
4
|
+
data.tar.gz: f71f648b7227e328e16e914d1285f53242c3b5d35456c1c59971924f6087cf52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75e7530e1274da33a63de6705ae6d024cd8aa736266b74dcd4c01623303fbd4ce2bfdcab96f67423c3451265d84b6cfe03473d3ac867e29148631291b554eaa3
|
7
|
+
data.tar.gz: 200ce30ad30d7841a0fa37f03f86b2ca1d34b3391e6d75fed0604c38bcac88bd77c680ca1268dd567a275889753fad7e3f35b807d9f4b7b8b67f2fcf10eb9814
|
data/README.md
CHANGED
@@ -65,11 +65,11 @@ If you have trouble downloading the package or just want to play around with the
|
|
65
65
|
1. Fork this repository
|
66
66
|
2. Clone it to your local computer
|
67
67
|
3. From within your local version of the directory, build the module: `gem build salesforce_certification_calculator.gemspec`
|
68
|
-
4. Then install that built module: `gem install ./salesforce_certification_calculator-0.2.
|
68
|
+
4. Then install that built module: `gem install ./salesforce_certification_calculator-0.2.3.gem`
|
69
69
|
5. Open a Ruby environment to use the module: `irb`
|
70
70
|
6. Execute any of the recently installed methods
|
71
71
|
|
72
|
-
You may need to update the specific version of the build as later releases come out (e.g., `-0.2.
|
72
|
+
You may need to update the specific version of the build as later releases come out (e.g., `-0.2.3.gem` may need to become `-0.3.0.gem`).
|
73
73
|
|
74
74
|
## Usage
|
75
75
|
|
@@ -99,6 +99,8 @@ def calculate_total
|
|
99
99
|
|
100
100
|
if summed_weights != 100
|
101
101
|
@total = "CANNOT CALCULATE"
|
102
|
+
else
|
103
|
+
@total = @total.round(2)
|
102
104
|
end
|
103
105
|
end
|
104
106
|
```
|
@@ -106,7 +108,8 @@ end
|
|
106
108
|
**Helper function to pull data stored in a reference XML file**
|
107
109
|
```ruby
|
108
110
|
def extract_initial_exam_data(exam)
|
109
|
-
|
111
|
+
file_path = @base_path + "/" + exam.file
|
112
|
+
doc = File.open(file_path) { |f| Nokogiri::XML(f) }
|
110
113
|
names = doc.xpath("//name")
|
111
114
|
weights = doc.xpath("//weight")
|
112
115
|
|
data/Rakefile
CHANGED
@@ -53,7 +53,7 @@ class SalesforceCertificationCalculator::Exam
|
|
53
53
|
@total += section.weight * section.score / 100.0
|
54
54
|
end
|
55
55
|
|
56
|
-
# Sets total to error message when sum of sections' weights is not 100
|
56
|
+
# Sets total to error message when sum of sections' weights is not 100; otherwise, rounds answer
|
57
57
|
if summed_weights != 100
|
58
58
|
@total = "CANNOT CALCULATE"
|
59
59
|
else
|