toolmantim-fancyviews 1.2 → 1.3

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,9 +1,11 @@
1
1
  task :default => :test
2
2
 
3
- desc "Run example test app"
4
- task :test do
5
- dir = File.dirname(__FILE__)
6
- system "cd #{dir} && ruby test/test.rb -p 2222"
3
+ %w(html4 html5).each do |version|
4
+ desc "Run example test app for #{version}"
5
+ task "test_#{version}" do
6
+ dir = File.dirname(__FILE__)
7
+ system "cd #{dir} && ruby test/#{version}.rb -p 2222"
8
+ end
7
9
  end
8
10
 
9
11
  begin
data/fancyviews.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "fancyviews"
3
3
  s.rubyforge_project = 'fancyviews'
4
- s.version = "1.2"
4
+ s.version = "1.3"
5
5
  s.summary = "Fancy Views"
6
6
  s.description = "Fancy Views"
7
7
  s.email = "myles@myles.id.au"
@@ -12,7 +12,8 @@ Gem::Specification.new do |s|
12
12
  Rakefile
13
13
  fancyviews.gemspec
14
14
  lib/sinatra/fancyviews.rb
15
- test/test.rb
15
+ test/html4.rb
16
+ test/html5.rb
16
17
  ]
17
18
  s.add_dependency("sinatra", [">= 0.9.1.1"])
18
19
  s.add_dependency("haml", [">= 2.2"])
@@ -75,7 +75,9 @@ module Sinatra
75
75
 
76
76
  rendered_styles = fancyviews.included_styles.map do |name, sass|
77
77
  # would be nice if construction took an :offest to go along with the :filename
78
- eng = Sass::Engine.new(imported + "\n" + sass, :attribute_syntax => :normal)
78
+ eng = Sass::Engine.new(imported + "\n" + sass,
79
+ :attribute_syntax => :normal,
80
+ :load_paths => [self.options.views])
79
81
  "\n/* -- #{name} -- */\n" + eng.render
80
82
  end.join
81
83
 
data/test/html4.rb ADDED
@@ -0,0 +1,33 @@
1
+ require 'rubygems'
2
+ require 'sinatra'
3
+ require File.dirname(__FILE__) + '/../lib/sinatra/fancyviews'
4
+
5
+ set :haml, :format => :html4
6
+
7
+ get('/') { page :home }
8
+
9
+ __END__
10
+
11
+ @@layout
12
+ !!!
13
+ %head
14
+ %title FancyTest
15
+ = styles :media => "screen, projection"
16
+ %body
17
+ = yield
18
+ = scripts
19
+
20
+ @@home
21
+ :style
22
+ body
23
+ :background-color goldenrod
24
+
25
+ :script
26
+ if (document.getElementsByTagName('style')[0].type != "text/css")
27
+ alert("Style tag doesn't have type = 'text/css'");
28
+ else if (document.getElementsByTagName('style')[0].media != "screen, projection")
29
+ alert("Style tag doesn't have media = 'screen, projection'");
30
+ else if (document.getElementsByTagName('script')[0].type != "text/javascript")
31
+ alert("Script tag doesn't have type = 'text/javascript'");
32
+ else
33
+ alert("All good!");
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toolmantim-fancyviews
3
3
  version: !ruby/object:Gem::Version
4
- version: "1.2"
4
+ version: "1.3"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Myles Byrne
@@ -44,7 +44,8 @@ files:
44
44
  - Rakefile
45
45
  - fancyviews.gemspec
46
46
  - lib/sinatra/fancyviews.rb
47
- - test/test.rb
47
+ - test/html4.rb
48
+ - test/html5.rb
48
49
  has_rdoc: false
49
50
  homepage:
50
51
  licenses: