mingle-link-fixer 1.0.1 → 1.0.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 +4 -4
- data/lib/mingle/stats.rb +16 -6
- data/lib/mingle_link_fixer.rb +1 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 085cbf2fff44b3d00b2d5e03363e73f315e313a4
|
4
|
+
data.tar.gz: 736cfff2fb5a8813b809455348b96f6dfb6abc09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 418e5cfbcfb334544db2479035b561c0773d6261f91df7d7b27e42e1ab8a87c5201464991399292fb5952fd967a4d015a8bedcd57c890f707480550f420d89b4
|
7
|
+
data.tar.gz: 277010de3832b6aa5c77eb3832cd7a395397b539e87c9ea420819cdf78fd628c750cbeed24487e2eee68cb9c58b681b02227ba36a161ca2891c88940af96f871
|
data/lib/mingle/stats.rb
CHANGED
@@ -4,6 +4,8 @@ module Mingle
|
|
4
4
|
attr_accessor :total_cards_checked, :cards_without_attachments, :cards_without_links,
|
5
5
|
:cards_fixed, :problematic_cards
|
6
6
|
|
7
|
+
SPACER = "=" * 80
|
8
|
+
|
7
9
|
def initialize
|
8
10
|
@total_cards_checked = 0
|
9
11
|
@cards_without_attachments = 0
|
@@ -13,12 +15,6 @@ module Mingle
|
|
13
15
|
@start = Time.now
|
14
16
|
end
|
15
17
|
|
16
|
-
def duration_in_seconds
|
17
|
-
Time.now - @start
|
18
|
-
end
|
19
|
-
|
20
|
-
SPACER = "=" * 80
|
21
|
-
|
22
18
|
def to_pretty_string
|
23
19
|
%{
|
24
20
|
#{SPACER}
|
@@ -32,11 +28,25 @@ module Mingle
|
|
32
28
|
|
33
29
|
Problematic Cards: #{problematic_cards.size}
|
34
30
|
#{'(specific errors can be seen if you set VERBOSE environment variable)' if problematic_cards.any?}
|
31
|
+
#{ problematic_cards_with_errors if Logging::VERBOSE }
|
35
32
|
|
36
33
|
Fixed Cards: #{cards_fixed}
|
37
34
|
#{SPACER}
|
38
35
|
}
|
39
36
|
end
|
40
37
|
|
38
|
+
private
|
39
|
+
|
40
|
+
def duration_in_seconds
|
41
|
+
Time.now - @start
|
42
|
+
end
|
43
|
+
|
44
|
+
def problematic_cards_with_errors
|
45
|
+
problematic_cards.inject([]) do |lines, pair|
|
46
|
+
card_number, error = pair
|
47
|
+
lines << "\nCard ##{card_number}: #{error.message}\n"
|
48
|
+
end.join("\n")
|
49
|
+
end
|
50
|
+
|
41
51
|
end
|
42
52
|
end
|
data/lib/mingle_link_fixer.rb
CHANGED
@@ -58,8 +58,7 @@ module Mingle
|
|
58
58
|
|
59
59
|
rescue => e
|
60
60
|
logger.error "Unable to fix Card ##{card.number} because of error: #{e.message}"
|
61
|
-
stats.problematic_cards[card.number] = e
|
62
|
-
logger.debug e.backtrace.join("\n")
|
61
|
+
stats.problematic_cards[card.number] = e
|
63
62
|
end
|
64
63
|
end
|
65
64
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mingle-link-fixer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bill DePhillips
|
@@ -19,14 +19,14 @@ extensions: []
|
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
21
|
- lib/mingle/attachment_link.rb
|
22
|
-
- lib/mingle/http_client.rb
|
23
|
-
- lib/mingle/logging.rb
|
24
22
|
- lib/mingle/api.rb
|
25
|
-
- lib/mingle/attachment_link_finder.rb
|
26
23
|
- lib/mingle/attachment.rb
|
27
|
-
- lib/mingle/
|
28
|
-
- lib/mingle/
|
24
|
+
- lib/mingle/logging.rb
|
25
|
+
- lib/mingle/http_client.rb
|
26
|
+
- lib/mingle/attachment_link_finder.rb
|
29
27
|
- lib/mingle/historical_attachments.rb
|
28
|
+
- lib/mingle/card.rb
|
29
|
+
- lib/mingle/stats.rb
|
30
30
|
- lib/mingle_link_fixer.rb
|
31
31
|
- LICENSE
|
32
32
|
- README.md
|