cider_ci-support 1.0.0 → 1.1.0.pre.beta.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: 748a3a62d9d7a67b1d78b92bd7c27ababa4ed21b
4
- data.tar.gz: 14866fbe5c1ddb8efbfb796e58304d2550f4c9fc
3
+ metadata.gz: a415fa7aff023229703f9130d401ab041767d358
4
+ data.tar.gz: ab1737be91d7c31c6a8afb1472e5a603c7ad0f21
5
5
  SHA512:
6
- metadata.gz: 9017413049294eec8c3ad663e964452f5601694a694e17f70edfdc6884a1aa011175b0ee262c141edaf3bfa023f183596cac8c4c853ee0e17580baaed5c4f1a3
7
- data.tar.gz: f9888ebd8c57be001ddb9df94e810371440eb2859e5616b15973b2dfd739f0be002146511f5dec58cc1c6120a9cb1d609aac68f82e80a88ed62dd68d1ad3491c
6
+ metadata.gz: 6d059856c0596a5955facc58f1d7935afa22236e85867375e92b440a331c91536e893215b0e6f504c7b1fad59d6717151d4ade289fd416e85761712d195a2526
7
+ data.tar.gz: 2a8d008e3c731c20615a237a46351358761b14952a40178cc79c8bde11bfff0def507e2736f44b8e17f3e42b9a5455722e490e79f1d438f8e4c482d691ae9f5e
data/.gitignore CHANGED
@@ -12,3 +12,4 @@
12
12
  *.o
13
13
  *.a
14
14
  mkmf.log
15
+ *.gem
data/README.md CHANGED
@@ -54,3 +54,12 @@ gem 'cider_ci-support', '~> 1.0.0'
54
54
  ~~~
55
55
 
56
56
 
57
+ ### Static code analysis with `cider-ci_flog`
58
+
59
+ `cider-ci_flog` uses [flog][] to perform a static code analysis. It exits with
60
+ 0 if and only if there are no offenders. The original `flog` always exits with
61
+ 0. Therefore `cider-ci_flog` lends itself to be used within a task of
62
+ a Cider-CI execution suite.
63
+
64
+ [flog]: http://ruby.sadi.st/Flog.html
65
+
data/bin/cider-ci_flog ADDED
@@ -0,0 +1,82 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'optparse'
4
+ require 'ostruct'
5
+ require 'yaml'
6
+ require 'flog_cli'
7
+ require 'flog'
8
+
9
+ # require 'pry'
10
+
11
+
12
+ ###############################################################################
13
+
14
+ #
15
+ # Authors: Thomas Schank <DrTom@schank.ch>
16
+ #
17
+ ###############################################################################
18
+
19
+
20
+ ###############################################################################
21
+ # Options, main ....
22
+ ###############################################################################
23
+
24
+
25
+ def parse_options options
26
+
27
+ optparse = OptionParser.new do |opts|
28
+ opts.banner = "Usage: cider-ci_flog FILE/DIR ..."
29
+
30
+ opts.on('-l', '--limit N', Integer) do |l|
31
+ options.limit= l
32
+ end
33
+
34
+ opts.on('-d', '--print-details') do
35
+ options.print_details= true
36
+ end
37
+
38
+
39
+
40
+ end.parse!
41
+
42
+ options
43
+ end
44
+
45
+
46
+ def main
47
+ options = OpenStruct.new
48
+ options.limit= 30
49
+ options.print_details= false
50
+
51
+ parse_options options
52
+
53
+ files= FlogCLI.expand_dirs_to_files ARGV
54
+
55
+ flog_options = FlogCLI.parse_options []
56
+ flogger= Flog.new flog_options
57
+ flogger.flog *files
58
+
59
+ offending= flogger.totals \
60
+ .select{|k,v| v > options.limit} \
61
+ .sort_by{ |k,v| -v}
62
+
63
+ if offending.empty?
64
+ $stdout.puts "cider-ci_flog OK"
65
+ exit
66
+ else
67
+ $stderr.puts "cider-ci_flog FAILED:"
68
+ offending.each do |offender|
69
+ $stderr.puts "" if options.print_details
70
+
71
+ $stderr.puts "#{offender[1].round} #{offender[0]}"
72
+ if options.print_details
73
+ $stderr.puts flogger.calls[offender[0]].to_yaml
74
+ end
75
+ end
76
+ abort
77
+ end
78
+
79
+ end
80
+
81
+ main
82
+
@@ -25,4 +25,5 @@ Gem::Specification.new do |spec|
25
25
  spec.add_runtime_dependency 'thread', '= 0.1.4'
26
26
  spec.add_runtime_dependency 'simplecov', '~> 0.9'
27
27
  spec.add_runtime_dependency 'json_roa-client', ">= 1.0.0.pre.beta.2"
28
+ spec.add_runtime_dependency 'flog', "~> 4.3.0"
28
29
  end
@@ -1,5 +1,5 @@
1
1
  module Cider_CI
2
2
  module Support
3
- VERSION = "1.0.0"
3
+ VERSION = "1.1.0-beta.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cider_ci-support
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0.pre.beta.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Schank
@@ -94,11 +94,26 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: 1.0.0.pre.beta.2
97
+ - !ruby/object:Gem::Dependency
98
+ name: flog
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 4.3.0
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 4.3.0
97
111
  description: ''
98
112
  email:
99
113
  - DrTom@schank.ch
100
114
  executables:
101
115
  - cider-ci_coverage
116
+ - cider-ci_flog
102
117
  extensions: []
103
118
  extra_rdoc_files: []
104
119
  files:
@@ -108,6 +123,7 @@ files:
108
123
  - README.md
109
124
  - Rakefile
110
125
  - bin/cider-ci_coverage
126
+ - bin/cider-ci_flog
111
127
  - cider_ci-support.gemspec
112
128
  - lib/cider_ci/support.rb
113
129
  - lib/cider_ci/support/version.rb
@@ -126,9 +142,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
126
142
  version: '0'
127
143
  required_rubygems_version: !ruby/object:Gem::Requirement
128
144
  requirements:
129
- - - ">="
145
+ - - ">"
130
146
  - !ruby/object:Gem::Version
131
- version: '0'
147
+ version: 1.3.1
132
148
  requirements: []
133
149
  rubyforge_project:
134
150
  rubygems_version: 2.2.2