rubbyReport 0.0.1 → 0.0.3
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/bin/rubbyReport +19 -12
- data/lib/rubbyReport.rb +10 -10
- data/lib/templates/basic.html.erb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 85ad31c1987be3b493591a27b94b739b3fae30b2491a709064893948e267a6ef
|
|
4
|
+
data.tar.gz: 3a9fda6461e60be7a93672cc3fcbab41e7cd0ad179bc984448cd2e288e96da40
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6cb7a53085377fb81e7d927dc6dea9f33b0a124f49cb76b5e07f86e26426f0bd2629769ba8aff38796b5c6a7617a9a92db21ecbc084eb6188d3bb0761020c9c5
|
|
7
|
+
data.tar.gz: ad08a6552a58ec4784c10edd6526449351bd07e397e2e0c5067dc99c9c20c729338c4d1e6551ad5ef367ae29723876d24a742b2b06940968c1916afd164a1991
|
data/bin/rubbyReport
CHANGED
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
2
3
|
|
|
3
4
|
require_relative '../lib/rubbyReport'
|
|
4
5
|
require 'thor'
|
|
5
6
|
|
|
6
7
|
class MyCLI < Thor
|
|
7
|
-
desc
|
|
8
|
+
desc 'generate', 'Generate report with .png files in current folder'
|
|
8
9
|
long_desc <<-LONGDESC
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
Command line utility to generate reports based on images.
|
|
11
|
+
|
|
12
|
+
Rubby Report will generate the report based on the
|
|
13
|
+
name of the file, and the order after the @ simbol
|
|
14
|
+
|
|
15
|
+
examples filenames:\x5
|
|
16
|
+
doing something here@1.png\x5
|
|
17
|
+
doing other thing@2.png\x5
|
|
18
|
+
third thing that has be done@3.png\x5
|
|
19
|
+
|
|
20
|
+
\x5> from: Rodrigo Tenorio(rt3norio@gmail.com)
|
|
17
21
|
LONGDESC
|
|
18
|
-
|
|
22
|
+
option :key, type: :string, desc: 'Jira Key, or Anything related like that',default: ''
|
|
23
|
+
option :description, type: :string, desc: 'Task description or title',default: ''
|
|
24
|
+
option :template, type: :string, desc: 'name of the template to be used. ["basic"]', default: 'basic'
|
|
25
|
+
def generate
|
|
19
26
|
r = RubbyReport.new
|
|
20
|
-
r.run
|
|
27
|
+
r.run(options[:description],options[:key], options[:template])
|
|
21
28
|
end
|
|
22
29
|
end
|
|
23
30
|
|
|
24
|
-
MyCLI.start(ARGV)
|
|
31
|
+
MyCLI.start(ARGV)
|
data/lib/rubbyReport.rb
CHANGED
|
@@ -14,19 +14,19 @@ class RubbyReport
|
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
def run
|
|
17
|
+
def run(description = "", key = "",template='basic')
|
|
18
18
|
data = ReportData.new
|
|
19
19
|
data.images_array = @images_list.map do |img|
|
|
20
20
|
[img.split('@')[-2], generate_base_64_from_img_to_src(img)]
|
|
21
21
|
end
|
|
22
|
-
data.issue_description =
|
|
23
|
-
data.
|
|
24
|
-
data.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
view = Report.new(
|
|
28
|
-
File.write(
|
|
29
|
-
|
|
22
|
+
data.issue_description = description
|
|
23
|
+
data.issue_key = key
|
|
24
|
+
data.time = Time.now
|
|
25
|
+
filename = key = '' ? "#{key}.html" : "report.html"
|
|
26
|
+
|
|
27
|
+
view = Report.new(template, data)
|
|
28
|
+
File.write(filename, view.render)
|
|
29
|
+
puts "generated #{filename} file in current folder."
|
|
30
30
|
end
|
|
31
31
|
end
|
|
32
32
|
|
|
@@ -44,7 +44,7 @@ class Report
|
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
class ReportData
|
|
47
|
-
attr_accessor :issue_key, :issue_description, :
|
|
47
|
+
attr_accessor :issue_key, :issue_description, :time, :images_array
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
<html>
|
|
3
3
|
<body>
|
|
4
4
|
<h1>Session Report</h1>
|
|
5
|
-
|
|
5
|
+
<p><%= @data.time%></p>
|
|
6
6
|
|
|
7
7
|
<h2><%= @data.issue_key %></h2>
|
|
8
8
|
<h3><%= @data.issue_description %></h3>
|
|
9
9
|
|
|
10
10
|
<br/><br/>
|
|
11
11
|
<% @data.images_array.each do |img|%>
|
|
12
|
-
<
|
|
12
|
+
<h4><%=img[0]%></h4>
|
|
13
13
|
<br/>
|
|
14
14
|
<img src='<%=img[1]%>' />
|
|
15
15
|
<br/><br/><br/>
|