
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
A configured Google API wrapper.
Add this to your Gemfile:
gem 'bps-google-api'
or install directly:
gem install bps-google-api
Configure the root directories for the gem:
GoogleAPI.configure do |config|
config.root = File.join('tmp', 'google_api')
end
For Rails, create an initializer:
GoogleAPI.configure do |config|
config.root = Rails.root.join('config', 'google_api')
config.keys = Rails.root.join('config', 'keys')
end
You can also alter the logging level using:
GoogleAPI.logging!(:FATAL) # %i[INFO WARN ERROR FATAL]
Then add the following in config/application.rb
:
require 'google_api'
GOOGLE_CLIENT_ID
GOOGLE_CLIENT_SECRET
GOOGLE_ACCESS_TOKEN
GOOGLE_REFRESH_TOKEN
GOOGLE_AUTH_EXP
GOOGLE_CALENDAR_ID_TEST
TZ # Timezone
By default, if no configuration is available, .new
will automatically run
.authorize!
and return a URL to generate an authorization token.
There are configured classes for both calendars and groups. This allows you to only specify the parent id once.
calendar = GoogleAPI::Configured::Calendar.new(calendar_id)
calendar.create(event_options)
calendar.list(max_results: 2500, page_token: nil)
calendar.list_all
calendar.get(event_id)
calendar.patch(event_id, patch_options)
calendar.update(event_id, updated_event_options)
calendar.add_conference(event_id)
calendar.conference_info(event_id, all: false)
calendar.delete(event_id)
calendar.permit(user)
calendar.unpermit(user)
group = GoogleAPI::Configured::Group.new('group@example.com')
group.get
group.members
group.add('somebody@example.com')
group.remove('somebody@example.com')
There is also an event-specific configured class:
event = GoogleAPI::Configured::Calendar::Event.new(calendar_id, event_id)
event.get
event.patch(patch_options)
event.update(updated_event_options)
event.add_conference
event.conference_info(all: false)
event.delete
Available event options are listed in GoogleAPI::Calendar::VALID_EVENT_KEYS
.
repeat_pattern = 'WEEKLY' # 'DAILY', etc.
recurrence = ["RRULE:FREQ=#{repeat_pattern};COUNT=#{sessions}"]
event_options = {
start: start_date, end: end_date, recurrence: recurrence,
summary: event_title, description: event_description,
location: location
}
To add a Meet call to an event, merge the following into event_options
:
{ conference: { id: meeting_id, signature: meeting_signature } }
To create a new Meet call on an event, merge the following into
event_options
instead:
{ conference: { id: :new } }
Rspec testing is available:
bundle exec rspec
The spec suite will fail if under 100% coverage.
Rubocop formatting validation is available:
bundle exec rubocop
Builds are generated automatically by Travis CI.
Build success requires both rspec
and rubocop
to pass.
FAQs
Unknown package
We found that bps-google-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.