forked from zmbush/coffeelint-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
53 lines (42 loc) · 981 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
require "bundler/gem_tasks"
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new('spec')
task :default => :spec
task :console do
sh "irb -rubygems -I lib -r coffeelint.rb"
end
task :cmd do
sh "ruby -I lib -- bin/coffeelint.rb"
end
task :prepare_coffeelint do
sh "git submodule init"
sh "git submodule update"
Dir.chdir('coffeelint') do
sh "npm install"
sh "npm run compile"
end
end
task :compile => [:prepare, :build]
task :prepare do
sh "git submodule init"
sh "git submodule update"
Dir.chdir('coffeelint') do
sh "npm install"
sh "npm run compile"
end
sh "rake spec"
end
def coffeelint_version
Dir.chdir('coffeelint') do
retval = `git describe`
retval.strip! || retval
end
end
task :update_readme do
readme_name = 'README.md'
readme = File.read(readme_name)
readme = readme.gsub(/(coffeelint version: )v[0-9.]+/, "\\1#{coffeelint_version}")
File.open(readme_name, 'w') do |f|
f.write(readme)
end
end