-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile.rb
69 lines (57 loc) · 1.76 KB
/
Rakefile.rb
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
require 'rubygems'
require 'pathname'
require 'launchy'
__DIR__ = Pathname.new(__FILE__).dirname
$LOAD_PATH << __DIR__ unless $LOAD_PATH.include?(__DIR__)
task :default => "spec:all"
namespace :spec do
task :default => :all
task :prepare do
@specs= Pathname.glob(__DIR__ + "rspec" + "**" + "*.rb").join(' ')
p @specs
end
task :all => :prepare do
system "spec #{@specs}"
end
task :doc => :prepare do
system "spec #{@specs} --format specdoc"
end
end
task :example do#=> "spec:all" do
require 'lib/jabs'
examples = __DIR__ + "examples"
jabs = (examples + "input_with_default.js.jabs").read
jabs_en = Jabs::Engine.new(jabs)
js = jabs_en.render
target = examples + "input_with_default.js"
js_file = File.new(target, 'w')
js_file.write(js)
js_file.close
haml = (examples + "layout.html.haml").read
haml_en = Haml::Engine.new(haml)
html = haml_en.render :example => target
html_file = File.new("layout.html", 'w')
html_file.write(html)
html_file.close
browser = Launchy::Browser.new
browser.visit(target)
end
begin
require 'jeweler'
Jeweler::Tasks.new do |gemspec|
gemspec.name = "jabs"
gemspec.summary = "Javascript Abstract Behavior Syntax"
gemspec.description = "Inspiredby HAML, SASS and JABL by mr Hampton Catlin"
gemspec.email = "collintmiller@gmail.com"
gemspec.homepage = "http://github.com/collin/jabs"
gemspec.authors = ["Collin Miller"]
gemspec.executables << 'jabs'
gemspec.add_dependency('fold', '0.5.0')
gemspec.add_dependency('johnson', '1.1.2')
gemspec.add_dependency('colored', '1.1')
gemspec.add_dependency('rack', '1.0.1')
end
Jeweler::GemcutterTasks.new
rescue LoadError
puts "Jeweler not available. Install it with: sudo gem install jeweler"
end