mccabe 0.1.0 → 0.1.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: 86c4e0a18d0b2971e6d30c63b019ca1bb74d02ef
4
- data.tar.gz: 2d457e73f9afd1cccb07a539763171a88f4e8547
3
+ metadata.gz: 72379d20b7c7ea824390cb61969e45cb5a9f505e
4
+ data.tar.gz: 1001d47499a6d291601a23564f439b13d493d8bc
5
5
  SHA512:
6
- metadata.gz: 02a5ed82955b75ae647e513fa3b615959756fe0186c485277b85e509d050170ae8b75358e2be7956b89069cfe0b8b8560d5880c700752a97b92f85ad838fde9a
7
- data.tar.gz: 48eb68e4fc58b95c73f9f2eb745ff40bfe87bab48b2ce3ca6876c5c878517f13b8f19937d4f35a53f88a83bb1db5c62c23e293bdb0679d224eeeb066b7037ca9
6
+ metadata.gz: 46f4510109cecbbf18c989bd796b5bf5f45526a5ad14c6943e23f5385462e02362dfbeb43f353843bc55b765195ad56b25a7912da102f6308ce64dfcdec49a5c
7
+ data.tar.gz: 755647bd30d9dc774c9bb9990ab8fad5ee18a0ccffc1583a44aecef6c75b46db64477b5ba09212a6ec58834820766aaa2f88c695f5de7424c65b986f9974d5b4
data/README.md CHANGED
@@ -16,9 +16,6 @@ optionally specify your own threshold as the first argument. The default
16
16
  threshold is 4. You will get error messages for any methods which have
17
17
  complexity greater than the threshold.
18
18
 
19
- If the first argument is not an integer, it will be interpreted as a file
20
- pattern (any other arguments are also file patterns).
21
-
22
19
  Note that the script only considers files with .rb extensions, so that it
23
20
  doesn't attempt to parse other languages as Ruby. So, if you have
24
21
  extensionless Ruby scripts, you won't be able to use this on them.
@@ -26,9 +23,10 @@ extensionless Ruby scripts, you won't be able to use this on them.
26
23
  Examples:
27
24
  ```
28
25
  mccabe file1 ../file2
29
- mccabe 3 file1 # using a different threshold
26
+ mccabe file1 --threshold 3 # using a different threshold
30
27
  mccabe *.rb # wildcards work, too
31
28
  mccabe . # can also look through entire directories
29
+ mccabe . --quiet # will not print to stdout, only return success/failure status code
32
30
  ```
33
31
 
34
32
  ## Contributing
data/lib/mccabe/parser.rb CHANGED
@@ -5,7 +5,7 @@ module McCabe
5
5
  # Collect all the methods from the AST.
6
6
  def self.collect_methods(ast)
7
7
  methods = {}
8
- nodes = [ast]
8
+ nodes = [ast].compact
9
9
  until nodes.empty?
10
10
  node = nodes.shift
11
11
  case node.type
@@ -1,3 +1,3 @@
1
1
  module McCabe
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mccabe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Mason