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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c567ac0623c7dd10af68535253e5e41940c3bb95a40f4d4bf949db7ab66c6fdc
4
- data.tar.gz: 5199c2d3b10aa5be6ee0f8d4c7a017b074cd273895af7998a173dd338dc67480
3
+ metadata.gz: d3e2c79e3592dc37772b3e758787237aee2a59eb61fdf6bb79e69a2922fb409c
4
+ data.tar.gz: f71f648b7227e328e16e914d1285f53242c3b5d35456c1c59971924f6087cf52
5
5
  SHA512:
6
- metadata.gz: 9958c6e030202ee90903b6305bbf0279d87e0ed98e8c24c9c8d398b3ac6913bc2bd21cd9fdb3f4c0be41cb9b59c419565ad19a21de39a9811a4d1a2de970f084
7
- data.tar.gz: 4d4b26d5210bb43bc701302579205897e654eeab15324d0429fa985ea9550845171b1961d16171f0442024e648b8810e55be37dbf1dbe7593f7cc7ac74a1e83d
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.2.gem`
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.2.gem` may need to become `-0.3.0.gem`).
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
- doc = File.open(exam.file) { |f| Nokogiri::XML(f) }
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
@@ -12,4 +12,4 @@ end
12
12
  desc "Run tests"
13
13
  task default: :test
14
14
 
15
- # --- Ran 103 tests in 0.013676s on 7/28/22 --- OK --- #
15
+ # --- Ran 103 tests in 0.013265s on 7/29/22 --- OK --- #
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: salesforce_certification_calculator
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
  - Jackson Reeves