cyborg 0.5.20 → 0.5.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/cyborg.gemspec +1 -1
- data/lib/cyborg/helpers/asset_helpers.rb +0 -1
- data/lib/cyborg/middleware.rb +1 -1
- data/lib/cyborg/plugin/assets/asset.rb +19 -11
- data/lib/cyborg/plugin/assets/javascripts.rb +7 -0
- data/lib/cyborg/plugin/assets/svgs.rb +4 -0
- data/lib/cyborg/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e39111c9fef46b63f7172aa6f57774a5ce4669ae
|
4
|
+
data.tar.gz: 00fa74b1ba044a4052f148ff45a29f0533ac5700
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0bc57a862058cfa6f14b3817bde0a8a194a7a5599e657f56b3cd9629931767590fbab2e71e8c8142890f59d2ebd9c9252ed2a07fbe4199989376283ad0d04c4
|
7
|
+
data.tar.gz: 3e85227a72c2764eb62977381c9f869859395a1dbb3b4d353749571decf3411554b7e5e871f3b9ad312bd458a59e90726ee049060ae7d29061003e9a03f49906
|
data/cyborg.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
21
|
spec.add_runtime_dependency 'sass', '~> 3.4'
|
22
|
-
spec.add_runtime_dependency 'esvg', '~> 3.
|
22
|
+
spec.add_runtime_dependency 'esvg', '~> 3.2'
|
23
23
|
spec.add_runtime_dependency 'listen', '~> 3.0.0'
|
24
24
|
spec.add_runtime_dependency 'block_helpers', '~> 0.3'
|
25
25
|
spec.add_runtime_dependency 'colorize', '~> 0.8'
|
data/lib/cyborg/middleware.rb
CHANGED
@@ -5,7 +5,7 @@ module Cyborg
|
|
5
5
|
class Application < Rails::Application
|
6
6
|
config.middleware.insert_before ActionDispatch::Static, Rack::Deflater
|
7
7
|
|
8
|
-
config.middleware.insert_before 0,
|
8
|
+
config.middleware.insert_before 0, Rack::Cors, :debug => true, :logger => (-> { Rails.logger }) do
|
9
9
|
allow do
|
10
10
|
origins "*"
|
11
11
|
resource "*", {
|
@@ -22,17 +22,11 @@ module Cyborg
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
def filter_files(names
|
26
|
-
names = [names].flatten.compact.map do |n|
|
27
|
-
File.basename(n).sub(/(\..+)$/,'')
|
28
|
-
end
|
25
|
+
def filter_files(names)
|
29
26
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
end
|
34
|
-
else
|
35
|
-
find_files
|
27
|
+
# Filter names based on asset file locations
|
28
|
+
find_files.select do |f|
|
29
|
+
names.include? File.basename(f).sub(/(\..+)$/,'')
|
36
30
|
end
|
37
31
|
end
|
38
32
|
|
@@ -95,7 +89,21 @@ module Cyborg
|
|
95
89
|
end
|
96
90
|
|
97
91
|
def urls(names=nil)
|
98
|
-
|
92
|
+
# If names are passed, look at the basename minus
|
93
|
+
# the extension as build files may have
|
94
|
+
# different extensions than sources
|
95
|
+
names = [names].flatten.compact.map do |n|
|
96
|
+
File.basename(n).sub(/(\..+)$/,'')
|
97
|
+
end
|
98
|
+
|
99
|
+
# Return all asset urls if none were specifically chosen
|
100
|
+
if names.empty?
|
101
|
+
find_files.map{ |file| url(file) }
|
102
|
+
|
103
|
+
# Filter files based on name
|
104
|
+
else
|
105
|
+
filter_files(names).map{ |file| url(file) }
|
106
|
+
end
|
99
107
|
end
|
100
108
|
|
101
109
|
def watch
|
@@ -13,6 +13,13 @@ module Cyborg
|
|
13
13
|
Cyborg.rails_path("tmp/cache/assets/.browserify-cache-#{name}.json")
|
14
14
|
end
|
15
15
|
|
16
|
+
# Find all asset files matching array of names
|
17
|
+
def filter_files(names)
|
18
|
+
[find_files, plugin.svgs.build_paths].flatten.select do |f|
|
19
|
+
names.include? File.basename(f).sub(/(\..+)$/,'')
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
16
23
|
def build
|
17
24
|
files = find_files
|
18
25
|
FileUtils.mkdir_p(File.dirname(cache_file)) if !files.empty?
|
data/lib/cyborg/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cyborg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Mathis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sass
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '3.
|
33
|
+
version: '3.2'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '3.
|
40
|
+
version: '3.2'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: listen
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|