aipim-rails 0.0.23 → 0.0.40

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 80fb646f129ebb2ba224b0bfadb3147627858ced
4
- data.tar.gz: 5e949db7561a2f975c74e44ea740ae0dd52fad29
3
+ metadata.gz: d25188c189a2fe95c0981e899ba2a959c976f3d3
4
+ data.tar.gz: 9c034938385d82d7c46e12af5f0b6ff94ef38ac7
5
5
  SHA512:
6
- metadata.gz: 89865bb169bde2af3082be3fc65378d4972235ce0f5a4aa6ca30cee409084a1e39e2ed71350172f438a0dae36f5459f6c336567f8135b4dbfd065ee2daa194ff
7
- data.tar.gz: 35cdde570acb2c0a2b7ae4f165609d6afb9ccb257acd3cbf8d7767620d60fb20c9fea08591196eee9ae202f64c966ad59dc1f1e7df75c40e09cacc5478dcc8c0
6
+ metadata.gz: 83dcf3f78ac4116979132242670e4ca07b4f459a8b987197e65195bd7450f91730b7ed70ad7d78d4d94d97f547bd8908717423e0f1b6a481c96c29301cb091b9
7
+ data.tar.gz: f9c478b5ea787c71066f430556a76afa3f01d8525775e8ff8171dbef68c216695b77633624574d63fab18ad47aed6eec5c3a698298af705ae93967778f683c56
data/bin/aipim CHANGED
@@ -8,13 +8,37 @@ if ARGV[0] == 'generate'
8
8
  system('mkdir -p aipim')
9
9
  system('mkdir -p aipim/screenshots')
10
10
  system('cp '+path+'lib/screenshot.rb features/support/')
11
- system('mkdir -p public/aipim')
12
- system('cp '+path+'lib/bootstrap.min.css public/aipim/')
13
- system('cp '+path+'lib/jquery-1.9.1.js public/aipim/')
11
+
14
12
  elsif ARGV[0] == 'html'
15
- ConvertToHtml.init("aipim/markdown.md")
16
- system('cp -r aipim/screenshots public/aipim/')
17
- system('cp -r aipim/relatorio.html public/aipim/')
18
- else
19
- Parser.init("features/login.feature")
13
+ %x[rm -rf aipim/markdown]
14
+ files = []
15
+ ARGV.delete_at(0)
16
+ ARGV.each do |arg|
17
+ ls = %x[ls #{arg}].split("\n")
18
+ ls.each do |f|
19
+ f = f.split('/')
20
+ f.delete_at(0)
21
+ f = f.join('/')
22
+ files << f if !(f =~ /.feature\z/).nil?
23
+ end
24
+ end
25
+ files.each { |f| Parser.init(f) }
26
+ files.each { |f| ConvertToHtml.init(f) }
27
+ system('cp '+path+'lib/bootstrap.min.css aipim/html')
28
+ system('cp '+path+'lib/jquery-1.9.1.js aipim/html')
29
+
30
+ elsif ARGV[0] == 'markdown' || ARGV[0] == 'md'
31
+ %x[rm -rf aipim/markdown]
32
+ files = []
33
+ ARGV.delete_at(0)
34
+ ARGV.each do |arg|
35
+ ls = %x[ls #{arg}].split("\n")
36
+ ls.each do |f|
37
+ f = f.split('/')
38
+ f.delete_at(0)
39
+ f = f.join('/')
40
+ files << f if !(f =~ /.feature\z/).nil?
41
+ end
42
+ end
43
+ files.each { |f| Parser.init(f) }
20
44
  end
@@ -4,11 +4,12 @@ module ConvertToHtml
4
4
 
5
5
  def self.md_to_html(filename)
6
6
  markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink => true, :space_after_headers => true)
7
- markdown.render(File.read(filename))
7
+ markdown.render(File.read("aipim/markdown/"+filename+".md"))
8
8
  end
9
9
 
10
10
  def self.init(filename)
11
- output = File.open("aipim/relatorio.html", "w")
11
+ system("mkdir -p aipim/html")
12
+ output = File.open("aipim/html/"+filename+".html", "w")
12
13
  output.puts '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'
13
14
  output.puts '<html>'
14
15
  output.puts ' <head>'
@@ -15,8 +15,9 @@ module Parser
15
15
 
16
16
  def self.read_links(filename)
17
17
  cenario_counter = 1
18
- output = File.new("aipim/markdown.md", "w")
19
- file = File.new(filename, "r")
18
+ system("mkdir -p aipim/markdown")
19
+ output = File.new("aipim/markdown/#{filename}.md", "w")
20
+ file = File.new("features/#{filename}", "r")
20
21
  while(line = read_line(file))
21
22
  if ParserHelper.is_cenario?(line)
22
23
  output.puts "[#{cenario_counter}. #{ParserHelper.get_cenario(line)}](#) "
@@ -29,12 +30,12 @@ module Parser
29
30
 
30
31
  def self.read_content(filename)
31
32
 
32
- file = File.new(filename, "r")
33
- output = File.new("aipim/markdown.md", "a")
33
+ file = File.new("features/#{filename}", "r")
34
+ output = File.new("aipim/markdown/#{filename}.md", "a")
34
35
 
35
36
  screenshot = false
36
37
  cenario_counter = 1
37
- result = %x[ls aipim/screenshots/].split("\n")
38
+ result = %x[ls aipim/screenshots/#{filename}].split("\n")
38
39
  counter_screenshot = 0
39
40
 
40
41
  output.puts ""
@@ -62,7 +63,7 @@ module Parser
62
63
  end
63
64
  end
64
65
  if screenshot
65
- output.puts '> [![Alt text](screenshots/'+result[counter_screenshot].to_s+')](screenshots/'+result[counter_screenshot].to_s+') '
66
+ output.puts '> [![Alt text](../screenshots/'+filename+'/'+result[counter_screenshot].to_s+')](../screenshots/'+filename+'/'+result[counter_screenshot].to_s+') '
66
67
  counter_screenshot = counter_screenshot+1
67
68
  screenshot = false
68
69
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aipim-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.23
4
+ version: 0.0.40
5
5
  platform: ruby
6
6
  authors:
7
7
  - Facta TI