burp_cms 1.3.29 → 1.3.30

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: 001be3b750841a64a69f32f5576b9849ac889175
4
- data.tar.gz: 33d0a38d18eb883904237df832631ab510e023eb
3
+ metadata.gz: d744d6c79835e7ad19ee848fe5dc5a893a0f45a5
4
+ data.tar.gz: 04120147b5eae6329a925f878629ecf30e4b8876
5
5
  SHA512:
6
- metadata.gz: c5006101a566317332b649e2e4175091b6706ec40ec68cf8ea0d3e4fcc1d28dd77eb93df082ebaa864fc6ad679f2c51d863384c27a3071aee8153c52fd404532
7
- data.tar.gz: ae1fdeb230be0bc3394bacd2ce38149dc3de7f6cb817775b38f0a4a01e7712386f7f3a4ae6515c808e893c19ac6ddec6f33ab65dde46077d3e41e8b34264006e
6
+ metadata.gz: dee0d584ca843a98d99952250a80184ae4e7d81601223b82666e26b4c00eba0fe93fc702b2f24f6f4d499bbd29628cdc402879c8c2e0ffb62b22b2f172424de6
7
+ data.tar.gz: 0e66197d1e6ea569e9c347df2f7b8c2a27ae9a5492d0d83e3c70f87f1fd4bb1fa1f5af959804f9921cdc48c5f3f335ec5842f1925b36fd777225c1bddb2aef6d
data/lib/burp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Burp
2
- VERSION = "1.3.29"
2
+ VERSION = "1.3.30"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  require 'fileutils'
2
2
  require 'term/ansicolor'
3
3
 
4
- class MyPrinter
4
+ class BurpRakeHelper
5
5
  extend Term::ANSIColor
6
6
 
7
7
  def self.print_yellow text
@@ -11,6 +11,22 @@ class MyPrinter
11
11
  def self.print_green text
12
12
  print green, text, reset, "\n"
13
13
  end
14
+
15
+
16
+ def self.write(path)
17
+ css_path = "#{Rails.root}#{path}"
18
+ print "\t#{css_path}"
19
+ if File.exist?(css_path)
20
+ BurpRakeHelper.print_yellow " Skipping"
21
+ else
22
+ FileUtils.mkdir_p(File.dirname(css_path))
23
+ File.open(css_path,"w") do |file|
24
+ yield file
25
+ end
26
+ BurpRakeHelper.print_green " OK"
27
+ end
28
+ end
29
+
14
30
  end
15
31
 
16
32
  namespace :burp do
@@ -23,66 +39,45 @@ namespace :burp do
23
39
 
24
40
  print "\t#{cms_root}"
25
41
  if File.exist?(cms_root)
26
- MyPrinter.print_yellow " Skipping"
42
+ BurpRakeHelper.print_yellow " Skipping"
27
43
  else
28
44
  FileUtils.mkdir_p(cms_root)
29
- MyPrinter.print_green " OK"
45
+ BurpRakeHelper.print_green " OK"
30
46
  end
31
47
 
32
48
  print "\t#{cms_root}/.git"
33
49
  if File.exist?("#{cms_root}/.git")
34
- MyPrinter.print_yellow " Skipping"
50
+ BurpRakeHelper.print_yellow " Skipping"
35
51
  else
36
52
  `git init #{cms_root}`
37
- MyPrinter.print_green " OK"
53
+ BurpRakeHelper.print_green " OK"
38
54
  end
39
55
 
40
- menu_path = "#{Rails.root}/app/cms/menus/main.yaml"
41
- print "\t#{menu_path}"
42
- if File.exist?(menu_path)
43
- MyPrinter.print_yellow " Skipping"
44
- else
45
- FileUtils.mkdir_p(File.dirname(menu_path))
46
- File.open(menu_path,"w") do |file|
47
- file.write("---\n:name: root\n:children:\n")
48
- end
49
- MyPrinter.print_green " OK"
56
+ BurpRakeHelper.write('/app/cms/menus/main.yaml') do |file|
57
+ file.write("---\n:name: root\n:children:\n")
50
58
  end
51
59
 
52
- js_path = "#{Rails.root}/app/assets/javascripts/burp.js"
53
- print "\t#{js_path}"
54
- if File.exist?(js_path)
55
- MyPrinter.print_yellow " Skipping"
56
- else
57
- File.open(js_path,"w") do |file|
58
- file.write("// Includes burp related javascript.\n//\n//= require 'burp/editing'\n//= require 'burp/cms_helper'")
59
- end
60
- MyPrinter.print_green " OK"
60
+ BurpRakeHelper.write('/app/assets/javascripts/burp.js') do |file|
61
+ file.write("// Includes burp related javascript.\n//\n//= require 'burp/editing'\n//= require 'burp/cms_helper'")
61
62
  end
62
63
 
63
- css_path = "#{Rails.root}/app/assets/stylesheets/burp.css"
64
- print "\t#{css_path}"
65
- if File.exist?(css_path)
66
- MyPrinter.print_yellow " Skipping"
67
- else
68
- File.open(css_path,"w") do |file|
69
- file.write("/*\n * Includes burp related stylesheet.\n *\n *= require 'burp/editing'\n */")
70
- end
71
- MyPrinter.print_green " OK"
64
+ BurpRakeHelper.write("/app/assets/stylesheets/burp.css") do |file|
65
+ file.write("/*\n * Includes burp related stylesheet.\n *\n *= require 'burp/editing'\n */")
72
66
  end
73
67
 
74
- access_path = "#{Rails.root}/config/initializers/burp_access.rb"
75
- print "\t#{access_path}"
76
- if File.exist?(access_path)
77
- MyPrinter.print_yellow " Skipping"
78
- else
79
- File.open(access_path,"w") do |file|
80
- file.write(%{
68
+ BurpRakeHelper.write("/app/assets/stylesheets/customize-burp.less") do |file|
69
+ file.write("/*\n * Add your customizations to the burp admin here.\n *\n */\n\n")
70
+ end
71
+
72
+ BurpRakeHelper.write("/app/assets/javascripts/customize-burp.js") do |file|
73
+ file.write("/*\n * Add your customizations to the burp admin here.\n *\n */\n\n")
74
+ end
75
+
76
+ BurpRakeHelper.write("/config/initializers/burp_access.rb") do |file|
77
+ file.write(%{
81
78
  Rails.application.config.burp_username = "#{Rails.application.class.parent_name.downcase}"
82
79
  Rails.application.config.burp_password = "#{('a'..'z').to_a.shuffle[0,6].join}"
83
- })
84
- end
85
- MyPrinter.print_green " OK"
80
+ })
86
81
  end
87
82
 
88
83
  puts ""
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: burp_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.29
4
+ version: 1.3.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darwin