File tree Expand file tree Collapse file tree 5 files changed +27
-2
lines changed Expand file tree Collapse file tree 5 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
6
6
and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
7
7
8
+ ## [ 1.5.1] - 2021-03-02
9
+
10
+ ### Fixed
11
+
12
+ - Fixed a ` NameError ` that was thrown when ` Patch::Sdg ` was called. Specs have been added to ensure this does not happen again.
13
+
8
14
## [ 1.5.0] - 2021-03-01
9
15
10
16
### Changed
Original file line number Diff line number Diff line change 1
1
PATH
2
2
remote: .
3
3
specs:
4
- patch_ruby (1.4.0 )
4
+ patch_ruby (1.5.1 )
5
5
json (~> 2.1 , >= 2.1.0 )
6
6
typhoeus (~> 1.0 , >= 1.0.1 )
7
7
Original file line number Diff line number Diff line change 36
36
require 'patch_ruby/models/project'
37
37
require 'patch_ruby/models/project_list_response'
38
38
require 'patch_ruby/models/project_response'
39
+ require 'patch_ruby/models/sdg'
39
40
require 'patch_ruby/models/standard'
40
41
41
42
# APIs
Original file line number Diff line number Diff line change 11
11
=end
12
12
13
13
module Patch
14
- VERSION = '1.5.0 '
14
+ VERSION = '1.5.1 '
15
15
end
Original file line number Diff line number Diff line change
1
+ describe Patch do
2
+ context 'Models' do
3
+ it 'defines all models' do
4
+ constants . each do |constant |
5
+ expect { Patch . const_get ( constant ) } . not_to raise_error
6
+ end
7
+ end
8
+ end
9
+
10
+ def constants
11
+ # Given a file path return the constant of that path, for example:
12
+ # 'lib/patch_ruby/models/project_response.rb' -> ProjectResponse
13
+ Dir . glob ( "lib/patch_ruby/models/*.rb" ) . map do |file |
14
+ parsed_filename = file . split ( '/' ) . last . split ( '.' ) . first
15
+ constant = parsed_filename . split ( '_' ) . map ( &:capitalize ) . join ( '' )
16
+ end
17
+ end
18
+ end
You can’t perform that action at this time.
0 commit comments