pain 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/bin/pain +14 -15
  3. data/lib/pain/version.rb +1 -1
  4. data/pain.gemspec +1 -0
  5. metadata +16 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3c4206b23bae5c9b227f43d0418a8bbfabe7d8d3
4
- data.tar.gz: 8c6753d6ba640cacbd626c6833624f1d8f4774b7
3
+ metadata.gz: 3d82939d4bae35504e839fc0118e27f73ea0df02
4
+ data.tar.gz: 0425ba7e11bf078c0f27c6a402e2d2c176700c47
5
5
  SHA512:
6
- metadata.gz: 248b2f22e0ec30f3c514a322fd83e9a6ec22bee38f11577db7e8ff603e4cab3b03a3ceb6e6551f3c19cd47b48bddbec2eb605eb70cac3abddb1e8887b9abf6b9
7
- data.tar.gz: d4f5f6f7696d4a16dade07df3769684a4972eaf2189bbffeeb7b3400b0f7bce8a305044e045c2ae615107743cd6a7cdd32627bdb9731c53a1785c4fed500f705
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
- end
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
- elsif danger.is_a? Symbol
63
- danger
64
- else
62
+ elsif danger.is_a? Symbol
63
+ danger
64
+ else
65
65
  case_danger(danger)
66
- end
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 "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]
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
- 'How likely is this bug to occur?') do |like|
103
- options[:likelihood] = Pain::normalize(like, :likelihood)
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
- 'How much impact will this bug have?') do |impact|
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
- 'What kind of bug is this?') do |bug_type|
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::normalize(response, input)
123
+ options[input] = Pain.normalize(response, input)
125
124
  first = false
126
125
  end
127
126
  end
data/lib/pain/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pain
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
data/pain.gemspec CHANGED
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ['lib']
20
20
 
21
21
  spec.add_dependency 'term-ansicolor'
22
+ spec.add_dependency 'tins'
22
23
 
23
24
  spec.add_development_dependency 'bundler', '~> 1.6'
24
25
  spec.add_development_dependency 'rake'
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.1
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-07 00:00:00.000000000 Z
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