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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6464757c3c7c9f42c5c427ee2498fd7e757ae6c287f8db9fd1d7decd121c4072
4
- data.tar.gz: cab914f13890894d6302b33a16189ac765dbe64f981cac8ed7eab40ca2e1a81c
3
+ metadata.gz: 85ad31c1987be3b493591a27b94b739b3fae30b2491a709064893948e267a6ef
4
+ data.tar.gz: 3a9fda6461e60be7a93672cc3fcbab41e7cd0ad179bc984448cd2e288e96da40
5
5
  SHA512:
6
- metadata.gz: 51b438e03dadce9988b55dfec9918c8cfbfd20c5c415edc99729135ccec87f6d01796da5c22a69119972df34c5261e424c840fe128ae26b8f84c41dc01896244
7
- data.tar.gz: d1b440b4cced2fa18b9d035144894eaf8c229eedd008c1dc750e3a48bbe44efc668e2d7fac36ce56dd6e9aea4804bf6d188db3d1ece27744c0d1428714557a7f
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 "generate", 'Generate report with .png files in current folder'
8
+ desc 'generate', 'Generate report with .png files in current folder'
8
9
  long_desc <<-LONGDESC
9
- `Rubby Report will generate the report based on the name of the file, the order after the @ simbol
10
-
11
- examples filenames:
12
- doing something here@1.png
13
- doing other thing@2.png
14
- third thing that has be done@3.png
15
-
16
- > from: Rodrigo Tenorio(rt3norio@gmail.com)
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
- def generate()
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 = 'descricao do que o ticket pedia'
23
- data.date = Time.now
24
- data.issue_key = "TO-15492"
25
-
26
-
27
- view = Report.new('basic', data)
28
- File.write("report.html", view.render)
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, :date, :images_array
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
- <h3><%=img[0]%></h3>
12
+ <h4><%=img[0]%></h4>
13
13
  <br/>
14
14
  <img src='<%=img[1]%>' />
15
15
  <br/><br/><br/>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubbyReport
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Tenorio