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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7292aa15e017e232fdcbc8e67fc924495737c605
4
- data.tar.gz: d4ca219a8a469f100ae0f0c3786a94b62c47dc85
3
+ metadata.gz: 97677d8e1b43e3224acf0bdee3ad83212b7ad09a
4
+ data.tar.gz: 845fef57839b4451b7c2a8304bfbe6ce66dd1534
5
5
  SHA512:
6
- metadata.gz: 73d3006d0bb69f00ca5f38083474c1ce8ad50fbc3d0cea96c825a15f55b90ade2a212567cc46d43ee8c036c087b6b632fe6826cc1f8eed9a4b3bd664e5cc4066
7
- data.tar.gz: 3cbd5c066d25ac89cd85c35dd3812e41de4d4cdbe62db5b764f85f9e556475ce7765bf2469ddc7dc2243e9b700884c6ba2fd1cd360ca617d8c42d44d071990b6
6
+ metadata.gz: dd41b88d9e8b029575e70050372566de65514a3424068ed5d6344d0ba5b671eee7c169874e1922690ebab05cc71669471b4ed98d6c888f9acc9dd32b8dd62270
7
+ data.tar.gz: 1c725f41e09e6b597c7d45c46ab972fc7d9b5f31de81c1b5ec078f9d1d3a20d420f280604e1554215ff3bd1eb57528d1cda519c4a150147070a6f13405a1d1a2
data/.gitignore CHANGED
@@ -3,7 +3,6 @@
3
3
  .bundle
4
4
  .config
5
5
  .yardoc
6
- Gemfile.lock
7
6
  InstalledFiles
8
7
  _yardoc
9
8
  coverage
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&amp;utm_medium=referral&amp;utm_content=cascer1/lita-diabetter&amp;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&amp;utm_medium=referral&amp;utm_content=cascer1/lita-diabetter&amp;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
- route(/^-diabot.*$/i, :deprecated, command: false)
22
-
23
- def deprecated(response)
24
- response.reply('The -diabot prefix is deprecated. See `diabot help` for more info')
25
- end
26
-
27
- def convert(response)
28
- if response.message.body.match(URI.regexp(%w(http https))).nil?
29
- input = response.matches[0][0]
30
- Lita.logger.debug('Converting BG for input "' + input + '"')
31
-
32
- if input.to_f < @@lower
33
- response.reply("#{input} mmol/L is #{mmol_to_mgdl(input).to_s} mg/dL")
34
- elsif input.to_f >= @@lower && input.to_f < @@upper
35
- mmol = mgdl_to_mmol(input).to_s
36
- mgdl = mmol_to_mgdl(input).to_s
37
-
38
- result = '*I\'m not sure if you gave me mmol/L or mg/dL, so I\'ll give you both.*\n'
39
- result += "#{input} mg/dL is **#{mmol} mmol/L**\n"
40
- result += "#{input} mmol/L is **#{mgdl} mg/dL**"
41
-
42
- response.reply(result)
43
- else
44
- response.reply("#{input} mg/dL is #{mgdl_to_mmol(input).to_s} mmol/L")
45
- end
46
- end
47
- end
48
-
49
- def estimate_a1c(response)
50
- input = response.matches[0][0]
51
- Lita.logger.debug('Estimating a1c for input "' + input + '"')
52
-
53
-
54
- if input.to_f < @@lower
55
- mmol = input.to_f.round(1)
56
- mgdl = mmol_to_mgdl(mmol)
57
-
58
- type = 'mmol'
59
- elsif input.to_f >= @@lower && input.to_f < @@upper
60
- mmol = input.to_f.round(1)
61
- mgdl_from_mmol = mmol_to_mgdl(input.to_f)
62
- mgdl = input.to_f
63
-
64
- dcct_alt = mgdl_to_dcct(mgdl_from_mmol)
65
- ifcc_alt = dcct_to_ifcc(dcct_alt).round(0).to_s
66
- dcct_alt = dcct.round(1).to_s
67
-
68
- type = 'unknown'
69
- else
70
- mgdl = input.to_i
71
- mmol = mgdl_to_mmol(mgdl)
72
-
73
- type = 'mgdl'
74
- end
75
-
76
- dcct = mgdl_to_dcct(mgdl)
77
- ifcc = dcct_to_ifcc(dcct).round(0).to_s
78
- dcct = dcct.round(1).to_s
79
-
80
-
81
- if type == 'unknown'
82
- reply = "*I'm not sure if you entered mmol/L or mg/dL, so I'll give you both*\n"
83
- reply += make_average_sentence('mmol', mmol, dcct_alt, ifcc_alt) + "\n"
84
- reply += make_average_sentence('mgdl', mgdl, dcct, ifcc)
85
- elsif type=='mmol'
86
- reply = make_average_sentence('mmol', mmol, dcct, ifcc)
87
- else
88
- reply = make_average_sentence('mgdl', mgdl, dcct, ifcc)
89
- end
90
-
91
- response.reply(reply)
92
- end
93
-
94
- def make_average_sentence(type, value, dcct, ifcc)
95
- if type == 'mmol'
96
- string = "An average of **#{value} mmol/L** is about "
97
- elsif type == 'mgdl'
98
- string = "An average of **#{value} mg/dL** is about "
99
- end
100
-
101
- string += "**#{dcct}%** (DCCT) or **#{ifcc} mmol/mol** (IFCC)"
102
- end
103
-
104
- def estimate_average_from_a1c(response)
105
- input = response.matches[0][0]
106
- Lita.logger.debug('Converting a1c to BG for input "' + input + '"')
107
- a1c = input.to_f
108
- dcct = 0
109
- ifcc = 0
110
-
111
- if input.index('.') == nil
112
- ifcc = a1c.round(0)
113
- dcct = ifcc_to_dcct(a1c).round(1)
114
- else
115
- dcct = a1c.round(1)
116
- ifcc = dcct_to_ifcc(a1c).round
117
- end
118
-
119
- mgdl = dcct_to_mgdl(dcct)
120
-
121
- reply = 'an A1C of ' + dcct.to_s + '% (DCCT) or '
122
- reply = reply + ifcc.to_s + ' mmol/mol (IFCC)'
123
- reply = reply + ' is about '
124
- reply = reply + mgdl.round.to_s + ' mg/dL or '
125
- reply = reply + mgdl_to_mmol(mgdl).round(1).to_s + ' mmol/L'
126
- response.reply(reply)
127
- end
128
-
129
- def mgdl_to_mmol(n)
130
- (n.to_i / @@conversion_ratio).round(1)
131
- end
132
-
133
- def mmol_to_mgdl(n)
134
- (n.to_f * @@conversion_ratio).round
135
- end
136
-
137
- def mgdl_to_dcct(n)
138
- ((n.to_i + 46.7) / 28.7)
139
- end
140
-
141
- def mgdl_to_ifcc(n)
142
- ((mgdl_to_dcct(n) - 2.15) * 10.929)
143
- end
144
-
145
- def dcct_to_ifcc(n)
146
- (n.to_f - 2.15) * 10.929
147
- end
148
-
149
- def ifcc_to_dcct(n)
150
- (n.to_f / 10.929) + 2.15
151
- end
152
-
153
- def dcct_to_mgdl(n)
154
- (n.to_f * 28.7) - 46.7
155
- end
156
-
157
- def ifcc_to_mgdl(n)
158
- dcct_to_mgdl((n / 10.929) + 2.5)
159
- end
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
@@ -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
- Lita::Handlers::Diabetter.template_root File.expand_path(
10
- File.join('..', '..', 'templates'),
11
- __FILE__
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
+ )
@@ -1,26 +1,26 @@
1
- Gem::Specification.new do |spec|
2
- spec.name = 'lita-diabetter'
3
- spec.version = '1.0.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
+ 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.0.0
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 00:00:00.000000000 Z
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