Skip to content

Commit 6c12590

Browse files
committed
Add Guard gem
1 parent 173b522 commit 6c12590

File tree

4 files changed

+75
-0
lines changed

4 files changed

+75
-0
lines changed

Guardfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# frozen_string_literal: true
2+
3+
guard :rspec, cmd: 'bundle exec rspec' do
4+
require 'guard/rspec/dsl'
5+
dsl = Guard::RSpec::Dsl.new(self)
6+
7+
# RSpec files
8+
rspec = dsl.rspec
9+
watch(rspec.spec_helper) { rspec.spec_dir }
10+
watch(rspec.spec_support) { rspec.spec_dir }
11+
watch(rspec.spec_files)
12+
13+
# Ruby files
14+
ruby = dsl.ruby
15+
dsl.watch_spec_files_for(ruby.lib_files)
16+
end

ajax-datatables-rails.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Gem::Specification.new do |s|
2626
s.add_development_dependency 'factory_bot'
2727
s.add_development_dependency 'faker'
2828
s.add_development_dependency 'generator_spec'
29+
s.add_development_dependency 'guard-rspec'
2930
s.add_development_dependency 'pg', '< 1.0'
3031
s.add_development_dependency 'pry'
3132
s.add_development_dependency 'rails', '>= 5.0'

bin/_guard-core

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
#
5+
# This file was generated by Bundler.
6+
#
7+
# The application '_guard-core' is installed as part of a gem, and
8+
# this file is here to facilitate running it.
9+
#
10+
11+
require "pathname"
12+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13+
Pathname.new(__FILE__).realpath)
14+
15+
bundle_binstub = File.expand_path("../bundle", __FILE__)
16+
17+
if File.file?(bundle_binstub)
18+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19+
load(bundle_binstub)
20+
else
21+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23+
end
24+
end
25+
26+
require "rubygems"
27+
require "bundler/setup"
28+
29+
load Gem.bin_path("guard", "_guard-core")

bin/guard

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
#
5+
# This file was generated by Bundler.
6+
#
7+
# The application 'guard' is installed as part of a gem, and
8+
# this file is here to facilitate running it.
9+
#
10+
11+
require "pathname"
12+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13+
Pathname.new(__FILE__).realpath)
14+
15+
bundle_binstub = File.expand_path("../bundle", __FILE__)
16+
17+
if File.file?(bundle_binstub)
18+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19+
load(bundle_binstub)
20+
else
21+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23+
end
24+
end
25+
26+
require "rubygems"
27+
require "bundler/setup"
28+
29+
load Gem.bin_path("guard", "guard")

0 commit comments

Comments
 (0)