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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 18932df829227244205d712f5f24606b960dbfc3
4
- data.tar.gz: 00bf1a7894c7d4b08172b0f5760cb72ac1e1923c
3
+ metadata.gz: e39111c9fef46b63f7172aa6f57774a5ce4669ae
4
+ data.tar.gz: 00fa74b1ba044a4052f148ff45a29f0533ac5700
5
5
  SHA512:
6
- metadata.gz: 6083983b7e9ec63be59d8e06dfe3f91e5845c6bbc6722077564eb4a39038c2af00553b2b9e6dc0fa0cbf6f33da7487119c65fb1b2b14ca90fae4c62f2cd5c7f3
7
- data.tar.gz: 236f2ef3845d780006b286c4920cbda5f48e1a436b7d7aea8fe7fb0a000f0233186a0c977dc11a58444004978323f478a992d3c147418d4a6f4e774e973a67dc
6
+ metadata.gz: e0bc57a862058cfa6f14b3817bde0a8a194a7a5599e657f56b3cd9629931767590fbab2e71e8c8142890f59d2ebd9c9252ed2a07fbe4199989376283ad0d04c4
7
+ data.tar.gz: 3e85227a72c2764eb62977381c9f869859395a1dbb3b4d353749571decf3411554b7e5e871f3b9ad312bd458a59e90726ee049060ae7d29061003e9a03f49906
@@ -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.1'
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'
@@ -21,7 +21,6 @@ module Cyborg
21
21
  options = args.last.is_a?(Hash) ? args.pop : {}
22
22
  tags = ''
23
23
 
24
- puts "searching for: #{javascript_url(args)}"
25
24
  javascript_url(args).each do |url|
26
25
  tags += javascript_include_tag url, options
27
26
  end
@@ -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, "Rack::Cors", :debug => true, :logger => (-> { Rails.logger }) do
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=nil)
26
- names = [names].flatten.compact.map do |n|
27
- File.basename(n).sub(/(\..+)$/,'')
28
- end
25
+ def filter_files(names)
29
26
 
30
- if !names.empty?
31
- find_files.select do |f|
32
- names.include? File.basename(f).sub(/(\..+)$/,'')
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
- filter_files(names).map{ |file| url(file) }
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?
@@ -35,6 +35,10 @@ module Cyborg
35
35
  .sub(plugin.root+'/','') # writtent to public dir
36
36
  end
37
37
 
38
+ def build_paths
39
+ @svg.build_paths.map { |file| file.sub("-#{plugin.version}",'') }
40
+ end
41
+
38
42
  def build
39
43
 
40
44
  begin
@@ -1,3 +1,3 @@
1
1
  module Cyborg
2
- VERSION = "0.5.20"
2
+ VERSION = "0.5.21"
3
3
  end
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.20
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-03 00:00:00.000000000 Z
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.1'
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.1'
40
+ version: '3.2'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: listen
43
43
  requirement: !ruby/object:Gem::Requirement