serum-rails 0.2.0 → 0.2.1

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: 8618c5eef15c29da8d226c626b0ccdac8ddc952a
4
- data.tar.gz: f575327bf6556db01f79fc950cbe98c16211ae12
3
+ metadata.gz: ab50cb542230e7195c2d5fa95e4564c075e738a5
4
+ data.tar.gz: 3abc89973b55f70c338024729ef70b8d747220a4
5
5
  SHA512:
6
- metadata.gz: a2f95adfded11edc85309746f3c851fe0425fbdc913f2c701164fcce6f28ebf9b61972b05a4acabe958049b7dced8227de7562b4b2b74f084efc372aefab8da6
7
- data.tar.gz: a050d3fb43e62e375a6a1196e789149656f9840a25106d1be8cb6641ecc1e0fa4344479f0fddd2a69130c1e4c134576c1a69186b72d7f98e260ab885f230a9bd
6
+ metadata.gz: c2526b799b3fb5a2a096b664ce8f9b52f5968de5ac486f696c6b4234fe3854a745e07f5c5b70cc652c45d2124e110a83f0f707be0d402744d63965e4b7e27952
7
+ data.tar.gz: 0bb6d3772b93ff066eef0084564b66eb9c010931e3223ea862e203d846c646b76b12d512da748196691768e3651fc56363c0e8badf750e1a607b96b818bc22a0
@@ -0,0 +1,8 @@
1
+ ### Run tests for gem development
2
+
3
+ 1. Use Ruby 2.1.2
4
+ 2. Run `bundle install` in project root
5
+ 3. Run `bundle install` in `spec/test_apps/rails-4-1`.
6
+ 4. You do **not** need to bundle in `spec/test_apps/rails-2-3`
7
+ 5. Run tests with `rspec spec`
8
+
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- serum-rails (0.2.0)
4
+ serum-rails (0.2.1)
5
5
  activesupport (>= 3.2)
6
6
 
7
7
  GEM
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.
@@ -36,13 +36,22 @@ module Serum
36
36
  private
37
37
 
38
38
  def run_command(cmd)
39
- Bundler.with_clean_env do
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
@@ -1,7 +1,7 @@
1
1
  module Serum
2
2
  module Rails
3
3
 
4
- VERSION = '0.2.0'
4
+ VERSION = '0.2.1'
5
5
 
6
6
  end
7
7
  end
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.0
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-04 00:00:00.000000000 Z
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