Almost a Space Game (A2SG)

Archive for the 'Ruby' category

Getting RestfulX and HerokuGarden to Play Nice

March 16, 2009 11:53 pm

If you’re using the very awesome HerokuGarden (or Heroku, for that matter) and are wanting to use the amazing RestfulX with it on an existing application there are a couple of not-exactly-obvious additional steps one needs to take in order to enable the HerokuGarden + RestfulX joy:

  1. herokugarden create your_app_name
  2. herokugarden clone your_app_name
  3. cd your_app_name
  4. mkdir lib
  5. mkdir lib/tasks
  6. mkdir vendor
  7. edit config/heroku.yml to hide the heroku toolbar (otherwise the heroku toolbar covers the action buttons. One could also adjust one’s Flex app to be shorter, I s’pose.)

    My heroku.yml, for example, looks like this:
    toolbar_collaborators: false
    toolbar_public: false
  8. It would be sweet to be able to run rake gems:unpack at this point but I wasn’t able to get that to work properly so I’ve been using the following workaround until I can figure that out (and check it into github):

    Create an entirely separate rails app on your local machine:

  9. cd ..
  10. rails temporary_application
  11. cd temporary_application
  12. add config.gem 'restfulx' to environment.rb
  13. rake gems:unpack
  14. Copy the entire vendor directory into your HerokuGarden app: (OSX/linux version)

  15. cp -R ./vendor/* ../your_app_name/vendor
  16. Delete the temporary application:

  17. cd ..
  18. rm -rf temporary_application
  19. Finish configuring your app:

  20. cd your_app_name
  21. add config.gem 'restfulx' to environment.rb
  22. script/generate rx_config
  23. git add .
  24. git commit -m "Added the RestfulX sekrit sauce"
  25. git push
  26. Resume down the standard RestfulX path of development joy:

  27. touch db/model.yml
  28. edit model.yml to your liking
  29. script/generate rx_yaml_scaffold
  30. rake db:refresh
  31. rake rx:flex:build
  32. git add .
  33. git commit -m "Created awesome RestfulX sample application"
  34. git push

If you’re aware of a better way to do this then please let me know so I can update these directions.

Searching for Ruby Gems

2:09 pm

The gem command makes it trivially easy to search for gems.

To search for a gem installed locally:
gem search <gem name or search term>

To search for a gem from the vast number of gems which exist:
gem search -r <gem name or search term>
or:
gem search --remote <gem name or search term>

To search for a gem from the vast number of gems which exist and also show descriptions:
gem search -d -r <gem name or search term>
or:
gem search --details --remote <gem name or search term>

Important Note:
The stuff in brackets above is my blog-style for variables… the brackets aren’t part of the syntax. Sorry if that’s confusing but I’m not sure how else to indicate variables without finding an awesome code-sample-friendly CSS stylesheet. ;)

san_jose_hackfest_on_steroids

June 16, 2008 5:25 pm

Several of us from not_joseph’s San Jose Ruby Hackfest Meetup have been getting together fairly frequently to hack. I’ve created a Google Group for folks in the South Bay area to announce when/where they’re hacking so that it’d be easier to set up impromtu hackfests and get to know other Ruby/Rails folks.

Please consider joining. :)

Stuff to Investigate/Revisit 01

May 23, 2008 10:03 pm

These are some interesting things I want to investigate in more depth, so I’m posting links for revisiting later.

Flex Stuff:

  • Flex MDI: Simplifies multiple-window(document) interfaces. Way cool.
  • dpunit: Flex Unit and Integration Testing, apparently different from FlexUnit.
  • FlexUnit: Flex Unit Testing
  • Spectra: A cool Flex Newsreader written by Microsoft. (via Bruce Eckel’s blog)
  • Degrafa: A Declarative Graphics Framework for Flex.

Rails Stuff: