ember-cli-rails-assets 0.6.2 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Rakefile +0 -5
- data/lib/ember_cli/assets/asset_map.rb +12 -10
- data/lib/ember_cli/assets/engine.rb +1 -1
- data/lib/ember_cli/assets/lookup.rb +2 -5
- data/lib/ember_cli/assets/paths.rb +4 -0
- data/lib/ember_cli/assets/version.rb +1 -1
- metadata +21 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7e9361dbdbf288e9b4945183a249ef297ec40d00d2bdbe1e5c3931e4015892e4
|
4
|
+
data.tar.gz: 91a2fbb0e865ad05e5e6f7ce07ceaa92fee88ec6f7bd10ad49dd8e265fac1b86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f2a291c76a50993d6e18cae3398364507ce288bc33da35f877945f5aaacbf51a45f48b260373f5708eef4d57134a3204c2b49d9d529f91da562b639a5a6fe9d
|
7
|
+
data.tar.gz: 86b8e8b0d76d40867537b97613504b131e3972eebc7c7fe386f284af1745481ffa2a81391bc26ebc0f89a67af2209c1ad1c2eae6e816d233d02b4f893b8eb608
|
data/Rakefile
CHANGED
@@ -4,7 +4,6 @@ begin
|
|
4
4
|
rescue LoadError
|
5
5
|
puts "You must `gem install bundler` and `bundle install` to run rake tasks"
|
6
6
|
end
|
7
|
-
require "appraisal"
|
8
7
|
|
9
8
|
require "rdoc/task"
|
10
9
|
|
@@ -33,7 +32,3 @@ if defined? RSpec
|
|
33
32
|
t.verbose = false
|
34
33
|
end
|
35
34
|
end
|
36
|
-
|
37
|
-
if !ENV["APPRAISAL_INITIALIZED"] && !ENV["TRAVIS"]
|
38
|
-
task :default => :appraisal
|
39
|
-
end
|
@@ -1,34 +1,36 @@
|
|
1
|
+
require 'nokogiri'
|
1
2
|
require "ember_cli/assets/errors"
|
2
3
|
|
3
4
|
module EmberCli
|
4
5
|
module Assets
|
5
6
|
class AssetMap
|
6
|
-
def initialize(name:, asset_map:)
|
7
|
+
def initialize(name:, asset_map:, index_html:)
|
7
8
|
@name = name
|
8
9
|
@asset_map = asset_map
|
10
|
+
@index_html = index_html
|
9
11
|
end
|
10
12
|
|
11
13
|
def javascripts
|
12
14
|
assert_asset_map!
|
13
15
|
|
14
|
-
|
15
|
-
|
16
|
-
asset_matching(/#{
|
17
|
-
|
16
|
+
Nokogiri::HTML(index_html.read).css('script').map {|s|
|
17
|
+
filename = File.basename(s['src'])
|
18
|
+
asset_matching(/#{Regexp.escape(filename)}\z/)
|
19
|
+
}
|
18
20
|
end
|
19
21
|
|
20
22
|
def stylesheets
|
21
23
|
assert_asset_map!
|
22
24
|
|
23
|
-
[
|
24
|
-
|
25
|
-
asset_matching(/#{
|
26
|
-
|
25
|
+
Nokogiri::HTML(index_html.read).css('link[rel="stylesheet"]').map {|s|
|
26
|
+
filename = File.basename(s['href'])
|
27
|
+
asset_matching(/#{Regexp.escape(filename)}\z/)
|
28
|
+
}
|
27
29
|
end
|
28
30
|
|
29
31
|
private
|
30
32
|
|
31
|
-
attr_reader :name, :asset_map
|
33
|
+
attr_reader :name, :asset_map, :index_html
|
32
34
|
|
33
35
|
def asset_matching(regex)
|
34
36
|
matching_asset = files.detect { |asset| asset =~ regex }
|
@@ -25,6 +25,7 @@ module EmberCli
|
|
25
25
|
AssetMap.new(
|
26
26
|
name: name_from_package_json,
|
27
27
|
asset_map: asset_map_hash.to_h,
|
28
|
+
index_html: paths.index_html,
|
28
29
|
)
|
29
30
|
end
|
30
31
|
|
@@ -33,11 +34,7 @@ module EmberCli
|
|
33
34
|
end
|
34
35
|
|
35
36
|
def asset_map_hash
|
36
|
-
|
37
|
-
JSON.parse(asset_map_file.read)
|
38
|
-
else
|
39
|
-
DirectoryAssetMap.new(paths.assets)
|
40
|
-
end
|
37
|
+
DirectoryAssetMap.new(paths.assets)
|
41
38
|
end
|
42
39
|
|
43
40
|
def name_from_package_json
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ember-cli-rails-assets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Doyle
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
11
|
+
date: 2023-02-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: nokogiri
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
description: Include EmberCLI-generated JavaScript and CSS stylesheet tags in your
|
14
28
|
Rails layouts
|
15
29
|
email:
|
@@ -33,7 +47,7 @@ homepage: https://github.com/seanpdoyle/ember-cli-rails-assets
|
|
33
47
|
licenses:
|
34
48
|
- MIT
|
35
49
|
metadata: {}
|
36
|
-
post_install_message:
|
50
|
+
post_install_message:
|
37
51
|
rdoc_options: []
|
38
52
|
require_paths:
|
39
53
|
- lib
|
@@ -48,9 +62,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
48
62
|
- !ruby/object:Gem::Version
|
49
63
|
version: '0'
|
50
64
|
requirements: []
|
51
|
-
|
52
|
-
|
53
|
-
signing_key:
|
65
|
+
rubygems_version: 3.4.6
|
66
|
+
signing_key:
|
54
67
|
specification_version: 4
|
55
68
|
summary: Include EmberCLI-generated JavaScript and CSS stylesheet tags in your Rails
|
56
69
|
layouts
|