public
Description: Minimalistic modular engine for StrokeDB
Homepage: http://strokedb.com
Clone URL: git://github.com/oleganza/strokedb-core.git
strokedb-core / Rakefile
100644 97 lines (77 sloc) 2.672 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
require "rake"
require "rake/clean"
require "rake/gempackagetask"
require "rake/rdoctask"
require "rake/testtask"
require "spec/rake/spectask"
require "fileutils"
 
def __DIR__
  File.dirname(__FILE__)
end
 
include FileUtils
 
require "lib/strokedb/version"
 
GEM_NAME = "strokedb"
GEM_VERSION = StrokeDB::VERSION
 
def sudo
  ENV['STROKEDB_SUDO'] ||= "sudo"
  sudo = windows? ? "" : ENV['STROKEDB_SUDO']
end
 
def windows?
  (PLATFORM =~ /win32|cygwin/) rescue nil
end
 
def install_home
  ENV['GEM_HOME'] ? "-i #{ENV['GEM_HOME']}" : ""
end
 
##############################################################################
# Packaging & Installation
##############################################################################
CLEAN.include ["**/.*.sw?", "pkg", "lib/*.bundle", "*.gem", "doc/rdoc", ".config", "coverage", "cache"]
 
desc "Run the specs."
task :default => :specs
 
task :strokedb => [:clean, :rdoc, :package]
 
spec = Gem::Specification.new do |s|
  s.name = GEM_NAME
  s.version = GEM_VERSION
  s.platform = Gem::Platform::RUBY
  s.author = "Oleg Andreev, Yurii Rashkovskii"
  s.email = "oleganza@gmail.com, yrashk@gmail.com"
  s.homepage = "http://strokedb.com/"
  s.summary = "StrokeDB. Distributed document-oriented database."
  s.bindir = "bin"
  s.description = s.summary
  s.executables = %w( strokedb )
  s.require_path = "lib"
  s.files = %w( MIT-LICENSE README Rakefile TODO ) + Dir["{docs,bin,spec,lib,examples,script}/**/*"]
 
  # rdoc
  s.has_rdoc = true
  s.extra_rdoc_files = %w( README MIT-LICENSE TODO )
  #s.rdoc_options += RDOC_OPTS + ["--exclude", "^(app|uploads)"]
 
  # Dependencies
  s.add_dependency "RubyInline"
  s.add_dependency "uuidtools"
  s.add_dependency "rake"
  s.add_dependency "json_pure"
  s.add_dependency "rspec"
  s.add_dependency "rack"
  
  # See sources on github.com
  s.add_dependency "gem_console"
  s.add_dependency "declarations"
  
  # Requirements
  s.requirements << "install the json gem to get faster json parsing"
  s.required_ruby_version = ">= 1.8.4"
end
 
Rake::GemPackageTask.new(spec) do |package|
  package.gem_spec = spec
end
 
desc "Run :package and install the resulting .gem"
task :install => :package do
  sh %{#{sudo} gem install #{install_home} --local pkg/#{GEM_NAME}-#{GEM_VERSION}.gem --no-rdoc --no-ri}
end
 
#desc "Run :package and install the resulting .gem with jruby"
#task :jinstall => :package do
# sh %{#{sudo} jruby -S gem install #{install_home} pkg/#{GEM_NAME}-#{GEM_VERSION}.gem --no-rdoc --no-ri}
#end
 
desc "Run :clean and uninstall the .gem"
task :uninstall => :clean do
  sh %{#{sudo} gem uninstall #{GEM_NAME}}
end