codesake-commons 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/codesake/commons/logging.rb +12 -12
- data/lib/codesake/commons/version.rb +1 -1
- data/lib/codesake/core/target.rb +2 -2
- metadata +16 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 421cd5855dd2b2ad566f440e9e0528b1596c0858
|
4
|
+
data.tar.gz: b7f7ce7ba86fedb95445d3a784b70046106a365a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b186d21c7c0b79ad43033e7551e64a1a518b5ed7a3b377abc5cd979397d2f09557f41a60d09aa94044a7014e1d443b5384e019f487ac18f3e6b59f2c4bb8d87b
|
7
|
+
data.tar.gz: fa5d2b4d282d106f8b13f2a070081c2bfb6dba5c7d675f876855e2d9f684540c9e5c766e4710db79f68c2806aee209d70df942aed09fb1ee40495bae8cb5f0b0
|
@@ -7,17 +7,17 @@ module Codesake
|
|
7
7
|
class Logging
|
8
8
|
include Singleton
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
attr_accessor :silence
|
11
|
+
attr_accessor :debug
|
12
|
+
attr_accessor :syslog
|
13
13
|
attr_accessor :filename
|
14
14
|
attr_reader :component
|
15
15
|
|
16
16
|
def initialize
|
17
17
|
super
|
18
|
-
@
|
19
|
-
@
|
20
|
-
@syslog =
|
18
|
+
@silence = false
|
19
|
+
@debug = true
|
20
|
+
@syslog = false
|
21
21
|
@filename = nil
|
22
22
|
@component = ""
|
23
23
|
end
|
@@ -37,19 +37,21 @@ module Codesake
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def warn(msg)
|
40
|
+
return if @silence
|
40
41
|
STDOUT.print Rainbow("#{Time.now.strftime("%H:%M:%S")} [w] #{@component}: #{msg}\n").yellow
|
41
42
|
send_to_syslog(msg, :warn)
|
42
43
|
send_to_file(msg, :warn)
|
43
44
|
end
|
44
45
|
|
45
46
|
def ok(msg)
|
47
|
+
return if @silence
|
46
48
|
STDOUT.print Rainbow("#{Time.now.strftime("%H:%M:%S")} [*] #{@component}: #{msg}\n").green
|
47
49
|
send_to_syslog(msg, :log)
|
48
50
|
send_to_file(msg, :log)
|
49
51
|
end
|
50
52
|
|
51
53
|
def log(msg)
|
52
|
-
return if @
|
54
|
+
return if @silence
|
53
55
|
STDOUT.print Rainbow("#{Time.now.strftime("%H:%M:%S")} [$] #{@component}: #{msg}\n").white
|
54
56
|
send_to_syslog(msg, :log)
|
55
57
|
send_to_file(msg, :log)
|
@@ -71,22 +73,20 @@ module Codesake
|
|
71
73
|
end
|
72
74
|
|
73
75
|
def debug(msg)
|
76
|
+
return if @silence
|
77
|
+
return unless @debug
|
74
78
|
STDOUT.print Rainbow("#{Time.now.strftime("%H:%M:%S")} [D] #{@component}: #{msg}\n").yellow.bright
|
75
79
|
send_to_syslog(msg, :debug)
|
76
80
|
send_to_file(msg, :debug)
|
77
81
|
end
|
78
82
|
|
79
83
|
def bug(msg)
|
84
|
+
return if @silence
|
80
85
|
STDERR.print Rainbow("#{Time.now.strftime("%H:%M:%S")} [%] #{@component}: - BUG - #{msg}\n").red.bright
|
81
86
|
send_to_syslog(msg, :debug)
|
82
87
|
send_to_file(msg, :debug)
|
83
88
|
end
|
84
89
|
|
85
|
-
def toggle_silence
|
86
|
-
@silencer = ! @silencer
|
87
|
-
@verbose = ! @silencer
|
88
|
-
end
|
89
|
-
|
90
90
|
def toggle_syslog
|
91
91
|
@syslog = ! @syslog
|
92
92
|
warn("codesake messages to syslog are now disabled") unless @syslog
|
data/lib/codesake/core/target.rb
CHANGED
@@ -7,7 +7,7 @@ module Codesake
|
|
7
7
|
attr_reader :url
|
8
8
|
attr_reader :username
|
9
9
|
attr_reader :password
|
10
|
-
|
10
|
+
|
11
11
|
attr_reader :page
|
12
12
|
|
13
13
|
|
@@ -16,7 +16,7 @@ module Codesake
|
|
16
16
|
attr_reader :language
|
17
17
|
attr_reader :cms
|
18
18
|
|
19
|
-
# This is the website tree. Fed by codesake-links.
|
19
|
+
# This is the website tree. Fed by codesake-links.
|
20
20
|
# Each tree element is an hash like
|
21
21
|
# {:url, :code, :kind, :dynamic} :dynamic is true or false if the page
|
22
22
|
# has some dynamic content that needs to be exploited (url parameters,
|
metadata
CHANGED
@@ -1,55 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codesake-commons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paolo Perego
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rainbow
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 2.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 2.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mechanize
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: nokogiri
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
description: codesake.com is an application security startup providing code review
|
@@ -61,11 +61,11 @@ executables: []
|
|
61
61
|
extensions: []
|
62
62
|
extra_rdoc_files: []
|
63
63
|
files:
|
64
|
-
- .document
|
65
|
-
- .gitignore
|
66
|
-
- .rspec
|
67
|
-
- .ruby-gemset
|
68
|
-
- .ruby-version
|
64
|
+
- ".document"
|
65
|
+
- ".gitignore"
|
66
|
+
- ".rspec"
|
67
|
+
- ".ruby-gemset"
|
68
|
+
- ".ruby-version"
|
69
69
|
- Gemfile
|
70
70
|
- LICENSE.txt
|
71
71
|
- README.md
|
@@ -89,17 +89,17 @@ require_paths:
|
|
89
89
|
- lib
|
90
90
|
required_ruby_version: !ruby/object:Gem::Requirement
|
91
91
|
requirements:
|
92
|
-
- -
|
92
|
+
- - ">="
|
93
93
|
- !ruby/object:Gem::Version
|
94
94
|
version: '0'
|
95
95
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
96
|
requirements:
|
97
|
-
- -
|
97
|
+
- - ">="
|
98
98
|
- !ruby/object:Gem::Version
|
99
99
|
version: '0'
|
100
100
|
requirements: []
|
101
101
|
rubyforge_project:
|
102
|
-
rubygems_version: 2.
|
102
|
+
rubygems_version: 2.2.2
|
103
103
|
signing_key:
|
104
104
|
specification_version: 4
|
105
105
|
summary: codesake_commons is the gem containing common ground routines useful across
|