wbzyl-sinatra-static-assets 0.1.6 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.markdown CHANGED
@@ -200,5 +200,3 @@ respectively.
200
200
  2\. In order to create a virual host add the following to */etc/hosts/*:
201
201
 
202
202
  127.0.0.1 localhost.localdomain localhost hitch.local
203
-
204
- 3\. TODO: write tests
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
+ :patch: 1
2
3
  :major: 0
3
- :minor: 1
4
- :patch: 6
4
+ :minor: 2
@@ -3,7 +3,7 @@
3
3
  require 'rubygems'
4
4
  require 'sinatra'
5
5
 
6
- gem 'sinatra-static-assets'
6
+ gem 'wbzyl-sinatra-static-assets'
7
7
  require 'sinatra/static_assets'
8
8
 
9
9
  get "/?" do
@@ -1,7 +1,4 @@
1
- gem 'sinatra', '>=0.9.2'
2
1
  require 'sinatra/base'
3
-
4
- gem 'emk-sinatra-url-for', '>=0.2.1'
5
2
  require 'sinatra/url_for'
6
3
 
7
4
  module Sinatra
data/test/sinatra_app.rb CHANGED
@@ -1,3 +1,6 @@
1
+ path = File.expand_path("../lib" + File.dirname(__FILE__))
2
+ $:.unshift(path) unless $:.include?(path)
3
+
1
4
  require 'rubygems'
2
5
 
3
6
  require 'sinatra'
@@ -19,3 +22,24 @@ get "/image_tag" do
19
22
  #{image_tag("/images/foo.jpg", :alt => "[foo image]")}
20
23
  EOD
21
24
  end
25
+
26
+ get "/stylesheet_link_tag" do
27
+ content_type "text/plain"
28
+ <<"EOD"
29
+ #{stylesheet_link_tag("/stylesheets/winter.css", "/stylesheets/summer.css", :media => "projection")}
30
+ EOD
31
+ end
32
+
33
+ get "/javascript_script_tag" do
34
+ content_type "text/plain"
35
+ <<"EOD"
36
+ #{javascript_script_tag "/javascripts/summer.js", :charset => "iso-8859-2"}
37
+ EOD
38
+ end
39
+
40
+ get "/link_to_tag" do
41
+ content_type "text/plain"
42
+ <<"EOD"
43
+ #{link_to "Tatry Mountains Rescue Team", "/topr"}
44
+ EOD
45
+ end
@@ -21,7 +21,7 @@ http://example.org/bar/foo
21
21
  EOD
22
22
  end
23
23
 
24
- def test_image_tag_returns_absolute_paths_and_full_urls
24
+ def test_image_tag_returns_sub_uri
25
25
  get '/image_tag', {}, 'SCRIPT_NAME' => '/bar'
26
26
  assert last_response.ok?
27
27
  assert_equal last_response.body, <<EOD
@@ -29,11 +29,29 @@ EOD
29
29
  EOD
30
30
  end
31
31
 
32
+ def test_stylesheet_link_tag_returns_sub_uri
33
+ get '/stylesheet_link_tag', {}, 'SCRIPT_NAME' => '/bar'
34
+ assert last_response.ok?
35
+ assert_equal last_response.body, <<EOD
36
+ <link charset="utf-8" href="/bar/stylesheets/winter.css" media="projection" rel="stylesheet" type="text/css">
37
+ <link charset="utf-8" href="/bar/stylesheets/summer.css" media="projection" rel="stylesheet" type="text/css">
38
+ EOD
39
+ end
40
+
41
+ def test_javascript_script_tag_returns_sub_uri
42
+ get '/javascript_script_tag', {}, 'SCRIPT_NAME' => '/bar'
43
+ assert last_response.ok?
44
+ assert_equal last_response.body, <<EOD
45
+ <script charset="iso-8859-2" src="/bar/javascripts/summer.js" type="text/javascript"></script>
46
+ EOD
47
+ end
48
+
49
+ def test_link_to_tag_returns_sub_uri
50
+ get '/link_to_tag', {}, 'SCRIPT_NAME' => '/bar'
51
+ assert last_response.ok?
52
+ assert_equal last_response.body, <<EOD
53
+ <a href='/bar/topr'>Tatry Mountains Rescue Team</a>
54
+ EOD
55
+ end
32
56
 
33
57
  end
34
-
35
- __END__
36
-
37
- stylesheet_link_tag "/stylesheets/screen.css", "/stylesheets/summer.css", :media => "projection"
38
- javascript_script_tag "/javascripts/jquery.js", "/javascripts/summer.js", :charset => "iso-8859-2"
39
- link_to "Tatry Mountains Rescue Team", "/topr"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wbzyl-sinatra-static-assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wlodek Bzyl
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-07-05 00:00:00 -07:00
12
+ date: 2009-07-26 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -62,7 +62,6 @@ extra_rdoc_files:
62
62
  - LICENSE
63
63
  - README.markdown
64
64
  files:
65
- - TODO
66
65
  - VERSION.yml
67
66
  - examples/rconfig.ru
68
67
  - examples/rsummer/config.ru
data/TODO DELETED
File without changes