Skip to content

Commit

Permalink
Ruby gem infrastructure
Browse files Browse the repository at this point in the history
Change-Id: Id4ba0bb59cabae275620821a00b28bd10e04360c
  • Loading branch information
avsej committed Feb 22, 2012
1 parent 24c983d commit 24b5a34
Show file tree
Hide file tree
Showing 10 changed files with 194 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
@@ -0,0 +1,4 @@
*.gem
.bundle
Gemfile.lock
pkg/*
5 changes: 5 additions & 0 deletions .yardopts
@@ -0,0 +1,5 @@
--protected
--no-private
-
README.markdown
HISTORY.markdown
4 changes: 4 additions & 0 deletions Gemfile
@@ -0,0 +1,4 @@
source "http://rubygems.org"

# Specify your gem's dependencies in couchbase-model.gemspec
gemspec
22 changes: 22 additions & 0 deletions Rakefile
@@ -0,0 +1,22 @@
# Author:: Couchbase <info@couchbase.com>
# Copyright:: 2012 Couchbase, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

require 'bundler/gem_tasks'

Dir['tasks/*.rake'].sort.each { |f| load f }

task :default => :test
26 changes: 26 additions & 0 deletions couchbase-model.gemspec
@@ -0,0 +1,26 @@
# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "couchbase/model/version"

Gem::Specification.new do |s|
s.name = "couchbase-model"
s.version = Couchbase::Model::VERSION
s.authors = ["Sergey Avseyev"]
s.email = ["sergey.avseyev@gmail.com"]
s.homepage = ""
s.summary = %q{Declarative interface to Couchbase}
s.description = %q{ORM-like interface allows you to persist your models to Couchbase}

s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]

s.add_runtime_dependency 'couchbase', '~> 1.0.0'

s.add_development_dependency 'rake', '~> 0.8.7'
s.add_development_dependency 'minitest'
s.add_development_dependency 'rdiscount'
s.add_development_dependency 'yard'
s.add_development_dependency RUBY_VERSION =~ /^1\.9/ ? 'ruby-debug19' : 'ruby-debug'
end
26 changes: 26 additions & 0 deletions lib/couchbase/model.rb
@@ -0,0 +1,26 @@
# Author:: Couchbase <info@couchbase.com>
# Copyright:: 2012 Couchbase, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

require 'couchbase/model/version'

module Couchbase

class Model

end

end
26 changes: 26 additions & 0 deletions lib/couchbase/model/version.rb
@@ -0,0 +1,26 @@
# Author:: Couchbase <info@couchbase.com>
# Copyright:: 2012 Couchbase, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

module Couchbase

class Model

VERSION = "0.0.1"

end

end
25 changes: 25 additions & 0 deletions tasks/doc.rake
@@ -0,0 +1,25 @@
# Author:: Couchbase <info@couchbase.com>
# Copyright:: 2012 Couchbase, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

require 'rake/clean'
require 'yard'
require 'yard/rake/yardoc_task'

YARD::Rake::YardocTask.new do |t|
t.options = %w(--protected --no-private)
t.files.push('-', 'README.markdown', 'HISTORY.markdown')
end
35 changes: 35 additions & 0 deletions tasks/test.rake
@@ -0,0 +1,35 @@
# Author:: Couchbase <info@couchbase.com>
# Copyright:: 2012 Couchbase, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

require 'rake/testtask'
require 'rake/clean'

rule 'test/CouchbaseMock.jar' do |task|
jar_path = "0.5-SNAPSHOT/CouchbaseMock-0.5-20120222.060643-15.jar"
sh %{wget -q -O test/CouchbaseMock.jar http://files.couchbase.com/maven2/org/couchbase/mock/CouchbaseMock/#{jar_path}}
end

CLOBBER << 'test/CouchbaseMock.jar'

Rake::TestTask.new do |test|
test.libs << "test" << "."
test.ruby_opts << "-rruby-debug" if ENV['DEBUG']
test.pattern = 'test/test_*.rb'
test.options = '--verbose'
end

Rake::Task['test'].prerequisites.unshift('test/CouchbaseMock.jar')
21 changes: 21 additions & 0 deletions tasks/util.rake
@@ -0,0 +1,21 @@
# Author:: Couchbase <info@couchbase.com>
# Copyright:: 2012 Couchbase, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

desc 'Start an irb session and load the library.'
task :console => :compile do
exec "irb -I lib -rruby-debug -rcouchbase-model"
end

0 comments on commit 24b5a34

Please sign in to comment.