
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
A view layer helper which takes an object (such as an ActiveRecord instance from your database) and generates an "Add To Google Calendar" URL based on it's attributes.
This follows the ISO RFC-2445 calendar standard of using dtstart
, dtend
, summary
, etc. You can customize these fields to match your implementation (ie. start_date
, end_date
, event_name
, etc). Details on this below.
Add this line to your application's Gemfile:
gem 'add_to_google_cal'
And then execute:
$ bundle
Or install it yourself as:
$ gem install add_to_google_cal
class Wedding < AR::Base
has_google_cal
end
Wedding.first.to_google_cal
# TODO: Support custom column names, ie:
has_google_cal {
:dtstart_attribute => 'crazy_date_start_column_name'
}
require 'ostruct'
object = OpenStruct.new({
:summary => "Super awesome event coming up in 2009, y'all!",
:dtstart => '2019-03-07'
})
AddToGoogleCal::Builder.new(object).call
=> "https://www.google.com/calendar/render?action=TEMPLATE&dates=20190726T000000Z/20190726T000000Z& ..." (or something like this)
attributes = {
{
dtstart: Time.utc(2013, 01, 03, 12, 00),
dtend: Time.utc(2013, 01, 03, 14, 00),
summary: 'This is the Title of the Event'
}
}
AddToGoogleCal::Builder.new(attributes).call
=> 'https://www.google.com/calendar/render?action=TEMPLATE&dates=20130103T120000Z/20130103T140000Z&text=This+is+the+Title+of+the+Event'
<%= link_to("Add To Google Calendar", AddToGoogleCal.new(object).call) %>
Handle converting various types of date/time objects
Support objects / structs
Finish implementing the ActiveRecord hook
Support custom column names in has_google_cal AR mixin
@pcreux and everyone else who has colloborated / paired on this project.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)I was working on Handcrafted Video Wedding Invites and this project was born out of a need to allow wedding guests quickly adding a wedding event to their Google Calendar.
FAQs
Unknown package
We found that add_to_google_cal demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.