-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
61 lines (54 loc) · 1.77 KB
/
Rakefile
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
require 'rake'
begin
require 'rspec/core'
require 'rspec/core/rake_task'
rescue MissingSourceFile
module RSpec
module Core
class RakeTask
def initialize(name)
task name do
# if rspec-rails is a configured gem, this will output helpful material and exit ...
require File.expand_path(File.dirname(__FILE__) + "/../../config/environment")
# ... otherwise, do this:
raise <<-MSG
#{"*" * 80}
* You are trying to run an rspec rake task defined in
* #{__FILE__},
* but rspec can not be found. Try running 'gem install rspec'.
#{"*" * 80}
MSG
end
end
end
end
end
end
Rake.application.instance_variable_get('@tasks').delete('default')
task :default => :spec
desc "Run all specs in spec directory"
RSpec::Core::RakeTask.new(:spec)
namespace :spec do
desc "Run all specs with rcov"
RSpec::Core::RakeTask.new(:coverage) do |t|
t.pattern = 'spec/**/*_spec.rb'
t.rcov = true
t.rcov_opts = %w{--exclude osx\/objc,gems\/,spec\/,features\/}
t.verbose = true
end
end
require "jeweler"
Jeweler::Tasks.new do |gemspec|
gemspec.name = "attr_encodable"
gemspec.summary = "An attribute black- or white-list for ActiveRecord serialization"
gemspec.files = Dir["{lib}/**/*", "LICENSE", "README.md"]
gemspec.description = %{
attr_encodable enables you to set up defaults for what is included or excluded when you serialize an ActiveRecord object. This is especially useful
for protecting private attributes when building a public API.
}
gemspec.email = "[email protected]"
gemspec.homepage = "http://github.com/Plinq/attr_encodable"
gemspec.authors = ["Flip Sasser"]
gemspec.test_files = Dir["{spec}/**/*"]
gemspec.add_development_dependency 'rspec', '>= 2.0'
end