slinky 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +2 -1
- data/Gemfile +17 -17
- data/README.md +35 -15
- data/VERSION +1 -1
- data/lib/slinky/listener.rb +3 -3
- data/lib/slinky/runner.rb +8 -2
- data/lib/slinky/server.rb +16 -5
- data/slinky.gemspec +57 -56
- data/spec/slinky_spec.rb +15 -2
- data/spec/spec_helper.rb +75 -14
- metadata +76 -115
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 889ff2fbc318014fa07dc0a6b6ec58f6836e8154
|
4
|
+
data.tar.gz: e9ae1e023ceeb1f07ce8c8950f279a52d1f6e048
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4b072781ffd19338d0685a2bf3cd0d25545343ec88d92de5aa3463afbcf992b23034639ad3792efe47a510d6db371fbd2d6cc9a4c2e9cc2078bae9d3cd98b513
|
7
|
+
data.tar.gz: 9ea118ef3f70d8708fa85547029ffec8023b798e09ca8dc701111927c634bdb0a96ad8ec660070bcada4c6933dd83dc06faab7e6462024884bb6cd08fee938de
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -1,25 +1,25 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
2
|
|
3
3
|
# main gems
|
4
|
-
gem "eventmachine", "
|
5
|
-
gem "eventmachine_httpserver", "
|
6
|
-
gem "em-websocket", "~> 0.3
|
7
|
-
gem "em-proxy", "
|
8
|
-
gem "rainbow", "
|
9
|
-
gem "mime-types", "
|
10
|
-
gem "yui-compressor", "
|
11
|
-
gem "listen", "
|
4
|
+
gem "eventmachine", "~> 1.0"
|
5
|
+
gem "eventmachine_httpserver", "~> 0.2"
|
6
|
+
gem "em-websocket", "~> 0.3"
|
7
|
+
gem "em-proxy", "~> 0.1"
|
8
|
+
gem "rainbow", "~> 1.1"
|
9
|
+
gem "mime-types", "~> 1.16"
|
10
|
+
gem "yui-compressor", "~> 0.12"
|
11
|
+
gem "listen", "~> 2.4"
|
12
12
|
|
13
13
|
# compilation support gems
|
14
|
-
gem "haml", "
|
15
|
-
gem "sass", "
|
16
|
-
gem "coffee-script", "
|
14
|
+
gem "haml", "~> 3.1"
|
15
|
+
gem "sass", "~> 3.1"
|
16
|
+
gem "coffee-script", "~> 2.2"
|
17
17
|
|
18
18
|
group :development do
|
19
|
-
gem "rspec", "~> 2.10
|
20
|
-
gem "yard", "~> 0.
|
21
|
-
gem "bundler", "
|
22
|
-
gem "jeweler", "~> 1.8
|
23
|
-
gem "fakefs", '~> 0.
|
24
|
-
gem "em-http-request", '~> 1.0
|
19
|
+
gem "rspec", "~> 2.10"
|
20
|
+
gem "yard", "~> 0.8"
|
21
|
+
gem "bundler", "~> 1.5"
|
22
|
+
gem "jeweler", "~> 1.8"
|
23
|
+
gem "fakefs", '~> 0.5', :require => "fakefs/safe"
|
24
|
+
gem "em-http-request", '~> 1.0'
|
25
25
|
end
|
data/README.md
CHANGED
@@ -10,19 +10,17 @@ leaving you ready to push to production.
|
|
10
10
|
|
11
11
|
[![Build Status](https://secure.travis-ci.org/mwylde/slinky.png)](http://travis-ci.org/mwylde/slinky)
|
12
12
|
|
13
|
-
What can slinky do for you?
|
13
|
+
#### What can slinky do for you?
|
14
14
|
|
15
|
-
|
15
|
+
##### Slinky Server
|
16
16
|
|
17
|
-
* Transparently compiles sources for a variety of languages
|
18
|
-
supported: CoffeeScript, ClojureScript, SASS/SCSS, LESS, HAML)
|
17
|
+
* Transparently compiles sources for a variety of languages
|
19
18
|
* Supports the [LiveReload](http://livereload.com) protocol, for
|
20
19
|
instant browser updates
|
21
|
-
*
|
22
|
-
and server code separately
|
20
|
+
* Includes a customizable proxy, so your dev environment can mirror production
|
23
21
|
* Includes support for HTML5 [pushState](https://developer.mozilla.org/en-US/docs/DOM/Manipulating_the_browser_history) based apps
|
24
22
|
|
25
|
-
|
23
|
+
##### Slinky Builder
|
26
24
|
|
27
25
|
* Keeps track of the proper include order of your scripts and styles
|
28
26
|
* Compiles, minifies and concatenates JavaScript and CSS
|
@@ -45,14 +43,36 @@ $ scp -r ../pub/ myserver.com:/var/www/project
|
|
45
43
|
|
46
44
|
## The details
|
47
45
|
|
48
|
-
1. [
|
49
|
-
2. [
|
50
|
-
3. [
|
51
|
-
4. [
|
52
|
-
5. [
|
53
|
-
6. [
|
54
|
-
7. [
|
55
|
-
8. [
|
46
|
+
1. [Transparent compilation](#transparent-compilation)
|
47
|
+
2. [LiveReload/Guard support](#livereloadguard-support)
|
48
|
+
3. [Script & style management](#script--style-management)
|
49
|
+
4. [Specifying order](#specifying-order)
|
50
|
+
5. [Dependencies](#dependencies)
|
51
|
+
6. [Configuration](#configuration)
|
52
|
+
7. [PushState](#pushstate)
|
53
|
+
8. [Proxies](#proxies)
|
54
|
+
9. [Ignores](#ignores)
|
55
|
+
|
56
|
+
### Transparent compilation
|
57
|
+
|
58
|
+
The Slinky server will transparently compile various front-end languages
|
59
|
+
for you, providing a smooth transition from development to production.
|
60
|
+
What does this mean? When Slinky sees a request for a file that doesn't
|
61
|
+
exist (say, "/scripts/core.js") it will look for a file that can be compiled
|
62
|
+
into that ("/scripts/core.coffee"), compile it, then return the result. This
|
63
|
+
allows you to write code without concern for which files are "native"
|
64
|
+
and which need compilation.
|
65
|
+
|
66
|
+
Currently supported languages include:
|
67
|
+
|
68
|
+
* CoffeeScript
|
69
|
+
* HAML
|
70
|
+
* SASS/SCSS
|
71
|
+
* LESS
|
72
|
+
* ClojureScript (experimental)
|
73
|
+
|
74
|
+
Adding support for new languages is simple, and pull requests are welcome.
|
75
|
+
|
56
76
|
|
57
77
|
### LiveReload/Guard support
|
58
78
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.1
|
data/lib/slinky/listener.rb
CHANGED
@@ -8,8 +8,7 @@ module Slinky
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def run
|
11
|
-
listener = Listen.to(@manifest.dir)
|
12
|
-
listener.change do |mod, add, rem|
|
11
|
+
listener = Listen.to(@manifest.dir) do |mod, add, rem|
|
13
12
|
handle_mod(mod) if mod.size > 0
|
14
13
|
handle_add(add) if add.size > 0
|
15
14
|
|
@@ -29,7 +28,8 @@ module Slinky
|
|
29
28
|
|
30
29
|
handle_rem(rem) if rem.size > 0
|
31
30
|
end
|
32
|
-
listener.start
|
31
|
+
listener.start
|
32
|
+
listener
|
33
33
|
end
|
34
34
|
|
35
35
|
def handle_mod files
|
data/lib/slinky/runner.rb
CHANGED
@@ -60,8 +60,6 @@ module Slinky
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def command_start
|
63
|
-
Signal.trap('INT') { puts "Slinky fading away ... "; exit(0); }
|
64
|
-
|
65
63
|
EM::run {
|
66
64
|
@config ||= Config.empty
|
67
65
|
|
@@ -88,6 +86,14 @@ module Slinky
|
|
88
86
|
end
|
89
87
|
|
90
88
|
Listener.new(manifest, livereload).run
|
89
|
+
|
90
|
+
Signal.trap('INT') {
|
91
|
+
Listen.stop
|
92
|
+
EM::stop
|
93
|
+
puts "Slinky fading away ... "
|
94
|
+
exit(0)
|
95
|
+
}
|
96
|
+
|
91
97
|
puts "Started static file server on port #{port}"
|
92
98
|
}
|
93
99
|
end
|
data/lib/slinky/server.rb
CHANGED
@@ -38,13 +38,20 @@ module Slinky
|
|
38
38
|
def self.process_path resp, path, pushstate = false
|
39
39
|
file = manifest.find_by_path(path).first
|
40
40
|
if file.is_a? ManifestDir
|
41
|
-
file = manifest.find_by_path(path+"/index.html").first
|
41
|
+
file = manifest.find_by_path(path + "/index.html").first
|
42
|
+
path += "/index.html"
|
42
43
|
end
|
43
44
|
|
44
45
|
resp.content_type MIME::Types.type_for(path).first
|
45
46
|
|
46
47
|
if file
|
47
|
-
|
48
|
+
if file.source.end_with?(path)
|
49
|
+
# They're requesting the source file and we should just
|
50
|
+
# return it
|
51
|
+
serve_file(resp, file.source)
|
52
|
+
else
|
53
|
+
handle_file(resp, file)
|
54
|
+
end
|
48
55
|
elsif !pushstate && p = config.pushstate_for_path("/" + path)
|
49
56
|
path = p[0] == "/" ? p[1..-1] : p
|
50
57
|
self.process_path(resp, path, true)
|
@@ -56,9 +63,13 @@ module Slinky
|
|
56
63
|
|
57
64
|
# Takes a manifest file and produces a response for it
|
58
65
|
def self.handle_file resp, mf
|
59
|
-
|
60
|
-
|
61
|
-
|
66
|
+
begin
|
67
|
+
if path = mf.process
|
68
|
+
serve_file resp, path.to_s
|
69
|
+
else
|
70
|
+
raise StandardError.new
|
71
|
+
end
|
72
|
+
rescue
|
62
73
|
resp.status = 500
|
63
74
|
resp.content = "Error compiling #{mf.source}\n"
|
64
75
|
end
|
data/slinky.gemspec
CHANGED
@@ -2,14 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: slinky 0.7.1 ruby lib
|
5
6
|
|
6
7
|
Gem::Specification.new do |s|
|
7
8
|
s.name = "slinky"
|
8
|
-
s.version = "0.7.
|
9
|
+
s.version = "0.7.1"
|
9
10
|
|
10
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib"]
|
11
13
|
s.authors = ["Micah Wylde"]
|
12
|
-
s.date = "
|
14
|
+
s.date = "2014-03-30"
|
13
15
|
s.description = "A static file server for rich web apps that automatically compiles SASS, HAML, CoffeeScript and more"
|
14
16
|
s.email = "micah@micahw.com"
|
15
17
|
s.executables = ["slinky"]
|
@@ -50,68 +52,67 @@ Gem::Specification.new do |s|
|
|
50
52
|
]
|
51
53
|
s.homepage = "http://mwylde.github.com/slinky/"
|
52
54
|
s.licenses = ["MIT"]
|
53
|
-
s.
|
54
|
-
s.rubygems_version = "1.8.24"
|
55
|
+
s.rubygems_version = "2.2.2"
|
55
56
|
s.summary = "Static file server for javascript apps"
|
56
57
|
|
57
58
|
if s.respond_to? :specification_version then
|
58
|
-
s.specification_version =
|
59
|
+
s.specification_version = 4
|
59
60
|
|
60
61
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
61
|
-
s.add_runtime_dependency(%q<eventmachine>, ["
|
62
|
-
s.add_runtime_dependency(%q<eventmachine_httpserver>, ["
|
63
|
-
s.add_runtime_dependency(%q<em-websocket>, ["~> 0.3
|
64
|
-
s.add_runtime_dependency(%q<em-proxy>, ["
|
65
|
-
s.add_runtime_dependency(%q<rainbow>, ["
|
66
|
-
s.add_runtime_dependency(%q<mime-types>, ["
|
67
|
-
s.add_runtime_dependency(%q<yui-compressor>, ["
|
68
|
-
s.add_runtime_dependency(%q<listen>, ["
|
69
|
-
s.add_runtime_dependency(%q<haml>, ["
|
70
|
-
s.add_runtime_dependency(%q<sass>, ["
|
71
|
-
s.add_runtime_dependency(%q<coffee-script>, ["
|
72
|
-
s.add_development_dependency(%q<rspec>, ["~> 2.10
|
73
|
-
s.add_development_dependency(%q<yard>, ["~> 0.
|
74
|
-
s.add_development_dependency(%q<bundler>, ["
|
75
|
-
s.add_development_dependency(%q<jeweler>, ["~> 1.8
|
76
|
-
s.add_development_dependency(%q<fakefs>, ["~> 0.
|
77
|
-
s.add_development_dependency(%q<em-http-request>, ["~> 1.0
|
62
|
+
s.add_runtime_dependency(%q<eventmachine>, ["~> 1.0"])
|
63
|
+
s.add_runtime_dependency(%q<eventmachine_httpserver>, ["~> 0.2"])
|
64
|
+
s.add_runtime_dependency(%q<em-websocket>, ["~> 0.3"])
|
65
|
+
s.add_runtime_dependency(%q<em-proxy>, ["~> 0.1"])
|
66
|
+
s.add_runtime_dependency(%q<rainbow>, ["~> 1.1"])
|
67
|
+
s.add_runtime_dependency(%q<mime-types>, ["~> 1.16"])
|
68
|
+
s.add_runtime_dependency(%q<yui-compressor>, ["~> 0.12"])
|
69
|
+
s.add_runtime_dependency(%q<listen>, ["~> 2.4"])
|
70
|
+
s.add_runtime_dependency(%q<haml>, ["~> 3.1"])
|
71
|
+
s.add_runtime_dependency(%q<sass>, ["~> 3.1"])
|
72
|
+
s.add_runtime_dependency(%q<coffee-script>, ["~> 2.2"])
|
73
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.10"])
|
74
|
+
s.add_development_dependency(%q<yard>, ["~> 0.8"])
|
75
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.5"])
|
76
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.8"])
|
77
|
+
s.add_development_dependency(%q<fakefs>, ["~> 0.5"])
|
78
|
+
s.add_development_dependency(%q<em-http-request>, ["~> 1.0"])
|
78
79
|
else
|
79
|
-
s.add_dependency(%q<eventmachine>, ["
|
80
|
-
s.add_dependency(%q<eventmachine_httpserver>, ["
|
81
|
-
s.add_dependency(%q<em-websocket>, ["~> 0.3
|
82
|
-
s.add_dependency(%q<em-proxy>, ["
|
83
|
-
s.add_dependency(%q<rainbow>, ["
|
84
|
-
s.add_dependency(%q<mime-types>, ["
|
85
|
-
s.add_dependency(%q<yui-compressor>, ["
|
86
|
-
s.add_dependency(%q<listen>, ["
|
87
|
-
s.add_dependency(%q<haml>, ["
|
88
|
-
s.add_dependency(%q<sass>, ["
|
89
|
-
s.add_dependency(%q<coffee-script>, ["
|
90
|
-
s.add_dependency(%q<rspec>, ["~> 2.10
|
91
|
-
s.add_dependency(%q<yard>, ["~> 0.
|
92
|
-
s.add_dependency(%q<bundler>, ["
|
93
|
-
s.add_dependency(%q<jeweler>, ["~> 1.8
|
94
|
-
s.add_dependency(%q<fakefs>, ["~> 0.
|
95
|
-
s.add_dependency(%q<em-http-request>, ["~> 1.0
|
80
|
+
s.add_dependency(%q<eventmachine>, ["~> 1.0"])
|
81
|
+
s.add_dependency(%q<eventmachine_httpserver>, ["~> 0.2"])
|
82
|
+
s.add_dependency(%q<em-websocket>, ["~> 0.3"])
|
83
|
+
s.add_dependency(%q<em-proxy>, ["~> 0.1"])
|
84
|
+
s.add_dependency(%q<rainbow>, ["~> 1.1"])
|
85
|
+
s.add_dependency(%q<mime-types>, ["~> 1.16"])
|
86
|
+
s.add_dependency(%q<yui-compressor>, ["~> 0.12"])
|
87
|
+
s.add_dependency(%q<listen>, ["~> 2.4"])
|
88
|
+
s.add_dependency(%q<haml>, ["~> 3.1"])
|
89
|
+
s.add_dependency(%q<sass>, ["~> 3.1"])
|
90
|
+
s.add_dependency(%q<coffee-script>, ["~> 2.2"])
|
91
|
+
s.add_dependency(%q<rspec>, ["~> 2.10"])
|
92
|
+
s.add_dependency(%q<yard>, ["~> 0.8"])
|
93
|
+
s.add_dependency(%q<bundler>, ["~> 1.5"])
|
94
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8"])
|
95
|
+
s.add_dependency(%q<fakefs>, ["~> 0.5"])
|
96
|
+
s.add_dependency(%q<em-http-request>, ["~> 1.0"])
|
96
97
|
end
|
97
98
|
else
|
98
|
-
s.add_dependency(%q<eventmachine>, ["
|
99
|
-
s.add_dependency(%q<eventmachine_httpserver>, ["
|
100
|
-
s.add_dependency(%q<em-websocket>, ["~> 0.3
|
101
|
-
s.add_dependency(%q<em-proxy>, ["
|
102
|
-
s.add_dependency(%q<rainbow>, ["
|
103
|
-
s.add_dependency(%q<mime-types>, ["
|
104
|
-
s.add_dependency(%q<yui-compressor>, ["
|
105
|
-
s.add_dependency(%q<listen>, ["
|
106
|
-
s.add_dependency(%q<haml>, ["
|
107
|
-
s.add_dependency(%q<sass>, ["
|
108
|
-
s.add_dependency(%q<coffee-script>, ["
|
109
|
-
s.add_dependency(%q<rspec>, ["~> 2.10
|
110
|
-
s.add_dependency(%q<yard>, ["~> 0.
|
111
|
-
s.add_dependency(%q<bundler>, ["
|
112
|
-
s.add_dependency(%q<jeweler>, ["~> 1.8
|
113
|
-
s.add_dependency(%q<fakefs>, ["~> 0.
|
114
|
-
s.add_dependency(%q<em-http-request>, ["~> 1.0
|
99
|
+
s.add_dependency(%q<eventmachine>, ["~> 1.0"])
|
100
|
+
s.add_dependency(%q<eventmachine_httpserver>, ["~> 0.2"])
|
101
|
+
s.add_dependency(%q<em-websocket>, ["~> 0.3"])
|
102
|
+
s.add_dependency(%q<em-proxy>, ["~> 0.1"])
|
103
|
+
s.add_dependency(%q<rainbow>, ["~> 1.1"])
|
104
|
+
s.add_dependency(%q<mime-types>, ["~> 1.16"])
|
105
|
+
s.add_dependency(%q<yui-compressor>, ["~> 0.12"])
|
106
|
+
s.add_dependency(%q<listen>, ["~> 2.4"])
|
107
|
+
s.add_dependency(%q<haml>, ["~> 3.1"])
|
108
|
+
s.add_dependency(%q<sass>, ["~> 3.1"])
|
109
|
+
s.add_dependency(%q<coffee-script>, ["~> 2.2"])
|
110
|
+
s.add_dependency(%q<rspec>, ["~> 2.10"])
|
111
|
+
s.add_dependency(%q<yard>, ["~> 0.8"])
|
112
|
+
s.add_dependency(%q<bundler>, ["~> 1.5"])
|
113
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8"])
|
114
|
+
s.add_dependency(%q<fakefs>, ["~> 0.5"])
|
115
|
+
s.add_dependency(%q<em-http-request>, ["~> 1.0"])
|
115
116
|
end
|
116
117
|
end
|
117
118
|
|
data/spec/slinky_spec.rb
CHANGED
@@ -345,6 +345,11 @@ describe "Slinky" do
|
|
345
345
|
@resp.content.should == File.read("/src/l1/test.js")
|
346
346
|
end
|
347
347
|
|
348
|
+
it "should serve source files" do
|
349
|
+
Slinky::Server.serve_file @resp, "/src/l1/l2/test3.coffee"
|
350
|
+
@resp.content.should == File.read("/src/l1/l2/test3.coffee")
|
351
|
+
end
|
352
|
+
|
348
353
|
it "should serve 404s" do
|
349
354
|
@resp.should_receive(:status=).with(404)
|
350
355
|
Slinky::Server.serve_file @resp, "/src/asdf/faljshd"
|
@@ -425,6 +430,14 @@ eos
|
|
425
430
|
end
|
426
431
|
end
|
427
432
|
|
433
|
+
it "should not crash for syntax errors" do
|
434
|
+
File.open("/src/bad_file.haml", "w+"){|f| f.write("%head{") }
|
435
|
+
mf = Slinky::ManifestFile.new("/src/bad_file.haml", nil, @mdevel)
|
436
|
+
$stderr.should_receive(:puts).with(/Failed on/)
|
437
|
+
@resp.should_receive(:status=).with(500)
|
438
|
+
Slinky::Server.handle_file @resp, mf
|
439
|
+
end
|
440
|
+
|
428
441
|
it "should serve files for realz" do
|
429
442
|
$stdout.should_receive(:puts).with(/Started static file server on port 43453/)
|
430
443
|
@results = []
|
@@ -435,7 +448,7 @@ eos
|
|
435
448
|
slinky_scripts
|
436
449
|
slinky_styles
|
437
450
|
%body
|
438
|
-
h1
|
451
|
+
%h1 index
|
439
452
|
eos
|
440
453
|
}
|
441
454
|
run_for 3 do
|
@@ -451,7 +464,7 @@ eos
|
|
451
464
|
rs = [multi.responses[:callback][:index], multi.responses[:callback][:base]]
|
452
465
|
rs.compact.size.should == 2
|
453
466
|
rs.each{|r|
|
454
|
-
r.response.include?("index").should == true
|
467
|
+
r.response.include?("<h1>index</h1>").should == true
|
455
468
|
}
|
456
469
|
multi.responses[:errback].size.should == 0
|
457
470
|
EM.stop_event_loop
|
data/spec/spec_helper.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
2
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
+
|
4
|
+
require 'bundler/setup'
|
3
5
|
require 'rspec'
|
4
6
|
require 'slinky'
|
5
7
|
require 'fakefs/safe'
|
@@ -10,22 +12,62 @@ require 'open-uri'
|
|
10
12
|
# in ./support/ and its subdirectories.
|
11
13
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
12
14
|
|
13
|
-
|
15
|
+
# Monkeypath to fix Tempfile creation in Ruby 2.1
|
16
|
+
# (https://github.com/defunkt/fakefs/pull/227)
|
14
17
|
module FakeFS
|
15
|
-
class File
|
16
|
-
def self.absolute_path(*args)
|
17
|
-
RealFile.absolute_path(*args)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
# Neccessary to fix a problem between FakeFS and Tempfile
|
22
18
|
class Dir
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
19
|
+
if RUBY_VERSION >= '2.1'
|
20
|
+
module Tmpname # :nodoc:
|
21
|
+
module_function
|
22
|
+
|
23
|
+
def tmpdir
|
24
|
+
Dir.tmpdir
|
25
|
+
end
|
26
|
+
|
27
|
+
def make_tmpname(prefix_suffix, n)
|
28
|
+
case prefix_suffix
|
29
|
+
when String
|
30
|
+
prefix = prefix_suffix
|
31
|
+
suffix = ""
|
32
|
+
when Array
|
33
|
+
prefix = prefix_suffix[0]
|
34
|
+
suffix = prefix_suffix[1]
|
35
|
+
else
|
36
|
+
raise ArgumentError, "unexpected prefix_suffix: #{prefix_suffix.inspect}"
|
37
|
+
end
|
38
|
+
t = Time.now.strftime("%Y%m%d")
|
39
|
+
path = "#{prefix}#{t}-#{$$}-#{rand(0x100000000).to_s(36)}"
|
40
|
+
path << "-#{n}" if n
|
41
|
+
path << suffix
|
42
|
+
end
|
43
|
+
|
44
|
+
def create(basename, *rest)
|
45
|
+
if opts = Hash.try_convert(rest[-1])
|
46
|
+
opts = opts.dup if rest.pop.equal?(opts)
|
47
|
+
max_try = opts.delete(:max_try)
|
48
|
+
opts = [opts]
|
49
|
+
else
|
50
|
+
opts = []
|
51
|
+
end
|
52
|
+
tmpdir, = *rest
|
53
|
+
if $SAFE > 0 and tmpdir.tainted?
|
54
|
+
tmpdir = '/tmp'
|
55
|
+
else
|
56
|
+
tmpdir ||= tmpdir()
|
57
|
+
end
|
58
|
+
n = nil
|
59
|
+
begin
|
60
|
+
path = File.join(tmpdir, make_tmpname(basename, n))
|
61
|
+
yield(path, n, *opts)
|
62
|
+
rescue Errno::EEXIST
|
63
|
+
n ||= 0
|
64
|
+
n += 1
|
65
|
+
retry if !max_try or n < max_try
|
66
|
+
raise "cannot generate temporary name using `#{basename}' under `#{tmpdir}'"
|
67
|
+
end
|
68
|
+
path
|
69
|
+
end
|
70
|
+
end
|
29
71
|
end
|
30
72
|
end
|
31
73
|
end
|
@@ -54,6 +96,24 @@ module Slinky
|
|
54
96
|
end
|
55
97
|
end
|
56
98
|
|
99
|
+
# Compressors don't work under FakeFS
|
100
|
+
class FakeCompressor
|
101
|
+
def compress s
|
102
|
+
s
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
class Manifest
|
107
|
+
alias :old_compress :compress
|
108
|
+
def compress ext, output, compressor
|
109
|
+
if block_given?
|
110
|
+
old_compress ext, output, FakeCompressor.new, &Proc.new
|
111
|
+
else
|
112
|
+
old_compress ext, output, FakeCompressor.new
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
57
117
|
# No way to make this work with FakeFS, so just disabled it
|
58
118
|
class Listener
|
59
119
|
def run; end
|
@@ -74,6 +134,7 @@ RSpec.configure do |config|
|
|
74
134
|
@config = Slinky::ConfigReader.empty
|
75
135
|
end
|
76
136
|
config.before :each do
|
137
|
+
FakeFS.activate!
|
77
138
|
FileUtils.rm_rf("/src") rescue nil
|
78
139
|
FileUtils.mkdir("/src")
|
79
140
|
FileUtils.mkdir_p("/src/l1/l2/l3")
|
metadata
CHANGED
@@ -1,288 +1,253 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slinky
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
5
|
-
prerelease:
|
4
|
+
version: 0.7.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Micah Wylde
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-03-30 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: eventmachine
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
19
|
+
version: '1.0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
26
|
+
version: '1.0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: eventmachine_httpserver
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - "~>"
|
36
32
|
- !ruby/object:Gem::Version
|
37
|
-
version: 0.2
|
33
|
+
version: '0.2'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - "~>"
|
44
39
|
- !ruby/object:Gem::Version
|
45
|
-
version: 0.2
|
40
|
+
version: '0.2'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: em-websocket
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- - ~>
|
45
|
+
- - "~>"
|
52
46
|
- !ruby/object:Gem::Version
|
53
|
-
version: 0.3
|
47
|
+
version: '0.3'
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- - ~>
|
52
|
+
- - "~>"
|
60
53
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.3
|
54
|
+
version: '0.3'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: em-proxy
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - "~>"
|
68
60
|
- !ruby/object:Gem::Version
|
69
|
-
version: 0.1
|
61
|
+
version: '0.1'
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - "~>"
|
76
67
|
- !ruby/object:Gem::Version
|
77
|
-
version: 0.1
|
68
|
+
version: '0.1'
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: rainbow
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
|
-
- -
|
73
|
+
- - "~>"
|
84
74
|
- !ruby/object:Gem::Version
|
85
|
-
version: 1.1
|
75
|
+
version: '1.1'
|
86
76
|
type: :runtime
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
|
-
- -
|
80
|
+
- - "~>"
|
92
81
|
- !ruby/object:Gem::Version
|
93
|
-
version: 1.1
|
82
|
+
version: '1.1'
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: mime-types
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
|
-
- -
|
87
|
+
- - "~>"
|
100
88
|
- !ruby/object:Gem::Version
|
101
89
|
version: '1.16'
|
102
90
|
type: :runtime
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
|
-
- -
|
94
|
+
- - "~>"
|
108
95
|
- !ruby/object:Gem::Version
|
109
96
|
version: '1.16'
|
110
97
|
- !ruby/object:Gem::Dependency
|
111
98
|
name: yui-compressor
|
112
99
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
100
|
requirements:
|
115
|
-
- -
|
101
|
+
- - "~>"
|
116
102
|
- !ruby/object:Gem::Version
|
117
|
-
version: 0.
|
103
|
+
version: '0.12'
|
118
104
|
type: :runtime
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
107
|
requirements:
|
123
|
-
- -
|
108
|
+
- - "~>"
|
124
109
|
- !ruby/object:Gem::Version
|
125
|
-
version: 0.
|
110
|
+
version: '0.12'
|
126
111
|
- !ruby/object:Gem::Dependency
|
127
112
|
name: listen
|
128
113
|
requirement: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
114
|
requirements:
|
131
|
-
- -
|
115
|
+
- - "~>"
|
132
116
|
- !ruby/object:Gem::Version
|
133
|
-
version:
|
117
|
+
version: '2.4'
|
134
118
|
type: :runtime
|
135
119
|
prerelease: false
|
136
120
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
none: false
|
138
121
|
requirements:
|
139
|
-
- -
|
122
|
+
- - "~>"
|
140
123
|
- !ruby/object:Gem::Version
|
141
|
-
version:
|
124
|
+
version: '2.4'
|
142
125
|
- !ruby/object:Gem::Dependency
|
143
126
|
name: haml
|
144
127
|
requirement: !ruby/object:Gem::Requirement
|
145
|
-
none: false
|
146
128
|
requirements:
|
147
|
-
- -
|
129
|
+
- - "~>"
|
148
130
|
- !ruby/object:Gem::Version
|
149
|
-
version: 3.
|
131
|
+
version: '3.1'
|
150
132
|
type: :runtime
|
151
133
|
prerelease: false
|
152
134
|
version_requirements: !ruby/object:Gem::Requirement
|
153
|
-
none: false
|
154
135
|
requirements:
|
155
|
-
- -
|
136
|
+
- - "~>"
|
156
137
|
- !ruby/object:Gem::Version
|
157
|
-
version: 3.
|
138
|
+
version: '3.1'
|
158
139
|
- !ruby/object:Gem::Dependency
|
159
140
|
name: sass
|
160
141
|
requirement: !ruby/object:Gem::Requirement
|
161
|
-
none: false
|
162
142
|
requirements:
|
163
|
-
- -
|
143
|
+
- - "~>"
|
164
144
|
- !ruby/object:Gem::Version
|
165
|
-
version: 3.1
|
145
|
+
version: '3.1'
|
166
146
|
type: :runtime
|
167
147
|
prerelease: false
|
168
148
|
version_requirements: !ruby/object:Gem::Requirement
|
169
|
-
none: false
|
170
149
|
requirements:
|
171
|
-
- -
|
150
|
+
- - "~>"
|
172
151
|
- !ruby/object:Gem::Version
|
173
|
-
version: 3.1
|
152
|
+
version: '3.1'
|
174
153
|
- !ruby/object:Gem::Dependency
|
175
154
|
name: coffee-script
|
176
155
|
requirement: !ruby/object:Gem::Requirement
|
177
|
-
none: false
|
178
156
|
requirements:
|
179
|
-
- -
|
157
|
+
- - "~>"
|
180
158
|
- !ruby/object:Gem::Version
|
181
|
-
version: 2.2
|
159
|
+
version: '2.2'
|
182
160
|
type: :runtime
|
183
161
|
prerelease: false
|
184
162
|
version_requirements: !ruby/object:Gem::Requirement
|
185
|
-
none: false
|
186
163
|
requirements:
|
187
|
-
- -
|
164
|
+
- - "~>"
|
188
165
|
- !ruby/object:Gem::Version
|
189
|
-
version: 2.2
|
166
|
+
version: '2.2'
|
190
167
|
- !ruby/object:Gem::Dependency
|
191
168
|
name: rspec
|
192
169
|
requirement: !ruby/object:Gem::Requirement
|
193
|
-
none: false
|
194
170
|
requirements:
|
195
|
-
- - ~>
|
171
|
+
- - "~>"
|
196
172
|
- !ruby/object:Gem::Version
|
197
|
-
version: 2.10
|
173
|
+
version: '2.10'
|
198
174
|
type: :development
|
199
175
|
prerelease: false
|
200
176
|
version_requirements: !ruby/object:Gem::Requirement
|
201
|
-
none: false
|
202
177
|
requirements:
|
203
|
-
- - ~>
|
178
|
+
- - "~>"
|
204
179
|
- !ruby/object:Gem::Version
|
205
|
-
version: 2.10
|
180
|
+
version: '2.10'
|
206
181
|
- !ruby/object:Gem::Dependency
|
207
182
|
name: yard
|
208
183
|
requirement: !ruby/object:Gem::Requirement
|
209
|
-
none: false
|
210
184
|
requirements:
|
211
|
-
- - ~>
|
185
|
+
- - "~>"
|
212
186
|
- !ruby/object:Gem::Version
|
213
|
-
version: 0.
|
187
|
+
version: '0.8'
|
214
188
|
type: :development
|
215
189
|
prerelease: false
|
216
190
|
version_requirements: !ruby/object:Gem::Requirement
|
217
|
-
none: false
|
218
191
|
requirements:
|
219
|
-
- - ~>
|
192
|
+
- - "~>"
|
220
193
|
- !ruby/object:Gem::Version
|
221
|
-
version: 0.
|
194
|
+
version: '0.8'
|
222
195
|
- !ruby/object:Gem::Dependency
|
223
196
|
name: bundler
|
224
197
|
requirement: !ruby/object:Gem::Requirement
|
225
|
-
none: false
|
226
198
|
requirements:
|
227
|
-
- -
|
199
|
+
- - "~>"
|
228
200
|
- !ruby/object:Gem::Version
|
229
|
-
version: 1.
|
201
|
+
version: '1.5'
|
230
202
|
type: :development
|
231
203
|
prerelease: false
|
232
204
|
version_requirements: !ruby/object:Gem::Requirement
|
233
|
-
none: false
|
234
205
|
requirements:
|
235
|
-
- -
|
206
|
+
- - "~>"
|
236
207
|
- !ruby/object:Gem::Version
|
237
|
-
version: 1.
|
208
|
+
version: '1.5'
|
238
209
|
- !ruby/object:Gem::Dependency
|
239
210
|
name: jeweler
|
240
211
|
requirement: !ruby/object:Gem::Requirement
|
241
|
-
none: false
|
242
212
|
requirements:
|
243
|
-
- - ~>
|
213
|
+
- - "~>"
|
244
214
|
- !ruby/object:Gem::Version
|
245
|
-
version: 1.8
|
215
|
+
version: '1.8'
|
246
216
|
type: :development
|
247
217
|
prerelease: false
|
248
218
|
version_requirements: !ruby/object:Gem::Requirement
|
249
|
-
none: false
|
250
219
|
requirements:
|
251
|
-
- - ~>
|
220
|
+
- - "~>"
|
252
221
|
- !ruby/object:Gem::Version
|
253
|
-
version: 1.8
|
222
|
+
version: '1.8'
|
254
223
|
- !ruby/object:Gem::Dependency
|
255
224
|
name: fakefs
|
256
225
|
requirement: !ruby/object:Gem::Requirement
|
257
|
-
none: false
|
258
226
|
requirements:
|
259
|
-
- - ~>
|
227
|
+
- - "~>"
|
260
228
|
- !ruby/object:Gem::Version
|
261
|
-
version: 0.
|
229
|
+
version: '0.5'
|
262
230
|
type: :development
|
263
231
|
prerelease: false
|
264
232
|
version_requirements: !ruby/object:Gem::Requirement
|
265
|
-
none: false
|
266
233
|
requirements:
|
267
|
-
- - ~>
|
234
|
+
- - "~>"
|
268
235
|
- !ruby/object:Gem::Version
|
269
|
-
version: 0.
|
236
|
+
version: '0.5'
|
270
237
|
- !ruby/object:Gem::Dependency
|
271
238
|
name: em-http-request
|
272
239
|
requirement: !ruby/object:Gem::Requirement
|
273
|
-
none: false
|
274
240
|
requirements:
|
275
|
-
- - ~>
|
241
|
+
- - "~>"
|
276
242
|
- !ruby/object:Gem::Version
|
277
|
-
version: 1.0
|
243
|
+
version: '1.0'
|
278
244
|
type: :development
|
279
245
|
prerelease: false
|
280
246
|
version_requirements: !ruby/object:Gem::Requirement
|
281
|
-
none: false
|
282
247
|
requirements:
|
283
|
-
- - ~>
|
248
|
+
- - "~>"
|
284
249
|
- !ruby/object:Gem::Version
|
285
|
-
version: 1.0
|
250
|
+
version: '1.0'
|
286
251
|
description: A static file server for rich web apps that automatically compiles SASS,
|
287
252
|
HAML, CoffeeScript and more
|
288
253
|
email: micah@micahw.com
|
@@ -293,9 +258,9 @@ extra_rdoc_files:
|
|
293
258
|
- LICENSE.txt
|
294
259
|
- README.md
|
295
260
|
files:
|
296
|
-
- .document
|
297
|
-
- .rspec
|
298
|
-
- .travis.yml
|
261
|
+
- ".document"
|
262
|
+
- ".rspec"
|
263
|
+
- ".travis.yml"
|
299
264
|
- Gemfile
|
300
265
|
- LICENSE.txt
|
301
266
|
- README.md
|
@@ -325,29 +290,25 @@ files:
|
|
325
290
|
homepage: http://mwylde.github.com/slinky/
|
326
291
|
licenses:
|
327
292
|
- MIT
|
293
|
+
metadata: {}
|
328
294
|
post_install_message:
|
329
295
|
rdoc_options: []
|
330
296
|
require_paths:
|
331
297
|
- lib
|
332
298
|
required_ruby_version: !ruby/object:Gem::Requirement
|
333
|
-
none: false
|
334
299
|
requirements:
|
335
|
-
- -
|
300
|
+
- - ">="
|
336
301
|
- !ruby/object:Gem::Version
|
337
302
|
version: '0'
|
338
|
-
segments:
|
339
|
-
- 0
|
340
|
-
hash: 4080873917067961416
|
341
303
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
342
|
-
none: false
|
343
304
|
requirements:
|
344
|
-
- -
|
305
|
+
- - ">="
|
345
306
|
- !ruby/object:Gem::Version
|
346
307
|
version: '0'
|
347
308
|
requirements: []
|
348
309
|
rubyforge_project:
|
349
|
-
rubygems_version:
|
310
|
+
rubygems_version: 2.2.2
|
350
311
|
signing_key:
|
351
|
-
specification_version:
|
312
|
+
specification_version: 4
|
352
313
|
summary: Static file server for javascript apps
|
353
314
|
test_files: []
|