Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

removed bones, updated jeweler, git work tree

  • Loading branch information...
commit 18ae29e5015d2355a1f9e368727a3088016e1f94 1 parent f73cf21
mihael authored
Showing with 32 additions and 56 deletions.
  1. +28 −52 Rakefile
  2. +4 −4 lib/transender.rb
View
80 Rakefile
@@ -1,33 +1,3 @@
-# Look in the tasks/setup.rb file for the various options that can be
-# configured in this Rakefile. The .rake files in the tasks directory
-# are where the options are used.
-
-begin
- require 'bones'
- Bones.setup
-rescue LoadError
- begin
- load 'tasks/setup.rb'
- rescue LoadError
- raise RuntimeError, '### please install the "bones" gem ###'
- end
-end
-
-ensure_in_path 'lib'
-require 'transender'
-
-task :default => 'spec:run'
-
-PROJ.name = 'transender'
-PROJ.authors = 'Mihael'
-PROJ.email = 'kitschmaster@gmail.com'
-PROJ.url = 'http://kitschmaster.com/kiches/246'
-PROJ.version = Transender::VERSION
-PROJ.rubyforge.name = 'transender'
-PROJ.spec.opts << '--color'
-PROJ.ignore_file = '.gitignore'
-PROJ.readme_file = 'README.txt'
-
require 'rubygems'
require 'rake'
begin
@@ -38,37 +8,43 @@ begin
gem.email = "kitschmaster@gmail.com"
gem.homepage = "http://github.com/mihael/transender"
gem.authors = ["Mihael"]
+ gem.rubyforge_project = "transender"
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
end
+
+ Jeweler::RubyforgeTasks.new
rescue LoadError
- puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
end
+require 'spec/rake/spectask'
+Spec::Rake::SpecTask.new(:spec) do |spec|
+ spec.libs << 'lib' << 'spec'
+ spec.spec_files = FileList['spec/**/*_spec.rb']
+end
+
+Spec::Rake::SpecTask.new(:rcov) do |spec|
+ spec.libs << 'lib' << 'spec'
+ spec.pattern = 'spec/**/*_spec.rb'
+ spec.rcov = true
+end
+
+
+task :default => :spec
+
require 'rake/rdoctask'
Rake::RDocTask.new do |rdoc|
+ if File.exist?('VERSION.yml')
+ config = YAML.load(File.read('VERSION.yml'))
+ version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
+ else
+ version = ""
+ end
+
rdoc.rdoc_dir = 'rdoc'
- rdoc.title = 'transender'
- rdoc.options << '--line-numbers' << '--inline-source'
+ rdoc.title = "trans #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
-require 'rake/testtask'
-Rake::TestTask.new(:test) do |test|
- test.libs << 'lib' << 'test'
- test.pattern = 'test/**/*_test.rb'
- test.verbose = false
-end
-
-begin
- require 'rcov/rcovtask'
- Rcov::RcovTask.new do |test|
- test.libs << 'test'
- test.pattern = 'test/**/*_test.rb'
- test.verbose = true
- end
-rescue LoadError
- task :rcov do
- abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
- end
-end
View
8 lib/transender.rb
@@ -90,8 +90,8 @@ def initialize(options)
def clone_and_remove_git
#prepare destination without any warning
`rm -rf #{@app_path}`
- #clone that git repo and rename at the same time
- `git clone #{@transform} #{@app_path}`
+ #clone that git repo and rename at the same time, use --work-tree, otherwise rake spec fails miserably
+ `git --work-tree=#{@app_path} clone --no-hardlinks #{@transform} #{@app_path}`
#remove any past life remains from the fresh project
`rm -rf #{File.join(@app_path, 'build')}`
`rm -rf #{File.join(@app_path, '.git')}`
@@ -121,7 +121,7 @@ def zip
z
end
- def transform
+ def transformize
clone_and_remove_git
rename
zip
@@ -129,7 +129,7 @@ def transform
#Use maybe like this: Transender::Ji.transform_and_zip(ahash) {|zip| render :text => zip}
def self.transform_and_zip(t={}, &block)
- zip = Ji.new(t).transform
+ zip = Ji.new(t).transformize
yield zip if block
end
Please sign in to comment.
Something went wrong with that request. Please try again.