devloop 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/bin/devloop_run +1 -1
- data/lib/devloop/diff_parser.rb +7 -1
- data/lib/devloop/version.rb +1 -1
- data/spec/diff_parser_spec.rb +49 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1aacef492d0bf184908275bc5df40ba6915cf3a1215edc39fb41374fa18574e0
|
4
|
+
data.tar.gz: aa92fd7489fcd1fbefaf1ad01e7fddcf9b39b8ab9ba9d9964794ba15cba15559
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a26d307a8957fba390304bdcacbb6e3b2b23c4f86bb3fcbbc9b3a2fc0e14b69a16836cf7f4cb9e6b68efcc24a775113bdc5b64b639c0da3921ab9f2a835f006e
|
7
|
+
data.tar.gz: 4444e6eede7525a922044f6c2f7c7d1363b5d9490d94dce08499b52d2021338d04acdb1a95eaf3dfc43fed50edfd2a800a006a3b4d8701dcb152c1caa9e958dc
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Devloop [![Gem Version](https://badge.fury.io/rb/devloop.svg)](https://badge.fury.io/rb/devloop) [![GH Actions](https://github.com/pawurb/devloop/actions/workflows/ci.yml/badge.svg)](https://github.com/pawurb/devloop/actions)
|
2
2
|
|
3
|
-
Devloop is an automated Rspec runner for Rails apps inspired by [TLDR](https://github.com/tendersearls/tldr). The purpose of this tool is to provide continuous and instant feedback when working on the Rails app. It runs only specs from _lines_ modified in the recent git commits. Even if you have a large `spec/user_spec.rb` file, you'll receive specs feedback in ~second on each file save.
|
3
|
+
Devloop is an automated Rspec runner for Rails apps inspired by [TLDR](https://github.com/tendersearls/tldr) and Rust ([full story](https://pawelurbanek.com/rust-ruby-workflow)). The purpose of this tool is to provide continuous and instant feedback when working on the Rails app. It runs only specs from _lines_ modified in the recent git commits. Even if you have a large `spec/user_spec.rb` file, you'll receive specs feedback in ~second on each file save.
|
4
4
|
|
5
5
|
Optionally, you can edit first line of any spec file (i.e. add `#`) to run all the tests from it.
|
6
6
|
|
data/bin/devloop_run
CHANGED
data/lib/devloop/diff_parser.rb
CHANGED
@@ -21,7 +21,13 @@ module Devloop
|
|
21
21
|
end.uniq
|
22
22
|
|
23
23
|
# Remove filenames with line number if filename without line number is present
|
24
|
-
results.reject { |result| results.include?(result.split(":").first) && result.include?(":") }
|
24
|
+
res = results.reject { |result| results.include?(result.split(":").first) && result.include?(":") }.map do |el|
|
25
|
+
if el.split(":").last == "0"
|
26
|
+
el.split(":").first
|
27
|
+
else
|
28
|
+
el
|
29
|
+
end
|
30
|
+
end
|
25
31
|
end
|
26
32
|
|
27
33
|
private
|
data/lib/devloop/version.rb
CHANGED
data/spec/diff_parser_spec.rb
CHANGED
@@ -96,4 +96,53 @@ describe Devloop::DiffParser do
|
|
96
96
|
expect(Devloop::DiffParser.call(diff)).to eq(["spec/models/team_spec.rb:19", "spec/models/team_spec.rb:24"])
|
97
97
|
end
|
98
98
|
end
|
99
|
+
|
100
|
+
context "removes 0 line numbers" do
|
101
|
+
let(:diff) do
|
102
|
+
<<~DIFF
|
103
|
+
diff --git a/spec/config_spec.rb b/spec/config_spec.rb
|
104
|
+
index d9716e7..b470ec2 100644
|
105
|
+
--- a/spec/config_spec.rb
|
106
|
+
+++ b/spec/config_spec.rb
|
107
|
+
@@ -5 +5 @@ require "spec_helper"
|
108
|
+
-describe "PgLocksMonitor::Confiuration" do
|
109
|
+
+describe "PgLocksMonitor::Configuration" do
|
110
|
+
@@ -8,2 +8,5 @@ describe "PgLocksMonitor::Confiuration" do
|
111
|
+
- expect(config.notify_locks).to eq true
|
112
|
+
- expect(config.notify_blocking).to eq true
|
113
|
+
+ expect(config.monitor_locks).to eq true
|
114
|
+
+ expect(config.monitor_blocking).to eq true
|
115
|
+
+ expect(config.locks_min_duration_ms).to eq 200
|
116
|
+
+ expect(config.blocking_min_duration_ms).to eq 100
|
117
|
+
+ expect(config.notifier_class).to eq PgLocksMonitor::DefaultNotifier
|
118
|
+
@@ -14 +17 @@ describe "PgLocksMonitor::Confiuration" do
|
119
|
+
- config.notify_locks = false
|
120
|
+
+ config.monitor_locks = false
|
121
|
+
@@ -17 +20 @@ describe "PgLocksMonitor::Confiuration" do
|
122
|
+
- expect(PgLocksMonitor.configuration.notify_locks).to eq false
|
123
|
+
+ expect(PgLocksMonitor.configuration.monitor_locks).to eq false
|
124
|
+
diff --git a/spec/default_notifier_spec.rb b/spec/default_notifier_spec.rb
|
125
|
+
new file mode 100644
|
126
|
+
index 0000000..d99d3a1
|
127
|
+
--- /dev/null
|
128
|
+
+++ b/spec/default_notifier_spec.rb
|
129
|
+
@@ -0,0 +1,11 @@
|
130
|
+
+# frozen_string_literal: true
|
131
|
+
+
|
132
|
+
+require "spec_helper"
|
133
|
+
+
|
134
|
+
+describe PgLocksMonitor::DefaultNotifier do
|
135
|
+
+ it "requires correct config if Slack notifications enabled" do
|
136
|
+
+ expect {
|
137
|
+
+ PgLocksMonitor::DefaultNotifier.call({})
|
138
|
+
+ }.not_to raise_error
|
139
|
+
+ end
|
140
|
+
+end
|
141
|
+
DIFF
|
142
|
+
end
|
143
|
+
|
144
|
+
it "parses the diff correctly" do
|
145
|
+
expect(Devloop::DiffParser.call(diff)).to eq(["spec/config_spec.rb:5", "spec/config_spec.rb:8", "spec/config_spec.rb:14", "spec/config_spec.rb:17", "spec/default_notifier_spec.rb"])
|
146
|
+
end
|
147
|
+
end
|
99
148
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devloop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pawurb
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: listen
|