Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
BUNDLE_PATH: "vendor/bundle"
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ jobs:
advanced-security: false # fail the build on findings instead of uploading SARIF

lint:
# Advisory-only for the first pass: the legacy codebase has many
# pre-existing RuboCop offenses; a dedicated cleanup pass will follow.
continue-on-error: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down
34 changes: 31 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,43 @@ AllCops:
Gemspec/RequireMFA:
Enabled: true

# Gemspec floors are intentionally low; raising them is a separate breaking-change decision.
Gemspec/RequiredRubyVersion:
Enabled: false

# Legacy codebase predates the default complexity thresholds (giant EWS type
# tables and SOAP builders); tuned to current maxima. Tightening these is
# future refactoring work, not a lint-cleanup pass.
Metrics/MethodLength:
Max: 45

Metrics/AbcSize:
Max: 70

Metrics/BlockLength:
Max: 150

Metrics/ClassLength:
Max: 1100

Metrics/CyclomaticComplexity:
Max: 20

Metrics/ModuleLength:
Max: 400

Metrics/ParameterLists:
MaxOptionalParameters: 4

Metrics/PerceivedComplexity:
Max: 25

Layout/FirstHashElementIndentation:
EnforcedStyle: consistent

Layout/HashAlignment:
EnforcedHashRocketStyle: table

RSpec/ContextWording:
Enabled: false

Style/BlockDelimiters:
EnforcedStyle: semantic

Expand Down
12 changes: 7 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# frozen_string_literal: true

source 'https://rubygems.org/'

gemspec

group :development do
gem 'bundler-audit', '~> 0.9.3', require: false
gem 'pry-nav'
gem 'rb-inotify', require: false
gem 'rspec'
gem 'rb-inotify', :require => false
gem 'rubocop', require: false
gem 'ruby_audit', '~> 3.1', require: false if RUBY_VERSION >= '3.1.0'
gem 'turn'
gem "pry-nav"
gem 'rubocop', :require => false
gem "bundler-audit", "~> 0.9.3", require: false
gem "ruby_audit", "~> 3.1", require: false if RUBY_VERSION >= "3.1.0"
end
4 changes: 3 additions & 1 deletion Guardfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# frozen_string_literal: true

# A sample Guardfile
# More info at https://github.com/guard/guard#readme

guard 'rspec' do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
watch('spec/spec_helper.rb') { 'spec' }
end
42 changes: 20 additions & 22 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,42 +1,40 @@
# frozen_string_literal: true

require 'rubygems'
require 'bundler'

require 'bundler/gem_tasks'
require 'date'

task :default => [:gem]
task default: [:gem]

desc "Build the gem without a version change"
desc 'Build the gem without a version change'
task :gem do
system "gem build viewpoint.gemspec"
system 'gem build viewpoint.gemspec'
end

desc "Clean the build environment"
desc 'Clean the build environment'
task :clean do
system "rm -f viewpoint*.gem"
system 'rm -f viewpoint*.gem'
end

desc "Build the gem, but increment the version first"
task :newrelease => [:versionup, :clean, :gem]

desc 'Build the gem, but increment the version first'
task newrelease: %i[versionup clean gem]

desc "Increment the version by 1 minor release"
desc 'Increment the version by 1 minor release'
task :versionup do
ver = up_min_version
puts "New version: #{ver}"
ver = up_min_version
puts "New version: #{ver}"
end


def up_min_version
f = File.open('VERSION', 'r+')
ver = f.readline.chomp
v_arr = ver.split(/\./).map do |v|
v.to_i
end
v_arr[2] += 1
ver = v_arr.join('.')
f.rewind
f.write(ver)
f = File.open('VERSION', 'r+')
ver = f.readline.chomp
v_arr = ver.split(/\./).map(&:to_i)
v_arr[2] += 1
ver = v_arr.join('.')
f.rewind
f.write(ver)
f.close
ver
ver
end
70 changes: 37 additions & 33 deletions lib/ews/calendar_accessors.rb
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
=begin
This file is a cotribution to Viewpoint; the Ruby library for Microsoft Exchange Web Services.

Copyright © 2013 Mark McCahill <mark.mccahill@duke.edu>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=end

module Viewpoint::EWS::CalendarAccessors
include Viewpoint::EWS

def event_busy_type( the_event )
the_event[:calendar_event][:elems][2][:busy_type][:text]
# frozen_string_literal: true

# This file is a cotribution to Viewpoint; the Ruby library for Microsoft Exchange Web Services.
#
# Copyright © 2013 Mark McCahill <mark.mccahill@duke.edu>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

module Viewpoint
module EWS
# Calendar operations mixed into the EWS client.
module CalendarAccessors
include Viewpoint::EWS

def event_busy_type(the_event)
the_event[:calendar_event][:elems][2][:busy_type][:text]
end

def event_start_time(the_event)
the_event[:calendar_event][:elems][0][:start_time][:text]
end

def event_end_time(the_event)
the_event[:calendar_event][:elems][1][:end_time][:text]
end
end
end

def event_start_time( the_event )
the_event[:calendar_event][:elems][0][:start_time][:text]
end

def event_end_time( the_event )
the_event[:calendar_event][:elems][1][:end_time][:text]
end

end # Viewpoint::EWS::CalendarAccessors
end
Loading