guard-opal-rails 0.1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/.rubocop.yml +1 -0
- data/.rubocop_todo.yml +35 -0
- data/Gemfile +4 -0
- data/Guardfile +28 -0
- data/LICENSE.txt +22 -0
- data/README.md +82 -0
- data/Rakefile +4 -0
- data/guard-opal-rails.gemspec +30 -0
- data/lib/guard/opal-rails.rb +132 -0
- data/lib/guard/opal-rails/null_process_toggle.rb +18 -0
- data/lib/guard/opal-rails/process_toggle.rb +12 -0
- data/lib/guard/opal-rails/process_toggle_factory.rb +22 -0
- data/lib/guard/opal-rails/standalone_spec_server_process_toggle.rb +24 -0
- data/lib/guard/opal-rails/templates/Guardfile +10 -0
- data/lib/guard/opal-rails/version.rb +6 -0
- data/spec/lib/guard/opal-rails/process_toggle_factory_spec.rb +20 -0
- data/spec/lib/guard/opal-rails/standalone_spec_server_process_toggle_spec.rb +13 -0
- metadata +178 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b146594f065fa51c85b92c3d0c8d7f21ec50a295
|
4
|
+
data.tar.gz: 74d94ff26daccf2af6f03ada444835f03e9fc3ce
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8fd6c3402aaafac3a7b0a8818593b6d16b5c02f4f03fac3401cbc9d004bda145ddca08abd227c0cc0abfc95b10a50f054405cf38f14cee5e37f15c2567a15463
|
7
|
+
data.tar.gz: 9038f3bc2f842b4a9917615c72042635f5c9397510cd3f3ef40963a986c0a01e568a05ed1d46ab31e687e1ef93154a70c5338edc023e0666ac7696f3c0d069c8
|
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# This configuration was generated by `rubocop --auto-gen-config`
|
2
|
+
# on 2015-03-09 12:47:55 -0700 using RuboCop version 0.29.1.
|
3
|
+
# The point is for the user to remove these configuration records
|
4
|
+
# one by one as the offenses are removed from the code base.
|
5
|
+
# Note that changes in the inspected code, or installation of new
|
6
|
+
# versions of RuboCop, may require this file to be generated again.
|
7
|
+
|
8
|
+
# Offense count: 9
|
9
|
+
# Configuration parameters: AllowURI, URISchemes.
|
10
|
+
Metrics/LineLength:
|
11
|
+
Max: 180
|
12
|
+
|
13
|
+
# Offense count: 1
|
14
|
+
# Cop supports --auto-correct.
|
15
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
16
|
+
Style/BracesAroundHashParameters:
|
17
|
+
Enabled: false
|
18
|
+
|
19
|
+
# Offense count: 4
|
20
|
+
# Cop supports --auto-correct.
|
21
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
22
|
+
Style/HashSyntax:
|
23
|
+
Enabled: false
|
24
|
+
|
25
|
+
# Offense count: 2
|
26
|
+
# Cop supports --auto-correct.
|
27
|
+
# Configuration parameters: SupportedStyles.
|
28
|
+
Style/LambdaCall:
|
29
|
+
EnforcedStyle: braces
|
30
|
+
|
31
|
+
# Offense count: 4
|
32
|
+
# Configuration parameters: MaxSlashes.
|
33
|
+
Style/RegexpLiteral:
|
34
|
+
Enabled: false
|
35
|
+
|
data/Gemfile
ADDED
data/Guardfile
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
group :specs, halt_on_fail: true do
|
2
|
+
guard :rspec, cmd: 'bundle exec rspec' do
|
3
|
+
require 'guard/rspec/dsl'
|
4
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
5
|
+
|
6
|
+
# RSpec files
|
7
|
+
rspec = dsl.rspec
|
8
|
+
watch(rspec.spec_files)
|
9
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
10
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
11
|
+
|
12
|
+
# Ruby files
|
13
|
+
dsl.watch_spec_files_for(dsl.ruby.lib_files)
|
14
|
+
|
15
|
+
watch(%r{^(lib/guard/rspec/template)s/Guardfile$}) do
|
16
|
+
rspec.spec.('lib/guard/rspec/template')
|
17
|
+
end
|
18
|
+
|
19
|
+
watch(%r{^lib/guard/rspec/dsl.rb$}) do
|
20
|
+
rspec.spec.('lib/guard/rspec/template')
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
guard :rubocop, all_on_start: false do
|
25
|
+
watch(%r{.+\.rb$})
|
26
|
+
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
|
27
|
+
end
|
28
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 Forrest Chang
|
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.
|
data/README.md
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
# Guard::OpalRails
|
2
|
+
|
3
|
+
|
4
|
+
Guard::OpalRails automatically launches specs when files are modified. For fast spec runs, it does not use the ```rake opal:spec``` task.
|
5
|
+
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile (inside the development group):
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'guard-opal-rails'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install guard-opal-rails
|
22
|
+
|
23
|
+
Add the guard definition to your Guardfile by running this command:
|
24
|
+
|
25
|
+
```
|
26
|
+
$ guard init opal-rails
|
27
|
+
```
|
28
|
+
|
29
|
+
## Usage
|
30
|
+
|
31
|
+
Please read [Guard usage doc](https://github.com/guard/guard#readme).
|
32
|
+
|
33
|
+
### List of available options:
|
34
|
+
|
35
|
+
``` ruby
|
36
|
+
spec_url: nil # The url to hit to run the specs. Point to your_rails_app/opal_spec
|
37
|
+
# or don't set/set to nil to use standalone server
|
38
|
+
sound_on: true # set to false to turn off, works w/osx terminal-notifier
|
39
|
+
success_sound: "default" # Sound played with successful specs I use a custom applause sound
|
40
|
+
fail_sound: "Sosumi # Sound played with failed specs, defaults to "Sosumi"
|
41
|
+
|
42
|
+
```
|
43
|
+
|
44
|
+
## Notes
|
45
|
+
|
46
|
+
### spec_url and how to run the spec server
|
47
|
+
To run specs, this plugin hits the url specified in spec_url (your_rails_app/opal_spec) or kicks off the standalone spec server defined in opal-rails 0.7.1 and higher (at time of writing you may have to point to my opal-rails fork github.com/fkchang/opal-rails to get this feature. So which server should you use? Some considerations
|
48
|
+
|
49
|
+
#### Reasons to point to your own rails app
|
50
|
+
|
51
|
+
* You're already running your rails app, and don't want the standalone server as yet another process to run.
|
52
|
+
* You run something like pow, your app is always available
|
53
|
+
* You run Windows or JRuby, the current implementation of the standalone spec server uses fork (not supported on windows MRI or Jruby) to daemonize the process
|
54
|
+
* You need to run opal-rails specs in > that 1 project at once, currently the spec server is fixed to startup on localhost:9998
|
55
|
+
|
56
|
+
#### Reasons to use the standalone spec server
|
57
|
+
* Your app isn't always running
|
58
|
+
* You only need to run opal-rails specs in one project at a time
|
59
|
+
|
60
|
+
### Notifications
|
61
|
+
|
62
|
+
The notifications sounds were built and tested around OSX's terminal notifier. Apologies to users of other notification plugins. Additions welcome.
|
63
|
+
|
64
|
+
* Default sounds for success/fail were picked on sounds that ought to exist in OSX defaults (System Preferences > Sound > Sound Effects), I personally use much more dramatic custom sounds to good effect (make sme happy)
|
65
|
+
* Clicking on notification will take you to the spec url page - handy on getting more details on a spec fail
|
66
|
+
|
67
|
+
|
68
|
+
## Contributing
|
69
|
+
|
70
|
+
1. Fork it ( https://github.com/[my-github-username]/guard-opal-rails/fork )
|
71
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
72
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
73
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
74
|
+
5. Create a new Pull Request
|
75
|
+
|
76
|
+
### Author
|
77
|
+
|
78
|
+
[Forrest Chang](https://github.com/fkchang) ([@fkchang2000](https://twitter.com/fkchang2000))
|
79
|
+
|
80
|
+
### Contributors
|
81
|
+
|
82
|
+
[https://github.com/guard/guard-opal-rails/contributors](https://github.com/guard/guard-opal-rails/contributors)
|
data/Rakefile
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'guard/opal-rails/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'guard-opal-rails'
|
8
|
+
spec.version = Guard::OpalRailsVersion::VERSION
|
9
|
+
spec.authors = ['Forrest Chang']
|
10
|
+
spec.email = ['fkc_email-ruby@yahoo.com']
|
11
|
+
spec.summary = 'Guard gem for running specs in opal-rails'
|
12
|
+
spec.description = 'Guard::OpalRails automatically runs your opal specs in rails projects using opal-rails'
|
13
|
+
spec.homepage = ''
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
spec.add_dependency 'guard-compat', '~> 1.2'
|
21
|
+
|
22
|
+
spec.add_development_dependency 'bundler', '~> 1.7'
|
23
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
24
|
+
spec.add_development_dependency 'rspec'
|
25
|
+
# opal spec dir not configurable before this
|
26
|
+
spec.add_development_dependency 'opal-rails' # , '>= 0.7.1'
|
27
|
+
spec.add_development_dependency 'guard-rspec'
|
28
|
+
spec.add_development_dependency 'guard-rubocop'
|
29
|
+
spec.add_runtime_dependency 'opal-rails' # , ">= 0.7.1"
|
30
|
+
end
|
@@ -0,0 +1,132 @@
|
|
1
|
+
# rubocop:disable all
|
2
|
+
require 'guard/opal-rails/version'
|
3
|
+
# rubocop:enable all
|
4
|
+
require 'guard/compat/plugin'
|
5
|
+
require 'guard/opal-rails/process_toggle_factory'
|
6
|
+
|
7
|
+
module Guard
|
8
|
+
# The Guard plugin to run opal-rails specs
|
9
|
+
class OpalRails < Plugin
|
10
|
+
# the plugin states we care about
|
11
|
+
|
12
|
+
# Initializes a Guard plugin.
|
13
|
+
# Don't do any work here, especially as Guard plugins get initialized
|
14
|
+
# even if they are not in an active group!
|
15
|
+
#
|
16
|
+
# @param [Hash] options the custom Guard plugin options
|
17
|
+
# @option options [Array<Guard::Watcher>] watchers the Guard plugin file
|
18
|
+
# watchers
|
19
|
+
# @option options [Symbol] group the group this Guard plugin belongs to
|
20
|
+
# @option options [Boolean] any_return allow any object to be returned from
|
21
|
+
# a watcher
|
22
|
+
#
|
23
|
+
def initialize(options = {})
|
24
|
+
super
|
25
|
+
@process_toggle = ProcessToggleFactory.process_toggle_for options
|
26
|
+
@spec_url = @process_toggle.spec_url
|
27
|
+
@sounds_on = options[:sounds_on] == false ? false : true
|
28
|
+
@success_sound = options[:success_sound] || 'default'
|
29
|
+
@fail_sound = options[:fail_sound] || 'Sosumi'
|
30
|
+
end
|
31
|
+
# Called once when Guard starts. Please override initialize method to init
|
32
|
+
# stuff.
|
33
|
+
#
|
34
|
+
# @raise [:task_has_failed] when start has failed
|
35
|
+
# @return [Object] the task result
|
36
|
+
#
|
37
|
+
def start
|
38
|
+
@process_toggle.start
|
39
|
+
run_opal_specs
|
40
|
+
end
|
41
|
+
|
42
|
+
# Called when `stop|quit|exit|s|q|e + enter` is pressed (when Guard quits).
|
43
|
+
#
|
44
|
+
# @raise [:task_has_failed] when stop has failed
|
45
|
+
# @return [Object] the task result
|
46
|
+
#
|
47
|
+
def stop
|
48
|
+
@process_toggle.stop
|
49
|
+
end
|
50
|
+
|
51
|
+
# Called when just `enter` is pressed
|
52
|
+
# This method should be principally used for long action like running all
|
53
|
+
# specs/tests/...
|
54
|
+
#
|
55
|
+
# @raise [:task_has_failed] when run_all has failed
|
56
|
+
# @return [Object] the task result
|
57
|
+
#
|
58
|
+
def run_all
|
59
|
+
run_opal_specs
|
60
|
+
end
|
61
|
+
|
62
|
+
# Called on file(s) modifications that the Guard plugin watches.
|
63
|
+
#
|
64
|
+
# @param [Array<String>] paths the changes files or paths
|
65
|
+
# @raise [:task_has_failed] when run_on_modifications has failed
|
66
|
+
# @return [Object] the task result
|
67
|
+
#
|
68
|
+
# rubocop:disable all
|
69
|
+
def run_on_modifications(paths)
|
70
|
+
# rubocop:enable all
|
71
|
+
|
72
|
+
run_opal_specs
|
73
|
+
end
|
74
|
+
|
75
|
+
# learned this trick from guard-rails-assets because guard plugins don't
|
76
|
+
# expect to have hyphenated names
|
77
|
+
def self.template(plugin_location)
|
78
|
+
File.read(template_path(plugin_location))
|
79
|
+
end
|
80
|
+
|
81
|
+
def self.template_path(plugin_location)
|
82
|
+
# workaround because Guard discards the '-' when detecting template path
|
83
|
+
File.join(plugin_location, 'lib', 'guard', 'opal-rails', 'templates',
|
84
|
+
'Guardfile')
|
85
|
+
end
|
86
|
+
|
87
|
+
private
|
88
|
+
|
89
|
+
# this is the opal-rspec runner that uses phantomjs to hit your page
|
90
|
+
def spec_runner
|
91
|
+
@spec_runner ||= File.join(Gem::Specification.find_by_path('opal-rspec')
|
92
|
+
.full_gem_path,
|
93
|
+
'/vendor/spec_runner.js')
|
94
|
+
end
|
95
|
+
|
96
|
+
# Runs the specs, parses the output to give a notification
|
97
|
+
|
98
|
+
# rubocop:disable all
|
99
|
+
def run_opal_specs
|
100
|
+
results = `phantomjs #{spec_runner} #{@spec_url}`
|
101
|
+
puts results # want this to show on the terminal
|
102
|
+
if results =~ /((\d+) examples, (\d+) failures .+\))/
|
103
|
+
message = $1
|
104
|
+
total = $2
|
105
|
+
failures = $3.to_i
|
106
|
+
if failures > 0
|
107
|
+
title = "#{failures} Specs failed"
|
108
|
+
sound = @fail_sound
|
109
|
+
image = :failed
|
110
|
+
else
|
111
|
+
title = "#{total} Specs passed"
|
112
|
+
sound = @success_sound
|
113
|
+
image = :success
|
114
|
+
end
|
115
|
+
else
|
116
|
+
message = results
|
117
|
+
title = 'Specs failed to run'
|
118
|
+
image = :failed
|
119
|
+
sound = @fail_sound
|
120
|
+
end
|
121
|
+
notify_params = {
|
122
|
+
type: image,
|
123
|
+
title: title,
|
124
|
+
open: @spec_url
|
125
|
+
}
|
126
|
+
|
127
|
+
notify_params.merge!(sound: sound) if @sounds_on
|
128
|
+
Guard::Compat::UI.notify(message, notify_params)
|
129
|
+
end
|
130
|
+
# rubocop:enable all
|
131
|
+
end
|
132
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'guard/opal-rails/process_toggle'
|
2
|
+
|
3
|
+
module Guard
|
4
|
+
class OpalRails < Plugin
|
5
|
+
# Does nothing for start and stop
|
6
|
+
class NullProcessToggle < ProcessToggle
|
7
|
+
def spec_url
|
8
|
+
@options[:spec_url]
|
9
|
+
end
|
10
|
+
|
11
|
+
def start
|
12
|
+
end
|
13
|
+
|
14
|
+
def stop
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'guard/compat/plugin'
|
2
|
+
module Guard
|
3
|
+
class OpalRails < Plugin
|
4
|
+
# Base class for process toggles. These are classes which control
|
5
|
+
# start/stop for various situations
|
6
|
+
class ProcessToggle
|
7
|
+
def initialize(options = {})
|
8
|
+
@options = options
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require_relative 'process_toggle'
|
2
|
+
require_relative 'null_process_toggle'
|
3
|
+
require_relative 'standalone_spec_server_process_toggle'
|
4
|
+
require 'guard/compat/plugin'
|
5
|
+
|
6
|
+
module Guard
|
7
|
+
class OpalRails < Plugin
|
8
|
+
# This class returns the correct type of ProcessToggle based on options
|
9
|
+
# currently there are 2 cases
|
10
|
+
# 1) url provided, so no processes need to be started
|
11
|
+
# 2) url not provided or nil, so se start up the standalong spec server
|
12
|
+
class ProcessToggleFactory
|
13
|
+
def self.process_toggle_for(options)
|
14
|
+
if options[:spec_url]
|
15
|
+
NullProcessToggle.new(options)
|
16
|
+
else
|
17
|
+
StandaloneSpecServerProcessToggle.new(options)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'guard/opal-rails/process_toggle'
|
2
|
+
|
3
|
+
module Guard
|
4
|
+
class OpalRails < Plugin
|
5
|
+
# Starts and stops standalone spec server for opal-rails
|
6
|
+
class StandaloneSpecServerProcessToggle < ProcessToggle
|
7
|
+
include Rake::DSL if defined? Rake::DSL
|
8
|
+
# the url for specs, currently hard coded, anticipate dynamically
|
9
|
+
# retrieving this down the road. Points to standlone spec server
|
10
|
+
# from opal-rails
|
11
|
+
def spec_url
|
12
|
+
'http://localhost:9998'
|
13
|
+
end
|
14
|
+
|
15
|
+
def start
|
16
|
+
system 'bundle exec rake opal:spec:start_server'
|
17
|
+
end
|
18
|
+
|
19
|
+
def stop
|
20
|
+
system 'bundle exec rake opal:spec:kill_server'
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# options for opal-rails - see README for more info
|
2
|
+
# spec_url: The url to hit to run the specs. Point to your rails_app/opal_spec or don't set to run standalong server
|
3
|
+
# sounds_on: defaults to true set to false to turn off, works w/osx terminal-notifier
|
4
|
+
# success_sound: Sound played with successful specs, defaults to "default". Needs to be in your OSX sound prefs
|
5
|
+
# fail_sound: Sound played with failed specs, defaults to "Sosumi"
|
6
|
+
guard 'opal-rails', :spec_url => 'your_rails_app/opal_spec', :sounds_on => true, :success_sound => 'applause', :fail_sound => 'submarine' do
|
7
|
+
# include where opal files and opal specs live, below are the defaults for
|
8
|
+
# opal-rails 0.7.1+
|
9
|
+
watch Regexp.new('(app/assets/javascripts|spec-opal)/.+\.rb')
|
10
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'guard/opal-rails/process_toggle_factory'
|
2
|
+
describe Guard::OpalRails::ProcessToggleFactory do
|
3
|
+
it 'should create NullProcessToggle for a specified spec_url' do
|
4
|
+
process_toggle = Guard::OpalRails::ProcessToggleFactory.process_toggle_for(
|
5
|
+
{ spec_url: 'foo.dev/opal_spec' })
|
6
|
+
expect(process_toggle).to be_a Guard::OpalRails::NullProcessToggle
|
7
|
+
end
|
8
|
+
|
9
|
+
it 'should create StandaloneSpecServerProcessToggle for nil spec_url' do
|
10
|
+
process_toggle = Guard::OpalRails::ProcessToggleFactory.process_toggle_for(
|
11
|
+
{ spec_url: nil })
|
12
|
+
expect(process_toggle).to be_a Guard::OpalRails::StandaloneSpecServerProcessToggle
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'should return a StandaloneSpecServerProcessToggle if spec_url not defined' do
|
16
|
+
process_toggle = Guard::OpalRails::ProcessToggleFactory.process_toggle_for({})
|
17
|
+
expect(process_toggle).to be_a Guard::OpalRails::StandaloneSpecServerProcessToggle
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'guard/opal-rails/standalone_spec_server_process_toggle'
|
2
|
+
describe Guard::OpalRails::StandaloneSpecServerProcessToggle do
|
3
|
+
it 'should call the right rake task to start the server' do
|
4
|
+
# subject.should_receive(:run_task).with 'opal:spec:start_server'
|
5
|
+
expect(subject).to receive(:system).with 'bundle exec rake opal:spec:start_server'
|
6
|
+
subject.start
|
7
|
+
end
|
8
|
+
it 'should call the right rake task to stop the server' do
|
9
|
+
# subject.should_receive(:run_task).with 'opal:spec:kill_server'
|
10
|
+
expect(subject).to receive(:system).with 'bundle exec rake opal:spec:kill_server'
|
11
|
+
subject.stop
|
12
|
+
end
|
13
|
+
end
|
metadata
ADDED
@@ -0,0 +1,178 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: guard-opal-rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Forrest Chang
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-03-09 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: guard-compat
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.2'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.7'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.7'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: opal-rails
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: guard-rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: guard-rubocop
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: opal-rails
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description: Guard::OpalRails automatically runs your opal specs in rails projects
|
126
|
+
using opal-rails
|
127
|
+
email:
|
128
|
+
- fkc_email-ruby@yahoo.com
|
129
|
+
executables: []
|
130
|
+
extensions: []
|
131
|
+
extra_rdoc_files: []
|
132
|
+
files:
|
133
|
+
- .gitignore
|
134
|
+
- .rubocop.yml
|
135
|
+
- .rubocop_todo.yml
|
136
|
+
- Gemfile
|
137
|
+
- Guardfile
|
138
|
+
- LICENSE.txt
|
139
|
+
- README.md
|
140
|
+
- Rakefile
|
141
|
+
- guard-opal-rails.gemspec
|
142
|
+
- lib/guard/opal-rails.rb
|
143
|
+
- lib/guard/opal-rails/null_process_toggle.rb
|
144
|
+
- lib/guard/opal-rails/process_toggle.rb
|
145
|
+
- lib/guard/opal-rails/process_toggle_factory.rb
|
146
|
+
- lib/guard/opal-rails/standalone_spec_server_process_toggle.rb
|
147
|
+
- lib/guard/opal-rails/templates/Guardfile
|
148
|
+
- lib/guard/opal-rails/version.rb
|
149
|
+
- spec/lib/guard/opal-rails/process_toggle_factory_spec.rb
|
150
|
+
- spec/lib/guard/opal-rails/standalone_spec_server_process_toggle_spec.rb
|
151
|
+
homepage: ''
|
152
|
+
licenses:
|
153
|
+
- MIT
|
154
|
+
metadata: {}
|
155
|
+
post_install_message:
|
156
|
+
rdoc_options: []
|
157
|
+
require_paths:
|
158
|
+
- lib
|
159
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
160
|
+
requirements:
|
161
|
+
- - '>='
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
version: '0'
|
164
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
|
+
requirements:
|
166
|
+
- - '>='
|
167
|
+
- !ruby/object:Gem::Version
|
168
|
+
version: '0'
|
169
|
+
requirements: []
|
170
|
+
rubyforge_project:
|
171
|
+
rubygems_version: 2.0.6
|
172
|
+
signing_key:
|
173
|
+
specification_version: 4
|
174
|
+
summary: Guard gem for running specs in opal-rails
|
175
|
+
test_files:
|
176
|
+
- spec/lib/guard/opal-rails/process_toggle_factory_spec.rb
|
177
|
+
- spec/lib/guard/opal-rails/standalone_spec_server_process_toggle_spec.rb
|
178
|
+
has_rdoc:
|