fudge 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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MmE4MjI5YjRiMjU5MDBjMDliOTJiODJjOGQyYzk0MmE5MzFkYTgxMg==
4
+ MGFlMjgwNDllODA1YjQ4ODYzMjQxYzM2NDgzYmY0YThjNzMzYWFiNw==
5
5
  data.tar.gz: !binary |-
6
- N2UzMGEyNDAxZGM2MDBhNWNlNTQwYWNlM2U4MTYxYzQ3MTU0MDM3Yg==
6
+ NmI2NjllN2QyZjhlYmE3YTg2MzQ4NzBkODgxNjJhM2Q1ZDRkMDAwZg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YzZiMGNjZGNlZjk2MDgxNzVjMTBmMGNlZmQxMDQ3Zjg4YWM1OTIwOWI3ZTE1
10
- MDY3NjFhMjlmNmE1NTEyZmNmNDM2NzVhMWFiMTAyZDZmNjYyNTA1MjE4ODBm
11
- ZDc2ZjlkYWZkNmFjYWIwNWYwNzA3YWQ2MjcxZDQ0ZGRjYTYwYTE=
9
+ OWYwYmRmZjNjNDBiZDdmY2I2NTc4MjRlZjJiZTk2MDdhNzkwOTM5YWNhODdj
10
+ NTE1OGU3NWFjOGRlN2Y4YzliYWE1NjAwMzRmMGM0NTdiY2JkZWFkMTdjMGUx
11
+ MzA4ZWUyYWZjM2MwYjk0NWMzNjNhNDQ2MGZiNWM2NWE5ODE4Mjc=
12
12
  data.tar.gz: !binary |-
13
- NzgxOTI4ZjI5YzY3MDk5ZDc2ZTljOGZiNjg1OTFjNTIxZTcxZWZhZmJjNTk5
14
- YWI3ZGViNjliZWU4NDRkZjExZTA2MmFkNTc3YWU2Yjg1MjU3MjVkMGY3Y2Nm
15
- ZjhlOTQ3ODIwZTc2NDg1MzM0M2MzZDA5OTNkOTYwMDk0OTc3Yjc=
13
+ NzY2Mzc4Y2Q5ZDU3ZTgxYzJhMDcxNzBjOWEwMmQyZTUzYWYwNGQyYWU1YTFm
14
+ MzQ2ZWExN2NhNzMwMjJjZTAwYTRlYzAxZDY4ZDUxOWI0YzZiZmZlMDFlMGFh
15
+ ZmNlMzYzMzBjN2NlMDY2MDE2MTg2ZmRjNGE0YjQ5MWQ5ZjRmYzM=
@@ -66,9 +66,19 @@ module Fudge
66
66
  end
67
67
 
68
68
  def extract_scores(matches)
69
- lines = extract_lines(matches)
70
- _, average, max, _ = lines
71
- [average.first.to_f, max.first.to_f]
69
+ average = max = total = 0
70
+ extract_lines(matches).each do |value, key|
71
+ case key
72
+ when 'flog total'
73
+ total = value.to_f
74
+ when 'flog/method average'
75
+ average = value.to_f
76
+ else
77
+ max = value.to_f unless value.nil?
78
+ break
79
+ end
80
+ end
81
+ [average, max, total]
72
82
  end
73
83
 
74
84
  def extract_lines(matches)
@@ -1,4 +1,4 @@
1
1
  module Fudge
2
2
  # Define gem version
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
@@ -5,6 +5,12 @@ describe Fudge::Tasks::Flog do
5
5
 
6
6
  it_should_behave_like 'bundle aware'
7
7
 
8
+ let(:output_perfect) do
9
+ <<-EOF
10
+ 0.0: flog total
11
+ 0.0: flog/method average
12
+ EOF
13
+ end
8
14
 
9
15
  let(:output_good) do
10
16
  <<-EOF
@@ -65,6 +71,7 @@ EOF
65
71
  it { should_not succeed_with_output output_good_average_bad_max }
66
72
  it { should_not succeed_with_output output_bad_average_good_max }
67
73
  it { should succeed_with_output output_good }
74
+ it { should succeed_with_output output_perfect }
68
75
 
69
76
  context 'when :max score is supplied' do
70
77
  it 'fails when score is higher than max' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fudge
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
  - Sage One team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-14 00:00:00.000000000 Z
11
+ date: 2013-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ! '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: json
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 1.7.7
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 1.7.7
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: redcarpet
57
71
  requirement: !ruby/object:Gem::Requirement