File tree Expand file tree Collapse file tree 4 files changed +11
-10
lines changed
Expand file tree Collapse file tree 4 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 3333 - " 3.1"
3434 - " 3.2"
3535 - " 3.3"
36+ - " 3.4"
3637 name : Ruby ${{ matrix.ruby }}
3738 steps :
3839 - uses : actions/checkout@v5
4142 with :
4243 ruby-version : ${{ matrix.ruby }}
4344 bundler-cache : true
44- - name : Run tests without uploading code coverage
45- if : ${{ matrix.ruby != '3.0' }}
45+ - name : Run tests
4646 run : bundle exec rake
47- - name : Run tests and upload coverage to Code Climate
48- if : ${{ matrix.ruby == '3.0' }}
49- 50- env :
51- CC_TEST_REPORTER_ID : ${{ secrets.CODECLIMATE_TOKEN }}
52- with :
53- coverageCommand : bundle exec rake
Original file line number Diff line number Diff line change 44 TargetRubyVersion : 2.6
55 NewCops : enable
66
7- require :
7+ plugins :
88 - rubocop-rake
99 - rubocop-rspec
1010
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ Gem::Specification.new do |spec|
3030 spec . require_paths = [ 'lib' ]
3131
3232 spec . add_dependency 'activesupport'
33+ spec . add_dependency 'datemath'
3334 spec . add_dependency 'mail'
3435 spec . add_dependency 'opensearch-ruby-cli'
3536 spec . add_dependency 'rexml'
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ require 'email_report_processor'
66require 'opensearch/cli'
77require 'faraday/net_http_persistent'
88
9+ require 'datemath'
910require 'openssl'
1011require 'optparse'
1112
9394message_reader = EmailReportProcessor ::MessageReader . new
9495report_processor = EmailReportProcessor ::ReportProcessor . new ( client : cli . client , options : options )
9596
97+ accepted_dates = Datemath ::Parser . new ( options [ :deduplicate_since ] ) . parse ..Datemath ::Parser . new ( options [ :deduplicate_until ] ) . parse
98+
9699if ARGV . empty?
97100 mail = Mail . new ( $stdin. read )
98101 report_processor . send_report ( message_reader . process_message ( mail ) )
@@ -103,13 +106,17 @@ else
103106 m = EmailReportProcessor ::Mbox . new ( filename )
104107
105108 while ( mail = m . next_message )
109+ next unless accepted_dates . cover? ( mail . date )
110+
106111 report_processor . send_report ( message_reader . process_message ( mail ) )
107112 p . step
108113 end
109114 elsif options [ :maildir ]
110115 m = EmailReportProcessor ::MailDir . new ( filename )
111116
112117 while ( mail = m . next_message )
118+ next unless accepted_dates . cover? ( mail . date )
119+
113120 report_processor . send_report ( message_reader . process_message ( mail ) )
114121 p . step
115122 end
You can’t perform that action at this time.
0 commit comments