pain 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/pain +14 -15
- data/lib/pain/version.rb +1 -1
- data/pain.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d82939d4bae35504e839fc0118e27f73ea0df02
|
4
|
+
data.tar.gz: 0425ba7e11bf078c0f27c6a402e2d2c176700c47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7274c6e4e5ff75ca1470afd5e01af84ffd4b3e8f7915e19c734ef419ef8d5ec3000aaf1b3273f228107914572b01cdeb4ced2b76757d18cd30db2bcc466b419f
|
7
|
+
data.tar.gz: 2adcf6c499b2315e5c1354bc8cc4b4c34268312ea616a8892ba43b1a639a226fa4796c8b07ba5c8c71bb57d5535258e087857e632895cab560ce3699c9a8efaf
|
data/bin/pain
CHANGED
@@ -24,7 +24,7 @@ def get_color(value)
|
|
24
24
|
9
|
25
25
|
else
|
26
26
|
252
|
27
|
-
|
27
|
+
end
|
28
28
|
Term::ANSIColor::Attribute[offset]
|
29
29
|
end
|
30
30
|
|
@@ -59,18 +59,18 @@ end
|
|
59
59
|
def color_output(msg, danger = :normal)
|
60
60
|
level = if danger == :normal
|
61
61
|
:default
|
62
|
-
|
63
|
-
|
64
|
-
|
62
|
+
elsif danger.is_a? Symbol
|
63
|
+
danger
|
64
|
+
else
|
65
65
|
case_danger(danger)
|
66
|
-
|
66
|
+
end
|
67
67
|
puts msg.color(get_color(level))
|
68
68
|
end
|
69
69
|
|
70
70
|
def display_options_for(input)
|
71
71
|
ceiling = Pain::OPTIONS[input].count
|
72
72
|
Pain::OPTIONS[input].each do |v, msg|
|
73
|
-
color_output("#{v}: #{msg}", (v/ceiling.to_f))
|
73
|
+
color_output("#{v}: #{msg}", (v / ceiling.to_f))
|
74
74
|
end
|
75
75
|
puts
|
76
76
|
end
|
@@ -87,29 +87,28 @@ def print_report_for(o)
|
|
87
87
|
hash
|
88
88
|
end
|
89
89
|
|
90
|
-
color_output
|
91
|
-
color_output
|
92
|
-
color_output
|
90
|
+
color_output "Type: #{o[:bug_type]} - #{Pain::OPTIONS[:bug_type][o[:bug_type]]}", levels[:bug_type]
|
91
|
+
color_output "Likelihood: #{o[:likelihood]} - #{Pain::OPTIONS[:likelihood][o[:likelihood]]}", levels[:likelihood]
|
92
|
+
color_output "Impact: #{o[:impact]} - #{Pain::OPTIONS[:impact][o[:impact]]}", levels[:impact]
|
93
93
|
puts
|
94
94
|
color_output "User Pain: #{pain}", total_danger(pain)
|
95
95
|
end
|
96
96
|
|
97
|
-
|
98
97
|
options = {}
|
99
98
|
|
100
99
|
OptionParser.new do |opts|
|
101
100
|
opts.on('-l', '--likelihood [LIKELIHOOD]', OptionParser::DecimalInteger,
|
102
|
-
|
103
|
-
options[:likelihood] = Pain
|
101
|
+
Pain::INPUT_MESSAGE[:likelihood]) do |like|
|
102
|
+
options[:likelihood] = Pain.normalize(like, :likelihood)
|
104
103
|
end
|
105
104
|
|
106
105
|
opts.on('-i', '--impact [IMPACT]', OptionParser::DecimalInteger,
|
107
|
-
|
106
|
+
Pain::INPUT_MESSAGE[:impact]) do |impact|
|
108
107
|
options[:impact] = Pain.normalize(impact, :impact)
|
109
108
|
end
|
110
109
|
|
111
110
|
opts.on('-t', '--type [TYPE]', OptionParser::DecimalInteger,
|
112
|
-
|
111
|
+
Pain::INPUT_MESSAGE[:bug_type]) do |bug_type|
|
113
112
|
options[:bug_type] = Pain.normalize(bug_type, :bug_type)
|
114
113
|
end
|
115
114
|
end.parse!
|
@@ -121,7 +120,7 @@ end.parse!
|
|
121
120
|
display_options_for(input) if first
|
122
121
|
|
123
122
|
response = gets.chomp
|
124
|
-
options[input] = Pain
|
123
|
+
options[input] = Pain.normalize(response, input)
|
125
124
|
first = false
|
126
125
|
end
|
127
126
|
end
|
data/lib/pain/version.rb
CHANGED
data/pain.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pain
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Nicholson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: term-ansicolor
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: tins
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|