CrudVision - Lisa Seelye

August 28, 2008

Playing with Git

Filed under: git, github, open source, reve, ruby, subversion — Lisa Seelye @ 5:05 pm

I’ve begun playing with git over at github by importing Reve’s source.

Eventually I will do away with subversion and trac and move to github for Reve completely. Trac is not very good and often locks up.

As I’m still new with git and github I’ll have to keep contributions to a minimum since I don’t know exactly what I’m doing.

August 14, 2008

Reve is going to MIT (license)

Filed under: api, eve online, open source, reve, ruby — Lisa Seelye @ 8:52 pm

There’s a new revision of Reve that has just been uploaded to Rubyforge: Revision 99.

This includes a major change - Reve is now licensed under a proper license: the MIT License. The terms of the license are now distributed with the package and are.

There is also a fix for the character_id that came back from a market order request.

Why a new license now? Simply because I think it’s important to realise that it’s unlikely that anyone will use Reve to create some billion dollar enterprise that I could have got in on. Yeah, not everyone can be Delicious, Flickr or Facebook. ha ha.

So go forth, ye multitudes and fix, hax, and use. Ruby and Rails both use the MIT license so now Reve should be at home.

July 30, 2008

Eve Online Empyrean Age 1.0 Database Dump for PostgreSQL

Filed under: eve online, open source, postgres, sql — Lisa Seelye @ 6:29 pm

Today CCP announced the release of their MS SQL dump. Following in step with past conversions here is a Postgres version. Tested with 8.0.15 but should work on everything.

This dump is odd: CCP is using integers where they mean to use booleans. So in those cases remember 1 is true, 0 is false. Good luck.

Edit: As a note the Eve Online Database Viewer is updated with this dump.

Edit 2 (July 31, 2008): I nearly forgot to give props to bunjiboys for providing the .sql files from which the above dump is derrived.

Fixtures in Rails Suck - this makes them suck less

Filed under: open source, rails, snippet, testing — Lisa Seelye @ 1:31 am

If you've got a boat load of legacy fixtures laying around (and who doesn't?) it can be a pain now that Rails handles the ID of objects so you don't have to.

On the train back from holiday I wrote a snippet of code to migrate them:

RUBY:
  1. def Util.real_yml(klass,col = 'name')
  2.     y = YAML.load_file(File.join(RAILS_ROOT,'test','fixtures',"#{klass.to_s.tableize}.yml"))
  3.     real_names = y.inject([]) { |names,(key,val)| names <<y[key][col] if y[key][col] ;names  }
  4.     real_objs = klass.find :all, :conditions => [ "#{col} IN (?)",real_names ], :order => "#{col} asc"
  5.     yml = ""
  6.     real_objs.each do |real_obj|
  7.       yml += "#{real_obj.name.downcase.gsub(' ','_').gsub('-','')}:\n"
  8.       real_obj.attributes.each do |k,v|
  9.         if k =~ /_id$/ && real_obj.respond_to?(k.gsub(/_id$/,'').to_sym) && ! v.nil?
  10.           n_klass = k.gsub(/_id$/,'').camelize.constantize.find(v) rescue nil
  11.           key = k.gsub(/_id$/,'')
  12.           val = n_klass.name.downcase.gsub(' ','_').gsub('-','')
  13.           yml += "  #{key}: #{val}\n"
  14.         else
  15.           yml += "  #{k}: #{v}\n" unless k.to_s == 'id'
  16.         end
  17.       end
  18.     end
  19.     yml
  20.   end

The use is:

RUBY:
  1. require 'util'
  2. print Util.real_yml(Corporation)

Copy/paste into corporations.yml

So far it's working great!

July 12, 2008

Reve Supports Eve’s Factional Warfare API

Filed under: eve online, open source, reve, ruby — Lisa Seelye @ 8:04 pm

Here's a quick announcement to let people know that Reve (0.0.96) now supports Factional Warfare.

The cool new things are:

I know the documentation may not be the best, but I'll do my best to improve it for the next release.

Grab the new gem (0.0.96) and give it a whirl!

June 10, 2008

New Reve Gem, release 91

Filed under: api, eve online, open source, reve, ruby, trac — Lisa Seelye @ 10:03 pm

Just a quick note. There's a new Reve gem out as of June 7th. This one's release notes are:

  • Typo fix in Reve::Classes::MapKill - shipJills -> shipKills
  • Resolve trac ticket 3 (lowercase field names in postfields method)
  • Update documentation to make 'charid' more consistantly 'characterid'
  • Resolve trac ticket 2 (Reve does not use @charid, but takes it as an argument in initialize)
  • Be strict about currentTime's casing.

The code changes can be seen At the Reve Trac.

February 17, 2008

First Reve Trac Ticket

Filed under: api, bugs, eve online, open source, rails, reve, ruby, subversion, testing, trac — Lisa Seelye @ 11:58 am

Had my first bug report today about the to_i method I made on the String class breaking Rails migrations because leading zeroes weren't being treated nicely in my method: "001".to_i # => 1 and fails the test 1.to_s == "001" and so a String was being returned fromto_i. Crap.

I don't think that I need the method anyways (I'm going to spend part of today to make sure with more tests!) so I've removed it and tagged Release 80 and uploaded the gem to RubyForge. It should be available to gem update or gem install shortly.

This release also has a larger test coverage and some other unnecessary methods were pruned. Check it out!

January 2, 2008

Followup to My First Patch

Filed under: activerecord, open source, oracle, rails, snippet, sql — Lisa Seelye @ 5:50 pm

In reference to the post about My First Patch to the Rails trac I mentioned in the edit of the post that I emailed the maintainer. There's been no response, unfortunately.

So I'll post the patch here so it'll get a bit more visibility and hopefully Oracle users can find it helpful in speeding up rake db:migrate on Oracle systems with a lot of indicies.

Patch to speed up Rails’s OracleAdapter#indexes method

December 19, 2007

Reve release 39

Filed under: eve online, open source, reve, ruby — Lisa Seelye @ 10:08 pm

Here is Reve release 39. As always it can be found at its homepage, http://www.crudvision.com/reve-ruby-eve-online-api-library/
Download the release with these links. Reve requires the hpricot gem to run.

This release supports the API Version 2 from Eve Online. The RDoc can be found online at http://docs.crudvision.com/reve/ or by running rake doc.

I know the documentation is spartan. I'll be working on the documentation over the coming week to make it much more informative.

December 1, 2007

My First Patch

Filed under: open source, oracle, rails, sql, work — Lisa Seelye @ 10:05 pm

I've submitted my first patch to the Rails trac today to speed up the OracleAdapter#indexes method (used in migrations). A client at work uses Oracle and in the production environment this method was taking upwards of 45 seconds to run per table!One of their DBAs gave me the SQL there, so I can't take the credit, I just submitted it.

I hope it's accepted. Incidentally, it works and has saved me a lot of time with migrations.

Edit: Yeah, turns out that since turning these adapters into gems patches for them shouldn't be done through Rails trac. How irritating, but whatever. I've sent the patch do the current maintainer for review.

Powered by WordPress