Skip to content
Browse files

Gemified with jeweler

  • Loading branch information...
1 parent cd265b4 commit 4338a1f6070bc753f98425af920b96fb17dbad31 @aeden aeden committed Aug 25, 2010
Showing with 99 additions and 88 deletions.
  1. +18 −88 Rakefile
  2. +81 −0 rails_sql_views.gemspec
View
106 Rakefile
@@ -3,7 +3,6 @@ require 'rake/testtask'
require 'rake/rdoctask'
require 'rake/packagetask'
require 'rake/gempackagetask'
-require 'rake/contrib/rubyforgepublisher'
require File.join(File.dirname(__FILE__), 'lib/rails_sql_views', 'version')
@@ -48,97 +47,28 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_files.include('lib/**/*.rb')
end
-PKG_FILES = FileList[
- 'CHANGELOG',
- 'README',
- 'Rakefile',
- 'bin/**/*',
- 'lib/**/*',
-] - [ 'test' ]
-
-spec = Gem::Specification.new do |s|
- s.name = 'rails_sql_views'
- s.version = PKG_VERSION
- s.summary = "Adds SQL Views to Rails."
- s.description = <<-EOF
- Library which adds SQL Views to Rails.
- EOF
-
- s.add_dependency('activerecord', '>= 2.1.0')
- s.add_dependency('rake', '>= 0.8.3')
-
- s.rdoc_options << '--exclude' << '.'
- s.has_rdoc = false
-
- s.files = PKG_FILES.to_a.delete_if {|f| f.include?('.svn')}
- s.require_path = 'lib'
-
- s.author = "Anthony Eden"
- s.email = "anthonyeden@gmail.com"
- s.homepage = "http://activewarehouse.rubyforge.org/rails_sql_views"
- s.rubyforge_project = "activewarehouse"
-end
-
-Rake::GemPackageTask.new(spec) do |pkg|
- pkg.gem_spec = spec
- pkg.need_tar = true
- pkg.need_zip = true
-end
-
-desc "Generate code statistics"
-task :lines do
- lines, codelines, total_lines, total_codelines = 0, 0, 0, 0
-
- for file_name in FileList["lib/**/*.rb"]
- next if file_name =~ /vendor/
- f = File.open(file_name)
-
- while line = f.gets
- lines += 1
- next if line =~ /^\s*$/
- next if line =~ /^\s*#/
- codelines += 1
- end
- puts "L: #{sprintf("%4d", lines)}, LOC #{sprintf("%4d", codelines)} | #{file_name}"
-
- total_lines += lines
- total_codelines += codelines
-
- lines, codelines = 0, 0
- end
-
- puts "Total: Lines #{total_lines}, LOC #{total_codelines}"
-end
-
-desc "Publish the release files to RubyForge."
-task :release => [ :package ] do
- `rubyforge login`
-
- for ext in %w( gem tgz zip )
- release_command = "rubyforge add_release activewarehouse #{PKG_NAME} 'REL #{PKG_VERSION}' pkg/#{PKG_NAME}-#{PKG_VERSION}.#{ext}"
- puts release_command
- system(release_command)
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |s|
+ s.name = "rails_sql_views"
+ s.summary = "Library which adds SQL Views to ActiveRecord."
+ s.email = "josh@technicalpickles.com"
+ s.homepage = "http://activewarehouse.rubyforge.org/rails_sql_views"
+ s.description = "Adds support for using SQL views within ActiveRecord"
+ s.authors = ["Anthony Eden"]
+ s.files = FileList[
+ "CHANGELOG",
+ "README",
+ "Rakefile",
+ "{bin,lib}/**/*"
+ ]
+ s.add_dependency 'activerecord'
end
+rescue LoadError
+ puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
end
desc "Publish the API documentation"
task :pdoc => [:rdoc] do
Rake::SshDirPublisher.new("aeden@rubyforge.org", "/var/www/gforge-projects/activewarehouse/rails_sql_views/rdoc", "rdoc").upload
end
-
-desc "Install the gem from a local generated package"
-task :install => [:package] do
- windows = RUBY_PLATFORM =~ /mswin/
- sudo = windows ? '' : 'sudo'
- gem = windows ? 'gem.bat' : 'gem'
- `#{sudo} #{gem} install pkg/#{PKG_NAME}-#{PKG_VERSION}`
-end
-
-desc "Reinstall the gem from a local package copy"
-task :reinstall => [:package] do
- windows = RUBY_PLATFORM =~ /mswin/
- sudo = windows ? '' : 'sudo'
- gem = windows ? 'gem.bat' : 'gem'
- `#{sudo} #{gem} uninstall #{PKG_NAME} -x`
- `#{sudo} #{gem} install pkg/#{PKG_NAME}-#{PKG_VERSION}`
-end
View
81 rails_sql_views.gemspec
@@ -0,0 +1,81 @@
+# 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{rails_sql_views}
+ s.version = "0.8.0"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Anthony Eden"]
+ s.date = %q{2010-08-25}
+ s.description = %q{Adds support for using SQL views within ActiveRecord}
+ s.email = %q{josh@technicalpickles.com}
+ s.extra_rdoc_files = [
+ "LICENSE",
+ "README",
+ "TODO"
+ ]
+ s.files = [
+ "CHANGELOG",
+ "README",
+ "Rakefile",
+ "lib/active_record/view.rb",
+ "lib/core_ext/module.rb",
+ "lib/rails_sql_views.rb",
+ "lib/rails_sql_views/connection_adapters/abstract/schema_definitions.rb",
+ "lib/rails_sql_views/connection_adapters/abstract/schema_statements.rb",
+ "lib/rails_sql_views/connection_adapters/abstract_adapter.rb",
+ "lib/rails_sql_views/connection_adapters/mysql_adapter.rb",
+ "lib/rails_sql_views/connection_adapters/oci_adapter.rb",
+ "lib/rails_sql_views/connection_adapters/oracle_adapter.rb",
+ "lib/rails_sql_views/connection_adapters/oracleenhanced_adapter.rb",
+ "lib/rails_sql_views/connection_adapters/oracleenhanced_adapter.rb.orig",
+ "lib/rails_sql_views/connection_adapters/postgresql_adapter.rb",
+ "lib/rails_sql_views/connection_adapters/postgresql_adapter.rb.orig",
+ "lib/rails_sql_views/connection_adapters/sqlite_adapter.rb",
+ "lib/rails_sql_views/connection_adapters/sqlserver_adapter.rb",
+ "lib/rails_sql_views/loader.rb",
+ "lib/rails_sql_views/schema_dumper.rb",
+ "lib/rails_sql_views/version.rb"
+ ]
+ s.homepage = %q{http://activewarehouse.rubyforge.org/rails_sql_views}
+ s.rdoc_options = ["--charset=UTF-8"]
+ s.require_paths = ["lib"]
+ s.rubygems_version = %q{1.3.6}
+ s.summary = %q{Library which adds SQL Views to ActiveRecord.}
+ s.test_files = [
+ "test/adapter_test.rb",
+ "test/connection/native_mysql/connection.rb",
+ "test/connection/native_postgresql/connection.rb",
+ "test/connection/oracle_enhanced/connection.rb",
+ "test/models/item.rb",
+ "test/models/person.rb",
+ "test/models/person2.rb",
+ "test/models/place.rb",
+ "test/models/v_person.rb",
+ "test/models/v_profile.rb",
+ "test/schema.native_mysql.expected.rb",
+ "test/schema.native_postgresql.expected.rb",
+ "test/schema.oracle_enhanced.expected.rb",
+ "test/schema_dumper_test.rb",
+ "test/test_helper.rb",
+ "test/view_model_test.rb",
+ "test/view_operations_test.rb"
+ ]
+
+ 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<activerecord>, [">= 0"])
+ else
+ s.add_dependency(%q<activerecord>, [">= 0"])
+ end
+ else
+ s.add_dependency(%q<activerecord>, [">= 0"])
+ end
+end
+

0 comments on commit 4338a1f

Please sign in to comment.
Something went wrong with that request. Please try again.