devloop 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7bdfbb6b5c25d903818042b071bf95090cccb324fd993957d8a6c9232310d6b3
4
- data.tar.gz: dc18174f6087bca3656a47d072baa8c9b3ef177252ba20a50bdac21660417d9d
3
+ metadata.gz: 1aacef492d0bf184908275bc5df40ba6915cf3a1215edc39fb41374fa18574e0
4
+ data.tar.gz: aa92fd7489fcd1fbefaf1ad01e7fddcf9b39b8ab9ba9d9964794ba15cba15559
5
5
  SHA512:
6
- metadata.gz: dee4939c6e441d48e24d96d70ae4d215376adbbca9fc31f3f69374d0dfd7cc643dd5e2f2fd41975dd5476f477858b95e8bfe1c49716a5657721b74d28a551edc
7
- data.tar.gz: 8f94d9393b420e40028c53748f27415e0e587252ce94cb67b0b7ebf86f4aa6ff05e9bc1c7617c81d75c4835050b4a7d736d0874eb4807915e50968160ec42e7d
6
+ metadata.gz: a26d307a8957fba390304bdcacbb6e3b2b23c4f86bb3fcbbc9b3a2fc0e14b69a16836cf7f4cb9e6b68efcc24a775113bdc5b64b639c0da3921ab9f2a835f006e
7
+ data.tar.gz: 4444e6eede7525a922044f6c2f7c7d1363b5d9490d94dce08499b52d2021338d04acdb1a95eaf3dfc43fed50edfd2a800a006a3b4d8701dcb152c1caa9e958dc
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Devloop
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
@@ -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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devloop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - pawurb