Skip to content

Commit

Permalink
Updated README and bumped version
Browse files Browse the repository at this point in the history
  • Loading branch information
Ginty committed Oct 16, 2011
1 parent 49f9a05 commit f736b25
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
17 changes: 11 additions & 6 deletions README.rdoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
= Cranky

Cranky is a fixtures replacement inspired by the excellent Factory Girl, but simpler and with less magic going on.
Cranky is a fixtures replacement inspired by the excellent Factory Girl but with easier syntax and no external
dependencies, it will work straight out of the box with rails 10.

In short use this if you want to quickly and naturally create factory methods that you feel 100% in control of.

Expand All @@ -10,10 +11,7 @@ First install the gem...

gem install cranky

Or for rails stick it in your environment.rb or Gemfile as normal...

# environment.rb
config.gem "cranky"
Or with bundler...

# Gemfile
gem "cranky"
Expand All @@ -29,7 +27,14 @@ You can create as many different factory files as you want, just require them in

== In a Nutshell

Cranky steals its core syntax from Factory Girl and can drop into tests already written for that framework...
The API to use in your tests is:

crank(:user) # Build a user instance without saving
crank!(:user) # Build and save a user instance
crank(:user, :name => "Ian") # Override a default attribute value
crank(:user_attrs) # Return a set of valid attributes rather than the object

Alternatively the Factory Girl syntax also works and therefore Cranky can drop into tests already written for that framework...

Factory.build(:user) # Build a user instance without saving
Factory.create(:user) # Build and save a user instance
Expand Down
2 changes: 1 addition & 1 deletion lib/cranky/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Cranky
VERSION = "0.2.0"
VERSION = "0.3.0"
end
10 changes: 2 additions & 8 deletions rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,14 @@ task :release_tag do
system "git tag -a v#{Cranky::VERSION} -m 'version #{Cranky::VERSION}'"
end

# Push to github
desc "Push to Github"
task :push do
system "git push --tags origin master"
end

desc "Build the gem"
task :build do
system "gem build cranky.gemspec"
system "bundle exec gem build cranky.gemspec"
end

desc "Release version #{Cranky::VERSION}"
task :release => [:build, :release_tag, :push] do
system "gem push cranky-#{Cranky::VERSION}.gem"
system "bundle exec gem push cranky-#{Cranky::VERSION}.gem"
end


0 comments on commit f736b25

Please sign in to comment.