pronto-jscs 0.0.5 → 0.0.6

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: 54183aa2fba02980a7554a60de68074ae251e49f
4
- data.tar.gz: c3994cc371f36a59ff99d6a055d5d4562ed0064b
3
+ metadata.gz: d7f8ae14d0ba4df47b6b18ab6d25b974871733e6
4
+ data.tar.gz: 22fe169238d9ff68888dbe00249ddfb6a749e345
5
5
  SHA512:
6
- metadata.gz: e5464c915abb62941dac376929e46d1f8316f7bac356a7290069967fc21b118f8c7a7770f1b10687cc0df28316668d19657166a72ea414dbc4ea71cdc87a0e72
7
- data.tar.gz: 87b8e92eb93829e33e5191c7b616e32f1f2f2bedf917ad6ef8e8192f20f51be286e54a095dcab9a4f93906179dc5db5263eb820b687bbc3a17a82cd304ae98c3
6
+ metadata.gz: c2e68d0b175d1aa291a85306b97ab11b585e38caecaba2e79f1dfe86e29ade00ad2155bd42bb5e3c2f9e1e9053144e2e255d509f23a1506696812da97b5a126f
7
+ data.tar.gz: a60d3d186648ebcb0a4eac891aceff1c9c1e14f05aa8130ab1f2fa2155a925cf5db7318def6ef119052661d5ecb8368d621787315c992e097c730523e996124a
data/README.md CHANGED
@@ -9,3 +9,8 @@ Pronto runner for [JSCS](http://jscs.info/), JavaScript Code Style checker.
9
9
 
10
10
  You'll need to be able to run `jscs` from command line. See [jscs.info](http://jscs.info).
11
11
 
12
+ ## Config
13
+
14
+ If you have a *.jscsrc* file in the root of your project, that will be used.
15
+ Alternatively the environment variable *JSCSRC_LOCATION* can specify an alternative location.
16
+ Otherwise, the *airbnb* config is used.
@@ -1,5 +1,5 @@
1
1
  module Pronto
2
2
  module JSCS
3
- VERSION = '0.0.5'
3
+ VERSION = '0.0.6'
4
4
  end
5
5
  end
@@ -10,7 +10,13 @@ module Pronto
10
10
  return [] if @patch.nil?
11
11
  path = @patch.new_file_full_path.to_s
12
12
  params = '--reporter=json'
13
- params << ' -p airbnb' unless File.exist?('.jscsrc')
13
+ if ENV['JSCSRC_LOCATION']
14
+ # Use a specific config file if specified
15
+ params << " --config=#{ENV['JSCSRC_LOCATION']}"
16
+ else
17
+ # Fall back to airbnb default
18
+ params << ' -p airbnb' unless File.exist?('.jscsrc')
19
+ end
14
20
  stdout, stderr, _status = Open3.capture3("jscs \"#{path}\" #{params}")
15
21
  puts "WARN: pronto-jscs: #{stderr}" if stderr && stderr.size > 0
16
22
  return [] if stdout.nil? || stdout.size == 0
data/lib/pronto/jscs.rb CHANGED
@@ -31,7 +31,7 @@ module Pronto
31
31
  end
32
32
 
33
33
  def js_file?(path)
34
- %w(.js .erb .html).include?(File.extname(path))
34
+ File.extname(path) == '.js'
35
35
  end
36
36
  end
37
37
  end
data/pronto-jscs.gemspec CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ['lib']
19
19
 
20
- spec.add_runtime_dependency('pronto', '~> 0.5.0')
20
+ spec.add_runtime_dependency('pronto', '~> 0.5.0', '< 0.6.0')
21
21
  spec.add_development_dependency 'bundler', '~> 1.10'
22
22
  spec.add_development_dependency 'rake', '~> 10.0'
23
23
  spec.add_development_dependency 'rspec', '~> 3.3'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pronto-jscs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Varaneckas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-05 00:00:00.000000000 Z
11
+ date: 2016-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pronto
@@ -17,6 +17,9 @@ dependencies:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.5.0
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: 0.6.0
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -24,6 +27,9 @@ dependencies:
24
27
  - - "~>"
25
28
  - !ruby/object:Gem::Version
26
29
  version: 0.5.0
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: 0.6.0
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: bundler
29
35
  requirement: !ruby/object:Gem::Requirement