rack-cat 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,3 +1,15 @@
1
+ require "rake/testtask"
2
+
3
+ task :test do
4
+ Rake::TestTask.new do |t|
5
+ t.libs << "test"
6
+ t.test_files = FileList['test/*_test.rb']
7
+ t.verbose = true
8
+ end
9
+ end
10
+
11
+ task :default => :test
12
+
1
13
  begin
2
14
  require 'jeweler'
3
15
  Jeweler::Tasks.new do |gem|
data/Readme CHANGED
@@ -1,10 +1,10 @@
1
1
  Rack::Cat
2
2
  =========
3
3
 
4
- A Rack middleware to concatenate your assets (static, dynamic and remote) to serve javascripts and stylesheets faster.
4
+ A Rack middleware to concatenate your assets (static, dynamic and remote) and serve javascripts and stylesheets faster.
5
5
 
6
6
  Currently it supports concatenating static files (read from disk) and dynamic pages (read from the app itself).
7
- Remote file support will become a reality when I find someone who needs it ;)
7
+ Remote file support will become reality when I find someone who needs it ;)
8
8
 
9
9
 
10
10
  Usage
@@ -43,4 +43,3 @@ License
43
43
  =======
44
44
 
45
45
  MIT
46
-
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.1.0
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rack-cat}
8
- s.version = "0.0.3"
8
+ s.version = "0.1.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jacek Becela"]
@@ -18,13 +18,22 @@ Gem::Specification.new do |s|
18
18
  "Readme",
19
19
  "VERSION",
20
20
  "lib/rack/cat.rb",
21
- "rack-cat.gemspec"
21
+ "rack-cat.gemspec",
22
+ "test/cat_test.rb",
23
+ "test/fixtures/bar/bar.txt",
24
+ "test/fixtures/baz.txt",
25
+ "test/fixtures/foo/foo.txt",
26
+ "test/test_helper.rb"
22
27
  ]
23
28
  s.homepage = %q{http://github.com/ncr/rack-cat}
24
29
  s.rdoc_options = ["--charset=UTF-8"]
25
30
  s.require_paths = ["lib"]
26
31
  s.rubygems_version = %q{1.3.6}
27
32
  s.summary = %q{Rack middleware to concatenate yor assets (static, dynamic and remote)}
33
+ s.test_files = [
34
+ "test/cat_test.rb",
35
+ "test/test_helper.rb"
36
+ ]
28
37
 
29
38
  if s.respond_to? :specification_version then
30
39
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
@@ -0,0 +1,22 @@
1
+ require "test_helper"
2
+ require "rack/cat"
3
+ require "fileutils"
4
+
5
+ class CatTest < Test::Unit::TestCase
6
+ test "concatentaion of static and dynamic files" do
7
+ env = Rack::MockRequest.env_for("/all.txt")
8
+ app = Rack::Cat.new(
9
+ lambda {|env| [200, {}, ["app"]]},
10
+ :sources => ["test/fixtures", "test/fixtures/foo"],
11
+ :bundles => {
12
+ "/all.txt" => ["/foo.txt", "/bar/bar.txt", "/baz.txt", "/app.txt"]
13
+ },
14
+ :destination => "test/fixtures/baz/public/"
15
+ )
16
+ app.call(env)
17
+
18
+ assert_equal "foo\nbar\nbaz\napp", File.read("test/fixtures/baz/public/all.txt")
19
+
20
+ FileUtils.rm_r("test/fixtures/baz")
21
+ end
22
+ end
@@ -0,0 +1 @@
1
+ bar
@@ -0,0 +1 @@
1
+ baz
@@ -0,0 +1 @@
1
+ foo
@@ -0,0 +1,7 @@
1
+ require "rubygems"
2
+
3
+ gem "test-unit", ">=2.0.0"
4
+
5
+ require "test/unit"
6
+ require "rack"
7
+ require "rack/mock"
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
+ - 1
7
8
  - 0
8
- - 3
9
- version: 0.0.3
9
+ version: 0.1.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jacek Becela
@@ -56,6 +56,11 @@ files:
56
56
  - VERSION
57
57
  - lib/rack/cat.rb
58
58
  - rack-cat.gemspec
59
+ - test/cat_test.rb
60
+ - test/fixtures/bar/bar.txt
61
+ - test/fixtures/baz.txt
62
+ - test/fixtures/foo/foo.txt
63
+ - test/test_helper.rb
59
64
  has_rdoc: true
60
65
  homepage: http://github.com/ncr/rack-cat
61
66
  licenses: []
@@ -86,5 +91,6 @@ rubygems_version: 1.3.6
86
91
  signing_key:
87
92
  specification_version: 3
88
93
  summary: Rack middleware to concatenate yor assets (static, dynamic and remote)
89
- test_files: []
90
-
94
+ test_files:
95
+ - test/cat_test.rb
96
+ - test/test_helper.rb