forked from KimNorgaard/validates_hostname
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
73 lines (63 loc) · 2.43 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
62
63
64
65
66
67
68
69
70
71
72
73
require 'rubygems'
require 'rake/testtask'
require 'rdoc/task'
require 'rubygems/package_task'
require 'rubygems/specification'
require 'rspec/core/rake_task'
require './lib/validates_hostname/version'
GEM_NAME = "validates_hostname"
GEM_VERSION = PAK::ValidatesHostname::VERSION
spec = Gem::Specification.new do |s|
s.name = GEM_NAME
s.version = GEM_VERSION
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Kim Nørgaard"]
s.description = 'Extension to ActiveRecord::Base for validating hostnames'
s.summary = 'Checks for valid hostnames'
s.email = 'jasen@jasen.dk'
s.extra_rdoc_files = ["README.rdoc", "CHANGELOG.rdoc", "MIT-LICENSE"]
s.files = ["validates_hostname.gemspec", "MIT-LICENSE", "CHANGELOG.rdoc", "README.rdoc", "Rakefile", "lib/validates_hostname", "lib/validates_hostname/version.rb", "lib/validates_hostname.rb"]
s.homepage = %q{https://github.com/KimNorgaard/validates_hostname}
s.licenses = 'MIT'
s.require_paths = ["lib"]
s.add_runtime_dependency 'activerecord', '>= 3.0'
s.add_runtime_dependency 'activesupport', '>= 3.0'
s.add_development_dependency 'rspec', '~> 3.0'
s.add_development_dependency 'rspec-rails'
s.add_development_dependency 'rails'
s.add_development_dependency 'sqlite3'
s.add_development_dependency 'pry-byebug'
s.add_development_dependency 'rspec-collection_matchers'
end
desc 'Test the validates_as_hostname gem/plugin.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.pattern = 'test/*_test.rb'
t.verbose = true
end
desc 'Default: run specs.'
task :default => :spec
desc "Run specs"
RSpec::Core::RakeTask.new do |t|
t.pattern = "./spec/**/*_spec.rb" # don't need this, it's default.
end
desc 'Generate documentation for plugin.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'ValidatesHostname'
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('lib/**/*.rb')
end
Gem::PackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
end
desc "Install the gem locally"
task :install => [:package] do
sh %{gem install pkg/#{GEM_NAME}-#{GEM_VERSION}}
end
desc "Create a gemspec file"
task :make_spec do
File.open("#{GEM_NAME}.gemspec", "w") do |file|
file.puts spec.to_ruby
end
end