web_assets 0.0.3 → 0.0.4

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: 9a90355e0b954e2fd493d34a62521e6f7b574825
4
- data.tar.gz: 751363128a72a06eab7104d354cf11cfc847123e
3
+ metadata.gz: 86f6e11ff8d37590421286122c253206c08a6109
4
+ data.tar.gz: 550279a2af50f36629a68b2617470950203eff89
5
5
  SHA512:
6
- metadata.gz: b825c6fe19a1c65e4df8b49ec99e5d19d7c69f0921277854496c212b8e75cb79820bf13722a2cbcf08bd83586c00bc96f7b35b0c8a0fac641e1df9f50dace24a
7
- data.tar.gz: 48eb6d86c02278f7b68e51b455efa9fdf8cc0543df0b26db3f4f858b7346aa224e137fbefa0916a34ab621aa6fbe7d1ec1d888ba7807952ea94ee93bbce45f6f
6
+ metadata.gz: ac8aa27d7f17ea4751001c0b792207b1b97c035350afd31554b1fc553a9ec47c7e20e4344224ea17a032ffeb13122eced09c4fdb5957dffaccf0dd461945574e
7
+ data.tar.gz: 6e0e07709c222f796f007cc62f9500def83cd4659c00dcfe81aa0334b0303c2846d2e1f881df532afd3e3c08c6731f6e0624919fb5e02fd22ee3cece65f79561
@@ -9,30 +9,55 @@ module WebAssets
9
9
  @stylesheet_processor = stylesheet_processor
10
10
  end
11
11
 
12
+ #
13
+ # set the script path and return :ok
14
+ #
12
15
  def set_script_path path
13
16
  script_processor.set_path path
14
17
  end
15
18
 
19
+ #
20
+ # set the stylesheet path and return :ok
21
+ #
16
22
  def set_stylesheet_path path
17
23
  stylesheet_processor.set_path path
18
24
  end
19
25
 
26
+ #
27
+ # append a path to the script load path and return :ok
28
+ #
20
29
  def add_script_load_path path
21
30
  script_processor.add_load_path path
22
31
  end
23
32
 
33
+ #
34
+ # append a path to the stylesheet load path and return :ok
35
+ #
24
36
  def add_stylesheet_load_path path
25
37
  stylesheet_processor.add_load_path path
26
38
  end
27
39
 
40
+ #
41
+ # return an array of the filenames the script filename depends on and itself
42
+ #
28
43
  def script_filenames filename
29
44
  script_processor.filenames filename
30
45
  end
31
46
 
47
+ #
48
+ # return the script filename with its content digest
49
+ #
32
50
  def script_digest_filename filename
33
51
  script_processor.digest_filename filename
34
52
  end
35
53
 
54
+ #
55
+ # return the script content as a string
56
+ # boolean options:
57
+ # - bundle: inline all dependencies
58
+ # - minify: minify the content
59
+ # - gzip: return the gzipped binary content
60
+ #
36
61
  def script_content filename, options = {}
37
62
  options[:bundle] = options.fetch :bundle, true
38
63
  options[:minify] = options.fetch :minify, false
@@ -40,10 +65,19 @@ module WebAssets
40
65
  script_processor.content filename, options
41
66
  end
42
67
 
68
+ #
69
+ # return the stylesheet filename with its content digest
70
+ #
43
71
  def stylesheet_digest_filename filename
44
72
  stylesheet_processor.digest_filename filename
45
73
  end
46
74
 
75
+ #
76
+ # return the stylesheet content processed, as a string
77
+ # boolean options:
78
+ # - minify: minify the content
79
+ # - gzip: return the gzipped binary content
80
+ #
47
81
  def stylesheet_content filename, options = {}
48
82
  options[:minify] = options.fetch :minify, false
49
83
  options[:gzip] = options.fetch :gzip, false
@@ -44,27 +44,32 @@ module WebAssets
44
44
 
45
45
  request.when [:script_filenames, String] do |filename|
46
46
  WebAssets.logger.debug "ClientInterface#process: script_filenames = #{filename.inspect}"
47
- reply request, api.script_filenames(filename)
47
+ names = api.script_filenames(filename)
48
+ reply request, [:filenames, names]
48
49
  end
49
50
 
50
51
  request.when [:script_digest_filename, String] do |filename|
51
52
  WebAssets.logger.debug "ClientInterface#process: script_digest_filename = #{filename.inspect}"
52
- reply request, api.script_digest_filename(filename)
53
+ name = api.script_digest_filename(filename)
54
+ reply request, [:filename, name]
53
55
  end
54
56
 
55
57
  request.when [:script_content, Array] do |filename, options|
56
- WebAssets.logger.debug "ClientInterface#process: script_content = #{filename.inspect}"
57
- reply request, api.script_content(filename, options)
58
+ WebAssets.logger.debug "ClientInterface#process: script_content = #{filename.inspect}, #{options.inspect}"
59
+ content = api.script_content(filename, Hash[options])
60
+ reply request, [:content, content]
58
61
  end
59
62
 
60
63
  request.when [:stylesheet_digest_filename, String] do |filename|
61
64
  WebAssets.logger.debug "ClientInterface#process: stylesheet_digest_filename = #{filename.inspect}"
62
- reply request, api.stylesheet_digest_filename(filename)
65
+ name = api.stylesheet_digest_filename(filename)
66
+ reply request, [:filename, name]
63
67
  end
64
68
 
65
69
  request.when [:stylesheet_content, Array] do |filename, options|
66
- WebAssets.logger.debug "ClientInterface#process: stylesheet_content = #{filename.inspect}"
67
- reply request, api.stylesheet_content(filename, options)
70
+ WebAssets.logger.debug "ClientInterface#process: stylesheet_content = #{filename.inspect}, #{options.inspect}"
71
+ content = api.stylesheet_content(filename, Hash[options])
72
+ reply request, [:content, content]
68
73
  end
69
74
 
70
75
  WebAssets.logger.debug "ClientInterface#process: END"
@@ -73,7 +78,6 @@ module WebAssets
73
78
  def reply request, response
74
79
  WebAssets.logger.debug "ClientInterface#reply: #send! #{response.inspect}"
75
80
  request.send! response
76
- WebAssets.logger.debug "ClientInterface#reply: #receive_loop"
77
81
  request.receive_loop
78
82
  end
79
83
 
@@ -1,3 +1,3 @@
1
1
  module WebAssets
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: web_assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mathieu Lajugie