Close
Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

PIVOTAL LABS
Standup 3/27/2009: Gem repo forked?

Interesting Things

  • IE doesn’t allow you to change the type of an input. If you create an input with createElement, IE will not allow you to change that element to a button. This was discovered when a project’s javascript dom builder code was modified to generate inputs of type=button rather than type=submit. The cross-browser solution was to create some other temporary dom element such as a div and then set the innerHtml of that element to a type=button input, then extract that child element and return it in the builder call. Yeah!

Ask for Help

“What’s the best way to get gems for forked repos?”

There was quite a discussion on this. The specific issue is that the team is trying to use Compass (Chris Eppstein gave a talk on Compass at Pivotal on 3/18-look for the future video on our Talks Page.) For the moment, since compass depends on the edge version of sass you must first manually install sass before installing the compass gem.

  • One suggestion was to submit a fix for the gem. This is not a good solution in this case since the new version of sass/haml is expected to be released soon, fixing compass and simplifying its installation.
  • Pivotal will likely host its own internal gem server at some point to deal with issues like this.
  • The Has My Gem Built Yet? service might be useful in some situations, but not for this specific problem.

Comments
  1. Kyle says:

    Github?

  2. Chris Eppstein says:

    If it’s a rails app, I recommend that you just vendor the gem until the official release. Haml can be installed as a frozen gem or you can just check it out from github into your vendor/plugins/haml directory.

  3. Joseph Palermo says:

    Quick correction on the IE problem.

    While Input elements in IE have the problem that you can’t change the `type` attribute, they do let you set it once after you have created it.

    The problem we were having was with Button elements. The spec says they should default to type `submit`, but IE defaults them to a type of `button`. IE also doesn’t let you change the `type` attribute, making it impossible to create a submit Button element in IE using createElement(‘button’).

  4. Myles Eftos says:

    A nicer work around for the changing type issue is to clone the input using cloneNode, change the type of the cloned input, and replace the existing input with the cloned one. No erronous elements or innerHTML required.

  5. Chad Woolley says:

    @chris – the gem had native components, so we didn’t vendor it.

    The problem with building our fork on GitHub was that HAML had a non-standard package procedure which did filesystem access.

    So, we used [Jeweler](http://technicalpickles.github.com/jeweler/) to generate and check in a gemspec on our github fork, and then used [GemInstaller](http://geminstaller.rubyforge.org) to install it.

    We did try out [HasMyGemBuiltYet.org](http://hasmygembuiltyet.org), but it built really fast anyway :)

    — [Chad](http://pivotallabs.com/users/chad/profile)

  6. Joseph Palermo says:

    @Myles

    I can’t get cloneNode to work in IE. When I clone an input of type “text” or “password”, the newly created node still has the original type, and attempting to set it fails in IE.

    What I typically do in this case is create an new input, and set the type to what I want, then copy over the id and className attributes, not very clean at all, so if you’ve got a way to do it with cloneNode, let me know.

Post a Comment

Your Information (Name required. Email address will not be displayed with comment.)

* Copy This Password *

* Type Or Paste Password Here *