zassets 0.2.9 → 0.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 526e0116ba636c8929029fbebddc6472fc74bb7b
4
- data.tar.gz: d465831f9c2cdf5de8d0333d4bb8b89342166b49
3
+ metadata.gz: e7744be16bae574b350ba874a1bb0e3cd5591f07
4
+ data.tar.gz: 8b4da81c7eb6ee792c6760b9f59a8e5720d4f434
5
5
  SHA512:
6
- metadata.gz: 6708d4e71ca564b5243ed20ec43d3d35847cae06faae5224feddab724001d172a1b6ec587c0f87c556d178bfaf635e235981b12ce7f677c7a0a4d4d167df77c2
7
- data.tar.gz: 020e0fb921d49bb4eda482e13a477f480ec733acbfec464ad1c0e835db67b5cee66fe25b766b9f6393b9fcf38aa1101a23189361a8486436a7fcf4e78d415c59
6
+ metadata.gz: d97295f205196173b4d4eb36ceada670e7880826593724cc1460c3cf520a816624f42b4215234b3ae107e1b820dac84c79ba66b2b6041c02d913a0fb93cd11b0
7
+ data.tar.gz: 95cf5e5c8a2204b5277627fc910d13a4d7ccf34b6b2d299501b26cff20107c1cbd04d758d2f3f5aaab2dbf024fbac663dbf88b67823f6790ccd35570007377ef
data/README.md CHANGED
@@ -318,13 +318,13 @@ TODO
318
318
  Similar/related code
319
319
  --------------------
320
320
 
321
- * https://github.com/sstephenson/sprockets
321
+ * https://github.com/sstephenson/sprockets  
322
322
  Sprockets: Rack-based asset packaging
323
323
 
324
- * http://rack.github.io/
324
+ * http://rack.github.io/  
325
325
  Rack: a Ruby Webserver Interface
326
326
 
327
- * Sprockets contrib guide:
327
+ * Sprockets contrib guide:  
328
328
  https://github.com/radar/guides/blob/56da5701c470442c3ab96a0005023117eae58777/sprockets.md
329
329
 
330
330
  ### With features for static sites
@@ -0,0 +1,13 @@
1
+ require 'aruba/api'
2
+ require 'aruba/cucumber/hooks'
3
+
4
+ require 'zassets/testing/cucumber/builder_steps'
5
+ require 'zassets/testing/cucumber/config_steps'
6
+ require 'zassets/testing/cucumber/filesystem_steps'
7
+ require 'zassets/testing/cucumber/manifest_steps'
8
+ require 'zassets/testing/cucumber/output_steps'
9
+ require 'zassets/testing/cucumber/run_steps'
10
+
11
+ World(Aruba::Api)
12
+
13
+ DEFAULT_CONFIG_PATH = 'config/zassets.yaml'
@@ -0,0 +1,31 @@
1
+ def glob pattern
2
+ cd('.') { Dir[pattern].first }
3
+ end
4
+
5
+
6
+ When /^I build$/ do
7
+ run_simple 'zassets build'
8
+ end
9
+
10
+
11
+ Then /^the built file "([^"]*)" must exist$/ do |path|
12
+ expect(glob path).to be_an_existing_file
13
+ end
14
+
15
+ Then /^the built file "([^"]*)" must contain "([^"]*)"$/ do |path, content|
16
+ expect(glob path).to have_file_content Regexp.new(content)
17
+ end
18
+
19
+ Then /^the built file "([^"]*)" must match:/ do |path, content|
20
+ expect(glob path)
21
+ .to have_file_content Regexp.compile(content, Regexp::EXTENDED)
22
+ end
23
+
24
+ Then /^the built file "([^"]*)" must match \/([^\/]*)\/$/ do |path, content|
25
+ expect(glob path)
26
+ .to have_file_content Regexp.compile(content)
27
+ end
28
+
29
+ Then /^it must build$/ do
30
+ expect('public/assets/manifest.json').to be_an_existing_file
31
+ end
@@ -0,0 +1,8 @@
1
+ Given /^this config file:$/ do |config|
2
+ write_file DEFAULT_CONFIG_PATH, config
3
+ end
4
+
5
+
6
+ Then /^it must fail to parse the config$/ do
7
+ expect(all_output).to match /yaml.+error/i
8
+ end
@@ -0,0 +1,15 @@
1
+ Given /^a directory named "([^"]*)"$/ do |path|
2
+ create_directory path
3
+ end
4
+
5
+ Given /^a file named "([^"]*)" with "([^"]*)"$/ do |path, content|
6
+ write_file path, (content + "\n")
7
+ end
8
+
9
+ Given /^a file named "([^"]+)" with:$/ do |path, content|
10
+ write_file path, (content + "\n")
11
+ end
12
+
13
+ Given /^an empty file named "([^"]*)"$/ do |path|
14
+ write_file path, ''
15
+ end
@@ -0,0 +1,7 @@
1
+ Then /^the manifest must include build path for "([^"]*)"$/ do |path|
2
+ cd '.' do
3
+ manifest = JSON.parse(IO.read('public/assets/manifest.json'))
4
+ built_path_pattern = path.gsub '.', '-[0-9a-f]+\.'
5
+ expect(manifest['assets'][path]).to match Regexp.compile(built_path_pattern)
6
+ end
7
+ end
@@ -0,0 +1,11 @@
1
+ Then /^the output must contain "([^"]+)"$/ do |content|
2
+ expect(all_output).to include content
3
+ end
4
+
5
+ Then /^the output must contain:$/ do |content|
6
+ expect(all_output).to include content
7
+ end
8
+
9
+ Then /^the output must match \/([^\/]+)\/([a-z]*)$/ do |pattern, options|
10
+ expect(all_output).to match Regexp.new(pattern, options)
11
+ end
@@ -0,0 +1,7 @@
1
+ When(/^I successfully run `([^`]+)`$/) do |command|
2
+ run_simple Aruba::Platform.unescape(command, aruba.config.keep_ansi), true
3
+ end
4
+
5
+ When(/^I run `([^`]+)`$/) do |command|
6
+ run_simple Aruba::Platform.unescape(command, aruba.config.keep_ansi), false
7
+ end
@@ -0,0 +1,3 @@
1
+ require 'httparty'
2
+
3
+ require 'zassets/testing/cucumber/server_steps'
@@ -0,0 +1,47 @@
1
+ Given /^the server is running$/ do
2
+ @_server ||= Server.new
3
+ cd('.') { @_server.start }
4
+ end
5
+
6
+ Given /^the server is running with this config:$/ do |config|
7
+ write_file DEFAULT_CONFIG_PATH, config
8
+ @_server = Server.new
9
+ cd('.') { @_server.start }
10
+ end
11
+
12
+
13
+ When /^I stop the server$/ do
14
+ @_server.stop
15
+ end
16
+
17
+ When /^I request "([^"]*)"$/ do |path|
18
+ @response = HTTParty.get(@_server.uri_for_path path)
19
+ end
20
+
21
+ When /^I send the SIGINT signal$/ do
22
+ @_server.sig_int
23
+ end
24
+
25
+
26
+ Then /^the server must stop successfully$/ do
27
+ expect(@_server.wait_stop).to be true
28
+ expect(@_server.exit_status).to eq 0
29
+ end
30
+
31
+ Then /^the rack handler must be "([^"]*)"$/ do |handler|
32
+ @_server.stop
33
+ expect(@_server.stdout + @_server.stderr).to match /#{handler}/i
34
+ end
35
+
36
+ Then /^the response status must be (\d+)$/ do |status|
37
+ expect(@response.code).to eq status.to_i
38
+ end
39
+
40
+ Then /^the body must be "([^"]*)"$/ do |body|
41
+ expect(@response.body).to eq body.gsub('\n', "\n")
42
+ end
43
+
44
+ Then /^the server output must match \/(.*)\/$/ do |pattern|
45
+ @_server.stop
46
+ expect(@_server.stdout + @_server.stderr).to match Regexp.compile(pattern)
47
+ end
@@ -1,3 +1,3 @@
1
1
  module ZAssets
2
- VERSION = '0.2.9'
2
+ VERSION = '0.2.10'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zassets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.2.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thibault Jouan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-03 00:00:00.000000000 Z
11
+ date: 2015-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coffee-script
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0.5'
89
+ version: '0.8'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0.5'
96
+ version: '0.8'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: cucumber
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -168,6 +168,15 @@ files:
168
168
  - lib/zassets/memory_file.rb
169
169
  - lib/zassets/server.rb
170
170
  - lib/zassets/sprockets_env.rb
171
+ - lib/zassets/testing/cucumber.rb
172
+ - lib/zassets/testing/cucumber/builder_steps.rb
173
+ - lib/zassets/testing/cucumber/config_steps.rb
174
+ - lib/zassets/testing/cucumber/filesystem_steps.rb
175
+ - lib/zassets/testing/cucumber/manifest_steps.rb
176
+ - lib/zassets/testing/cucumber/output_steps.rb
177
+ - lib/zassets/testing/cucumber/run_steps.rb
178
+ - lib/zassets/testing/cucumber/server.rb
179
+ - lib/zassets/testing/cucumber/server_steps.rb
171
180
  - lib/zassets/version.rb
172
181
  homepage: https://rubygems.org/gems/zassets
173
182
  licenses:
@@ -192,5 +201,5 @@ rubyforge_project:
192
201
  rubygems_version: 2.4.5
193
202
  signing_key:
194
203
  specification_version: 4
195
- summary: zassets-0.2.9
204
+ summary: zassets-0.2.10
196
205
  test_files: []