Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

adopt my new gem tasks, and fix running tests in modern gems

  • Loading branch information...
commit 3c8f0c3071ab59135c95642fe7309725fd05d4af 1 parent 0874e62
@godfat authored
View
4 .gitignore
@@ -1,6 +1,2 @@
-tmp
pkg
-doc
-ann-*
-
*.rbc
View
3  .gitmodules
@@ -0,0 +1,3 @@
+[submodule "task"]
+ path = task
+ url = git://github.com/godfat/gemgem.git
View
14 Gemfile
@@ -0,0 +1,14 @@
+
+source 'http://rubygems.org'
+
+gemspec
+
+# datamapper
+gem 'dm-core'
+gem 'dm-aggregates'
+gem 'dm-migrations'
+gem 'dm-sqlite-adapter'
+
+# rails
+gem 'activerecord'
+gem 'sqlite3'
View
45 Rakefile
@@ -1,40 +1,19 @@
# encoding: utf-8
-begin
- require 'bones'
-rescue LoadError
- abort '### Please install the "bones" gem ###'
-end
-
-ensure_in_path 'lib'
-proj = 'pagify'
-require "#{proj}/version"
-
-Bones{
- version Pagify::VERSION
-
- ruby_opts [''] # silence warning, too many in addressable and/or dm-core
- depend_on 'dm-core', :development => true, :version => '>=0.10.1'
- depend_on 'dm-aggregates', :development => true
- depend_on 'dm-migrations', :development => true
- depend_on 'dm-sqlite-adapter', :development => true
-
- depend_on 'activerecord', :development => true, :version => '>=2.3.4'
+require "#{dir = File.dirname(__FILE__)}/task/gemgem"
+Gemgem.dir = dir
- name proj
- url "http://github.com/godfat/#{proj}"
- authors 'Lin Jen-Shin (aka godfat 真常)'
- email 'godfat (XD) godfat.org'
+($LOAD_PATH << File.expand_path("#{Gemgem.dir}/lib")).uniq!
- history_file 'CHANGES'
- readme_file 'README'
- ignore_file '.gitignore'
- rdoc.include ['\w+']
-}
+desc 'Generate gemspec'
+task 'gem:spec' do
+ Gemgem.spec = Gemgem.create do |s|
+ require 'pagify/version'
+ s.name = 'pagify'
+ s.version = Pagify::VERSION
-CLEAN.include Dir['**/*.rbc']
+ %w[].each{ |g| s.add_runtime_dependency(g) }
+ end
-task :default do
- Rake.application.options.show_task_pattern = /./
- Rake.application.display_tasks_and_comments
+ Gemgem.write
end
View
104 pagify.gemspec
@@ -1,50 +1,86 @@
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
- s.name = %q{pagify}
- s.version = "0.7.1.3"
+ s.name = "pagify"
+ s.version = "0.7.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Lin Jen-Shin (aka godfat 真常)"]
- s.date = %q{2010-11-30}
- s.description = %q{ Pagination tools for Array(or custom class), DataMapper and ActiveRecord
- Helpers for Innate/Ramaze and Rails included.}
- s.email = %q{godfat (XD) godfat.org}
- s.extra_rdoc_files = ["CHANGES", "LICENSE", "NOTICE", "README", "Rakefile", "TODO", "misc.txt", "pagify.gemspec"]
- s.files = ["CHANGES", "LICENSE", "NOTICE", "README", "Rakefile", "TODO", "lib/pagify.rb", "lib/pagify/active_record.rb", "lib/pagify/array.rb", "lib/pagify/data_mapper.rb", "lib/pagify/helper/abstract.rb", "lib/pagify/helper/detail/setting.rb", "lib/pagify/helper/detail/setup.rb", "lib/pagify/helper/detail/web.rb", "lib/pagify/helper/html.rb", "lib/pagify/helper/innate.rb", "lib/pagify/helper/rails.rb", "lib/pagify/page/basic.rb", "lib/pagify/page/null.rb", "lib/pagify/pager/active_record.rb", "lib/pagify/pager/array.rb", "lib/pagify/pager/basic.rb", "lib/pagify/pager/data_mapper.rb", "lib/pagify/pager/detail/page_accept_string_or_blank.rb", "lib/pagify/pager/null.rb", "lib/pagify/pagifier/abstract.rb", "lib/pagify/pagifier/active_record.rb", "lib/pagify/pagifier/array.rb", "lib/pagify/pagifier/data_mapper.rb", "lib/pagify/version.rb", "misc.txt", "pagify.gemspec", "spec/pagify_spec.rb", "spec/spec_helper.rb", "test/helper.rb", "test/helper_model.rb", "test/helper_pagify.rb", "test/helper_web.rb", "test/test_active_record.rb", "test/test_array.rb", "test/test_basic.rb", "test/test_data_mapper.rb", "test/test_html.rb", "test/test_innate.rb", "test/test_null.rb", "test/test_rails.rb"]
- s.homepage = %q{http://github.com/godfat/pagify}
- s.rdoc_options = ["--main", "README"]
+ s.authors = ["Lin Jen-Shin (godfat)"]
+ s.date = "2011-11-11"
+ s.description = ""
+ s.email = ["godfat (XD) godfat.org"]
+ s.files = [
+ ".gitignore",
+ ".gitmodules",
+ "CHANGES",
+ "Gemfile",
+ "LICENSE",
+ "NOTICE",
+ "README",
+ "Rakefile",
+ "TODO",
+ "lib/pagify.rb",
+ "lib/pagify/active_record.rb",
+ "lib/pagify/array.rb",
+ "lib/pagify/data_mapper.rb",
+ "lib/pagify/helper/abstract.rb",
+ "lib/pagify/helper/detail/setting.rb",
+ "lib/pagify/helper/detail/setup.rb",
+ "lib/pagify/helper/detail/web.rb",
+ "lib/pagify/helper/html.rb",
+ "lib/pagify/helper/innate.rb",
+ "lib/pagify/helper/rails.rb",
+ "lib/pagify/page/basic.rb",
+ "lib/pagify/page/null.rb",
+ "lib/pagify/pager/active_record.rb",
+ "lib/pagify/pager/array.rb",
+ "lib/pagify/pager/basic.rb",
+ "lib/pagify/pager/data_mapper.rb",
+ "lib/pagify/pager/detail/page_accept_string_or_blank.rb",
+ "lib/pagify/pager/null.rb",
+ "lib/pagify/pagifier/abstract.rb",
+ "lib/pagify/pagifier/active_record.rb",
+ "lib/pagify/pagifier/array.rb",
+ "lib/pagify/pagifier/data_mapper.rb",
+ "lib/pagify/version.rb",
+ "misc.txt",
+ "pagify.gemspec",
+ "spec/pagify_spec.rb",
+ "spec/spec_helper.rb",
+ "task/.gitignore",
+ "task/gemgem.rb",
+ "test/helper.rb",
+ "test/helper_model.rb",
+ "test/helper_pagify.rb",
+ "test/helper_web.rb",
+ "test/test_active_record.rb",
+ "test/test_array.rb",
+ "test/test_basic.rb",
+ "test/test_data_mapper.rb",
+ "test/test_html.rb",
+ "test/test_innate.rb",
+ "test/test_null.rb",
+ "test/test_rails.rb"]
+ s.homepage = "https://github.com/godfat/pagify"
s.require_paths = ["lib"]
- s.rubyforge_project = %q{pagify}
- s.rubygems_version = %q{1.3.7}
- s.summary = %q{Pagination tools for Array(or custom class), DataMapper and ActiveRecord Helpers for Innate/Ramaze and Rails included.}
- s.test_files = ["test/test_active_record.rb", "test/test_array.rb", "test/test_basic.rb", "test/test_data_mapper.rb", "test/test_html.rb", "test/test_innate.rb", "test/test_null.rb", "test/test_rails.rb"]
+ s.rubygems_version = "1.8.11"
+ s.summary = ""
+ s.test_files = [
+ "test/test_active_record.rb",
+ "test/test_array.rb",
+ "test/test_basic.rb",
+ "test/test_data_mapper.rb",
+ "test/test_html.rb",
+ "test/test_innate.rb",
+ "test/test_null.rb",
+ "test/test_rails.rb"]
if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 3
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_development_dependency(%q<dm-core>, [">= 0.10.1"])
- s.add_development_dependency(%q<dm-aggregates>, [">= 1.0.2"])
- s.add_development_dependency(%q<dm-migrations>, [">= 1.0.2"])
- s.add_development_dependency(%q<dm-sqlite-adapter>, [">= 1.0.2"])
- s.add_development_dependency(%q<activerecord>, [">= 2.3.4"])
- s.add_development_dependency(%q<bones>, [">= 3.5.4"])
else
- s.add_dependency(%q<dm-core>, [">= 0.10.1"])
- s.add_dependency(%q<dm-aggregates>, [">= 1.0.2"])
- s.add_dependency(%q<dm-migrations>, [">= 1.0.2"])
- s.add_dependency(%q<dm-sqlite-adapter>, [">= 1.0.2"])
- s.add_dependency(%q<activerecord>, [">= 2.3.4"])
- s.add_dependency(%q<bones>, [">= 3.5.4"])
end
else
- s.add_dependency(%q<dm-core>, [">= 0.10.1"])
- s.add_dependency(%q<dm-aggregates>, [">= 1.0.2"])
- s.add_dependency(%q<dm-migrations>, [">= 1.0.2"])
- s.add_dependency(%q<dm-sqlite-adapter>, [">= 1.0.2"])
- s.add_dependency(%q<activerecord>, [">= 2.3.4"])
- s.add_dependency(%q<bones>, [">= 3.5.4"])
end
end
1  task
@@ -0,0 +1 @@
+Subproject commit 25209c8e9137fdbcc87c91292e60dcea95c21c35
View
18 test/test_active_record.rb
@@ -11,6 +11,18 @@
require 'pagify/active_record'
+require 'tempfile'
+db = Tempfile.new('pagify')
+db.close
+
+require 'sqlite3/sqlite3_native'
+require 'sqlite3'
+
+DataMapper.setup(:active_record, "sqlite3:#{db.path}")
+
+ActiveRecord::Base.establish_connection(
+ :adapter => 'sqlite3', :database => db.path)
+
class TestActiveRecord < TestCase
include PagifyCase
def test_for_active_record
@@ -28,8 +40,6 @@ def find all, opts = {}
end
end
- DataMapper.setup(:active_record, 'sqlite3:tmp/active_record.sqlite3')
-
class UserForActiveRecord
include DataMapper::Resource
def self.default_repository_name
@@ -53,9 +63,6 @@ def self.default_repository_name
auto_migrate!
end
- ActiveRecord::Base.establish_connection(
- :adapter => 'sqlite3', :database => 'tmp/active_record.sqlite3')
-
class User < ActiveRecord::Base
has_many :pets
end
@@ -69,5 +76,4 @@ class Pet < ActiveRecord::Base
def all_pets_with_name_godfat user
user.pets.all(:conditions => ['name = ?', 'godfat'])
end
-
end
View
0  tmp/.gitignore
No changes.
Please sign in to comment.
Something went wrong with that request. Please try again.