-
Notifications
You must be signed in to change notification settings - Fork 64
/
rake_helpers.rb
74 lines (61 loc) · 2.08 KB
/
rake_helpers.rb
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
# encoding: utf-8
current_dir = File.dirname(__FILE__)
require File.join(current_dir, "remarkable/lib/remarkable/core/version.rb")
require 'rubygems'
require 'rake/gempackagetask'
require 'rake/rdoctask'
########### Common package && release
RUBY_FORGE_PROJECT = "remarkable"
PROJECT_URL = "http://github.com/carlosbrando/remarkable"
GEM_VERSION = Remarkable::VERSION
PACKAGE_DIR = File.join(File.dirname(__FILE__), 'pkg')
RELEASE_NAME = "REL #{GEM_VERSION}"
RSPEC_VERSION = '2.0.0.alpha11'
def self.configure_gemspec!
begin
require 'jeweler'
Jeweler::Tasks.new do |gemspec|
gemspec.rubyforge_project = RUBY_FORGE_PROJECT
gemspec.name = GEM_NAME
gemspec.version = GEM_VERSION
gemspec.platform = Gem::Platform::RUBY
gemspec.has_rdoc = true
gemspec.extra_rdoc_files = EXTRA_RDOC_FILES
gemspec.summary = PROJECT_SUMMARY
gemspec.description = PROJECT_DESCRIPTION
gemspec.authors = GEM_AUTHOR
gemspec.email = GEM_EMAIL
gemspec.homepage = PROJECT_URL
gemspec.require_path = 'lib'
gemspec.files = EXTRA_RDOC_FILES + Dir.glob("{lib,locale}/**/*") + Dir.glob("*.gemspec")
gemspec.add_dependency('rspec', ">= #{RSPEC_VERSION}")
yield gemspec if block_given?
end
Jeweler::GemcutterTasks.new
rescue LoadError
puts "Jeweler not available. Install it with: gem install jeweler"
end
end
########### Common specs
gem 'rspec', ">= #{RSPEC_VERSION}"
# RSpec2
gem 'rspec-expectations'
require 'rspec/core/rake_task'
desc "Run the specs under spec"
RSpec::Core::RakeTask.new do |t|
# Stub
end
########## Common rdoc
Rake::RDocTask.new do |rdoc|
rdoc.main = "README"
rdoc.rdoc_dir = 'rdoc'
rdoc.title = GEM_NAME
rdoc.rdoc_files.include(*EXTRA_RDOC_FILES)
rdoc.rdoc_files.include('lib/**/*.rb')
rdoc.options << '--line-numbers' << '--inline-source'
end
def load_project_path(project)
project_path = File.join(File.dirname(__FILE__), project, 'lib')
return nil if $LOAD_PATH.include?(File.expand_path(project_path))
$LOAD_PATH.unshift(File.expand_path(project_path))
end