guard-jasmine-rails 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 877aa26df5335413da671494e46f6bc47ba02c0a
4
- data.tar.gz: 6cbe72291827b389a4ae776dd7ab64dabe7ce578
3
+ metadata.gz: d206f30c6b8169dd5a9328ec6a14d950d4236cc8
4
+ data.tar.gz: ec890c3cd99f3afdb1cd572d50723a21ea6fa6ac
5
5
  SHA512:
6
- metadata.gz: ca4ab5ffd83a1d6bf3d4e5e230f881feb0bd10aa899296da4fb3c0088eb9735032f895cb9507601000d94349885389c8ceea0b99b810a07297e05e54b7978802
7
- data.tar.gz: ab838b0a6e75fcf2ea2de380ab7563682e16188cc3b7df07e23b886cd2aba58d9674856b6ad45626c9a77aa390524fb905b348985a2c592a019f2cbeb8b0125a
6
+ metadata.gz: 7354060e799a25b491a616c5f8eccea091c9869d2c8936cd22cf58b529b2a985119d5113e07295222aacc33cdd74b40c092236d5953c82f63384811141bcee51
7
+ data.tar.gz: ba5ddf636f24ea739104d4ad6106b0230cd2114ca08d0d8f742290741a059e8e78b12c0c9d039cf79a1f332527974d196ee7c929a8c4c5cf36bcd00e80b70c87
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,6 @@
1
+ ## Contribution Guidelines
2
+ 1. Fork the repository
3
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
4
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
5
+ 4. Push to the branch (`git push origin my-new-feature`)
6
+ 5. Create new Pull Request
data/README.md CHANGED
@@ -4,15 +4,19 @@ Guard Plugin for running Jasmine Javascript tests via the [JasmineRails gem](htt
4
4
 
5
5
  ## Installation
6
6
 
7
+ Install gem via rubygems:
8
+ ```bash
9
+ $ gem install guard-jasmine-rails
7
10
  ```
8
- # Gemfile
9
- gem 'jasmine-rails'
10
- gem 'guard-jasmine-rails'
11
+
12
+ Setup your Guardfile with the proper configuration with:
13
+ ```bash
14
+ $ guard init jasmine-rails
11
15
  ```
12
16
 
13
17
  ## Usage
14
18
 
15
- ```
19
+ ```ruby
16
20
  # Guardfile
17
21
  guard 'jasmine-rails' do
18
22
  watch(%r{spec/javascripts/.+_spec\.(js\.coffee|js|coffee)$})
@@ -25,7 +29,8 @@ end
25
29
  ### Options
26
30
 
27
31
  configure the plugin by passing options into the guard initializer. ex:
28
- ```
32
+
33
+ ```ruby
29
34
  # example to configure plugin
30
35
  guard 'jasmine-rails', all_on_start: false do
31
36
  end
@@ -34,10 +39,9 @@ end
34
39
  #### `all_on_start` (default true)
35
40
  toggle running all Jasmine tests when Guard is first started.
36
41
 
42
+
37
43
  ## Contributing
38
44
 
39
- 1. Fork it
40
- 2. Create your feature branch (`git checkout -b my-new-feature`)
41
- 3. Commit your changes (`git commit -am 'Add some feature'`)
42
- 4. Push to the branch (`git push origin my-new-feature`)
43
- 5. Create new Pull Request
45
+ Patches are always welcome and thank you to all [project contributors](https://github.com/thegarage/guard-jasmine-rails/graphs/contributors)!
46
+
47
+ Interested in contributing? Review the project [contribution guidelines](CONTRIBUTING.md) and get started!
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "guard-jasmine-rails"
7
- spec.version = "1.0.0"
7
+ spec.version = "1.1.0"
8
8
  spec.authors = ["Ryan Sonnek"]
9
9
  spec.email = ["ryan@codecrate.com"]
10
10
  spec.description = "A Guard for Jasmine Rails."
@@ -7,6 +7,8 @@ module Guard
7
7
  DEFAULTS = {
8
8
  all_on_start: true
9
9
  }
10
+ LOG_PREFIX = 'Guard::JasmineRails'
11
+ NOTIFICATION_TITLE = 'Jasmine results'
10
12
 
11
13
  def initialize(watchers = [], options = {})
12
14
  super watchers, DEFAULTS.merge(options)
@@ -51,14 +53,24 @@ module Guard
51
53
  log "Running: #{command}", :debug
52
54
  success = system(command)
53
55
  if success
54
- log 'Success!'
56
+ log 'No failures detected'
57
+ notify 'All specs passed.', :success
55
58
  else
56
59
  log "Error running specs", :error
60
+ notify 'Error running specs.', :failed
57
61
  end
58
62
  end
59
63
 
60
64
  def log(message, level = :info)
61
- UI.send(level, "Guard::JasmineRails #{message}")
65
+ UI.send(level, [LOG_PREFIX, message].join(' '))
66
+ end
67
+
68
+ def notify(message, type = :success)
69
+ priority = {
70
+ failed: 2,
71
+ success: -2
72
+ }[type]
73
+ ::Guard::Notifier.notify(message, title: NOTIFICATION_TITLE , image: type, priority: priority)
62
74
  end
63
75
  end
64
76
  end
@@ -0,0 +1,5 @@
1
+ guard 'jasmine-rails', all_on_start: false do
2
+ watch(%r{spec/javascripts/helpers/.+\.(js|coffee)})
3
+ watch(%r{spec/javascripts/.+_spec\.(js\.coffee|js|coffee)$})
4
+ watch(%r{app/assets/javascripts/(.+?)\.(js\.coffee|js|coffee)(?:\.\w+)*$}) { |m| "spec/javascripts/#{ m[1] }_spec.#{ m[2] }" }
5
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-jasmine-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Sonnek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-27 00:00:00.000000000 Z
11
+ date: 2014-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard
@@ -60,12 +60,14 @@ extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
62
  - .gitignore
63
+ - CONTRIBUTING.md
63
64
  - Gemfile
64
65
  - LICENSE.txt
65
66
  - README.md
66
67
  - Rakefile
67
68
  - guard-jasmine-rails.gemspec
68
69
  - lib/guard/jasmine-rails.rb
70
+ - lib/guard/jasmine-rails/templates/Guardfile
69
71
  homepage: ''
70
72
  licenses:
71
73
  - MIT
@@ -86,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
88
  version: '0'
87
89
  requirements: []
88
90
  rubyforge_project:
89
- rubygems_version: 2.0.6
91
+ rubygems_version: 2.0.14
90
92
  signing_key:
91
93
  specification_version: 4
92
94
  summary: A plugin to run Jasmine Javascript specs automatically through Guard.