MEETING: Tuesday, December 1st, 7pm, RHT

5 views
Skip to first unread message

Igal Koshevoy

unread,
Nov 26, 2009, 9:30:33 AM11/26/09
to Portland Ruby Brigade
The next Ruby Brigade meeting is coming soon. If you have a suggestion
for a technical talk, discussion topic, questions you want answered,
group activity, demo, etc ... please reply. You're also welcome to
post suggestions at any time during the month.

-igal

PS: Happy Thanksgiving!

###

Get directions to the venue and add this event to your calendar:
http://calagator.org/events/1250457806

The Portland Ruby Brigade is a user group for Ruby programmers in the
Portland, Oregon area. Join other developers for presentations and
discussions about Ruby and its uses.

VENUE: This meeting’s space is kindly provided by Robert Half Technology
at their 2nd Floor Conference Room. Enter the KOIN Tower from SW
Columbia between 2nd and 3rd Avenue, take the back elevators to the 2nd
floor, and then follow the pdxruby signs.

Maher Hawash

unread,
Nov 26, 2009, 9:46:37 AM11/26/09
to pdx...@googlegroups.com
Igal,

I am curious about what's available in rails based content management
systems. Are there systems like Drupal
and Wordpress built in rails.

Thanks,
Maher
> --
>
> You received this message because you are subscribed to the Google Groups "pdxruby" group.
> To post to this group, send email to pdx...@googlegroups.com.
> To unsubscribe from this group, send email to pdxruby+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pdxruby?hl=en.
>
>
>

Mike Gunderloy

unread,
Nov 26, 2009, 9:56:04 AM11/26/09
to pdx...@googlegroups.com

Igal Koshevoy

unread,
Nov 26, 2009, 12:13:18 PM11/26/09
to pdx...@googlegroups.com
Can we get some volunteers to give short talks on a Ruby-based CMS
they've used or researched, give us an overview, and describe its pros
and cons? Mike has provided a nice list of contenders to get you
started: http://afreshcup.com/home/2009/11/26/rails-cms-alternatives.html

If you'd like to talk about one, please reply with the name of the
tool and your experience with it (e.g., "None, but I'll research it
over the weekend."). If multiple people want to talk about the same
tool, we can discuss how to best combine their efforts.

I can give a basic talk about ActiveScaffold, although I'd prefer if
someone else that makes heavier use of it could give that talk
instead.

> On Nov 26, 2009, at 8:46 AM, Maher Hawash wrote:
>> I am curious about what's available in rails based content management
>> systems. Are there systems like Drupal
>> and Wordpress built in rails.
I would also be very interested hearing others talk about this topic.

I've looked at tools like Radiant (a self-contained CMS built with
Rails), Comatose (a plugin for Rails) and Mephisto (a blog written
with Rails), but quickly gave up because they seemed needlessly
difficult to customize (e.g., add some controls to a form), were very
invasive (e.g., they take over, it was no longer a Rails app), or
didn't integrate well with Rails (e.g., couldn't use ActiveRecord).

The closest thing to a Rails CMS that I use is ActiveScaffold, an
easy-to-use Rails plugin that provides controller actions and views
for managing ActiveRecord objects. Its actions include: list, search,
show, add, edit and destroy. I like it because it integrates well in
to an existing application and is fairly customizable. Details:
http://activescaffold.com/

On Thu, Nov 26, 2009 at 8:56 AM, Mike Gunderloy <lark...@gmail.com> wrote:
> Coincidentally, I just posted http://afreshcup.com/home/2009/11/26/rails-cms-alternatives.html
Mike: Thank you for putting together that listing.

All: I recommend subscribing to Mike's blog, it's full of good
original content and curated information: http://afreshcup.com/

-igal

Maher Hawash

unread,
Nov 28, 2009, 1:20:45 PM11/28/09
to pdx...@googlegroups.com
I have looked over the BrowseCMS over the last couple of days, and I can go over
what I've learned so far. It would be nice if you can go over the
ActiveScaffold as well.

Maher

Markus Roberts

unread,
Nov 29, 2009, 2:07:36 AM11/29/09
to pdx...@googlegroups.com
All --

After years of grumbling I've finally seen the light about test driven
development, and have finally realized just how phenomenally powerful
it can be. As a celebration of my new found love for this technique,
I'm presenting this month's hangman in TDD form. First the tests,
then the code (with a few of those annoying underscores fig-leafing
about).

(Full disclosure: although I was a good doober and wrote the tests
first, I wound up adjusting a few of them slightly to make them pass
after I had the code working. I've noted the changes in these tests
in comments. All three are in the philosophy section).

--------------
hangman7.spec-------------------------------------------------
require 'hangman7.rb'

class My_funky_class
attr_reader :weight,:tags
def initialize(weight,*tags,&action)
@weight = weight
@tags = tags
@action = action
end
def tag(t)
@tags ||= t
end
def do_it
@action.call(@weight,@tags)
end
end

describe "Chauncy," do
describe "when unable to see the internet" do
it "should raise an error" do
Ping.stub!(:pingecho).with('google.com',10,80).and_return
false
lambda { Chauncy.new(Integer,7) }.should
raise_error(IOError)
end
end

describe "when instantiating instances" do
it "should be able to act like any other class" do
Chauncy.new(Integer,7).should == 7
Chauncy.new(String,'bob').should == 'bob'
Chauncy.new(Integer,'18').should_not == '18'
Chauncy.new(Integer,'18').should == 18
Chauncy.new(String,42).should_not == 42
Chauncy.new(String,42).should == '42'
Chauncy.new(Array,:a,'b',"c").should == [:a,'b',"c"]
mfo = Chauncy.new(My_funky_class,1234,:this,:is,:funky)
{ |w,t| {:weight => w, :tags => t } }
mfo.weight.should == 1234
mfo.do_it[:weight].should == 1234
mfo.tags.should == [:this,:is,:funky]
mfo.do_it[:tags].should == [:this,:is,:funky]
end
end

describe "when counting in foreign languages" do
it "should know French" do
Chauncy.languages.should be_include("French")
end
it "should know Spanish" do
Chauncy.languages.should be_include("Spanish")
end
it "should know Latin" do
Chauncy.languages.should be_include("Latin")
end
it "should know English" do
# Hey, to most of the world's population it's a foreign
language!
Chauncy.languages.should be_include("English")
end
it "should know how to count to ten in French" do
Chauncy.languages["French"].express(1..10).should ==
['un', 'deux', 'trois', 'quatre', 'cinq', 'six', 'sept', 'huit',
'neuf', 'dix']
end
it "should know how to count to ten in Spanish" do
Chauncy.languages["Spanish"].express(1..10).should ==
['uno', 'dos', 'tres', 'quatro', 'cinco', 'seis', 'siete', 'ocho',
'neuve', 'diez']
end
it "should know how to count to ten in Latin" do
Chauncy.languages["Latin"].express(1..10).should ==
['unus
','duo
','tres','quattor','quinque','sex','septem','octo','novem','decem']
end
it "should know how to count to ten in English" do
Chauncy.languages["English"].express(1..10).should ==
['one','two','three','four','five','six','seven','eight','nine','ten']
end
it "should default to English if no language is specified" do
Chauncy.language.should == "English"
Chauncy.express(1..10).should ==
['one','two','three','four','five','six','seven','eight','nine','ten']
end
end

describe "when doing math" do
it "should be able to do basic operations in any combination
of languages (including idioms)" do
Chauncy.evaluate("quatro + deux").should == "six"
Chauncy.languages["Latin"].evaluate("quatro divided by
deux").should == "duo"
Chauncy.evaluate("half a score").should == "ten"
end
it "should raise an exception on ambiguities" do
# Could be a date or (7 in French) divided by (3 in
idiomatic English).
lambda { Chauncy.evaluate("third of sept") }.should
raise_error(ArgumentError)
end
it "should be able to differentiate functions from their
verbal descriptions" do
f = 'the height of his shoulder plus the length of his
arm times the sine of t over the rate of rotation',
Chauncy.differentiate(f,'t').should == '(v1/v2)*cos(t/v2)
where v1 is the length of his arm, v2 is the rate of rotation'
end
it "should be able to integrate functions from their verbal
descriptions" do
f = 'the height of his shoulder plus the length of his
arm times the sine of t over the rate of rotation',
Chauncy.integrate(f,'t').should == '(v1*t)-((v2*v3)*cos(t/
v3) where v1 is the height of his shoulders, v2 is the length of his
arm, v3 is the rate of rotation'
end
end

describe "when doing philosophy / metamath / wordgames" do
it "should be able to answer the old standards" do
# match rather than equality because the wording isn't
consistent.
Chauncy.query("Which came first, the chicken or the
egg?").should =~ /(the )?egg/i
# chomp in case it comes back with a trailing "\n"
Chauncy.query("Why did the chicken cross the
road?").chomp.should == 'To get to the other side.'
end
it "should raise a NotImplementedError if asked an
undecidable question" do
lambda { Chauncy.query("How can you tell if a context
free grammar is ambiguous?") }.should raise_error(NotImplementedError)
#
# Note that with the improved query algorithm the
original test query,
#
# lambda { Chauncy.query("Does P = NP? ") }.should
raise_error(NotImplementedError")
#
# now appears to hang rather than raising an error. This
may or may not be a bug.
#
end
end
end
--------------------------------------------------------------------------------------------------------------------

The results of running these tests:

--------------------------------------------------------------------------------------------------------------------

Chauncy, when unable to see the internet
- should raise an error

Chauncy, when instantiating instances
- should be able to act like any other class

Chauncy, when counting in foreign languages
- should know French
- should know Spanish
- should know Latin
- should know English
- should know how to count to ten in French
- should know how to count to ten in Spanish
- should know how to count to ten in Latin
- should know how to count to ten in English
- should default to English if no language is specified

Chauncy, when doing math
- should be able to do basic operations in any combination of
languages (including idioms)
- should raise an exception on ambiguities
- should be able to differentiate functions from their verbal
descriptions
- should be able to integrate functions from their verbal descriptions

Chauncy, when doing philosophy / metamath / wordgames
- should be able to answer the old standards
- should raise a NotImplementedError if asked an undecidable question

Finished in 0.005178 seconds

17 examples, 0 failures

--------------------------------------------------------------------------------------------------------------------

One of the great things about doing it this way is that it gets rid of
all the hand-wavy description of what the code does, so we can focus
on how in the heck it does it. The actual code is rather short
(though it does load a few libraries):

----------------------------------------------------------------------------------------------------------------------

require 'ping'
require 'net/http'
require 'strscan'
require 'observer'

X = (0..19).partition { |i| i = i+10; (2...i).any? { |j| i % j == 0 } }
Y = __________u___l_______.split(//)
Z = X.collect { |a| Y.values_at(*a).join }
class << Chauncy = Class.new.new
Languages = [/[{=>}]/=>{}]
W = %w{ google.com www.wolframalpha.com twitter.com }
[::Proc] << [W,X,Y,Z]
class ::Proc
Z.each { |q| __f__________(q) { self } }
end
Z.each { |q| __f__________(q) { self } }
end

-----------------------------------------------------------------------------------------------------------------

Enjoy!

-- Markus



Igal Koshevoy

unread,
Nov 30, 2009, 9:09:31 PM11/30/09
to pdx...@googlegroups.com
Maher,

Thanks, I look forward to hearing your talk about BrowseCMS.

I'll put together a talk for ActiveScaffold.

-igal

Igal Koshevoy

unread,
Nov 30, 2009, 9:44:41 PM11/30/09
to pdx...@googlegroups.com
Markus,

Quite impressive, thanks for cooking this up. We'll allocate more time
than usual to discuss what's going on in this. I look forward to seeing
how you pulled off some of these magic tricks.

-igal

PS: "fig-leafing" :)
PPS: "appears to hang rather than raising an error. This may or may not
be a bug." :o

Igal Koshevoy

unread,
Nov 30, 2009, 10:06:27 PM11/30/09
to Portland Ruby Brigade
I've updated the meeting description to include:

Meeting topics:
* Markus Roberts presents some particularly puzzling code.
* Maher Hawash presents BrowseCMS.
* Igal Koshevoy presents ActiveScaffold and home-brewed Snippets.
* Other Ruby-based CMS/blog discussions.
* ...your great talk here!
* And many other topics that come up at the meeting.

If you have another talk, discussion or question, please reply or just
bring it with you to the meeting.

See you there!

-igal

Luke Kanies

unread,
Nov 30, 2009, 11:42:04 PM11/30/09
to pdx...@googlegroups.com
On Nov 28, 2009, at 11:07 PM, Markus Roberts wrote:

> All --
>
> After years of grumbling I've finally seen the light about test driven
> development, and have finally realized just how phenomenally powerful
> it can be. As a celebration of my new found love for this technique,
> I'm presenting this month's hangman in TDD form. First the tests,
> then the code (with a few of those annoying underscores fig-leafing
> about).


While, of course, I'm happy you've seen the light on TDD, I can only
respond to this problem with: You are completely insane.

I look forward to struggling through it tomorrow. It does seem
particularly effective for hangman.

[...]

--
SELF-EVIDENT, adj. Evident to one's self and to nobody else.
-- Ambrose Bierce
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com

Justin George

unread,
Dec 1, 2009, 1:09:16 AM12/1/09
to pdx...@googlegroups.com

Mein Gott im Himmel, here I was thinking 'hah it looks like you could fake it with a service call to google...' and my next thought was 'oh no, he didn't...' followed by a scoll down to the meat of it and much wailing and gnashing of teeth. Kudos to you sir.

Only once have I seen this level of superb derangement, in a self-modifying php script... different list I suppose.

On Nov 30, 2009 9:52 PM, "Luke Kanies" <lu...@madstop.com> wrote:

On Nov 28, 2009, at 11:07 PM, Markus Roberts wrote: > All -- > > After years of grumbling I've fina...

While, of course, I'm happy you've seen the light on TDD, I can only
respond to this problem with:  You are completely insane.

I look forward to struggling through it tomorrow.  It does seem
particularly effective for hangman.

[...]

--
SELF-EVIDENT, adj. Evident to one's self and to nobody else.
    -- Ambrose Bierce
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com

-- You received this message because you are subscribed to the Google Groups "pdxruby" group. To p...

Monty Williams

unread,
Dec 1, 2009, 5:55:39 PM12/1/09
to pdx...@googlegroups.com
Igal,

I'll be there 
tonight, so if anyone has questions about the MagLev Alpha, I can do a 5 minute (or less) update.

Maybe we can do a MagLev presentation/demo for the 
January meeting.

-- Monty

Igal Koshevoy

unread,
Dec 1, 2009, 6:02:22 PM12/1/09
to pdx...@googlegroups.com
Monty: That'd be great. Congrats to you and your team on reaching alpha.

All: You can go download MagLev Alpha from http://maglev.gemstone.com/

-igal

Sam Livingston-Gray

unread,
Dec 1, 2009, 6:17:54 PM12/1/09
to pdx...@googlegroups.com
On Dec 1, 2009, at 3:02 PM, Igal Koshevoy wrote:
> All: You can go download MagLev Alpha from http://maglev.gemstone.com/

Is it just me, or is the font on that page appallingly hard to read?
-Sam

Ben Munat

unread,
Dec 1, 2009, 6:28:56 PM12/1/09
to pdx...@googlegroups.com
It's just you. :-p

b

Erik Hollensbe

unread,
Dec 1, 2009, 6:29:52 PM12/1/09
to pdx...@googlegroups.com
I think it's the color scheme here; the font just "enhances" it.

-Erik

Igal Koshevoy

unread,
Dec 1, 2009, 8:03:56 PM12/1/09
to pdx...@googlegroups.com, Monty Williams
Monty,

I also found the text difficult to read because of the large font size,
narrow column width, ragged edge caused by centered text, and the
intense contrast between links and non-links in heavily-linked text,
etc. So while the content is on the right track and won't stop the
intended audience from reading it, the page itself could benefit from an
appointment with a graphics designer. :)

Best wishes,

-igal
Reply all
Reply to author
Forward
0 new messages