mushy 0.2.6 → 0.2.7

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: b1f4610ff32999add5edef562475fff259d62961c020d10abec4e2bfbe64344f
4
- data.tar.gz: c0d2c08fdf345a28e7abfb9377309c1c1c3d09c0c38a28ca106e911da0bdb12f
3
+ metadata.gz: 92ba64469be678fe9889628ae7b6897f78935605605c83652d257f2c4a948d3d
4
+ data.tar.gz: 1fa13be3acb6a38f8062536d416630f92867ed93b8f28ac3c140f91a6dfd1385
5
5
  SHA512:
6
- metadata.gz: e7995542973e879c9dc1485182f74b2f648d37eb711b21017de11370a5839a0c92663d48fbcf1192781f121db1dddf0a367f68865a4761881306712fed37bbaa
7
- data.tar.gz: a89ff7d26708e89c7d64fc8486146a4b51bcbba9abe8ad824796c90f6bae217f1f6578f41ca5772a8f105ec13e8e60c9981673dffdc7e88477ce2a11afa23fc9
6
+ metadata.gz: d9aaebd4c3a70c7e64417eb515d719ad6e0bd0c6ccacdde4a2b8ae21845e77b63ee2ca0639d1207aa2d064c8aa3bda48f282a3f640e07b26c171cd1819191416
7
+ data.tar.gz: ba95b540eb1746ae7b525221c746aee163861c62956e3ac08e5405738bdf329eea32c0d8378283b6c625a1d1919d6f1fd11b936548822ce2a15c438651112a6f
@@ -0,0 +1,86 @@
1
+ module Mushy
2
+
3
+ class GitLog < Bash
4
+
5
+ def self.details
6
+ {
7
+ name: 'GitLog',
8
+ description: 'Return git logs.',
9
+ config: {
10
+ directory: {
11
+ description: 'The working directory in which the command will be run.',
12
+ type: 'text',
13
+ shrink: true,
14
+ value: '',
15
+ },
16
+ after: {
17
+ description: 'Filter for commits after this',
18
+ type: 'text',
19
+ shrink: true,
20
+ value: '',
21
+ },
22
+ before: {
23
+ description: 'Filter for commits before this',
24
+ type: 'text',
25
+ shrink: true,
26
+ value: '',
27
+ },
28
+ author: {
29
+ description: 'Filter for commits by this author',
30
+ type: 'text',
31
+ shrink: true,
32
+ value: '',
33
+ },
34
+ committer: {
35
+ description: 'Filter for commits by this committer',
36
+ type: 'text',
37
+ shrink: true,
38
+ value: '',
39
+ },
40
+ },
41
+ }
42
+ end
43
+
44
+ def process event, config
45
+
46
+ config[:command] = 'git log'
47
+
48
+ if config[:directory].to_s != ''
49
+ config[:command] = "cd \"#{config[:directory]}\";#{config[:command]}"
50
+ end
51
+
52
+ [:after, :before, :author, :committer]
53
+ .select { |x| config[x].to_s != ''}
54
+ .each { |k| config[:command] = "#{config[:command]} --#{k}=\"#{config[k]}\"" }
55
+
56
+ result = super event, config
57
+
58
+ return result unless result[:success]
59
+
60
+ result[:text].split("\n\n").reduce([]) do |results, line|
61
+ if line.start_with? 'commit'
62
+ results << { message: line.sub('commit', 'commit:') }
63
+ else
64
+ results[-1][:message] = results[-1][:message] + "\nMessage: " + line.strip
65
+ end
66
+ results
67
+ end.map { |x| x[:message] }.map do |line|
68
+ line.split("\n").reduce({}) do |t, i|
69
+ segments = i.split ':'
70
+ key = segments.shift.strip.downcase.to_sym
71
+ t[key] = segments.map { |y| y.strip }.join ':'
72
+ t
73
+ end
74
+ end.map do |commit|
75
+ commit.tap do |x|
76
+ segments = x[:author].split '<'
77
+ x[:author_name] = segments.shift.strip
78
+ x[:author_email] = segments.join('').strip.gsub('>', '')
79
+ end
80
+ end
81
+
82
+ end
83
+
84
+ end
85
+
86
+ end
data/mushy.gemspec CHANGED
@@ -4,7 +4,7 @@ require 'mushy/version'
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = 'mushy'
7
- s.version = '0.2.6'
7
+ s.version = '0.2.7'
8
8
  s.date = '2020-11-23'
9
9
  s.summary = 'Process streams of work using common modules.'
10
10
  s.description = 'This tool assists in the creation and processing of workflows.'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mushy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darren Cauthon
@@ -162,6 +162,7 @@ files:
162
162
  - lib/mushy/fluxs/filter.rb
163
163
  - lib/mushy/fluxs/format.rb
164
164
  - lib/mushy/fluxs/get.rb
165
+ - lib/mushy/fluxs/git_log.rb
165
166
  - lib/mushy/fluxs/ls.rb
166
167
  - lib/mushy/fluxs/parse_html.rb
167
168
  - lib/mushy/fluxs/pdf.rb