jsus 0.1.22 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +5 -0
- data/Gemfile.lock +10 -14
- data/Rakefile +0 -4
- data/TODO +2 -1
- data/VERSION +1 -1
- data/bin/jsus +23 -0
- data/jsus.gemspec +17 -14
- data/lib/jsus.rb +5 -0
- data/lib/jsus/package.rb +7 -3
- data/lib/jsus/source_file.rb +10 -4
- data/lib/jsus/validator.rb +2 -0
- data/lib/jsus/validator/base.rb +38 -0
- data/lib/jsus/validator/mooforge.rb +19 -0
- data/spec/data/MooforgeValidation/README +2 -0
- data/spec/data/MooforgeValidation/app/javascripts/Orwik/Source/Library/InvalidNoAuthors.js +13 -0
- data/spec/data/MooforgeValidation/app/javascripts/Orwik/Source/Library/InvalidNoLicense.js +13 -0
- data/spec/data/MooforgeValidation/app/javascripts/Orwik/Source/Library/Valid.js +16 -0
- data/spec/data/MooforgeValidation/app/javascripts/Orwik/Source/Widget/Input/Input.Color.js +20 -0
- data/spec/data/MooforgeValidation/app/javascripts/Orwik/Source/Widget/Input/Input.js +19 -0
- data/spec/data/MooforgeValidation/app/javascripts/Orwik/Source/Widget/Widget.js +16 -0
- data/spec/data/MooforgeValidation/app/javascripts/Orwik/package.yml +11 -0
- data/spec/jsus/source_file_spec.rb +12 -5
- data/spec/jsus/validator/base_spec.rb +33 -0
- data/spec/jsus/validator/mooforge_spec.rb +30 -0
- metadata +20 -57
data/CHANGELOG
CHANGED
@@ -1,4 +1,9 @@
|
|
1
1
|
= Jsus Changelog
|
2
|
+
== Version 0.2.0
|
3
|
+
* Support for mooforge validator (checks if every file has authors && license),
|
4
|
+
more validators at request
|
5
|
+
* Errors on source files should now be easier to track down
|
6
|
+
|
2
7
|
== Version 0.1.21
|
3
8
|
* Support for wildcards in requires statements (beware, something could break)
|
4
9
|
|
data/Gemfile.lock
CHANGED
@@ -5,34 +5,30 @@ GEM
|
|
5
5
|
choice (0.1.4)
|
6
6
|
diff-lcs (1.1.2)
|
7
7
|
git (1.2.5)
|
8
|
-
haml (3.0.
|
9
|
-
jeweler (1.5.
|
8
|
+
haml (3.0.25)
|
9
|
+
jeweler (1.5.2)
|
10
10
|
bundler (~> 1.0.0)
|
11
11
|
git (>= 1.2.5)
|
12
12
|
rake
|
13
13
|
json_pure (1.4.6)
|
14
|
-
murdoc (0.1.
|
14
|
+
murdoc (0.1.5)
|
15
15
|
haml (~> 3.0.0)
|
16
16
|
haml (~> 3.0.0)
|
17
|
-
jeweler
|
18
17
|
rdiscount (~> 1.6.5)
|
19
18
|
rdiscount (~> 1.6.5)
|
20
|
-
rspec (~> 2.1.0)
|
21
|
-
sass (~> 3.1.0)
|
22
19
|
rake (0.8.7)
|
23
20
|
rdiscount (1.6.5)
|
24
21
|
rgl (0.4.0)
|
25
22
|
rake
|
26
23
|
stream (>= 0.5)
|
27
|
-
rspec (2.
|
28
|
-
rspec-core (~> 2.
|
29
|
-
rspec-expectations (~> 2.
|
30
|
-
rspec-mocks (~> 2.
|
31
|
-
rspec-core (2.
|
32
|
-
rspec-expectations (2.
|
24
|
+
rspec (2.4.0)
|
25
|
+
rspec-core (~> 2.4.0)
|
26
|
+
rspec-expectations (~> 2.4.0)
|
27
|
+
rspec-mocks (~> 2.4.0)
|
28
|
+
rspec-core (2.4.0)
|
29
|
+
rspec-expectations (2.4.0)
|
33
30
|
diff-lcs (~> 1.1.2)
|
34
|
-
rspec-mocks (2.
|
35
|
-
sass (3.1.0.alpha.39)
|
31
|
+
rspec-mocks (2.4.0)
|
36
32
|
stream (0.5)
|
37
33
|
|
38
34
|
PLATFORMS
|
data/Rakefile
CHANGED
@@ -19,10 +19,6 @@ Jeweler::Tasks.new do |gem|
|
|
19
19
|
gem.description = "Javascript packager and dependency resolver"
|
20
20
|
gem.email = "markizko@gmail.com"
|
21
21
|
gem.authors = ["Mark Abramov"]
|
22
|
-
gem.add_runtime_dependency "activesupport"
|
23
|
-
gem.add_runtime_dependency "json_pure"
|
24
|
-
gem.add_runtime_dependency "rgl"
|
25
|
-
gem.add_runtime_dependency "choice"
|
26
22
|
end
|
27
23
|
Jeweler::RubygemsDotOrgTasks.new
|
28
24
|
|
data/TODO
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/bin/jsus
CHANGED
@@ -12,6 +12,8 @@ require 'choice'
|
|
12
12
|
start_time = Time.now
|
13
13
|
|
14
14
|
Choice.options do
|
15
|
+
header "Jsus version #{Jsus.version}"
|
16
|
+
|
15
17
|
option 'input_directory', :required => true do
|
16
18
|
short "-i"
|
17
19
|
long "--input-directory=DIRECTORY"
|
@@ -79,6 +81,12 @@ Choice.options do
|
|
79
81
|
desc "When verbose mode is enabled, some debug information is displayed. Defaults to false."
|
80
82
|
end
|
81
83
|
|
84
|
+
option "validate_with", :required => false do
|
85
|
+
default []
|
86
|
+
long "--validate-with *VALIDATORS"
|
87
|
+
desc "performs validation of the resulting source. " <<
|
88
|
+
"Available validators: mooforge"
|
89
|
+
end
|
82
90
|
end
|
83
91
|
|
84
92
|
compile_start_time = Time.now
|
@@ -88,6 +96,8 @@ Jsus.verbose = Choice.choices[:verbose]
|
|
88
96
|
pool_load_start_time = Time.now
|
89
97
|
pool = if Choice.choices[:dependencies]
|
90
98
|
Jsus::Pool.new(Choice.choices[:dependencies])
|
99
|
+
else
|
100
|
+
Jsus::Pool.new
|
91
101
|
end
|
92
102
|
pool_load_finish_time = Time.now
|
93
103
|
|
@@ -98,6 +108,19 @@ package.compile(output_directory)
|
|
98
108
|
package.generate_scripts_info(output_directory) unless Choice.choices[:without_scripts_info]
|
99
109
|
package.generate_tree(output_directory) unless Choice.choices[:without_tree]
|
100
110
|
|
111
|
+
# Validations
|
112
|
+
validators_map = {"mooforge" => Jsus::Validator::Mooforge}
|
113
|
+
Choice.choices[:validate_with].each do |validator_name|
|
114
|
+
if validator = validators_map[validator_name.downcase]
|
115
|
+
errors = validator.new(pool.sources.to_a & package.source_files.to_a).validation_errors
|
116
|
+
unless errors.empty?
|
117
|
+
puts "Validator found errors: "
|
118
|
+
errors.each {|e| puts " * #{e}"}
|
119
|
+
end
|
120
|
+
else
|
121
|
+
puts "No such validator: #{validator_name}"
|
122
|
+
end
|
123
|
+
end
|
101
124
|
|
102
125
|
# Hack, hack, hack :[
|
103
126
|
if Choice.choices[:generate_includes]
|
data/jsus.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{jsus}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.2.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Mark Abramov"]
|
12
|
-
s.date = %q{
|
12
|
+
s.date = %q{2011-01-15}
|
13
13
|
s.default_executable = %q{jsus}
|
14
14
|
s.description = %q{Javascript packager and dependency resolver}
|
15
15
|
s.email = %q{markizko@gmail.com}
|
@@ -42,6 +42,9 @@ Gem::Specification.new do |s|
|
|
42
42
|
"lib/jsus/source_file.rb",
|
43
43
|
"lib/jsus/tag.rb",
|
44
44
|
"lib/jsus/tree.rb",
|
45
|
+
"lib/jsus/validator.rb",
|
46
|
+
"lib/jsus/validator/base.rb",
|
47
|
+
"lib/jsus/validator/mooforge.rb",
|
45
48
|
"markup/index_template.haml",
|
46
49
|
"markup/stylesheet.css",
|
47
50
|
"markup/template.haml",
|
@@ -86,6 +89,14 @@ Gem::Specification.new do |s|
|
|
86
89
|
"spec/data/JsonPackage/Source/SheetParser.CSS.js",
|
87
90
|
"spec/data/JsonPackage/Source/sg-regex-tools.js",
|
88
91
|
"spec/data/JsonPackage/package.json",
|
92
|
+
"spec/data/MooforgeValidation/README",
|
93
|
+
"spec/data/MooforgeValidation/app/javascripts/Orwik/Source/Library/InvalidNoAuthors.js",
|
94
|
+
"spec/data/MooforgeValidation/app/javascripts/Orwik/Source/Library/InvalidNoLicense.js",
|
95
|
+
"spec/data/MooforgeValidation/app/javascripts/Orwik/Source/Library/Valid.js",
|
96
|
+
"spec/data/MooforgeValidation/app/javascripts/Orwik/Source/Widget/Input/Input.Color.js",
|
97
|
+
"spec/data/MooforgeValidation/app/javascripts/Orwik/Source/Widget/Input/Input.js",
|
98
|
+
"spec/data/MooforgeValidation/app/javascripts/Orwik/Source/Widget/Widget.js",
|
99
|
+
"spec/data/MooforgeValidation/app/javascripts/Orwik/package.yml",
|
89
100
|
"spec/data/OutsideDependencies/README",
|
90
101
|
"spec/data/OutsideDependencies/app/javascripts/Core/Source/Class/Class.Extras.js",
|
91
102
|
"spec/data/OutsideDependencies/app/javascripts/Core/Source/Class/Class.js",
|
@@ -107,6 +118,8 @@ Gem::Specification.new do |s|
|
|
107
118
|
"spec/jsus/source_file_spec.rb",
|
108
119
|
"spec/jsus/tag_spec.rb",
|
109
120
|
"spec/jsus/tree_spec.rb",
|
121
|
+
"spec/jsus/validator/base_spec.rb",
|
122
|
+
"spec/jsus/validator/mooforge_spec.rb",
|
110
123
|
"spec/shared/class_stubs.rb",
|
111
124
|
"spec/spec_helper.rb"
|
112
125
|
]
|
@@ -124,6 +137,8 @@ Gem::Specification.new do |s|
|
|
124
137
|
"spec/jsus/source_file_spec.rb",
|
125
138
|
"spec/jsus/tag_spec.rb",
|
126
139
|
"spec/jsus/tree_spec.rb",
|
140
|
+
"spec/jsus/validator/base_spec.rb",
|
141
|
+
"spec/jsus/validator/mooforge_spec.rb",
|
127
142
|
"spec/shared/class_stubs.rb",
|
128
143
|
"spec/spec_helper.rb"
|
129
144
|
]
|
@@ -141,10 +156,6 @@ Gem::Specification.new do |s|
|
|
141
156
|
s.add_development_dependency(%q<rspec>, [">= 0"])
|
142
157
|
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
143
158
|
s.add_development_dependency(%q<murdoc>, [">= 0"])
|
144
|
-
s.add_runtime_dependency(%q<activesupport>, [">= 0"])
|
145
|
-
s.add_runtime_dependency(%q<json_pure>, [">= 0"])
|
146
|
-
s.add_runtime_dependency(%q<rgl>, [">= 0"])
|
147
|
-
s.add_runtime_dependency(%q<choice>, [">= 0"])
|
148
159
|
else
|
149
160
|
s.add_dependency(%q<activesupport>, [">= 0"])
|
150
161
|
s.add_dependency(%q<json_pure>, [">= 0"])
|
@@ -154,10 +165,6 @@ Gem::Specification.new do |s|
|
|
154
165
|
s.add_dependency(%q<rspec>, [">= 0"])
|
155
166
|
s.add_dependency(%q<jeweler>, [">= 0"])
|
156
167
|
s.add_dependency(%q<murdoc>, [">= 0"])
|
157
|
-
s.add_dependency(%q<activesupport>, [">= 0"])
|
158
|
-
s.add_dependency(%q<json_pure>, [">= 0"])
|
159
|
-
s.add_dependency(%q<rgl>, [">= 0"])
|
160
|
-
s.add_dependency(%q<choice>, [">= 0"])
|
161
168
|
end
|
162
169
|
else
|
163
170
|
s.add_dependency(%q<activesupport>, [">= 0"])
|
@@ -168,10 +175,6 @@ Gem::Specification.new do |s|
|
|
168
175
|
s.add_dependency(%q<rspec>, [">= 0"])
|
169
176
|
s.add_dependency(%q<jeweler>, [">= 0"])
|
170
177
|
s.add_dependency(%q<murdoc>, [">= 0"])
|
171
|
-
s.add_dependency(%q<activesupport>, [">= 0"])
|
172
|
-
s.add_dependency(%q<json_pure>, [">= 0"])
|
173
|
-
s.add_dependency(%q<rgl>, [">= 0"])
|
174
|
-
s.add_dependency(%q<choice>, [">= 0"])
|
175
178
|
end
|
176
179
|
end
|
177
180
|
|
data/lib/jsus.rb
CHANGED
@@ -18,6 +18,7 @@ require 'jsus/packager'
|
|
18
18
|
require 'jsus/pool'
|
19
19
|
require 'jsus/tree'
|
20
20
|
require 'jsus/documenter'
|
21
|
+
require 'jsus/validator'
|
21
22
|
#
|
22
23
|
# Jsus — a library for packaging up your source files.
|
23
24
|
#
|
@@ -34,4 +35,8 @@ module Jsus
|
|
34
35
|
def self.verbose=(verbose)
|
35
36
|
@verbose = verbose
|
36
37
|
end
|
38
|
+
|
39
|
+
def self.version
|
40
|
+
@version ||= File.read(File.dirname(__FILE__) + "/../VERSION")
|
41
|
+
end
|
37
42
|
end
|
data/lib/jsus/package.rb
CHANGED
@@ -29,10 +29,14 @@ module Jsus
|
|
29
29
|
Dir.chdir(directory) do
|
30
30
|
files.each do |source|
|
31
31
|
source_file = SourceFile.from_file(source, :package => self)
|
32
|
-
if source_file
|
33
|
-
|
32
|
+
if source_file
|
33
|
+
if source_file.extension?
|
34
|
+
extensions << source_file
|
35
|
+
else
|
36
|
+
source_files << source_file
|
37
|
+
end
|
34
38
|
else
|
35
|
-
|
39
|
+
puts "Warning: #{source} is not found for #{name}" if Jsus.verbose?
|
36
40
|
end
|
37
41
|
end
|
38
42
|
end
|
data/lib/jsus/source_file.rb
CHANGED
@@ -5,6 +5,8 @@
|
|
5
5
|
#
|
6
6
|
#
|
7
7
|
module Jsus
|
8
|
+
class BadSourceFileException < Exception; end
|
9
|
+
|
8
10
|
class SourceFile
|
9
11
|
attr_accessor :relative_filename, :filename, :package # :nodoc:
|
10
12
|
# Constructors
|
@@ -45,12 +47,16 @@ module Jsus
|
|
45
47
|
options[:content] = source
|
46
48
|
new(options)
|
47
49
|
else
|
48
|
-
|
49
|
-
nil
|
50
|
+
raise BadSourceFileException, "#{filename} is missing a header or header is invalid"
|
50
51
|
end
|
51
52
|
else
|
52
|
-
|
53
|
-
|
53
|
+
raise BadSourceFileException, "Referenced #{filename} does not exist. #{options[:package] ? "Referenced from package #{options[:package].name}" : ""}"
|
54
|
+
end
|
55
|
+
rescue Exception => e
|
56
|
+
if !e.kind_of?(BadSourceFileException) # if we didn't raise the error; like in YAML, for example
|
57
|
+
raise "Exception #{e.inspect} happened on #{filename}. Please take appropriate measures"
|
58
|
+
else # if we did it, just reraise
|
59
|
+
raise e
|
54
60
|
end
|
55
61
|
end
|
56
62
|
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Jsus
|
2
|
+
module Validator
|
3
|
+
class Base
|
4
|
+
def initialize(pool_or_array_or_container)
|
5
|
+
self.source_files = pool_or_array_or_container
|
6
|
+
end
|
7
|
+
|
8
|
+
def source_files
|
9
|
+
@source_files ||= []
|
10
|
+
end
|
11
|
+
alias_method :sources, :source_files
|
12
|
+
|
13
|
+
def source_files=(pool_or_array_or_container)
|
14
|
+
case pool_or_array_or_container
|
15
|
+
when Pool
|
16
|
+
@source_files = pool_or_array_or_container.sources.to_a
|
17
|
+
when Array
|
18
|
+
@source_files = pool_or_array_or_container
|
19
|
+
when Container
|
20
|
+
@source_files = pool_or_array_or_container.to_a
|
21
|
+
end
|
22
|
+
end
|
23
|
+
alias_method :sources=, :source_files=
|
24
|
+
|
25
|
+
def validate
|
26
|
+
validation_errors.empty?
|
27
|
+
end
|
28
|
+
|
29
|
+
def validation_errors
|
30
|
+
[]
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.validate(*args)
|
34
|
+
new(*args).validate
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Jsus
|
2
|
+
module Validator
|
3
|
+
class Mooforge < Base
|
4
|
+
def validation_errors
|
5
|
+
@validation_errors ||= sources.inject([]) do |result, sf|
|
6
|
+
if !sf.header
|
7
|
+
result << "#{sf.filename} is missing header"
|
8
|
+
elsif !sf.header["authors"]
|
9
|
+
result << "#{sf.filename} is missing authors"
|
10
|
+
elsif !sf.header["license"]
|
11
|
+
result << "#{sf.filename} is missing license"
|
12
|
+
else
|
13
|
+
result
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
/*
|
2
|
+
---
|
3
|
+
|
4
|
+
script: Input.Color.js
|
5
|
+
|
6
|
+
description: Cool colorpicker for everyone to enjoy
|
7
|
+
|
8
|
+
license: MIT-style license
|
9
|
+
|
10
|
+
authors:
|
11
|
+
- Yaroslaff Fedin
|
12
|
+
|
13
|
+
requires:
|
14
|
+
- Input
|
15
|
+
- Color
|
16
|
+
|
17
|
+
provides: [Input.Color]
|
18
|
+
|
19
|
+
...
|
20
|
+
*/
|
@@ -0,0 +1,11 @@
|
|
1
|
+
name: Orwik
|
2
|
+
filename: orwik.js
|
3
|
+
web: http://orwik.com
|
4
|
+
description: Orwik widgets and essensial things
|
5
|
+
license: MIT-Style License, http://mootools.net/license
|
6
|
+
copyright: 2008-2010 Yaroslaff Fedin http://orwik.com/people/inviz
|
7
|
+
authors: Orwik team, http://developers.orwik.com
|
8
|
+
sources:
|
9
|
+
- "Source/Library/Valid.js"
|
10
|
+
- "Source/Library/InvalidNoAuthors.js"
|
11
|
+
- "Source/Library/InvalidNoLicense.js"
|
@@ -23,17 +23,24 @@ describe Jsus::SourceFile do
|
|
23
23
|
end
|
24
24
|
|
25
25
|
context "when format is invalid" do
|
26
|
-
it "should
|
27
|
-
Jsus::SourceFile.from_file('spec/data/bad_test_source_one.js').should
|
28
|
-
Jsus::SourceFile.from_file('spec/data/bad_test_source_two.js').should
|
26
|
+
it "should raise error" do
|
27
|
+
lambda { Jsus::SourceFile.from_file('spec/data/bad_test_source_one.js') }.should raise_error
|
28
|
+
lambda { Jsus::SourceFile.from_file('spec/data/bad_test_source_two.js') }.should raise_error
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
32
|
context "when file does not exist" do
|
33
|
-
it "should
|
34
|
-
Jsus::SourceFile.from_file('spec/data/non-existant-file.js').should
|
33
|
+
it "should raise error" do
|
34
|
+
lambda { Jsus::SourceFile.from_file('spec/data/non-existant-file.js') }.should raise_error
|
35
35
|
end
|
36
36
|
end
|
37
|
+
|
38
|
+
context "when some error happens" do
|
39
|
+
it "should raise error" do
|
40
|
+
YAML.stub!(:load) { raise "Could not parse the file!" }
|
41
|
+
lambda { subject }.should raise_error(RuntimeError, /spec\/data\/test_source_one\.js/)
|
42
|
+
end
|
43
|
+
end
|
37
44
|
end
|
38
45
|
|
39
46
|
it "should set all available fields from constructor" do
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Jsus::Validator::Base do
|
4
|
+
subject { described_class.new(pool) }
|
5
|
+
let(:input_dir) { "spec/data/ChainDependencies/app/javascripts" }
|
6
|
+
let!(:pool) { Jsus::Pool.new(input_dir) }
|
7
|
+
context "initialization" do
|
8
|
+
it "should accept pool as the first argument" do
|
9
|
+
described_class.new(pool).source_files.should =~ pool.sources.to_a
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should accept container as the first argument" do
|
13
|
+
described_class.new(pool.sources).source_files.should =~ pool.sources.to_a
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should accept array as the first argument" do
|
17
|
+
described_class.new(pool.sources.to_a).source_files.should =~ pool.sources.to_a
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should respond to #validate method" do
|
22
|
+
subject.should respond_to(:validate)
|
23
|
+
end
|
24
|
+
|
25
|
+
describe ".validate" do
|
26
|
+
it "should be the same as calling new + validate" do
|
27
|
+
validator = mock
|
28
|
+
described_class.should_receive(:new).with([1]).and_return(validator)
|
29
|
+
validator.should_receive(:validate).and_return(true)
|
30
|
+
described_class.validate([1])
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Jsus::Validator::Mooforge do
|
4
|
+
describe "#validate" do
|
5
|
+
let(:input_dir) { "spec/data/MooforgeValidation/app/javascripts/Orwik/Source/Library" }
|
6
|
+
let!(:sources) {
|
7
|
+
["Valid.js", "InvalidNoAuthors.js", "InvalidNoLicense.js"].map {|fn| Jsus::SourceFile.from_file("#{input_dir}/#{fn}") }
|
8
|
+
}
|
9
|
+
|
10
|
+
it "should return true for valid files" do
|
11
|
+
described_class.validate([sources[0]]).should be_true
|
12
|
+
described_class.new([sources[0]]).validation_errors.should == []
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should return false for files without authors" do
|
16
|
+
described_class.validate([sources[1]]).should be_false
|
17
|
+
described_class.new([sources[1]]).validation_errors[0].should include(sources[1].filename)
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should return false for files without license" do
|
21
|
+
described_class.validate([sources[2]]).should be_false
|
22
|
+
described_class.new([sources[2]]).validation_errors[0].should include(sources[2].filename)
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should return false when some of the files fail" do
|
26
|
+
described_class.validate(sources).should be_false
|
27
|
+
described_class.new(sources).validation_errors.size.should == 2
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 0.
|
7
|
+
- 2
|
8
|
+
- 0
|
9
|
+
version: 0.2.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Mark Abramov
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date:
|
17
|
+
date: 2011-01-15 00:00:00 +03:00
|
18
18
|
default_executable: jsus
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -121,58 +121,6 @@ dependencies:
|
|
121
121
|
type: :development
|
122
122
|
prerelease: false
|
123
123
|
version_requirements: *id008
|
124
|
-
- !ruby/object:Gem::Dependency
|
125
|
-
name: activesupport
|
126
|
-
requirement: &id009 !ruby/object:Gem::Requirement
|
127
|
-
none: false
|
128
|
-
requirements:
|
129
|
-
- - ">="
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
segments:
|
132
|
-
- 0
|
133
|
-
version: "0"
|
134
|
-
type: :runtime
|
135
|
-
prerelease: false
|
136
|
-
version_requirements: *id009
|
137
|
-
- !ruby/object:Gem::Dependency
|
138
|
-
name: json_pure
|
139
|
-
requirement: &id010 !ruby/object:Gem::Requirement
|
140
|
-
none: false
|
141
|
-
requirements:
|
142
|
-
- - ">="
|
143
|
-
- !ruby/object:Gem::Version
|
144
|
-
segments:
|
145
|
-
- 0
|
146
|
-
version: "0"
|
147
|
-
type: :runtime
|
148
|
-
prerelease: false
|
149
|
-
version_requirements: *id010
|
150
|
-
- !ruby/object:Gem::Dependency
|
151
|
-
name: rgl
|
152
|
-
requirement: &id011 !ruby/object:Gem::Requirement
|
153
|
-
none: false
|
154
|
-
requirements:
|
155
|
-
- - ">="
|
156
|
-
- !ruby/object:Gem::Version
|
157
|
-
segments:
|
158
|
-
- 0
|
159
|
-
version: "0"
|
160
|
-
type: :runtime
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: *id011
|
163
|
-
- !ruby/object:Gem::Dependency
|
164
|
-
name: choice
|
165
|
-
requirement: &id012 !ruby/object:Gem::Requirement
|
166
|
-
none: false
|
167
|
-
requirements:
|
168
|
-
- - ">="
|
169
|
-
- !ruby/object:Gem::Version
|
170
|
-
segments:
|
171
|
-
- 0
|
172
|
-
version: "0"
|
173
|
-
type: :runtime
|
174
|
-
prerelease: false
|
175
|
-
version_requirements: *id012
|
176
124
|
description: Javascript packager and dependency resolver
|
177
125
|
email: markizko@gmail.com
|
178
126
|
executables:
|
@@ -206,6 +154,9 @@ files:
|
|
206
154
|
- lib/jsus/source_file.rb
|
207
155
|
- lib/jsus/tag.rb
|
208
156
|
- lib/jsus/tree.rb
|
157
|
+
- lib/jsus/validator.rb
|
158
|
+
- lib/jsus/validator/base.rb
|
159
|
+
- lib/jsus/validator/mooforge.rb
|
209
160
|
- markup/index_template.haml
|
210
161
|
- markup/stylesheet.css
|
211
162
|
- markup/template.haml
|
@@ -250,6 +201,14 @@ files:
|
|
250
201
|
- spec/data/JsonPackage/Source/SheetParser.CSS.js
|
251
202
|
- spec/data/JsonPackage/Source/sg-regex-tools.js
|
252
203
|
- spec/data/JsonPackage/package.json
|
204
|
+
- spec/data/MooforgeValidation/README
|
205
|
+
- spec/data/MooforgeValidation/app/javascripts/Orwik/Source/Library/InvalidNoAuthors.js
|
206
|
+
- spec/data/MooforgeValidation/app/javascripts/Orwik/Source/Library/InvalidNoLicense.js
|
207
|
+
- spec/data/MooforgeValidation/app/javascripts/Orwik/Source/Library/Valid.js
|
208
|
+
- spec/data/MooforgeValidation/app/javascripts/Orwik/Source/Widget/Input/Input.Color.js
|
209
|
+
- spec/data/MooforgeValidation/app/javascripts/Orwik/Source/Widget/Input/Input.js
|
210
|
+
- spec/data/MooforgeValidation/app/javascripts/Orwik/Source/Widget/Widget.js
|
211
|
+
- spec/data/MooforgeValidation/app/javascripts/Orwik/package.yml
|
253
212
|
- spec/data/OutsideDependencies/README
|
254
213
|
- spec/data/OutsideDependencies/app/javascripts/Core/Source/Class/Class.Extras.js
|
255
214
|
- spec/data/OutsideDependencies/app/javascripts/Core/Source/Class/Class.js
|
@@ -271,6 +230,8 @@ files:
|
|
271
230
|
- spec/jsus/source_file_spec.rb
|
272
231
|
- spec/jsus/tag_spec.rb
|
273
232
|
- spec/jsus/tree_spec.rb
|
233
|
+
- spec/jsus/validator/base_spec.rb
|
234
|
+
- spec/jsus/validator/mooforge_spec.rb
|
274
235
|
- spec/shared/class_stubs.rb
|
275
236
|
- spec/spec_helper.rb
|
276
237
|
has_rdoc: true
|
@@ -287,7 +248,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
287
248
|
requirements:
|
288
249
|
- - ">="
|
289
250
|
- !ruby/object:Gem::Version
|
290
|
-
hash:
|
251
|
+
hash: -2818897829593218981
|
291
252
|
segments:
|
292
253
|
- 0
|
293
254
|
version: "0"
|
@@ -315,5 +276,7 @@ test_files:
|
|
315
276
|
- spec/jsus/source_file_spec.rb
|
316
277
|
- spec/jsus/tag_spec.rb
|
317
278
|
- spec/jsus/tree_spec.rb
|
279
|
+
- spec/jsus/validator/base_spec.rb
|
280
|
+
- spec/jsus/validator/mooforge_spec.rb
|
318
281
|
- spec/shared/class_stubs.rb
|
319
282
|
- spec/spec_helper.rb
|