serum-rails 0.2.0 → 0.2.1
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/DEVELOPMENT.md +8 -0
- data/Gemfile.lock +1 -1
- data/README.md +31 -0
- data/lib/serum/rails/app.rb +10 -1
- data/lib/serum/rails/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab50cb542230e7195c2d5fa95e4564c075e738a5
|
4
|
+
data.tar.gz: 3abc89973b55f70c338024729ef70b8d747220a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2526b799b3fb5a2a096b664ce8f9b52f5968de5ac486f696c6b4234fe3854a745e07f5c5b70cc652c45d2124e110a83f0f707be0d402744d63965e4b7e27952
|
7
|
+
data.tar.gz: 0bb6d3772b93ff066eef0084564b66eb9c010931e3223ea862e203d846c646b76b12d512da748196691768e3651fc56363c0e8badf750e1a607b96b818bc22a0
|
data/DEVELOPMENT.md
ADDED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -16,6 +16,15 @@ Since all you send us are a few numbers, we don't need to look at your code for
|
|
16
16
|
estimate. This saves us signing an NDA and giving us access to your repository before
|
17
17
|
we even work together.
|
18
18
|
|
19
|
+
### Prerequisites
|
20
|
+
|
21
|
+
You need:
|
22
|
+
|
23
|
+
- Ruby 1.8.7 or higher
|
24
|
+
- [Bundler](http://bundler.io/)
|
25
|
+
- A machine that can run the project you want to generate metrics for. `serum-rails` will call `bundle` and `rake`
|
26
|
+
inside your project directory, so make sure you have a `database.yml` and all dependencies installed.
|
27
|
+
If you can open a Rails console you should be good to go.
|
19
28
|
|
20
29
|
### Installation
|
21
30
|
|
@@ -36,5 +45,27 @@ serum-rails PATH_TO_YOUR_RAILS_APPLICATION
|
|
36
45
|
```
|
37
46
|
|
38
47
|
`serum-rails` will scan the code of your application and output some code metric to the console.
|
48
|
+
It should look like this:
|
49
|
+
|
50
|
+
```
|
51
|
+
time = 2014-09-04 11:25:44
|
52
|
+
routes = 243
|
53
|
+
file_accesses = 66
|
54
|
+
controller_methods = 135
|
55
|
+
mailer_invocations = 17
|
56
|
+
uploaders = 5
|
57
|
+
redirects = 33
|
58
|
+
crypto_terms = 42
|
59
|
+
json_outputs = 0
|
60
|
+
cookie_accesses = 7
|
61
|
+
yaml_inputs = 0
|
62
|
+
unescaped_strings = 59
|
63
|
+
lines_of_code = 42784
|
64
|
+
gems = 154
|
65
|
+
```
|
39
66
|
|
40
67
|
Please e-mail the output to your security audit contact at makandra to continue the process.
|
68
|
+
|
69
|
+
### Gem development
|
70
|
+
|
71
|
+
If you want to make changes to the `serum-rails` gem itself (not required for an audit), please see `DEVELOPMENT.md` in the project root for instructions.
|
data/lib/serum/rails/app.rb
CHANGED
@@ -36,13 +36,22 @@ module Serum
|
|
36
36
|
private
|
37
37
|
|
38
38
|
def run_command(cmd)
|
39
|
-
|
39
|
+
with_clean_env do
|
40
40
|
result = `#{cmd}`
|
41
41
|
$?.success? or raise "Error while running command: #{cmd}"
|
42
42
|
result
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
+
def with_clean_env(&block)
|
47
|
+
# Unlike RVM, rbenv does not auto-load Bundler for gem binaries. So.
|
48
|
+
if defined?(Bundler)
|
49
|
+
Bundler.with_clean_env(&block)
|
50
|
+
else
|
51
|
+
block.call
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
46
55
|
def ensure_root_exists
|
47
56
|
File.directory?(@root) or raise "Not a directory: #{@root}"
|
48
57
|
end
|
data/lib/serum/rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serum-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henning Koch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -62,6 +62,7 @@ files:
|
|
62
62
|
- ".gitignore"
|
63
63
|
- ".rspec"
|
64
64
|
- ".ruby-version"
|
65
|
+
- DEVELOPMENT.md
|
65
66
|
- Gemfile
|
66
67
|
- Gemfile.lock
|
67
68
|
- LICENSE
|