devloop 0.0.8 → 0.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
  SHA256:
3
- metadata.gz: c6e087fe2cd945782777fe0a1a87fd21b3022f0348a38b1c789f8ba6c7817f49
4
- data.tar.gz: 1718ef614659f6ba55a3a7ca1d60d2d7b676a70919d1a93e7bd4f0c5ff1a46ba
3
+ metadata.gz: f7d144786989a541134bfda50fe5496b59eb776342e114f6c9c772b630661cc5
4
+ data.tar.gz: 2dc23915955ac14ed782ba5efa8240a48a3a5671ce163ef9b58083a2670ae3a2
5
5
  SHA512:
6
- metadata.gz: 3c0948c9527bc7bed104aa6cac0a65bf6c67618e5d3afa31d2245d90565ca32546cb4bdc8c084ef2103c0919c648f4a315c923aed8ca1b1ec7b636fa394b83fa
7
- data.tar.gz: 59775a6c5a08119a319cd541bd8e45a7bc1432fb57b498a0e788eb22018f7ef864f316fd412c788a8574359144607ca695bb75b7e38bbe132e51ae68b712ecde
6
+ metadata.gz: ad7432cfb77b79e4321705e7fc5ba2cb6df2bd02b87bbbbb34465e73dbe20160890b08367a4c9e14f7177040b1a6c81fd04000c5743419f172d76b569e262fc9
7
+ data.tar.gz: a17b35a3eff615cef9398f5dfabf59256080e47b7fb82a15a809d5f4848dd20596631dbccf1049575e7f485da99ed8d2b54f5e14e38b03ff48a816d14014e4ad
data/README.md CHANGED
@@ -6,12 +6,6 @@ Optionally, you can edit first line of any spec file (i.e. add `#`) to run all t
6
6
 
7
7
  ## Installation
8
8
 
9
- It uses [fswatch](https://github.com/emcrisostomo/fswatch) so make sure to install it first:
10
-
11
- ```bash
12
- brew install fswatch
13
- ```
14
-
15
9
  In your `Gemfile`:
16
10
 
17
11
  ```ruby
@@ -24,7 +18,18 @@ Now you can run:
24
18
  bundle exec devloop
25
19
  ```
26
20
 
27
- While this command it running it will automatically execute tests related to the recently modified lines of code from `spec/` folder.
21
+ You can also use it without adding to the `Gemfile`:
22
+
23
+ ```bash
24
+ gem install devloop
25
+ devloop
26
+ ```
27
+
28
+ Remember to run the `devloop` command from the root of your Rails application.
29
+
30
+ ## Usage
31
+
32
+ While `devloop` process is running it will automatically execute tests related to the recently modified lines of code from `spec/` folder.
28
33
 
29
34
  Devloop will automatically detect if [Spring](https://github.com/rails/spring) is enabled for your Rails app. I've observed it reduces time needed to run specs by ~4x.
30
35
 
data/bin/devloop CHANGED
@@ -3,12 +3,19 @@
3
3
  $LOAD_PATH.unshift(File.dirname(__FILE__) + "/../lib") unless $LOAD_PATH.include?(File.dirname(__FILE__) + "/../lib")
4
4
 
5
5
  require "devloop"
6
+ require "listen"
6
7
 
7
8
  begin
8
9
  system("bundle exec spring > /dev/null 2>&1")
9
- system("bundle exec devloop_run")
10
+ is_bundled = `bundle list`.include?("devloop")
11
+ run_command = is_bundled ? "bundle exec devloop_run" : "devloop_run"
12
+ system(run_command)
10
13
  puts "Devloop: watching for changes in spec directory..."
11
- system("fswatch -e '.*' -i '\.rb$' #{Dir.pwd} | xargs -n1 -I{} bundle exec devloop_run")
14
+ listener = Listen.to(".", only: %r{.rb$}) do
15
+ system(run_command)
16
+ end
17
+ listener.start
18
+ sleep
12
19
  rescue Interrupt # user pressed CTRL+C
13
20
  STDERR.puts "\nDevloop: exiting due to user request"
14
21
  exit 130
data/devloop.gemspec CHANGED
@@ -16,6 +16,7 @@ Gem::Specification.new do |s|
16
16
  s.require_paths = ["lib"]
17
17
  s.executables = ["devloop", "devloop_run"]
18
18
  s.license = "MIT"
19
+ s.add_dependency "listen"
19
20
  s.add_development_dependency "rake"
20
21
  s.add_development_dependency "rspec"
21
22
  s.add_development_dependency "rufo"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Devloop
4
- VERSION = "0.0.8"
4
+ VERSION = "0.1.0"
5
5
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devloop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - pawurb
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-11 00:00:00.000000000 Z
11
+ date: 2024-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: listen
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rake
15
29
  requirement: !ruby/object:Gem::Requirement