fukuzatsu 2.2.4 → 2.3.0

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: 72b97df7ac1eacbb7cb47ec99c8caa9ba56ba28a
4
- data.tar.gz: 53cd91bbd7078af812530cd214a2e0974594a96d
3
+ metadata.gz: f07a403fbf77bc5aa045f8d28699999fbc954550
4
+ data.tar.gz: 1fabf7d8de5355aef3458d402a8ee3d643fd07ac
5
5
  SHA512:
6
- metadata.gz: 0db15f8a52fa1a62d401b8331cb8ff00cee02b075d2d87e68f412de2481883b11ac12a6aecd1958bd5adba06408007c81c92880335e85eda692ffb015f76dc8d
7
- data.tar.gz: 303c5515bd9f2a4fc395cfc1def645588081a08571a13cda555db7220452bb8a3efdaf57722b3a18ec87e1d17cd650e585f873991ee06d4099fd4e4b59fee3f7
6
+ metadata.gz: 804fea9b31e7394be09f5bb7450acd91e337d6228c9a53aaacac565f642ae010a2d5e60262fa2875a0a5520f981efee8d265ad8f2bed9cd65ce23e0290fb23b8
7
+ data.tar.gz: e739fe0ebda996301973c086718d5718b587ce8759cba071d260ff593cb4d08d5e3dda5f83e9af47d08ccf1ceff8e9f2202b69b8909ca5085a2272281bbc6105
data/bin/fuku CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'fukuzatsu/cli'
3
- Fukuzatsu::CLI.start
3
+ Fukuzatsu::CLI.start
@@ -13,6 +13,7 @@ require_relative "fukuzatsu/formatters/html"
13
13
  require_relative "fukuzatsu/formatters/html_index"
14
14
  require_relative "fukuzatsu/formatters/json"
15
15
  require_relative "fukuzatsu/formatters/json_index"
16
+ require_relative "fukuzatsu/formatters/json_stdout"
16
17
  require_relative "fukuzatsu/formatters/text"
17
18
  require_relative "fukuzatsu/parser"
18
19
  require_relative "fukuzatsu/summary"
@@ -28,6 +29,7 @@ module Fukuzatsu
28
29
  html: Fukuzatsu::Formatters::Html,
29
30
  csv: Fukuzatsu::Formatters::Csv,
30
31
  json: Fukuzatsu::Formatters::Json,
32
+ json_stdout: Fukuzatsu::Formatters::JsonStdout,
31
33
  text: Fukuzatsu::Formatters::Text
32
34
  }
33
35
  end
@@ -5,7 +5,7 @@ module Fukuzatsu
5
5
 
6
6
  class CLI < Thor
7
7
 
8
- desc_text = "Formats are text (default, to STDOUT), html, and csv. "
8
+ desc_text = "Formats are text (default, to STDOUT), html, json, json_stdout, and csv. "
9
9
  desc_text << "Example: fuku check foo/ -f html"
10
10
 
11
11
  desc "check PATH_TO_FILE [-f FORMAT] [-t MAX_COMPLEXITY_ALLOWED] [-o OUTPUT_PATH]", desc_text
@@ -65,6 +65,10 @@ module Fukuzatsu
65
65
  true
66
66
  end
67
67
 
68
+ def no_stdout?
69
+ false
70
+ end
71
+
68
72
  end
69
73
  end
70
74
 
@@ -0,0 +1,27 @@
1
+ module Fukuzatsu
2
+
3
+ module Formatters
4
+
5
+ class JsonStdout
6
+
7
+ include Formatters::Base
8
+
9
+ attr_reader :summaries
10
+
11
+ def self.reset_output_directory(base_output_path)
12
+ end
13
+
14
+ def self.no_stdout?
15
+ true
16
+ end
17
+
18
+ def self.index(summaries, base_output_path)
19
+ puts summaries.map { |summary| Json.new(summary: summary, base_output_path: base_output_path).as_json }.to_json
20
+ end
21
+
22
+ def export
23
+ end
24
+
25
+ end
26
+ end
27
+ end
@@ -27,8 +27,10 @@ module Fukuzatsu
27
27
  summaries.uniq(&:container_name).each do |summary|
28
28
  self.formatter.new(summary: summary, base_output_path: self.output_path).export
29
29
  end
30
- explain
31
- check_complexity
30
+ unless self.formatter.no_stdout?
31
+ explain
32
+ check_complexity
33
+ end
32
34
  end
33
35
 
34
36
  private
@@ -1,3 +1,3 @@
1
1
  module Fukuzatsu
2
- VERSION = "2.2.4"
2
+ VERSION = "2.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fukuzatsu
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.4
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Coraline Ada Ehmke
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-12-16 00:00:00.000000000 Z
12
+ date: 2014-12-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: analyst
@@ -237,6 +237,7 @@ files:
237
237
  - lib/fukuzatsu/formatters/html_index.rb
238
238
  - lib/fukuzatsu/formatters/json.rb
239
239
  - lib/fukuzatsu/formatters/json_index.rb
240
+ - lib/fukuzatsu/formatters/json_stdout.rb
240
241
  - lib/fukuzatsu/formatters/templates/index.html.haml
241
242
  - lib/fukuzatsu/formatters/templates/output.html.haml
242
243
  - lib/fukuzatsu/formatters/text.rb