Skip to content

HTTPS clone URL

Subversion checkout URL

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