Skip to content
This repository has been archived by the owner on May 27, 2020. It is now read-only.

Commit

Permalink
Improve gem generation. Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
pusewicz committed Apr 6, 2009
1 parent 56755c5 commit d939123
Show file tree
Hide file tree
Showing 9 changed files with 150 additions and 45 deletions.
5 changes: 5 additions & 0 deletions .document
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
README.rdoc
lib/**/*.rb
bin/*
features/**/*.feature
LICENSE
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.sw?
.DS_Store
coverage
rdoc
pkg
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
57 changes: 57 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -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

4 changes: 2 additions & 2 deletions VERSION.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
:major: 0
:minor: 0
:patch: 0
:minor: 1
:patch: 4
30 changes: 17 additions & 13 deletions lib/rails_sequel/rails_sequel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
11 changes: 3 additions & 8 deletions lib/rails_sequel/version.rb
Original file line number Diff line number Diff line change
@@ -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
61 changes: 40 additions & 21 deletions rails_sequel.gemspec
Original file line number Diff line number Diff line change
@@ -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.