lita-diabetter 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/Gemfile +3 -3
- data/Gemfile.lock +80 -0
- data/README.md +36 -36
- data/Rakefile +6 -6
- data/lib/lita/handlers/diabetter-misc.rb +20 -0
- data/lib/lita/handlers/diabetter.rb +159 -165
- data/lib/lita-diabetter.rb +13 -12
- data/lita-diabetter.gemspec +26 -26
- data/spec/lita/handlers/diabetter_spec.rb +4 -4
- data/spec/spec_helper.rb +14 -14
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97677d8e1b43e3224acf0bdee3ad83212b7ad09a
|
4
|
+
data.tar.gz: 845fef57839b4451b7c2a8304bfbe6ce66dd1534
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd41b88d9e8b029575e70050372566de65514a3424068ed5d6344d0ba5b671eee7c169874e1922690ebab05cc71669471b4ed98d6c888f9acc9dd32b8dd62270
|
7
|
+
data.tar.gz: 1c725f41e09e6b597c7d45c46ab972fc7d9b5f31de81c1b5ec078f9d1d3a20d420f280604e1554215ff3bd1eb57528d1cda519c4a150147070a6f13405a1d1a2
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
gemspec
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
gemspec
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
lita-diabetter (1.0.0)
|
5
|
+
lita (~> 4.7)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
byebug (9.0.6)
|
11
|
+
coderay (1.1.1)
|
12
|
+
diff-lcs (1.2.5)
|
13
|
+
faraday (0.10.1)
|
14
|
+
multipart-post (>= 1.2, < 3)
|
15
|
+
http_router (0.11.2)
|
16
|
+
rack (>= 1.0.0)
|
17
|
+
url_mount (~> 0.2.1)
|
18
|
+
i18n (0.7.0)
|
19
|
+
ice_nine (0.11.2)
|
20
|
+
lita (4.7.1)
|
21
|
+
bundler (>= 1.3)
|
22
|
+
faraday (>= 0.8.7)
|
23
|
+
http_router (>= 0.11.2)
|
24
|
+
i18n (>= 0.6.9)
|
25
|
+
ice_nine (>= 0.11.0)
|
26
|
+
multi_json (>= 1.7.7)
|
27
|
+
puma (>= 2.7.1)
|
28
|
+
rack (>= 1.5.2, < 2.0.0)
|
29
|
+
rb-readline (>= 0.5.1)
|
30
|
+
redis-namespace (>= 1.3.0)
|
31
|
+
thor (>= 0.18.1)
|
32
|
+
method_source (0.8.2)
|
33
|
+
multi_json (1.12.1)
|
34
|
+
multipart-post (2.0.0)
|
35
|
+
pry (0.10.4)
|
36
|
+
coderay (~> 1.1.0)
|
37
|
+
method_source (~> 0.8.1)
|
38
|
+
slop (~> 3.4)
|
39
|
+
pry-byebug (3.4.2)
|
40
|
+
byebug (~> 9.0)
|
41
|
+
pry (~> 0.10)
|
42
|
+
puma (3.6.2)
|
43
|
+
rack (1.6.5)
|
44
|
+
rack-test (0.6.3)
|
45
|
+
rack (>= 1.0)
|
46
|
+
rake (10.4.2)
|
47
|
+
rb-readline (0.5.3)
|
48
|
+
redis (3.3.2)
|
49
|
+
redis-namespace (1.5.2)
|
50
|
+
redis (~> 3.0, >= 3.0.4)
|
51
|
+
rspec (3.0.0)
|
52
|
+
rspec-core (~> 3.0.0)
|
53
|
+
rspec-expectations (~> 3.0.0)
|
54
|
+
rspec-mocks (~> 3.0.0)
|
55
|
+
rspec-core (3.0.4)
|
56
|
+
rspec-support (~> 3.0.0)
|
57
|
+
rspec-expectations (3.0.4)
|
58
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
59
|
+
rspec-support (~> 3.0.0)
|
60
|
+
rspec-mocks (3.0.4)
|
61
|
+
rspec-support (~> 3.0.0)
|
62
|
+
rspec-support (3.0.4)
|
63
|
+
slop (3.6.0)
|
64
|
+
thor (0.19.4)
|
65
|
+
url_mount (0.2.1)
|
66
|
+
rack
|
67
|
+
|
68
|
+
PLATFORMS
|
69
|
+
x64-mingw32
|
70
|
+
|
71
|
+
DEPENDENCIES
|
72
|
+
bundler (~> 1.3)
|
73
|
+
lita-diabetter!
|
74
|
+
pry-byebug
|
75
|
+
rack-test
|
76
|
+
rake (< 11.0)
|
77
|
+
rspec (~> 3.0.0)
|
78
|
+
|
79
|
+
BUNDLED WITH
|
80
|
+
1.13.7
|
data/README.md
CHANGED
@@ -1,36 +1,36 @@
|
|
1
|
-
# lita-diabetter
|
2
|
-
|
3
|
-
[![Build Status][travis-img]][travis-url]
|
4
|
-
[![Gem Version][gem-img]][gem-url]
|
5
|
-
[![Gem Downloads][gem-dl-img]][gem-url]
|
6
|
-
[![Dependency status][gem-dep-img]][gem-dep-url]
|
7
|
-
[![Codacy Badge][codacy-img]][codacy-url]
|
8
|
-
|
9
|
-
TODO: Add a description of the plugin.
|
10
|
-
|
11
|
-
## Installation
|
12
|
-
|
13
|
-
Add lita-diabetter to your Lita instance's Gemfile:
|
14
|
-
|
15
|
-
``` ruby
|
16
|
-
gem "lita-diabetter"
|
17
|
-
```
|
18
|
-
|
19
|
-
## Configuration
|
20
|
-
|
21
|
-
TODO: Describe any configuration attributes the plugin exposes.
|
22
|
-
|
23
|
-
## Usage
|
24
|
-
|
25
|
-
TODO: Describe the plugin's features and how to use them.
|
26
|
-
|
27
|
-
|
28
|
-
[travis-img]: https://img.shields.io/travis/cascer1/lita-diabetter.svg
|
29
|
-
[travis-url]: https://travis-ci.org/cascer1/lita-diabetter
|
30
|
-
[gem-img]: https://img.shields.io/gem/v/lita-diabetter.svg
|
31
|
-
[gem-url]: https://badge.fury.io/rb/lita-diabetter
|
32
|
-
[gem-dl-img]: https://img.shields.io/gem/dv/lita-diabetter/stable.svg
|
33
|
-
[gem-dep-img]: https://img.shields.io/gemnasium/cascer1/lita-diabetter.svg
|
34
|
-
[gem-dep-url]: https://gemnasium.com/github.com/cascer1/lita-diabetter
|
35
|
-
[codacy-img]: https://img.shields.io/codacy/grade/218ed88601a243ccae18e98e590b622d.svg
|
36
|
-
[codacy-url]: https://www.codacy.com/app/cascer1/lita-diabetter?utm_source=github.com&utm_medium=referral&utm_content=cascer1/lita-diabetter&utm_campaign=Badge_Grade
|
1
|
+
# lita-diabetter
|
2
|
+
|
3
|
+
[![Build Status][travis-img]][travis-url]
|
4
|
+
[![Gem Version][gem-img]][gem-url]
|
5
|
+
[![Gem Downloads][gem-dl-img]][gem-url]
|
6
|
+
[![Dependency status][gem-dep-img]][gem-dep-url]
|
7
|
+
[![Codacy Badge][codacy-img]][codacy-url]
|
8
|
+
|
9
|
+
TODO: Add a description of the plugin.
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
Add lita-diabetter to your Lita instance's Gemfile:
|
14
|
+
|
15
|
+
``` ruby
|
16
|
+
gem "lita-diabetter"
|
17
|
+
```
|
18
|
+
|
19
|
+
## Configuration
|
20
|
+
|
21
|
+
TODO: Describe any configuration attributes the plugin exposes.
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Describe the plugin's features and how to use them.
|
26
|
+
|
27
|
+
|
28
|
+
[travis-img]: https://img.shields.io/travis/cascer1/lita-diabetter.svg
|
29
|
+
[travis-url]: https://travis-ci.org/cascer1/lita-diabetter
|
30
|
+
[gem-img]: https://img.shields.io/gem/v/lita-diabetter.svg
|
31
|
+
[gem-url]: https://badge.fury.io/rb/lita-diabetter
|
32
|
+
[gem-dl-img]: https://img.shields.io/gem/dv/lita-diabetter/stable.svg
|
33
|
+
[gem-dep-img]: https://img.shields.io/gemnasium/cascer1/lita-diabetter.svg
|
34
|
+
[gem-dep-url]: https://gemnasium.com/github.com/cascer1/lita-diabetter
|
35
|
+
[codacy-img]: https://img.shields.io/codacy/grade/218ed88601a243ccae18e98e590b622d.svg
|
36
|
+
[codacy-url]: https://www.codacy.com/app/cascer1/lita-diabetter?utm_source=github.com&utm_medium=referral&utm_content=cascer1/lita-diabetter&utm_campaign=Badge_Grade
|
data/Rakefile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
require 'bundler/gem_tasks'
|
2
|
-
require 'rspec/core/rake_task'
|
3
|
-
|
4
|
-
RSpec::Core::RakeTask.new(:spec)
|
5
|
-
|
6
|
-
task default: :spec
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'rspec/core/rake_task'
|
3
|
+
|
4
|
+
RSpec::Core::RakeTask.new(:spec)
|
5
|
+
|
6
|
+
task default: :spec
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Lita
|
2
|
+
module Handlers
|
3
|
+
class DiabetterMisc < Handler
|
4
|
+
|
5
|
+
route(/^-diabot.*$/i, :deprecated, command: false)
|
6
|
+
|
7
|
+
route(/^diabetes y$/i, :diabetesy, command: false, restrict_to: :diabot_meme)
|
8
|
+
|
9
|
+
def deprecated(response)
|
10
|
+
response.reply('The -diabot prefix is deprecated. See `diabot help` for more info')
|
11
|
+
end
|
12
|
+
|
13
|
+
def diabetesy(response)
|
14
|
+
response.reply('Because diabetes r hard')
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
Lita.register_handler(DiabetterMisc)
|
19
|
+
end
|
20
|
+
end
|
@@ -1,165 +1,159 @@
|
|
1
|
-
module Lita
|
2
|
-
module Handlers
|
3
|
-
class Diabetter < Handler
|
4
|
-
@@conversion_ratio = 18.0182
|
5
|
-
@@lower = 25.0 # Lower limit for mmol/L - mg/dL cutoff
|
6
|
-
@@upper = 50.0 # Upper limit for mmol/L - mg/dL cutoff
|
7
|
-
|
8
|
-
route(/(?:^|_)(\d{1,3}|\d{1,2}\.\d+)(?:$|_)/, :convert, command: false, help: {
|
9
|
-
'<number>' => 'Convert glucose between mass/molar concentration units.',
|
10
|
-
'_<number>_' => 'Convert glucose between mass/molar concentration units inline. E.g "I started at _125_ today"'
|
11
|
-
})
|
12
|
-
|
13
|
-
route(/estimate a1c(?: from average)?\s+(\d{1,3}|\d{1,2}\.\d+)$/i, :estimate_a1c, command: true, help: {
|
14
|
-
'estimate a1c [from average] <glucose level>' => 'Estimates A1C based on average BG level'
|
15
|
-
})
|
16
|
-
|
17
|
-
route(/estimate average(?: from a1c)?\s+(\d{1,3}|\d{1,2}\.\d+)$/i, :estimate_average_from_a1c, command: true, help: {
|
18
|
-
'estimate average [from a1c] <A1C>' => 'Estimates average blood glucose'
|
19
|
-
})
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
mgdl =
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
reply =
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
input
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
end
|
163
|
-
Lita.register_handler(Diabetter)
|
164
|
-
end
|
165
|
-
end
|
1
|
+
module Lita
|
2
|
+
module Handlers
|
3
|
+
class Diabetter < Handler
|
4
|
+
@@conversion_ratio = 18.0182
|
5
|
+
@@lower = 25.0 # Lower limit for mmol/L - mg/dL cutoff
|
6
|
+
@@upper = 50.0 # Upper limit for mmol/L - mg/dL cutoff
|
7
|
+
|
8
|
+
route(/(?:^|_)(\d{1,3}|\d{1,2}\.\d+)(?:$|_)/, :convert, command: false, help: {
|
9
|
+
'<number>' => 'Convert glucose between mass/molar concentration units.',
|
10
|
+
'_<number>_' => 'Convert glucose between mass/molar concentration units inline. E.g "I started at _125_ today"'
|
11
|
+
})
|
12
|
+
|
13
|
+
route(/estimate a1c(?: from average)?\s+(\d{1,3}|\d{1,2}\.\d+)$/i, :estimate_a1c, command: true, help: {
|
14
|
+
'estimate a1c [from average] <glucose level>' => 'Estimates A1C based on average BG level'
|
15
|
+
})
|
16
|
+
|
17
|
+
route(/estimate average(?: from a1c)?\s+(\d{1,3}|\d{1,2}\.\d+)$/i, :estimate_average_from_a1c, command: true, help: {
|
18
|
+
'estimate average [from a1c] <A1C>' => 'Estimates average blood glucose'
|
19
|
+
})
|
20
|
+
|
21
|
+
def convert(response)
|
22
|
+
if response.message.body.match(URI.regexp(%w(http https))).nil?
|
23
|
+
input = response.matches[0][0]
|
24
|
+
Lita.logger.debug('Converting BG for input "' + input + '"')
|
25
|
+
|
26
|
+
if input.to_f < @@lower
|
27
|
+
response.reply("#{input} mmol/L is #{mmol_to_mgdl(input).to_s} mg/dL")
|
28
|
+
elsif input.to_f >= @@lower && input.to_f < @@upper
|
29
|
+
mmol = mgdl_to_mmol(input).to_s
|
30
|
+
mgdl = mmol_to_mgdl(input).to_s
|
31
|
+
|
32
|
+
result = '*I\'m not sure if you gave me mmol/L or mg/dL, so I\'ll give you both.*\n'
|
33
|
+
result += "#{input} mg/dL is **#{mmol} mmol/L**\n"
|
34
|
+
result += "#{input} mmol/L is **#{mgdl} mg/dL**"
|
35
|
+
|
36
|
+
response.reply(result)
|
37
|
+
else
|
38
|
+
response.reply("#{input} mg/dL is #{mgdl_to_mmol(input).to_s} mmol/L")
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def estimate_a1c(response)
|
44
|
+
input = response.matches[0][0]
|
45
|
+
Lita.logger.debug('Estimating a1c for input "' + input + '"')
|
46
|
+
|
47
|
+
|
48
|
+
if input.to_f < @@lower
|
49
|
+
mmol = input.to_f.round(1)
|
50
|
+
mgdl = mmol_to_mgdl(mmol)
|
51
|
+
|
52
|
+
type = 'mmol'
|
53
|
+
elsif input.to_f >= @@lower && input.to_f < @@upper
|
54
|
+
mmol = input.to_f.round(1)
|
55
|
+
mgdl_from_mmol = mmol_to_mgdl(input.to_f)
|
56
|
+
mgdl = input.to_f
|
57
|
+
|
58
|
+
dcct_alt = mgdl_to_dcct(mgdl_from_mmol)
|
59
|
+
ifcc_alt = dcct_to_ifcc(dcct_alt).round(0).to_s
|
60
|
+
dcct_alt = dcct.round(1).to_s
|
61
|
+
|
62
|
+
type = 'unknown'
|
63
|
+
else
|
64
|
+
mgdl = input.to_i
|
65
|
+
mmol = mgdl_to_mmol(mgdl)
|
66
|
+
|
67
|
+
type = 'mgdl'
|
68
|
+
end
|
69
|
+
|
70
|
+
dcct = mgdl_to_dcct(mgdl)
|
71
|
+
ifcc = dcct_to_ifcc(dcct).round(0).to_s
|
72
|
+
dcct = dcct.round(1).to_s
|
73
|
+
|
74
|
+
|
75
|
+
if type == 'unknown'
|
76
|
+
reply = "*I'm not sure if you entered mmol/L or mg/dL, so I'll give you both*\n"
|
77
|
+
reply += make_average_sentence('mmol', mmol, dcct_alt, ifcc_alt) + "\n"
|
78
|
+
reply += make_average_sentence('mgdl', mgdl, dcct, ifcc)
|
79
|
+
elsif type=='mmol'
|
80
|
+
reply = make_average_sentence('mmol', mmol, dcct, ifcc)
|
81
|
+
else
|
82
|
+
reply = make_average_sentence('mgdl', mgdl, dcct, ifcc)
|
83
|
+
end
|
84
|
+
|
85
|
+
response.reply(reply)
|
86
|
+
end
|
87
|
+
|
88
|
+
def make_average_sentence(type, value, dcct, ifcc)
|
89
|
+
if type == 'mmol'
|
90
|
+
string = "An average of **#{value} mmol/L** is about "
|
91
|
+
elsif type == 'mgdl'
|
92
|
+
string = "An average of **#{value} mg/dL** is about "
|
93
|
+
end
|
94
|
+
|
95
|
+
string += "**#{dcct}%** (DCCT) or **#{ifcc} mmol/mol** (IFCC)"
|
96
|
+
end
|
97
|
+
|
98
|
+
def estimate_average_from_a1c(response)
|
99
|
+
input = response.matches[0][0]
|
100
|
+
Lita.logger.debug('Converting a1c to BG for input "' + input + '"')
|
101
|
+
a1c = input.to_f
|
102
|
+
dcct = 0
|
103
|
+
ifcc = 0
|
104
|
+
|
105
|
+
if input.index('.') == nil
|
106
|
+
ifcc = a1c.round(0)
|
107
|
+
dcct = ifcc_to_dcct(a1c).round(1)
|
108
|
+
else
|
109
|
+
dcct = a1c.round(1)
|
110
|
+
ifcc = dcct_to_ifcc(a1c).round
|
111
|
+
end
|
112
|
+
|
113
|
+
mgdl = dcct_to_mgdl(dcct)
|
114
|
+
|
115
|
+
reply = 'an A1C of ' + dcct.to_s + '% (DCCT) or '
|
116
|
+
reply = reply + ifcc.to_s + ' mmol/mol (IFCC)'
|
117
|
+
reply = reply + ' is about '
|
118
|
+
reply = reply + mgdl.round.to_s + ' mg/dL or '
|
119
|
+
reply = reply + mgdl_to_mmol(mgdl).round(1).to_s + ' mmol/L'
|
120
|
+
response.reply(reply)
|
121
|
+
end
|
122
|
+
|
123
|
+
def mgdl_to_mmol(n)
|
124
|
+
(n.to_i / @@conversion_ratio).round(1)
|
125
|
+
end
|
126
|
+
|
127
|
+
def mmol_to_mgdl(n)
|
128
|
+
(n.to_f * @@conversion_ratio).round
|
129
|
+
end
|
130
|
+
|
131
|
+
def mgdl_to_dcct(n)
|
132
|
+
((n.to_i + 46.7) / 28.7)
|
133
|
+
end
|
134
|
+
|
135
|
+
def mgdl_to_ifcc(n)
|
136
|
+
((mgdl_to_dcct(n) - 2.15) * 10.929)
|
137
|
+
end
|
138
|
+
|
139
|
+
def dcct_to_ifcc(n)
|
140
|
+
(n.to_f - 2.15) * 10.929
|
141
|
+
end
|
142
|
+
|
143
|
+
def ifcc_to_dcct(n)
|
144
|
+
(n.to_f / 10.929) + 2.15
|
145
|
+
end
|
146
|
+
|
147
|
+
def dcct_to_mgdl(n)
|
148
|
+
(n.to_f * 28.7) - 46.7
|
149
|
+
end
|
150
|
+
|
151
|
+
def ifcc_to_mgdl(n)
|
152
|
+
dcct_to_mgdl((n / 10.929) + 2.5)
|
153
|
+
end
|
154
|
+
|
155
|
+
|
156
|
+
end
|
157
|
+
Lita.register_handler(Diabetter)
|
158
|
+
end
|
159
|
+
end
|
data/lib/lita-diabetter.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
-
require 'lita'
|
2
|
-
|
3
|
-
Lita.load_locales Dir[File.expand_path(
|
4
|
-
File.join('..', '..', 'locales', '*.yml'), __FILE__
|
5
|
-
)]
|
6
|
-
|
7
|
-
require 'lita/handlers/diabetter'
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
1
|
+
require 'lita'
|
2
|
+
|
3
|
+
Lita.load_locales Dir[File.expand_path(
|
4
|
+
File.join('..', '..', 'locales', '*.yml'), __FILE__
|
5
|
+
)]
|
6
|
+
|
7
|
+
require 'lita/handlers/diabetter'
|
8
|
+
require 'lita/handlers/diabetter-misc'
|
9
|
+
|
10
|
+
Lita::Handlers::Diabetter.template_root File.expand_path(
|
11
|
+
File.join('..', '..', 'templates'),
|
12
|
+
__FILE__
|
13
|
+
)
|
data/lita-diabetter.gemspec
CHANGED
@@ -1,26 +1,26 @@
|
|
1
|
-
Gem::Specification.new do |spec|
|
2
|
-
spec.name = 'lita-diabetter'
|
3
|
-
spec.version = '1.
|
4
|
-
spec.version = "#{spec.version}.alpha.#{ENV['TRAVIS_BUILD_NUMBER']}" if ENV['TRAVIS']
|
5
|
-
spec.authors = ['Cas Eliëns']
|
6
|
-
spec.email = ['cas.eliens@gmail.com']
|
7
|
-
spec.description = 'A better diabetes handler for Lita'
|
8
|
-
spec.summary = 'Provides diabetes-related commands like glucose value conversions'
|
9
|
-
spec.homepage = 'https://github.com/cascer1/lita-diabetter'
|
10
|
-
spec.license = 'GPL-3.0+'
|
11
|
-
spec.metadata = {'lita_plugin_type' => 'handler'}
|
12
|
-
|
13
|
-
spec.files = `git ls-files`.split($/)
|
14
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
15
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
16
|
-
spec.require_paths = ['lib']
|
17
|
-
|
18
|
-
spec.add_runtime_dependency 'lita', '~> 4.7'
|
19
|
-
spec.required_ruby_version = '>= 2.0.0'
|
20
|
-
|
21
|
-
spec.add_development_dependency 'bundler', '~> 1.3'
|
22
|
-
spec.add_development_dependency 'pry-byebug'
|
23
|
-
spec.add_development_dependency 'rake', '< 11.0'
|
24
|
-
spec.add_development_dependency 'rack-test'
|
25
|
-
spec.add_development_dependency 'rspec', '~> 3.0.0'
|
26
|
-
end
|
1
|
+
Gem::Specification.new do |spec|
|
2
|
+
spec.name = 'lita-diabetter'
|
3
|
+
spec.version = '1.1.0'
|
4
|
+
spec.version = "#{spec.version}.alpha.#{ENV['TRAVIS_BUILD_NUMBER']}" if ENV['TRAVIS']
|
5
|
+
spec.authors = ['Cas Eliëns']
|
6
|
+
spec.email = ['cas.eliens@gmail.com']
|
7
|
+
spec.description = 'A better diabetes handler for Lita'
|
8
|
+
spec.summary = 'Provides diabetes-related commands like glucose value conversions'
|
9
|
+
spec.homepage = 'https://github.com/cascer1/lita-diabetter'
|
10
|
+
spec.license = 'GPL-3.0+'
|
11
|
+
spec.metadata = {'lita_plugin_type' => 'handler'}
|
12
|
+
|
13
|
+
spec.files = `git ls-files`.split($/)
|
14
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
15
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
16
|
+
spec.require_paths = ['lib']
|
17
|
+
|
18
|
+
spec.add_runtime_dependency 'lita', '~> 4.7'
|
19
|
+
spec.required_ruby_version = '>= 2.0.0'
|
20
|
+
|
21
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
22
|
+
spec.add_development_dependency 'pry-byebug'
|
23
|
+
spec.add_development_dependency 'rake', '< 11.0'
|
24
|
+
spec.add_development_dependency 'rack-test'
|
25
|
+
spec.add_development_dependency 'rspec', '~> 3.0.0'
|
26
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Lita::Handlers::Diabetter, lita_handler: true do
|
4
|
-
end
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Lita::Handlers::Diabetter, lita_handler: true do
|
4
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
# require 'simplecov'
|
2
|
-
# require 'coveralls'
|
3
|
-
# SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
4
|
-
# SimpleCov::Formatter::HTMLFormatter,
|
5
|
-
# Coveralls::SimpleCov::Formatter
|
6
|
-
# ]
|
7
|
-
# SimpleCov.start { add_filter "/spec/" }
|
8
|
-
|
9
|
-
require 'lita-diabetter'
|
10
|
-
require 'lita/rspec'
|
11
|
-
|
12
|
-
# A compatibility mode is provided for older plugins upgrading from Lita 3. Since this plugin
|
13
|
-
# was generated with Lita 4, the compatibility mode should be left disabled.
|
14
|
-
Lita.version_3_compatibility_mode = false
|
1
|
+
# require 'simplecov'
|
2
|
+
# require 'coveralls'
|
3
|
+
# SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
4
|
+
# SimpleCov::Formatter::HTMLFormatter,
|
5
|
+
# Coveralls::SimpleCov::Formatter
|
6
|
+
# ]
|
7
|
+
# SimpleCov.start { add_filter "/spec/" }
|
8
|
+
|
9
|
+
require 'lita-diabetter'
|
10
|
+
require 'lita/rspec'
|
11
|
+
|
12
|
+
# A compatibility mode is provided for older plugins upgrading from Lita 3. Since this plugin
|
13
|
+
# was generated with Lita 4, the compatibility mode should be left disabled.
|
14
|
+
Lita.version_3_compatibility_mode = false
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-diabetter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cas Eliëns
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|
@@ -104,9 +104,11 @@ files:
|
|
104
104
|
- ".gitignore"
|
105
105
|
- ".travis.yml"
|
106
106
|
- Gemfile
|
107
|
+
- Gemfile.lock
|
107
108
|
- README.md
|
108
109
|
- Rakefile
|
109
110
|
- lib/lita-diabetter.rb
|
111
|
+
- lib/lita/handlers/diabetter-misc.rb
|
110
112
|
- lib/lita/handlers/diabetter.rb
|
111
113
|
- lita-diabetter.gemspec
|
112
114
|
- locales/en.yml
|