checker 0.0.2 → 0.0.3
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.
- data/.gitignore +1 -0
- data/checker.gemspec +2 -2
- data/lib/checker.rb +3 -1
- data/lib/checker/modules/coffeescript.rb +34 -0
- data/lib/checker/modules/pry.rb +1 -1
- data/lib/checker/modules/sass.rb +34 -0
- metadata +5 -2
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
*.gem
|
data/checker.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'checker'
|
3
|
-
s.version = '0.0.
|
4
|
-
s.date = '2012-
|
3
|
+
s.version = '0.0.3'
|
4
|
+
s.date = '2012-06-07'
|
5
5
|
s.summary = "Syntax checker for various files"
|
6
6
|
s.description = "A collection of modules which every is designed to check syntax for specific files."
|
7
7
|
s.authors = ["Jacek Jakubik"]
|
data/lib/checker.rb
CHANGED
@@ -0,0 +1,34 @@
|
|
1
|
+
module Checker
|
2
|
+
module Modules
|
3
|
+
class Coffeescript
|
4
|
+
def self.check
|
5
|
+
puts ">> Coffeescript <<"
|
6
|
+
|
7
|
+
unless Coffeescript.check_for_executable
|
8
|
+
puts "coffee executable NOT FOUND, OMITTING..."
|
9
|
+
return true
|
10
|
+
end
|
11
|
+
|
12
|
+
files = Utils.files_modified
|
13
|
+
files.delete_if {|f| !f.ends_with?(".coffee")}
|
14
|
+
|
15
|
+
files.map! do |f|
|
16
|
+
puts "Checking #{f}..."
|
17
|
+
Coffeescript.check_one(f)
|
18
|
+
end
|
19
|
+
|
20
|
+
files.all_true?
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.check_one(file)
|
24
|
+
system("cat #{file} | egrep -v '^//=' | coffee -sc > /dev/null")
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.check_for_executable
|
28
|
+
cmd = "coffee -v"
|
29
|
+
system(cmd)
|
30
|
+
$?.exitstatus == 0
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
data/lib/checker/modules/pry.rb
CHANGED
@@ -0,0 +1,34 @@
|
|
1
|
+
module Checker
|
2
|
+
module Modules
|
3
|
+
class Sass
|
4
|
+
def self.check
|
5
|
+
puts ">> Sass <<"
|
6
|
+
|
7
|
+
unless Sass.check_for_executable
|
8
|
+
puts "sass executable NOT FOUND, OMITTING..."
|
9
|
+
return true
|
10
|
+
end
|
11
|
+
|
12
|
+
files = Utils.files_modified
|
13
|
+
files.delete_if {|f| !f.ends_with?(".scss") and !f.ends_with?(".sass")}
|
14
|
+
|
15
|
+
files.map! do |f|
|
16
|
+
puts "Checking #{f}..."
|
17
|
+
Sass.check_one(f)
|
18
|
+
end
|
19
|
+
|
20
|
+
files.all_true?
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.check_one(file)
|
24
|
+
system("sass #{file} > /dev/null")
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.check_for_executable
|
28
|
+
cmd = "sass -v"
|
29
|
+
system(cmd)
|
30
|
+
$?.exitstatus == 0
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: checker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-06-07 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: A collection of modules which every is designed to check syntax for specific
|
15
15
|
files.
|
@@ -19,6 +19,7 @@ executables:
|
|
19
19
|
extensions: []
|
20
20
|
extra_rdoc_files: []
|
21
21
|
files:
|
22
|
+
- .gitignore
|
22
23
|
- README
|
23
24
|
- bin/checker
|
24
25
|
- checker.gemspec
|
@@ -27,9 +28,11 @@ files:
|
|
27
28
|
- lib/checker/cli/execute.rb
|
28
29
|
- lib/checker/core_ext.rb
|
29
30
|
- lib/checker/modules/all.rb
|
31
|
+
- lib/checker/modules/coffeescript.rb
|
30
32
|
- lib/checker/modules/haml.rb
|
31
33
|
- lib/checker/modules/pry.rb
|
32
34
|
- lib/checker/modules/ruby.rb
|
35
|
+
- lib/checker/modules/sass.rb
|
33
36
|
- lib/checker/utils.rb
|
34
37
|
homepage: http://github.com/netguru/checker
|
35
38
|
licenses: []
|