edge_rack 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/edge_rack/middleware.rb +24 -4
- metadata +3 -3
data/lib/edge_rack/middleware.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
|
1
2
|
module EdgeRack
|
2
3
|
class Middleware
|
3
4
|
def initialize(app, options={})
|
@@ -9,13 +10,32 @@ module EdgeRack
|
|
9
10
|
host: "http://localhost"
|
10
11
|
}.merge(options)
|
11
12
|
|
13
|
+
@kind = "rack"
|
14
|
+
|
15
|
+
if defined?(Rails)
|
16
|
+
@paths = {
|
17
|
+
css: Rails.application.config.assets[:paths],
|
18
|
+
sass: (Rails.application.config.sass[:load_paths] rescue []),
|
19
|
+
less: (Rails.application.config.less[:paths] rescue [])
|
20
|
+
}
|
21
|
+
|
22
|
+
@kind = "rails"
|
23
|
+
end
|
24
|
+
|
25
|
+
params = {
|
26
|
+
project_path: @options[:project_path],
|
27
|
+
project_name: @options[:project_name],
|
28
|
+
project_kind: @kind
|
29
|
+
}
|
30
|
+
|
31
|
+
if defined?(Rails)
|
32
|
+
params[:load_paths] = ActiveSupport::JSON.encode(@paths)
|
33
|
+
end
|
34
|
+
|
12
35
|
Thread.new do
|
13
36
|
Net::HTTP.post_form(
|
14
37
|
URI.parse('http://localhost:48626/project'),
|
15
|
-
|
16
|
-
project_path: @options[:project_path],
|
17
|
-
project_name: @options[:project_name]
|
18
|
-
}
|
38
|
+
params
|
19
39
|
)
|
20
40
|
end
|
21
41
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: edge_rack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-11-
|
13
|
+
date: 2012-11-18 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rack
|
@@ -73,7 +73,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
73
73
|
version: '0'
|
74
74
|
segments:
|
75
75
|
- 0
|
76
|
-
hash: -
|
76
|
+
hash: -201069746119747233
|
77
77
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
78
|
none: false
|
79
79
|
requirements:
|