Skip to content

Commit

Permalink
Convert project so that it is Gemfile and gemspec based.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Buck committed Aug 1, 2012
1 parent 7a8ac37 commit 5620e02
Show file tree
Hide file tree
Showing 30 changed files with 1,172 additions and 181 deletions.
1 change: 1 addition & 0 deletions ruby/activerecord-nuodb-adapter/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions ruby/activerecord-nuodb-adapter/.idea/.rakeTasks

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions ruby/activerecord-nuodb-adapter/.idea/codeStyleSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions ruby/activerecord-nuodb-adapter/.idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions ruby/activerecord-nuodb-adapter/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions ruby/activerecord-nuodb-adapter/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions ruby/activerecord-nuodb-adapter/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

447 changes: 447 additions & 0 deletions ruby/activerecord-nuodb-adapter/.idea/workspace.xml

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions ruby/activerecord-nuodb-adapter/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
source 'https://rubygems.org'

gemspec

group(:development, :test) do
gem 'rack'
gem 'rake-compiler'
gem 'rdoc'
gem 'rcov'
end
File renamed without changes.
139 changes: 119 additions & 20 deletions ruby/activerecord-nuodb-adapter/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,135 @@
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# Copyright (c) 2012, NuoDB, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of NuoDB, Inc. nor the names of its contributors may
# be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL NUODB, INC. BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

begin
require 'rake'
rescue LoadError
require 'rubygems'
require 'rake'
require 'rubygems'
require 'rake'
require 'rake/clean'
require 'rake/testtask'
require 'rdoc/task'
require 'date'

#############################################################################
#
# Helper functions
#
#############################################################################

def name
@name ||= Dir['*.gemspec'].first.split('.').first
end

def version
require File.expand_path('../lib/active_record/connection_adapters/nuodb/version', __FILE__)
ActiveRecord::ConnectionAdapters::Nuodb::Version::VERSION
end

def rubyforge_project
name
end

def date
Date.today.to_s
end

def gemspec_file
"#{name}.gemspec"
end

def gem_file
"#{name}-#{version}.gem"
end

def replace_header(head, header_name)
head.sub!(/(\.#{header_name}\s*= ').*'/) { "#{$1}#{send(header_name)}'" }
end

require 'rubygems/package_task'
require 'hoe'

HOE = Hoe.spec 'activerecord-nuodb-adapter' do
self.author = ['NuoDB, Inc.']
self.email = ['info@nuodb.com']
self.need_tar = false
self.need_zip = false
def so_ext
case RUBY_PLATFORM
when /bsd/i, /darwin/i
# extras here...
@sh_extension = 'bundle'
when /linux/i
# extras here...
@sh_extension = 'so'
when /solaris|sunos/i
# extras here...
@sh_extension = 'so'
else
puts
puts "Unsupported platform '#{RUBY_PLATFORM}'. Supported platforms are BSD, DARWIN, and LINUX."
exit
end
end

self.test_globs = [ 'test/simple.rb' ];
#############################################################################
#
# Standard tasks
#
#############################################################################

spec_extras[:required_ruby_version] = Gem::Requirement.new('>= 1.8.6')
CLEAN.include('pkg')
CLOBBER.include('lib/**/*{.so,.bundle}')

extra_deps << ['nuodb', '~> 1.0.0']
require 'rdoc/task'
Rake::RDocTask.new do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "#{name} #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end

file "#{HOE.spec.name}.gemspec" => ['Rakefile', 'tasks/gem.rake'] do |t|
puts "Generating #{t.name}"
File.open(t.name, 'w') { |f| f.puts HOE.spec.to_yaml }
Rake::TestTask.new do |t|
t.libs << 'test'
end

desc "Generate or update the standalone gemspec file for the project"
task :gemspec => ["#{HOE.spec.name}.gemspec"]
task :default => :test

#############################################################################
#
# Packaging tasks
#
#############################################################################

desc "Build #{gem_file} into the pkg directory"
task :build do
sh "mkdir -p pkg"
sh "gem build #{gemspec_file}"
sh "mv #{gem_file} pkg"
end

task :install => :build do
sh "gem install pkg/activerecord-nuodb-adapter*.gem"
end

task :uninstall do
sh "gem uninstall activerecord-nuodb-adapter"
end
25 changes: 25 additions & 0 deletions ruby/activerecord-nuodb-adapter/activerecord-nuodb-adapter.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -*- encoding: utf-8 -*-
require File.expand_path('../lib/active_record/connection_adapters/nuodb/version', __FILE__)

Gem::Specification.new do |gem|
gem.name = "activerecord-nuodb-adapter"
gem.summary = %q{ActiveRecord adapter with AREL support for NuoDB.}
gem.description = %q{An adapter for ActiveRecord and AREL to support the NuoDB distributed database backend.}
gem.homepage = "http://www.nuodb.com/"
gem.authors = %w(Robert Buck)
gem.email = %w(support@nuodb.com)
gem.license = "BSD"
gem.version = ActiveRecord::ConnectionAdapters::Nuodb::Version::VERSION
gem.date = '2012-07-30'

gem.rdoc_options = %w(--charset=UTF-8)
gem.extra_rdoc_files = %w[README.rdoc]

gem.add_development_dependency('rake', '~> 0.9')
gem.add_development_dependency('rdoc', '~> 3.10')
gem.add_development_dependency('rcov', '~> 1.0')

gem.files = `git ls-files`.split($\)
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.require_paths = %w(lib)
end
Loading

0 comments on commit 5620e02

Please sign in to comment.