teaspoon 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/app/assets/javascripts/support/phantomjs-shims.js +35 -0
- data/lib/teaspoon/exceptions.rb +64 -69
- data/lib/teaspoon/framework/base.rb +4 -1
- data/lib/teaspoon/version.rb +1 -1
- data/lib/teaspoon-devkit.rb +7 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6947cdfc11c4b82dfb1c0db440b2effbcaa2b69
|
4
|
+
data.tar.gz: 0d792be5439b2f8b55c458620556e0ee9030aca4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb2cc7fb2e22d878e9f6a5877ddc71b8c21c7b004d17b1dfc76e3d6ea8e2fad666f9927cfe9b532fec219963ed27d21a0abb0dc3d712007b0057bf0a7a42a544
|
7
|
+
data.tar.gz: d7eab6abba8e2479aad8fe1551ea1e3c3358fe1b54b9cf8262acc7504f992e7df6ba392996b869f9458a6733eaf9d33160f6df4169695c713f65f5b20914280e
|
data/CHANGELOG.md
CHANGED
@@ -0,0 +1,35 @@
|
|
1
|
+
(function() {
|
2
|
+
|
3
|
+
var Ap = Array.prototype;
|
4
|
+
var slice = Ap.slice;
|
5
|
+
var Fp = Function.prototype;
|
6
|
+
|
7
|
+
if (!Fp.bind) {
|
8
|
+
// PhantomJS doesn't support Function.prototype.bind natively, so
|
9
|
+
// polyfill it whenever this module is required.
|
10
|
+
Fp.bind = function(context) {
|
11
|
+
var func = this;
|
12
|
+
var args = slice.call(arguments, 1);
|
13
|
+
|
14
|
+
function bound() {
|
15
|
+
var invokedAsConstructor = func.prototype && (this instanceof func);
|
16
|
+
return func.apply(
|
17
|
+
// Ignore the context parameter when invoking the bound function
|
18
|
+
// as a constructor. Note that this includes not only constructor
|
19
|
+
// invocations using the new keyword but also calls to base class
|
20
|
+
// constructors such as BaseClass.call(this, ...) or super(...).
|
21
|
+
!invokedAsConstructor && context || this,
|
22
|
+
args.concat(slice.call(arguments))
|
23
|
+
);
|
24
|
+
}
|
25
|
+
|
26
|
+
// The bound function must share the .prototype of the unbound
|
27
|
+
// function so that any object created by one constructor will count
|
28
|
+
// as an instance of both constructors.
|
29
|
+
bound.prototype = func.prototype;
|
30
|
+
|
31
|
+
return bound;
|
32
|
+
};
|
33
|
+
}
|
34
|
+
|
35
|
+
})();
|
data/lib/teaspoon/exceptions.rb
CHANGED
@@ -1,109 +1,101 @@
|
|
1
1
|
module Teaspoon
|
2
2
|
class Error < StandardError
|
3
|
+
protected
|
4
|
+
|
5
|
+
def build_message(msg_or_options)
|
6
|
+
if msg_or_options.is_a?(String)
|
7
|
+
msg_or_options
|
8
|
+
else
|
9
|
+
yield msg_or_options
|
10
|
+
end
|
11
|
+
end
|
3
12
|
end
|
4
13
|
|
5
14
|
class Failure < Teaspoon::Error
|
6
15
|
end
|
7
16
|
|
8
17
|
class EnvironmentNotFound < Teaspoon::Error
|
9
|
-
def initialize(
|
10
|
-
|
11
|
-
|
18
|
+
def initialize(msg_or_options)
|
19
|
+
super(build_message(msg_or_options) do |options|
|
20
|
+
"Unable to locate environment; searched in [#{options[:searched]}]. Have you run the installer?"
|
21
|
+
end)
|
12
22
|
end
|
13
23
|
end
|
14
24
|
|
15
25
|
# loading / configuration errors
|
16
26
|
|
17
27
|
class UnknownFramework < Teaspoon::Error
|
18
|
-
def initialize(
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
def available
|
28
|
+
def initialize(msg_or_options)
|
29
|
+
super(build_message(msg_or_options) do |options|
|
30
|
+
msg = "Unknown framework: expected \"#{options[:name]}\" to be a registered framework. Available frameworks are #{options[:available]}."
|
31
|
+
if options[:available].blank?
|
32
|
+
msg += " Do you need to update your Gemfile to use the teaspoon-#{options[:name]} gem? If you are upgrading, please see https://github.com/modeset/teaspoon/blob/master/CHANGELOG.md"
|
33
|
+
end
|
34
|
+
end)
|
27
35
|
end
|
28
36
|
end
|
29
37
|
|
30
38
|
class UnknownFrameworkVersion < Teaspoon::Error
|
31
|
-
def initialize(
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
def available
|
39
|
+
def initialize(msg_or_options)
|
40
|
+
super(build_message(msg_or_options) do |options|
|
41
|
+
"Unknown framework version: expected \"#{options[:name]}\" to have version #{options[:version]}."
|
42
|
+
end)
|
37
43
|
end
|
38
44
|
end
|
39
45
|
|
40
46
|
class UnknownDriver < Teaspoon::Error
|
41
|
-
def initialize(
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
def available
|
47
|
+
def initialize(msg_or_options)
|
48
|
+
super(build_message(msg_or_options) do |options|
|
49
|
+
"Unknown driver: expected \"#{options[:name]}\" to be a registered driver. Available drivers are #{options[:available]}"
|
50
|
+
end)
|
47
51
|
end
|
48
52
|
end
|
49
53
|
|
50
54
|
class UnknownFormatter < Teaspoon::Error
|
51
|
-
def initialize(
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
def available
|
55
|
+
def initialize(msg_or_options)
|
56
|
+
super(build_message(msg_or_options) do |options|
|
57
|
+
"Unknown formatter: expected \"#{options[:name]}\" to be a registered formatter. Available formatters are #{options[:available]}"
|
58
|
+
end)
|
57
59
|
end
|
58
60
|
end
|
59
61
|
|
60
62
|
class UnspecifiedFramework < Teaspoon::Error
|
61
|
-
def initialize(
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
def available
|
63
|
+
def initialize(msg_or_options)
|
64
|
+
super(build_message(msg_or_options) do |options|
|
65
|
+
"Missing framework: expected \"#{options[:name]}\" suite to configure one using `suite.use_framework`."
|
66
|
+
end)
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
70
70
|
class UnspecifiedDependencies < Teaspoon::Error
|
71
|
-
def initialize(
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
def available
|
71
|
+
def initialize(msg_or_options)
|
72
|
+
super(build_message(msg_or_options) do |options|
|
73
|
+
"Missing dependencies: expected framework \"#{options[:framework]}\" (#{options[:version]}) to specify the `dependencies` option when registering."
|
74
|
+
end)
|
77
75
|
end
|
78
76
|
end
|
79
77
|
|
80
78
|
class UnknownSuite < Teaspoon::Error
|
81
|
-
def initialize(
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
def available
|
79
|
+
def initialize(msg_or_options)
|
80
|
+
super(build_message(msg_or_options) do |options|
|
81
|
+
"Unknown suite configuration: expected \"#{options[:name]}\" to be a configured suite."
|
82
|
+
end)
|
87
83
|
end
|
88
84
|
end
|
89
85
|
|
90
86
|
class UnknownCoverage < Teaspoon::Error
|
91
|
-
def initialize(
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
def available
|
87
|
+
def initialize(msg_or_options)
|
88
|
+
super(build_message(msg_or_options) do |options|
|
89
|
+
"Unknown coverage configuration: expected \"#{options[:name]}\" to be a configured coverage."
|
90
|
+
end)
|
97
91
|
end
|
98
92
|
end
|
99
93
|
|
100
94
|
class NotFoundInRegistry < Teaspoon::Error
|
101
|
-
def initialize(
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
def available
|
95
|
+
def initialize(msg_or_options)
|
96
|
+
super(build_message(msg_or_options) do |options|
|
97
|
+
"Unknown configuration: expected \"#{options[:name]}\" to be registered. Available options are #{options[:available]}"
|
98
|
+
end)
|
107
99
|
end
|
108
100
|
end
|
109
101
|
|
@@ -130,23 +122,26 @@ module Teaspoon
|
|
130
122
|
end
|
131
123
|
|
132
124
|
class ServerError < Teaspoon::Error
|
133
|
-
def initialize(
|
134
|
-
|
135
|
-
|
125
|
+
def initialize(msg_or_options)
|
126
|
+
super(build_message(msg_or_options) do |options|
|
127
|
+
"Unable to start teaspoon server; #{options[:desc] || 'for an unknown reason'}."
|
128
|
+
end)
|
136
129
|
end
|
137
130
|
end
|
138
131
|
|
139
132
|
class DriverOptionsError < Teaspoon::Error
|
140
|
-
def initialize(
|
141
|
-
|
142
|
-
|
133
|
+
def initialize(msg_or_options)
|
134
|
+
super(build_message(msg_or_options) do |options|
|
135
|
+
"Malformed driver options#{options[:types] ? ": expected a valid #{options[:types]}." : '.'}"
|
136
|
+
end)
|
143
137
|
end
|
144
138
|
end
|
145
139
|
|
146
140
|
class AssetNotServableError < Teaspoon::Error
|
147
|
-
def initialize(
|
148
|
-
|
149
|
-
|
141
|
+
def initialize(msg_or_options)
|
142
|
+
super(build_message(msg_or_options) do |options|
|
143
|
+
"Unable to serve asset: expected \"#{options[:filename] || 'unknown file'}\" to be within a registered asset path."
|
144
|
+
end)
|
150
145
|
end
|
151
146
|
end
|
152
147
|
|
@@ -20,7 +20,10 @@ module Teaspoon
|
|
20
20
|
name.present? ? @_framework_name ||= name.to_sym : @_framework_name
|
21
21
|
end
|
22
22
|
|
23
|
-
def register_version(version, js_runner,
|
23
|
+
def register_version(version, js_runner, options = {})
|
24
|
+
dependencies = options[:dependencies] || []
|
25
|
+
dev_deps = options[:dev_deps] || []
|
26
|
+
|
24
27
|
if ENV["TEASPOON_DEVELOPMENT"] && dev_deps.any?
|
25
28
|
dependencies = dev_deps
|
26
29
|
end
|
data/lib/teaspoon/version.rb
CHANGED
data/lib/teaspoon-devkit.rb
CHANGED
@@ -21,9 +21,15 @@ module Teaspoon
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
def self.setup_framework_tasks(
|
24
|
+
def self.setup_framework_tasks(options)
|
25
25
|
extend Rake::DSL
|
26
26
|
|
27
|
+
framework = options[:framework]
|
28
|
+
framework_name = options[:framework_name]
|
29
|
+
framework_const = options[:framework_const]
|
30
|
+
framework_root = options[:framework_root]
|
31
|
+
compile_assets = options[:compile_assets]
|
32
|
+
|
27
33
|
namespace :teaspoon do
|
28
34
|
namespace framework do
|
29
35
|
desc "Run the #{framework_name} code examples"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teaspoon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jejacks0n
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2015-05-
|
14
|
+
date: 2015-05-06 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: railties
|
@@ -46,6 +46,7 @@ files:
|
|
46
46
|
- MIT.LICENSE
|
47
47
|
- README.md
|
48
48
|
- app/assets/javascripts/support/bind-poly.js
|
49
|
+
- app/assets/javascripts/support/phantomjs-shims.js
|
49
50
|
- app/assets/javascripts/support/sinon.js
|
50
51
|
- app/assets/javascripts/teaspoon-filterer.js
|
51
52
|
- app/assets/javascripts/teaspoon/error.coffee
|