Skip to content
Browse files

Improve gem generation. Bump version

  • Loading branch information...
1 parent 56755c5 commit d9391238a8e786464e7eb45290e1787235f7bc48 @pusewicz committed
Showing with 150 additions and 45 deletions.
  1. +5 −0 .document
  2. +5 −0 .gitignore
  3. +20 −0 LICENSE
  4. +1 −1 README.md
  5. +57 −0 Rakefile
  6. +2 −2 VERSION.yml
  7. +17 −13 lib/rails_sequel/rails_sequel.rb
  8. +3 −8 lib/rails_sequel/version.rb
  9. +40 −21 rails_sequel.gemspec
View
5 .document
@@ -0,0 +1,5 @@
+README.rdoc
+lib/**/*.rb
+bin/*
+features/**/*.feature
+LICENSE
View
5 .gitignore
@@ -0,0 +1,5 @@
+*.sw?
+.DS_Store
+coverage
+rdoc
+pkg
View
20 LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2009 Piotr Usewicz
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
2 README.md
@@ -18,7 +18,7 @@ Installation
Load the gem in `environment.rb`
Rails::Initializer.run do |config|
- config.gem 'pusewicz-rails_sequel', :version => '~> 0.0.2', :lib => 'rails_sequel', :source => 'http://gems.github.com'
+ config.gem 'pusewicz-rails_sequel', :version => '0.1.4', :lib => 'rails_sequel', :source => 'http://gems.github.com'
end
Optional
View
57 Rakefile
@@ -0,0 +1,57 @@
+require 'rubygems'
+require 'rake'
+
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |gem|
+ gem.name = "rails_sequel"
+ gem.summary = "Sequel plugin for Ruby on Rails"
+ gem.description = "rails_sequel allows you to quickly use Sequel Toolkit as your ORM in Ruby on Rails"
+ gem.email = "piotr@layer22.com"
+ gem.homepage = "http://github.com/pusewicz/rails_sequel"
+ gem.authors = ["Piotr Usewicz"]
+
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
+ end
+rescue LoadError
+ puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
+end
+
+# require 'rake/testtask'
+# Rake::TestTask.new(:test) do |test|
+# test.libs << 'lib' << 'test'
+# test.pattern = 'test/**/*_test.rb'
+# test.verbose = true
+# end
+#
+# begin
+# require 'rcov/rcovtask'
+# Rcov::RcovTask.new do |test|
+# test.libs << 'test'
+# test.pattern = 'test/**/*_test.rb'
+# test.verbose = true
+# end
+# rescue LoadError
+# task :rcov do
+# abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
+# end
+# end
+
+
+# task :default => :test
+
+require 'rake/rdoctask'
+Rake::RDocTask.new do |rdoc|
+ if File.exist?('VERSION.yml')
+ config = YAML.load(File.read('VERSION.yml'))
+ version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
+ else
+ version = ""
+ end
+
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = "rails_sequel #{version}"
+ rdoc.rdoc_files.include('README*')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
+
View
4 VERSION.yml
@@ -1,4 +1,4 @@
---
:major: 0
-:minor: 0
-:patch: 0
+:minor: 1
+:patch: 4
View
30 lib/rails_sequel/rails_sequel.rb
@@ -10,6 +10,7 @@ def self.connect
if options[:adapter] == 'mysql'
connection.execute("SET SQL_AUTO_IS_NULL=0")
end
+ connection
end
# Returns loaded database.yml configuration for current environment
@@ -22,24 +23,27 @@ def self.prepare_options
options = {}
# Use SQLite by default
- options[:adapter] = (config[:adapter] || "sqlite")
+ options[:adapter] = config[:adapter] || "sqlite"
+
# Use localhost as default host
- options[:host] = (config[:host] || "localhost")
+ options[:host] = config[:host] || "localhost"
+
# Default user is an empty string. Both username and user keys are supported.
- options[:user] = (config[:username] || config[:user] || "")
-
- options[:password] = config[:password] || ""
-
+ options[:user] = config[:username] || config[:user] || ""
+ options[:password] = config[:password] || ""
+
# Both encoding and charset options are supported, default is utf8
- options[:encoding] = (config[:encoding] || config[:charset] || "utf8")
+ options[:encoding] = config[:encoding] || config[:charset] || "utf8"
+
# Default database is hey_dude_configure_your_database
- options[:database] = config[:database] || "hey_dude_configure_your_database"
+ options[:database] = config[:database] || "hey_dude_configure_your_database"
+
# MSSQL support
- options[:db_type] = config[:db_type] if config[:db_type]
- options[:socket] = config[:socket] if config[:socket]
- options[:charset] = config[:charset] if config[:charset]
- options[:encoding] = config[:encoding] if config[:encoding]
- options[:loggers] = [Rails.logger]
+ options[:db_type] = config[:db_type] if config[:db_type]
+ options[:socket] = config[:socket] if config[:socket]
+ options[:charset] = config[:charset] if config[:charset]
+ options[:encoding] = config[:encoding] if config[:encoding]
+ options[:loggers] = [Rails.logger]
options
end
end
View
11 lib/rails_sequel/version.rb
@@ -1,15 +1,10 @@
module Rails
module SequelConnection
- module Version
- MAJOR = 0
- MINOR = 1
- TINY = 3
-
- STRING = [MAJOR, MINOR, TINY].join('.')
- end
+ config = YAML.load(File.read(File.join(File.dirname(__FILE__), '../../VERSION.yml')))
+ VERSION = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
def self.version
- Version::STRING
+ VERSION
end
end
end
View
61 rails_sequel.gemspec
@@ -1,23 +1,42 @@
+# -*- encoding: utf-8 -*-
+
Gem::Specification.new do |s|
- s.name = 'rails_sequel'
- # Change VERSION too
- s.version = "0.1.3"
- s.date = '2009-01-21'
-
- s.summary = "Sequel plugin for Ruby on Rails"
- s.description = "rails_sequel allows you to quickly use Sequel Toolkit as your ORM in Ruby on Rails"
-
- s.authors = ['Piotr Usewicz']
- s.email = 'piotr@layer22.com'
- s.homepage = 'http://github.com/pusewicz/rails_sequel/wikis'
-
- s.has_rdoc = false
- # s.rdoc_options = ['--main', 'README.rdoc']
- # s.rdoc_options << '--inline-source' << '--charset=UTF-8'
- # s.extra_rdoc_files = ['README.rdoc', 'LICENSE', 'CHANGELOG.rdoc']
-
- s.files = ["lib/rails_sequel/rails_sequel.rb", "lib/rails_sequel/sequel_ext.rb", "lib/rails_sequel/version.rb", "lib/rails_sequel.rb", "init.rb", "README.md"]
- # Dir['lib/**/*.rb'] + Dir['init.rb'] + Dir['README.md']
-
- s.add_dependency("sequel", [">= 2.8.0"])
+ s.name = %q{rails_sequel}
+ s.version = "0.1.4"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Piotr Usewicz"]
+ s.date = %q{2009-04-06}
+ s.description = %q{rails_sequel allows you to quickly use Sequel Toolkit as your ORM in Ruby on Rails}
+ s.email = %q{piotr@layer22.com}
+ s.extra_rdoc_files = [
+ "LICENSE",
+ "README.md"
+ ]
+ s.files = [
+ "LICENSE",
+ "README.md",
+ "Rakefile",
+ "VERSION.yml",
+ "lib/rails_sequel.rb",
+ "lib/rails_sequel/rails_sequel.rb",
+ "lib/rails_sequel/sequel_ext.rb",
+ "lib/rails_sequel/version.rb"
+ ]
+ s.has_rdoc = true
+ s.homepage = %q{http://github.com/pusewicz/rails_sequel}
+ s.rdoc_options = ["--charset=UTF-8"]
+ s.require_paths = ["lib"]
+ s.rubygems_version = %q{1.3.1}
+ s.summary = %q{Sequel plugin for Ruby on Rails}
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 2
+
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ else
+ end
+ else
+ end
end

0 comments on commit d939123

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