guard-jslint 0.0.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6765be1dbde7f0100095855ed29085e020c5c39c
4
+ data.tar.gz: 5e78ffd18bd8d80fcfb1b6759e72d81de8b45182
5
+ SHA512:
6
+ metadata.gz: 66b83b145446be5bbb6112c8bc16e97aa8de31bdc3fe227bcb17b018eee7ab7a9fde8dfc97d02bc036eedb66c23322ac686b7c845385c6199678735b9adf9926
7
+ data.tar.gz: 5b7146422d49eedd11d2edacd4d84a066d394d1c5cc445f511c68cebf7cf92c1b60d5698c3480b2ccc6d820cc59236b887b62c08053ed1b5f19150c010417bf9
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in guard-jslint.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Stuart Hanscombe
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,42 @@
1
+ # Guard::Jslint
2
+
3
+ TODO: This is very much in Beta,
4
+
5
+
6
+ ## Installation
7
+
8
+
9
+ Add Guard::Jslint to your Gemfile:
10
+
11
+ group :development, :test do
12
+ gem 'guard-jslint'
13
+ end
14
+
15
+ Add the default Guard::Jslint template to your Guardfile by running:
16
+
17
+ $ guard init jslint
18
+
19
+ Add this line to your application's Gemfile:
20
+
21
+ gem 'guard-jslint'
22
+
23
+ And then execute:
24
+
25
+ $ bundle
26
+
27
+ Or install it yourself as:
28
+
29
+ $ gem install guard-jslint
30
+
31
+ ## Usage
32
+
33
+ TODO: Currently this will only run on specific files, there is no
34
+ re-run.
35
+
36
+ ## Contributing
37
+
38
+ 1. Fork it ( http://github.com/<my-github-username>/guard-jslint/fork )
39
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
40
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
41
+ 4. Push to the branch (`git push origin my-new-feature`)
42
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "guard-jslint"
7
+ spec.version = "0.0.1"
8
+ spec.authors = ["Stuart Hanscombe"]
9
+ spec.email = ["hanscs1969@yahoo.co.uk"]
10
+ spec.summary = %q{Add Jslint to your Guardfile.}
11
+ spec.description = %q{Run your specs with Jslint watching your javascripts. BETA}
12
+ spec.homepage = "https://github.com/thelazycamel/guard-jslint"
13
+ spec.license = "MIT"
14
+
15
+ spec.files = `git ls-files -z`.split("\x0")
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_development_dependency "bundler", "~> 1.5"
21
+ spec.add_development_dependency "rake", "~> 0"
22
+ spec.add_dependency 'guard-compat', '~> 1.1'
23
+ spec.add_dependency 'jslint', '~> 1'
24
+ end
@@ -0,0 +1,101 @@
1
+ require 'guard'
2
+ require 'guard/guard'
3
+ require 'guard/notifier'
4
+ require 'jslint'
5
+ require 'terminal-notifier-guard'
6
+
7
+ module Guard
8
+ class Jslint < Guard
9
+ # Initializes a Guard plugin.
10
+ # Don't do any work here, especially as Guard plugins get initialized even if they are not in an active group!
11
+ #
12
+ # @param [Hash] options the custom Guard plugin options
13
+ # @option options [Array<Guard::Watcher>] watchers the Guard plugin file watchers
14
+ # @option options [Symbol] group the group this Guard plugin belongs to
15
+ # @option options [Boolean] any_return allow any object to be returned from a watcher
16
+ #
17
+ def initialize(watchers = [], options = {})
18
+ super
19
+ end
20
+
21
+ # Called once when Guard starts. Please override initialize method to init stuff.
22
+ #
23
+ # @raise [:task_has_failed] when start has failed
24
+ # @return [Object] the task result
25
+ #
26
+ def start
27
+ puts "Guard::Jslint Started"
28
+ end
29
+
30
+ # Called when `stop|quit|exit|s|q|e + enter` is pressed (when Guard quits).
31
+ #
32
+ # @raise [:task_has_failed] when stop has failed
33
+ # @return [Object] the task result
34
+ #
35
+ def stop
36
+ end
37
+
38
+ # Called when `reload|r|z + enter` is pressed.
39
+ # This method should be mainly used for "reload" (really!) actions like reloading passenger/spork/bundler/...
40
+ #
41
+ # @raise [:task_has_failed] when reload has failed
42
+ # @return [Object] the task result
43
+ #
44
+ def reload
45
+ end
46
+
47
+ # Called when just `enter` is pressed
48
+ # This method should be principally used for long action like running all specs/tests/...
49
+ #
50
+ # @raise [:task_has_failed] when run_all has failed
51
+ # @return [Object] the task result
52
+ #
53
+ def run_all
54
+ UI.info("Jslint: run_all method not yet created, please run from terminal")
55
+ end
56
+
57
+ # Called on file(s) additions that the Guard plugin watches.
58
+ #
59
+ # @param [Array<String>] paths the changes files or paths
60
+ # @raise [:task_has_failed] when run_on_additions has failed
61
+ # @return [Object] the task result
62
+ #
63
+ def run_on_additions(paths)
64
+ end
65
+
66
+ # Called on file(s) modifications that the Guard plugin watches.
67
+ #
68
+ # @param [Array<String>] paths the changes files or paths
69
+ # @raise [:task_has_failed] when run_on_modifications has failed
70
+ # @return [Object] the task result
71
+ #
72
+ def run_on_modifications(paths)
73
+ begin
74
+ paths.each do |path|
75
+ puts "Running jslint on #{path}"
76
+ cmd = system("bundle exec jslint #{path}")
77
+ if cmd == true
78
+ TerminalNotifier::Guard.success("Success, all your JavaScript is looking good", title: "Guard::Jslint")
79
+ UI.info("Jslint: Success, all your JavaScript is looking good")
80
+ else
81
+ TerminalNotifier::Guard.failed("Errors in your JavaScript", title: "Guard::Jslint")
82
+ UI.error("Jslint: Errors in your JavaScript")
83
+ end
84
+ end
85
+ rescue
86
+ TerminalNotifier::Guard.failed("Unable to run jslint on given paths", title: "Guard::Jslint")
87
+ UI.error("ERROR:: Unable to run jslint on given paths")
88
+ end
89
+ end
90
+
91
+ # Called on file(s) removals that the Guard plugin watches.
92
+ #
93
+ # @param [Array<String>] paths the changes files or paths
94
+ # @raise [:task_has_failed] when run_on_removals has failed
95
+ # @return [Object] the task result
96
+ #
97
+ def run_on_removals(paths)
98
+ end
99
+
100
+ end
101
+ end
@@ -0,0 +1,4 @@
1
+ guard 'jslint' do
2
+ watch(%r{^public/javascripts/.*\.js$})
3
+ watch('config/jslint.yml')
4
+ end
metadata ADDED
@@ -0,0 +1,108 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: guard-jslint
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Stuart Hanscombe
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-04-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.5'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: guard-compat
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.1'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.1'
55
+ - !ruby/object:Gem::Dependency
56
+ name: jslint
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1'
69
+ description: Run your specs with Jslint watching your javascripts. BETA
70
+ email:
71
+ - hanscs1969@yahoo.co.uk
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - Gemfile
78
+ - LICENSE.txt
79
+ - README.md
80
+ - Rakefile
81
+ - guard-jslint.gemspec
82
+ - lib/guard/jslint.rb
83
+ - lib/guard/jslint/templates/Guardfile
84
+ homepage: https://github.com/thelazycamel/guard-jslint
85
+ licenses:
86
+ - MIT
87
+ metadata: {}
88
+ post_install_message:
89
+ rdoc_options: []
90
+ require_paths:
91
+ - lib
92
+ required_ruby_version: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ required_rubygems_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ requirements: []
103
+ rubyforge_project:
104
+ rubygems_version: 2.2.0
105
+ signing_key:
106
+ specification_version: 4
107
+ summary: Add Jslint to your Guardfile.
108
+ test_files: []