File: Rakefile

package info (click to toggle)
ruby-rails-observers 0.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 268 kB
  • ctags: 233
  • sloc: ruby: 1,522; makefile: 2
file content (34 lines) | stat: -rw-r--r-- 839 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/env rake
require "bundler/gem_tasks"

require 'rake/testtask'

Rake::TestTask.new("test:regular") do |t|
  t.libs = ["test"]
  t.pattern = "test/*_test.rb"
  t.ruby_opts = ['-w']
end

Rake::TestTask.new("test:generators") do |t|
  t.libs = ["test"]
  t.pattern = "test/generators/*_test.rb"
  t.ruby_opts = ['-w']
end

task :default => :test
task :test => ['test:regular', 'test:generators']

specname = "rails-observers.gemspec"
deps = `git ls-files`.split("\n") - [specname]

file specname => deps do
  files       = `git ls-files`.split("\n")
  test_files  = `git ls-files -- {test,spec,features}/*`.split("\n")
  executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }

  require 'erb'

  File.open specname, 'w:utf-8' do |f|
    f.write ERB.new(File.read("#{specname}.erb")).result(binding)
  end
end