Skip to content

Commit 0833a0e

Browse files
committed
Remove unused RFC gem
* the RFC gem doesn't support ruby 3.3, but we don't seem to use it anyway
1 parent 5fce6bb commit 0833a0e

File tree

6 files changed

+0
-62
lines changed

6 files changed

+0
-62
lines changed

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ gem 'public_suffix'
3131
gem 'puma'
3232
gem 'rake'
3333
gem 'redis'
34-
gem 'rfc822'
3534
gem 'rubyzip', '>= 1.3.0'
3635
gem 'sequel', '~> 5.85'
3736
gem 'sequel_pg', require: 'sequel'

Gemfile.lock

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,6 @@ GEM
425425
reverse_markdown (2.1.1)
426426
nokogiri
427427
rexml (3.3.9)
428-
rfc822 (0.1.5)
429428
roodi (5.0.0)
430429
ruby_parser (~> 3.2, >= 3.2.2)
431430
rspec (3.13.0)
@@ -640,7 +639,6 @@ DEPENDENCIES
640639
railties (~> 7.2.1)
641640
rake
642641
redis
643-
rfc822
644642
roodi
645643
rspec (~> 3.13.0)
646644
rspec-collection_matchers

lib/sequel_plugins/vcap_validations.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,5 @@ def validates_url(attr, opts={})
88

99
validates_format(URI::DEFAULT_PARSER.make_regexp(%w[http https]), attr, message: opts.fetch(:message, :url))
1010
end
11-
12-
# Validates that an attribute is a valid email address
13-
#
14-
# @param [Symbol] The attribute to validate
15-
def validates_email(attr)
16-
validates_format(RFC822::EMAIL_REGEXP_WHOLE, attr, message: :email) if send(attr)
17-
end
1811
end
1912
end

lib/vcap/rest_api/message.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
require 'vcap/json_message'
2-
require 'rfc822'
32

43
module VCAP
54
module RestAPI
@@ -58,7 +57,6 @@ def self.schema_doc(schema)
5857

5958
URL = UrlDecorator.new(URI::DEFAULT_PARSER.make_regexp(%w[http https]))
6059
HTTPS_URL = HttpsUrlDecorator.new(URI::DEFAULT_PARSER.make_regexp('https'))
61-
EMAIL = EmailDecorator.new(RFC822::EMAIL_REGEXP_WHOLE)
6260
GIT_URL = GitUrlDecorator.new(URI::DEFAULT_PARSER.make_regexp(%w[http https git]))
6361

6462
# The block will be evaluated in the context of the schema validator used

spec/unit/lib/ext/validation_error_message_overrides_spec.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,6 @@
3535
end
3636
end
3737

38-
context 'with a custom readable_regexp for an email' do
39-
let(:regexp) { VCAP::RestAPI::Message::EMAIL }
40-
41-
it 'generates a readable message' do
42-
expected_emsg = 'must be a valid email'
43-
expect { subject.fail!(regexp, object) }.to raise_error(Membrane::SchemaValidationError, /#{expected_emsg}/)
44-
end
45-
end
46-
4738
context 'with a custom readable_regexp for a git URL' do
4839
let(:regexp) { VCAP::RestAPI::Message::GIT_URL }
4940

spec/unit/lib/sequel_plugins/vcap_validations_spec.rb

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -63,45 +63,4 @@ def self.define_validations(&)
6363
end
6464
end
6565
end
66-
67-
describe 'validates_email' do
68-
before do
69-
@c.define_validations { validates_email(:val) }
70-
end
71-
72-
it 'allows a valid email' do
73-
@m.val = '[email protected]'
74-
expect(@m).to be_valid
75-
end
76-
77-
it 'does not allow an email with no domain' do
78-
@m.val = 'some_guy'
79-
expect(@m).not_to be_valid
80-
end
81-
82-
it 'does not allow an email with no user' do
83-
@m.val = '@somedomain.com'
84-
expect(@m).not_to be_valid
85-
end
86-
87-
it 'does not allow a malformed email with multiple @' do
88-
@m.val = 'foo@[email protected]'
89-
expect(@m).not_to be_valid
90-
end
91-
92-
it 'allows a nil email' do
93-
@m.val = nil
94-
expect(@m).to be_valid
95-
end
96-
97-
it 'does not allow an empty email' do
98-
@m.val = ''
99-
expect(@m).not_to be_valid
100-
end
101-
102-
it 'does not allow an email with only spaces' do
103-
@m.val = ' '
104-
expect(@m).not_to be_valid
105-
end
106-
end
10766
end

0 commit comments

Comments
 (0)