Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 84 lines (68 sloc) 2.2 kb
2d67913 @josevalim Created rake_helper and refactored Rakefiles.
josevalim authored
1 current_dir = File.dirname(__FILE__)
2 require File.join(current_dir, "remarkable/lib/remarkable/version.rb")
3
4 require 'rubygems'
5 require 'rake/gempackagetask'
6 require 'rake/rdoctask'
7
8 ########### Common package && release
9
10 RUBY_FORGE_PROJECT = "remarkable"
11 PROJECT_URL = "http://github.com/carlosbrando/remarkable"
12
13 GEM_VERSION = Remarkable::VERSION
14 PACKAGE_DIR = File.join(File.dirname(__FILE__), 'pkg')
15 RELEASE_NAME = "REL #{GEM_VERSION}"
16
17 RSPEC_VERSION = '1.2.0'
18
afeab80 @josevalim More rake refactoring.
josevalim authored
19 def self.configure_gemspec!
20 $spec = Gem::Specification.new do |s|
21 s.rubyforge_project = RUBY_FORGE_PROJECT
22 s.name = GEM_NAME
23 s.version = GEM_VERSION
24 s.platform = Gem::Platform::RUBY
25 s.has_rdoc = true
26 s.extra_rdoc_files = EXTRA_RDOC_FILES
27 s.summary = PROJECT_SUMMARY
28 s.description = PROJECT_DESCRIPTION
29 s.authors = GEM_AUTHOR
30 s.email = GEM_EMAIL
31 s.homepage = PROJECT_URL
32 s.require_path = 'lib'
33 s.files = EXTRA_RDOC_FILES + Dir.glob("{lib,locale}/**/*")
34 s.test_files = Dir.glob("spec/**/*")
35 yield s
36 end
37
38 Rake::GemPackageTask.new($spec) do |pkg|
39 pkg.package_dir = PACKAGE_DIR
40 pkg.gem_spec = $spec
41 pkg.need_zip = true
42 pkg.need_tar = true
43 end
44 end
45
2d67913 @josevalim Created rake_helper and refactored Rakefiles.
josevalim authored
46 desc "Create a gemspec file"
47 task :gemspec do
48 File.open("#{GEM_NAME}.gemspec", "w") do |file|
49 file.puts $spec.to_ruby
50 end
51 end
52
53 desc "Build the gem and install it"
54 task :install => :gem do
55 system("sudo gem install #{PACKAGE_DIR}/#{GEM_NAME}-#{GEM_VERSION}.gem --local --ignore-dependencies")
56 end
57
58 desc "Uninstall the gem"
59 task :uninstall do
60 system("sudo gem uninstall #{GEM_NAME} --version #{GEM_VERSION}")
61 end
62
63 ########### Common specs
64
65 gem 'rspec', ENV['RSPEC_VERSION'] || '1.2.2'
66 require 'spec/rake/spectask'
67
68 desc "Run the specs under spec"
69 Spec::Rake::SpecTask.new do |t|
70 t.spec_opts = ['--options', "spec/spec.opts"]
71 t.spec_files = FileList['spec/**/*_spec.rb']
72 end
73
74 ########## Common rdoc
75
76 Rake::RDocTask.new do |rdoc|
77 rdoc.main = "README"
78 rdoc.rdoc_dir = 'rdoc'
79 rdoc.title = GEM_NAME
80 rdoc.rdoc_files.include(*EXTRA_RDOC_FILES)
81 rdoc.rdoc_files.include('lib/**/*.rb')
82 rdoc.options << '--line-numbers' << '--inline-source'
83 end
Something went wrong with that request. Please try again.