forked from primer/octicons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
32 lines (27 loc) · 857 Bytes
/
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
require "rake/testtask"
require "rubocop/rake_task"
require "bundler/gem_tasks"
RuboCop::RakeTask.new(:lint) do |t|
t.options = ["--display-cop-names"]
end
task :version, [:v] do |t, args|
out = "module OcticonsHelper\n"\
" VERSION = \"#{args[:v]}\".freeze\n"\
"end"
File.open(File.expand_path("../lib/octicons_helper/version.rb", __FILE__), "w") do |file|
file.puts out
end
["octicons_helper.gemspec", "Gemfile"].each do |filename|
gs = File.read(File.expand_path("../#{filename}", __FILE__))
File.open(File.expand_path("../#{filename}", __FILE__), "w") do |file|
file.puts gs.gsub(/"octicons", "[^"]+"/, "\"octicons\", \"#{args[:v]}\"")
end
end
end
Rake::TestTask.new do |t|
t.libs = ["lib", "test"]
t.test_files = FileList["test/*_test.rb"]
t.warning = false
end
desc "Run tests"
task default: :test