File tree 2 files changed +64
-4
lines changed
2 files changed +64
-4
lines changed Original file line number Diff line number Diff line change
1
+ name : Supported Ruby Matrix
2
+
3
+ env :
4
+ K_SOUP_COV_DO : false
5
+
6
+ on :
7
+ push :
8
+ branches :
9
+ - ' master'
10
+ tags :
11
+ - ' !*' # Do not execute on tags
12
+ pull_request :
13
+ branches :
14
+ - ' *'
15
+ # Allow manually triggering the workflow.
16
+ workflow_dispatch :
17
+
18
+ permissions :
19
+ contents : read
20
+
21
+ # Cancels all previous workflow runs for the same branch that have not yet completed.
22
+ concurrency :
23
+ # The concurrency group contains the workflow name and the branch name.
24
+ group : " ${{ github.workflow }}-${{ github.ref }}"
25
+ cancel-in-progress : true
26
+
27
+ jobs :
28
+ test :
29
+ name : Specs - Ruby ${{ matrix.ruby }}${{ matrix.name_extra || '' }}
30
+ if : " !contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
31
+ env : # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
32
+ BUNDLE_GEMFILE : ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
33
+ runs-on : ubuntu-latest
34
+ strategy :
35
+ matrix :
36
+ include :
37
+ - ruby : " 3.3"
38
+ rubygems : latest
39
+ bundler : latest
40
+ gemfile : vanilla
41
+ - ruby : " 3.2"
42
+ rubygems : latest
43
+ bundler : latest
44
+ gemfile : vanilla
45
+ # - Ruby 3.1 tests are run by coverage.yml
46
+ steps :
47
+ - name : Checkout
48
+ uses : actions/checkout@v4
49
+ - name : Setup Ruby & RubyGems
50
+ uses : ruby/setup-ruby@v1
51
+ with :
52
+ ruby-version : " ${{ matrix.ruby }}"
53
+ rubygems : " ${{ matrix.rubygems }}"
54
+ bundler : " ${{ matrix.bundler }}"
55
+ bundler-cache : true # runs 'bundle install' and caches installed gems automatically
56
+ - name : Run tests
57
+ run : bundle exec rake test
Original file line number Diff line number Diff line change 3
3
module OpenID
4
4
5
5
module URINorm
6
+ VALID_URI_SCHEMES = [ 'http' , 'https' ] . freeze
6
7
public
7
8
def URINorm . urinorm ( uri )
8
9
uri = URI . parse ( uri )
9
10
10
11
raise URI ::InvalidURIError . new ( 'no scheme' ) unless uri . scheme
12
+
11
13
uri . scheme = uri . scheme . downcase
12
- unless [ 'http' , 'https' ] . member? ( uri . scheme )
13
- raise URI ::InvalidURIError . new ( 'Not an HTTP or HTTPS URI' )
14
- end
14
+ raise URI ::InvalidURIError . new ( 'Not an HTTP or HTTPS URI' ) unless VALID_URI_SCHEMES . member? ( uri . scheme )
15
+
16
+ raise URI ::InvalidURIError . new ( 'no host' ) if uri . host . nil? # For Ruby 2.7
17
+
18
+ raise URI ::InvalidURIError . new ( 'no host' ) if uri . host . empty? # For Ruby 3+
15
19
16
- raise URI ::InvalidURIError . new ( 'no host' ) unless uri . host
17
20
uri . host = uri . host . downcase
18
21
19
22
uri . path = remove_dot_segments ( uri . path )
You can’t perform that action at this time.
0 commit comments