Permalink
Browse files

[dm-more] Converted to use Jeweler

* Removed old/unecessary files
  • Loading branch information...
1 parent 3f84577 commit d57a87430fe6ab3ab5a8310e1f7dfe6db27dd49c @dkubb dkubb committed Nov 24, 2009
Showing with 198 additions and 145 deletions.
  1. +0 −49 History.rdoc
  2. +1 −1 LICENSE
  3. +0 −34 Manifest.txt
  4. +25 −18 Rakefile
  5. 0 TODO
  6. +1 −0 VERSION
  7. +75 −0 dm-serializer.gemspec
  8. +0 −5 lib/dm-serializer/version.rb
  9. +6 −0 spec/rcov.opts
  10. +1 −0 tasks/ci.rake
  11. +0 −13 tasks/install.rb
  12. +36 −0 tasks/metrics.rake
  13. +25 −0 tasks/spec.rake
  14. +0 −25 tasks/spec.rb
  15. +9 −0 tasks/yard.rake
  16. +19 −0 tasks/yardstick.rake
View
@@ -1,49 +0,0 @@
-=== 0.10.1 / 2009-09-30
-
-* No changes this version
-
-=== 0.10.0 / 2009-09-15
-
- * Support serialization of dm-validation errors collection (#718)
- * Don't require json gem on ruby 1.9 (#776)
- * Allow YAML.dump(dm_object) (#792)
- * Correctly serialize child objects (#829)
-
-=== 0.9.11
-
-* No changes this version
-
-=== 0.9.10 / 2009-01-19
-
-* 1 minor enhancement:
-
- * Don't emit XML prologue when using libxml or nokogiri
-
-* 1 bug fix:
-
- * libxml and nokogiri no longer output an xml prologue
-
-=== 0.9.9 / 2009-01-04
-
-* 1 major enhancement:
-
- * Uses LibXML or Nokogiri if available for a ~6x improvement in
- serialization performance.
-
-* 4 minor enhancements:
-
- * Added :element_name and :collection_element_name options to #to_xml
- * Removed #xml_element_name override in #to_xml
- * Removed :read_only_attributes option from #to_json
- * Removed #serialized_properties override in #to_json
-
-=== 0.9.8 / 2008-12-07
-
-* 2 minor enhancements:
-
- * to_yaml and to_xml now support :only and :exclude options
- * to_yaml and to_xml now support serializing methods
-
-* 1 bug fix:
-
- * gem requires now preceded by gem() call
View
@@ -1,4 +1,4 @@
-Copyright (c) 2007 Guy van den Berg
+Copyright (c) 2009 Guy van den Berg
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
View
@@ -1,34 +0,0 @@
-History.rdoc
-LICENSE
-Manifest.txt
-README.rdoc
-Rakefile
-TODO
-autotest/discover.rb
-autotest/dmserializer_rspec.rb
-benchmarks/to_json.rb
-benchmarks/to_xml.rb
-lib/dm-serializer.rb
-lib/dm-serializer/common.rb
-lib/dm-serializer/to_csv.rb
-lib/dm-serializer/to_json.rb
-lib/dm-serializer/to_xml.rb
-lib/dm-serializer/to_yaml.rb
-lib/dm-serializer/version.rb
-lib/dm-serializer/xml_serializers.rb
-lib/dm-serializer/xml_serializers/libxml.rb
-lib/dm-serializer/xml_serializers/nokogiri.rb
-lib/dm-serializer/xml_serializers/rexml.rb
-spec/fixtures/cow.rb
-spec/fixtures/planet.rb
-spec/fixtures/quan_tum_cat.rb
-spec/lib/serialization_method_shared_spec.rb
-spec/public/serializer_spec.rb
-spec/public/to_csv_spec.rb
-spec/public/to_json_spec.rb
-spec/public/to_xml_spec.rb
-spec/public/to_yaml_spec.rb
-spec/spec.opts
-spec/spec_helper.rb
-tasks/install.rb
-tasks/spec.rb
View
@@ -1,24 +1,31 @@
-require 'pathname'
+require 'rubygems'
+require 'rake'
-ROOT = Pathname(__FILE__).dirname.expand_path
-JRUBY = RUBY_PLATFORM =~ /java/
-WINDOWS = Gem.win_platform? || (JRUBY && ENV_JAVA['os.name'] =~ /windows/i)
-SUDO = WINDOWS ? '' : ('sudo' unless ENV['SUDOLESS'])
+FileList['tasks/**/*.rake'].each { |task| load task }
-require ROOT + 'lib/dm-serializer/version'
+begin
+ require 'jeweler'
-AUTHOR = 'Guy van den Berg'
-EMAIL = 'vandenberg.guy [a] gmail [d] com'
-GEM_NAME = 'dm-serializer'
-GEM_VERSION = DataMapper::Serializer::VERSION
-GEM_DEPENDENCIES = [['dm-core', GEM_VERSION]]
-GEM_CLEAN = %w[ log pkg coverage ]
-GEM_EXTRAS = { :has_rdoc => true, :extra_rdoc_files => %w[ README.rdoc LICENSE TODO History.rdoc ] }
+ Jeweler::Tasks.new do |gem|
+ gem.name = 'dm-serializer'
+ gem.summary = 'DataMapper plugin for serializing Resources and Collections'
+ gem.description = gem.summary
+ gem.email = 'vandenberg.guy [a] gmail [d] com'
+ gem.homepage = 'http://github.com/datamapper/dm-more/tree/master/%s' % gem.name
+ gem.authors = [ 'Guy van den Berg' ]
-PROJECT_NAME = 'datamapper'
-PROJECT_URL = "http://github.com/datamapper/dm-more/tree/master/#{GEM_NAME}"
-PROJECT_DESCRIPTION = PROJECT_SUMMARY = 'DataMapper plugin for serializing DataMapper objects'
+ gem.rubyforge_project = 'datamapper'
-[ ROOT, ROOT.parent ].each do |dir|
- Pathname.glob(dir.join('tasks/**/*.rb').to_s).each { |f| require f }
+ gem.add_dependency 'dm-core', '~>0.10.2'
+
+ gem.add_development_dependency 'rspec', '>= 1.2.9'
+ gem.add_development_dependency 'yard', '>= 0.4.0'
+ end
+
+ Jeweler::GemcutterTasks.new
+ Jeweler::RubyforgeTasks.new do |rubyforge|
+ rubyforge.doc_task = 'yardoc'
+ end
+rescue LoadError
+ puts 'Jeweler (or a dependency) not available. Install it with: gem install jeweler'
end
View
No changes.
View
@@ -0,0 +1 @@
+0.10.2
View
@@ -0,0 +1,75 @@
+# Generated by jeweler
+# DO NOT EDIT THIS FILE DIRECTLY
+# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{dm-serializer}
+ s.version = "0.10.2"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Guy van den Berg"]
+ s.date = %q{2009-11-23}
+ s.description = %q{DataMapper plugin for serializing Resources and Collections}
+ s.email = %q{vandenberg.guy [a] gmail [d] com}
+ s.extra_rdoc_files = [
+ "LICENSE",
+ "README.rdoc"
+ ]
+ s.files = [
+ "LICENSE",
+ "README.rdoc",
+ "Rakefile",
+ "autotest/discover.rb",
+ "autotest/dmserializer_rspec.rb",
+ "benchmarks/to_json.rb",
+ "benchmarks/to_xml.rb",
+ "lib/dm-serializer.rb",
+ "lib/dm-serializer/common.rb",
+ "lib/dm-serializer/to_csv.rb",
+ "lib/dm-serializer/to_json.rb",
+ "lib/dm-serializer/to_xml.rb",
+ "lib/dm-serializer/to_yaml.rb",
+ "lib/dm-serializer/xml_serializers.rb",
+ "lib/dm-serializer/xml_serializers/libxml.rb",
+ "lib/dm-serializer/xml_serializers/nokogiri.rb",
+ "lib/dm-serializer/xml_serializers/rexml.rb",
+ "spec/fixtures/cow.rb",
+ "spec/fixtures/planet.rb",
+ "spec/fixtures/quan_tum_cat.rb",
+ "spec/lib/serialization_method_shared_spec.rb",
+ "spec/public/serializer_spec.rb",
+ "spec/public/to_csv_spec.rb",
+ "spec/public/to_json_spec.rb",
+ "spec/public/to_xml_spec.rb",
+ "spec/public/to_yaml_spec.rb",
+ "spec/spec.opts",
+ "spec/spec_helper.rb"
+ ]
+ s.homepage = %q{http://github.com/datamapper/dm-more/tree/master/dm-serializer}
+ s.rdoc_options = ["--charset=UTF-8"]
+ s.require_paths = ["lib"]
+ s.rubyforge_project = %q{datamapper}
+ s.rubygems_version = %q{1.3.5}
+ s.summary = %q{DataMapper plugin for serializing Resources and Collections}
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ s.add_runtime_dependency(%q<dm-core>, ["~> 0.10.2"])
+ s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
+ s.add_development_dependency(%q<yard>, [">= 0.4.0"])
+ else
+ s.add_dependency(%q<dm-core>, ["~> 0.10.2"])
+ s.add_dependency(%q<rspec>, [">= 1.2.9"])
+ s.add_dependency(%q<yard>, [">= 0.4.0"])
+ end
+ else
+ s.add_dependency(%q<dm-core>, ["~> 0.10.2"])
+ s.add_dependency(%q<rspec>, [">= 1.2.9"])
+ s.add_dependency(%q<yard>, [">= 0.4.0"])
+ end
+end
+
@@ -1,5 +0,0 @@
-module DataMapper
- module Serializer
- VERSION = '0.10.2'.freeze
- end
-end
View
@@ -0,0 +1,6 @@
+--exclude "spec"
+--sort coverage
+--callsites
+--xrefs
+--profile
+--text-summary
View
@@ -0,0 +1 @@
+task :ci => [ :verify_measurements, 'metrics:all' ]
View
@@ -1,13 +0,0 @@
-def sudo_gem(cmd)
- sh "#{SUDO} #{RUBY} -S gem #{cmd}", :verbose => false
-end
-
-desc "Install #{GEM_NAME} #{GEM_VERSION}"
-task :install => [ :package ] do
- sudo_gem "install pkg/#{GEM_NAME}-#{GEM_VERSION}"
-end
-
-desc "Uninstall #{GEM_NAME} #{GEM_VERSION}"
-task :uninstall => [ :clobber ] do
- sudo_gem "uninstall #{GEM_NAME} -v#{GEM_VERSION} -Ix"
-end
View
@@ -0,0 +1,36 @@
+begin
+ require 'metric_fu'
+rescue LoadError
+ namespace :metrics do
+ task :all do
+ abort 'metric_fu is not available. In order to run metrics:all, you must: gem install metric_fu'
+ end
+ end
+end
+
+begin
+ require 'reek/adapters/rake_task'
+
+ Reek::RakeTask.new do |t|
+ t.fail_on_error = true
+ t.verbose = false
+ t.source_files = 'lib/**/*.rb'
+ end
+rescue LoadError
+ task :reek do
+ abort 'Reek is not available. In order to run reek, you must: gem install reek'
+ end
+end
+
+begin
+ require 'roodi'
+ require 'roodi_task'
+
+ RoodiTask.new do |t|
+ t.verbose = false
+ end
+rescue LoadError
+ task :roodi do
+ abort 'Roodi is not available. In order to run roodi, you must: gem install roodi'
+ end
+end
View
@@ -0,0 +1,25 @@
+require 'spec/rake/spectask'
+require 'spec/rake/verify_rcov'
+
+spec_defaults = lambda do |spec|
+ spec.pattern = 'spec/**/*_spec.rb'
+ spec.libs << 'lib' << 'spec'
+ spec.spec_opts << '--options' << 'spec/spec.opts'
+end
+
+Spec::Rake::SpecTask.new(:spec, &spec_defaults)
+
+Spec::Rake::SpecTask.new(:rcov) do |rcov|
+ spec_defaults.call(rcov)
+ rcov.rcov = true
+ rcov.rcov_opts = File.read('spec/rcov.opts').split(/\s+/)
+end
+
+RCov::VerifyTask.new(:verify_rcov => :rcov) do |rcov|
+ rcov.threshold = 100
+end
+
+task :spec => :check_dependencies
+task :rcov => :check_dependencies
+
+task :default => :spec
View
@@ -1,25 +0,0 @@
-begin
- require 'spec/rake/spectask'
-
- task :default => [ :spec ]
-
- desc 'Run specifications'
- Spec::Rake::SpecTask.new(:spec) do |t|
- t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
- t.libs << 'lib' << 'spec' # needed for CI rake spec task, duplicated in spec_helper
-
- begin
- require 'rcov'
- t.rcov = JRUBY ? false : (ENV.has_key?('NO_RCOV') ? ENV['NO_RCOV'] != 'true' : true)
- t.rcov_opts << '--exclude' << 'spec'
- t.rcov_opts << '--text-summary'
- t.rcov_opts << '--sort' << 'coverage' << '--sort-reverse'
- rescue LoadError
- # rcov not installed
- rescue SyntaxError
- # rcov syntax invalid
- end
- end
-rescue LoadError
- # rspec not installed
-end
View
@@ -0,0 +1,9 @@
+begin
+ require 'yard'
+
+ YARD::Rake::YardocTask.new
+rescue LoadError
+ task :yard do
+ abort 'YARD is not available. In order to run yard, you must: gem install yard'
+ end
+end
View
@@ -0,0 +1,19 @@
+begin
+ require 'pathname'
+ require 'yardstick/rake/measurement'
+ require 'yardstick/rake/verify'
+
+ # yardstick_measure task
+ Yardstick::Rake::Measurement.new
+
+ # verify_measurements task
+ Yardstick::Rake::Verify.new do |verify|
+ verify.threshold = 100
+ end
+rescue LoadError
+ %w[ yardstick_measure verify_measurements ].each do |name|
+ task name.to_s do
+ abort "Yardstick is not available. In order to run #{name}, you must: gem install yardstick"
+ end
+ end
+end

0 comments on commit d57a874

Please sign in to comment.