friendly_fixtures plugin on github

I previously posted about my friendly_fixtures plugin

It’s now available at github: http://github.com/dfl/friendly_fixtures/tree/master

Finally getting git

Okay, so I’m finally starting to understand the concept and rewards of git. Scott Chacon’s peepcode book on git was really helpful, and also the slides from his railsconf talk.

I found contemplation of this statement to be quite enlightening:

git != svn + magic

factories-and-workers plugin on github

factories-and-workers at github

Factories and Workers is a Rails plugin originally written by Nathan Herald @ myobie.com after being inspired by Dan Manges’ blog post on factories. It uses some slick metaprogramming to generate factory methods for your ActiveRecord models. Over the past few months I’ve refactored the code, added a bunch of new features, and most importantly wrote some tests!

See it in action:

>> factory :monkey, { :name => "George" }
=> #<FactoryBuilder:0x1a4f2a8>

>> valid_monkey_attributes
=> {:name=>"George"}

>> build_monkey
=> #<Monkey id: nil, name: "George">

>> build_monkey( :name => "Bob" )
=> #<Monkey id: nil, name: "Bob">

>> Monkey.count
=> 0

>> create_monkey
=> #<Monkey id: 1, name: "George">

>> Monkey.count
=> 1

There’s much more info in the README.

Cooked this one up this morning… It will iterate through `svn st | grep \?` and ask for confirmation before adding to your subversion project. Of course, all the cool kids are using git these days anyways ;) Shouldn’t be hard to modify for that.

UPDATE: actually, there is no need for such a task with git. You can just use “git commit -a”.


namespace :svn do

  desc "Add files not under (sub)version control" 
  task :add do
    files = `svn st | grep \?`.map{|f| f.gsub(/\?\s+(.+)\n/){$1} }
    puts "No new files to add." and return if files.empty?
    files.each do |file|
      print "... #{file} [Yn]" 
     `svn add #{file}` unless STDIN.gets =~ /^n/i
    end
  end

end

actionmailer ActionView ActiveRecord activesupport ajax alphadecimal audio autotest BDD blocks capistrano ssh ruby controller css dashboard widget delegate dog puppy naming name DRM email obfuscation exceptions factories-and-workers factory pattern filemerge find and replace finder fink fixtures fun functional testing gem git google maps helper helpers imagemagick Intertrust javascript jquery jrails logo math meetup model openssl OS X patch Pioneer Electronics plugin polymorphism prototype.js rails rails gotcha rails,patch,validations railsconf rake rmagick RSA encryption ruby script shoulda subversion SyncTV TDD testing textmate tips tricks unique hashes unix shell validation view yaml zebra stripes