Skip to content

Commit

Permalink
Prep for 0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhuda committed May 16, 2012
1 parent 2c15143 commit 33d4842
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
4 changes: 4 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# VERSION 0.5 (May 16, 2012)

* First tagged version
* Changes generators to always generate an ApplicationSerializer
6 changes: 5 additions & 1 deletion active_model_serializers.gemspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# -*- encoding: utf-8 -*-

$:.unshift File.expand_path("../lib", __FILE__)
require "active_model/serializers/version"

Gem::Specification.new do |gem|
gem.authors = ["José Valim", "Yehuda Katz"]
gem.email = ["[email protected]", "[email protected]"]
Expand All @@ -11,7 +15,7 @@ Gem::Specification.new do |gem|
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
gem.name = "active_model_serializers"
gem.require_paths = ["lib"]
gem.version = "0.1.0"
gem.version = ActiveModel::Serializer::VERSION

gem.add_dependency 'activemodel', '~> 3.0'
gem.add_development_dependency "rails", "~> 3.0"
Expand Down
5 changes: 5 additions & 0 deletions lib/active_model/serializers/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module ActiveModel
class Serializer
VERSION = "0.5.0"
end
end
6 changes: 3 additions & 3 deletions test/generators_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ class SerializerGeneratorTest < Rails::Generators::TestCase

def test_generates_a_serializer
run_generator
assert_file "app/serializers/account_serializer.rb", /class AccountSerializer < ActiveModel::Serializer/
assert_file "app/serializers/account_serializer.rb", /class AccountSerializer < ApplicationSerializer/
end

def test_generates_a_namespaced_serializer
run_generator ["admin/account"]
assert_file "app/serializers/admin/account_serializer.rb", /class Admin::AccountSerializer < ActiveModel::Serializer/
assert_file "app/serializers/admin/account_serializer.rb", /class Admin::AccountSerializer < ApplicationSerializer/
end

def test_uses_application_serializer_if_one_exists
Expand Down Expand Up @@ -62,6 +62,6 @@ def test_generates_attributes_and_associations

def test_with_no_attributes_does_not_add_extra_space
run_generator ["account"]
assert_file "app/serializers/account_serializer.rb", /class AccountSerializer < ActiveModel::Serializer\nend/
assert_file "app/serializers/account_serializer.rb", /class AccountSerializer < ApplicationSerializer\nend/
end
end

0 comments on commit 33d4842

Please sign in to comment.