summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorLee Jarvis <lee@jarvis.co>2010-12-08 10:33:14 +0000
committerLee Jarvis <lee@jarvis.co>2010-12-08 10:33:14 +0000
commit2eb8fdc68bb8a6135ab39e20e540ace1058246f2 (patch)
tree2936a5c2b289731b1d67d4bef91dbb025df6c0e4 /Rakefile
parenta3e4b6f3e8914a570aa18428693250d8eceaf766 (diff)
downloadslop-2eb8fdc68bb8a6135ab39e20e540ace1058246f2.tar.gz
added rake install task rather than modifying readme every time
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile21
1 files changed, 5 insertions, 16 deletions
diff --git a/Rakefile b/Rakefile
index 4a6b351..ff60194 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,26 +1,15 @@
require 'rspec/core/rake_task'
-require File.join(File.dirname(__FILE__), 'lib/slop')
+require File.expand_path('../lib/slop', __FILE__)
RSpec::Core::RakeTask.new(:spec) do |spec|
spec.rspec_opts = ["-c", "--fail-fast", "-f documentation"]
spec.pattern = 'spec/**/*_spec.rb'
end
-namespace :readme do
-
- desc "Modify readme documentation automatically"
- task :compile do
- latest_version = 'slop-' + Slop::VERSION
- readme_filepath = File.join(File.dirname(__FILE__), "README.md")
-
- puts "Updating gem commands to instruct developer with version #{latest_version}"
-
- working_readme = File.read(readme_filepath)
- working_readme.gsub! /(slop-[0-9]+\.[0-9]+\.[0-9]+)/, latest_version
-
- File.open(readme_filepath, "w") { |readme| readme.puts working_readme }
- end
-
+desc "Install Slop as a Ruby gem"
+task :install do
+ sh("gem build slop.gemspec")
+ sh("gem install slop-#{Slop::VERSION}.gem")
end
task :default => :spec