jasmine-blanket 2.0.2 → 2.0.2.1

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: 231978e6d3c32dae2b78049c9d96cecf5f2fccb2
4
- data.tar.gz: 7048d16beb81e2747312a07daba2955623dfb4e7
3
+ metadata.gz: cfc7a45a66b1bf0a2ab128a0516ffbf8c94caa50
4
+ data.tar.gz: 9e58a5b967956bc4c1bfb5e9bab3fa049a7f7306
5
5
  SHA512:
6
- metadata.gz: a100f16433101cd70dd2d4fbc212cf96c5142fbf61b8cc07daaec034ae2d5f8b0c93b300f1f69137d76a6f9f4537c3bfacfeba899c80a3f444ba8ce8593092f6
7
- data.tar.gz: 451abf097b31d7bda7d74d59fca71a9cb8c56e0aa5827165f530cc8a2924a53d3b62c6d822ddf74cb9958a17fc83550424e182b3c29dbdb35a55ff9ea1677818
6
+ metadata.gz: cdf0fac467600670de8116ce20d9ef791109b9a64b5d78d155a692e847beeb71b098e2d9c5114d118e650eff889640d817ecebd145537e4e0cbac43662f03b94
7
+ data.tar.gz: 90725bc9d01fdecfdedc2cf0c9816360ccac143fd3e77914dea2157c7a84a468fbd6515d9a59ffbc53ecd06e1b1aab0a551f3d47627b148eb919c2f93f893aa3
data/README.md CHANGED
@@ -27,8 +27,24 @@ Or directly include it in your test runner with `/assets/blanket.js` and `/asset
27
27
 
28
28
  ## Usage
29
29
 
30
+ For Blanket.js
30
31
  [Blanket JS Usage](http://blanketjs.org/)
31
32
 
33
+ Adding JS Folders that you want covered by Blanket. Note: it's not very smart at the moment.
34
+
35
+ In jasmine.yml
36
+
37
+ included_blanket_folders:
38
+ - '/backbone/'
39
+
40
+ excluded_blanket_folders:
41
+ - '__spec__'
42
+ - '/templates/'
43
+
44
+ In jasmine_helper.rb
45
+
46
+ Jasmine::Blanket.load_configuration_from_yaml
47
+
32
48
  ## Version
33
49
 
34
50
  Matches Jasmine version
@@ -1,9 +1,53 @@
1
1
  require 'rails'
2
2
  require 'blanket/rails'
3
+ require "jasmine-blanket/configuration"
3
4
  require "jasmine-blanket/engine"
4
5
  require "jasmine-blanket/version"
5
6
 
6
7
  module Jasmine
7
8
  module Blanket
9
+ require 'yaml'
10
+
11
+ def self.configure(&block)
12
+ block.call(self.config)
13
+ end
14
+
15
+ def self.initialize_config
16
+ @config = Jasmine::Blanket::Configuration.new
17
+ end
18
+
19
+ def self.config
20
+ initialize_config
21
+ @config
22
+ end
23
+
24
+ def self.load_configuration_from_yaml(path = nil)
25
+ path ||= File.join(Dir.pwd, 'spec', 'javascripts', 'support', 'jasmine.yml')
26
+ if File.exist?(path)
27
+ yaml_config = YAML::load(File.read(path))
28
+
29
+ Jasmine::Blanket.configure do |config|
30
+ config.included_folders = yaml_config["included_blanket_folders"] if yaml_config["included_blanket_folders"].any?
31
+ config.excluded_folders = yaml_config["excluded_blanket_folders"] if yaml_config["excluded_blanket_folders"].any?
32
+ end
33
+ else
34
+ raise ConfigNotFound, "Unable to load jasmine config from #{path}"
35
+ end
36
+ end
37
+
38
+ # Temporary hacks
39
+ def self.included_folders
40
+ @config.included_folders
41
+ end
42
+
43
+ def self.excluded_folders
44
+ @config.excluded_folders
45
+ end
46
+
47
+ end
48
+
49
+ # Monkey Patch to use our template
50
+ def self.runner_template
51
+ File.read(File.join(File.dirname(__FILE__), "run.html.erb"))
8
52
  end
9
53
  end
@@ -0,0 +1,7 @@
1
+ module Jasmine
2
+ module Blanket
3
+ class Configuration
4
+ attr_accessor :included_folders, :excluded_folders
5
+ end
6
+ end
7
+ end
@@ -1,5 +1,5 @@
1
1
  module Jasmine
2
2
  module Blanket
3
- VERSION = "2.0.2"
3
+ VERSION = "2.0.2.1"
4
4
  end
5
5
  end
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2
+ <html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <meta content="text/html;charset=UTF-8" http-equiv="Content-Type"/>
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+ <title>Jasmine suite</title>
7
+ <link rel="shortcut icon" type="image/png" href="/__images__/jasmine_favicon.png">
8
+ <% css_files.each do |css_file| %>
9
+ <link rel="stylesheet" href="<%= css_file %>" type="text/css" media="screen"/>
10
+ <% end %>
11
+
12
+ <% js_files.each do |js_file| %>
13
+ <% cover = false %>
14
+ <% Jasmine::Blanket.included_folders.each {|folder| cover = true if js_file.include?(folder)} %>
15
+ <% Jasmine::Blanket.excluded_folders.each {|folder| cover = false if js_file.include?(folder)} %>
16
+
17
+ <script src="<%= js_file %>" type="text/javascript" <%= 'data-cover' if cover %>></script>
18
+ <% end %>
19
+
20
+ </head>
21
+ <!-- TODO: turbolinks breaks spec filter links -->
22
+ <body data-no-turbolink>
23
+ <div id="jasmine_content"></div>
24
+ </body>
25
+ </html>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jasmine-blanket
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Carleton
@@ -66,8 +66,10 @@ files:
66
66
  - Rakefile
67
67
  - jasmine-blanket.gemspec
68
68
  - lib/jasmine-blanket.rb
69
+ - lib/jasmine-blanket/configuration.rb
69
70
  - lib/jasmine-blanket/engine.rb
70
71
  - lib/jasmine-blanket/version.rb
72
+ - lib/run.html.erb
71
73
  - vendor/assets/javascripts/jasmine-blanket.js
72
74
  homepage: https://github.com/ScotterC/jasmine-blanket
73
75
  licenses: