Patch for Gem - what to do

1 view
Skip to first unread message

Sunny Beach

unread,
Feb 5, 2010, 9:14:06 AM2/5/10
to a2...@googlegroups.com
I am working on a Google calendar export of the a2geeks calendar and
using the GCal4Ruby gem.

It "kinda" works (works well for a single calendar) but has problems
with iterating through the 20+ calendars.

After a series of emails on the gem mailing list, owner/creator has
sent me a patch. At this point I have no idea what to do with it ;)

Any suggestions on how to "apply" this patch to my local machine are welcome.

Sunny

Zach Church

unread,
Feb 5, 2010, 9:37:19 AM2/5/10
to a2...@googlegroups.com
Hey Sunny,

I'm not sure if there's a way to apply it the the gem you have installed; I'd get the gem source, apply the patch, and install from there. If anybody knows an easier way, please correct me ;)

It looks like GCAl4Ruby is using a Subversion repository at svn://rubyforge.org/var/svn/gcal4ruby
If you checkout the repository with "svn checkout svn://rubyforge.org/var/svn/gcal4ruby", you can apply the patch like as described here: http://ariejan.net/2007/07/03/how-to-create-and-apply-a-patch-with-subversion/

Once you apply the patch, you'll have to build the gem by running 'gem build' in that directory. Then you can "(sudo) gem install <built gem>.gem"

Hope this helps.

Zach

--
You received this message because you are subscribed to the Google Groups "Ann Arbor Ruby Brigade" group.
To post to this group, send email to a2...@googlegroups.com.
To unsubscribe from this group, send email to a2rb+uns...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/a2rb?hl=en.


Jason Haruska

unread,
Feb 5, 2010, 10:02:30 AM2/5/10
to a2...@googlegroups.com
Try applying the patch where the gem is installed.

execute "gem env" and look for GEM PATHS (ubuntu example: /var/lib/gems/1.8)

cd into the directory where the gem is installed (ex:
/var/lib/gems/1.8/gems/GCal4Ruby-X.X.X)

apply the patch with "patch -p0 < /path/to/patchfile" (you may have to
adjust the -p level)

Sunny Beach

unread,
Feb 5, 2010, 7:25:13 PM2/5/10
to a2...@googlegroups.com
Thanks Jason,

This really helped. I was able to patch the gem (everything looked
like it worked). I am still having issues with the overall application
but will work on it some more this evening. I am pretty sure it is a
problem with my code, not the gem.

Sunny

---

File to patch: event.rb
patching file event.rb
Hunk #1 succeeded at 180 (offset 4 lines).
Hunk #2 succeeded at 195 (offset 4 lines).
Hunk #3 succeeded at 372 (offset 4 lines).
Hunk #4 succeeded at 381 (offset 4 lines).
Hunk #5 succeeded at 407 (offset 4 lines).
Hunk #6 succeeded at 421 (offset 4 lines).

Larry Siden

unread,
Feb 5, 2010, 10:37:29 PM2/5/10
to a2...@googlegroups.com
Sunny, how does your solution get the events.  Does it have to screen-scrape them from the a2geek calendar, or from a feed?

Larry Siden, 734-926-9614, http://umich.edu/~lsiden

The United States is a nation of laws, badly written and randomly enforced.
--Frank Zappa 1940-1993

Sunny Beach

unread,
Feb 6, 2010, 12:06:29 AM2/6/10
to a2...@googlegroups.com
Hello Larry,

I am getting a feed of events and the good news is that it WORKS! I
need to do more testing and check on recurring events--events that
happen more than once per "calendar period".

The earlier patch helped but I had to go into the gem and comment out
a line that was raising an exception. It is a part of the code that
deals with writing to calendars that are "read only". I am not using
this part of the code but it was causing failures.

I am planning to work on this more in the morning at Espresso Royale
on State. I will be there from 8-10am. At this point there is no
interface besides scaffolding and the "workflow" is very basic. Anyone
is welcome to come have coffee and chat.

I will put this up on Heroku at some point when it is a little further along.

Sunny

Larry Siden

unread,
Feb 6, 2010, 5:12:38 AM2/6/10
to a2...@googlegroups.com
Sorry, Sunny, I'll be in Grand Rapids at Code Retreat all day today.  I'm in my hotel bed right now.  Can't sleep, I'm so f$*#ing excited!  I might be av to help you work on it a bit, Sunday or later during the week if you like.

Larry Siden, 734-926-9614, http://umich.edu/~lsiden

The United States is a nation of laws, badly written and randomly enforced.
--Frank Zappa 1940-1993


Reply all
Reply to author
Forward
0 new messages