boppers 0.0.10 → 0.0.11

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
  SHA256:
3
- metadata.gz: 3b39066d054834c66ba916b57228d1239a2cc4915b26f4d89d6d10c725ab9e8d
4
- data.tar.gz: ade59801762cdd4c474a630c7875577b2ccba8811bc7e4f7b029398323a03a51
3
+ metadata.gz: 737a54c67e4b1622b880bac2d5019faae412a54847fa7d60993ce9aa3dc46f61
4
+ data.tar.gz: 9a0a2c78ff8fbfcdc00ec10c934dc735ec0b085a813798acc0f46272afdc3711
5
5
  SHA512:
6
- metadata.gz: 7b8987fb52a03b5d5e3c61e6966f0c5eb6ca273d7da43cba81d16188059b07768c9cda5d74478cb36dded7216ac257c02dffec12cc2d7b1ccd9d90ddeb31f0be
7
- data.tar.gz: ec1b3109599004b3363c0da994eb0372809bf3d7f2429e8dc134861f82fc46b86a515c7fe3bab41e5380fba2d9f612dd17f725ecb3283804a093acf28c3bd6ae
6
+ metadata.gz: c145e2386add5865634f5c059694decdc5d87b711a1bbf8ad95c4796280bb1ec99e1828f4bbedb4a9fa6a5190ca58c226bc055ffa5b8bcbfedbc61eea6c97a65
7
+ data.tar.gz: 772ab179bdc8a9771a4b1e67ab59856fe6374e6ba580f115649602a20c4b5c6093bb352c78fd9c7dc23fbf4aeb2332e0a89d4f8b749f4904cd27bbc4fdd11896
data/.rubocop.yml CHANGED
@@ -1,116 +1,10 @@
1
- AllCops:
2
- TargetRubyVersion: 2.4
3
-
4
- Style/Alias:
5
- EnforcedStyle: prefer_alias_method
6
-
7
- Style/FrozenStringLiteralComment:
8
- EnforcedStyle: always
9
-
10
- Style/ClassCheck:
11
- EnforcedStyle: kind_of?
12
-
13
- Metrics/LineLength:
14
- Max: 80
15
-
16
- Style/BlockDelimiters:
17
- Enabled: false
18
-
19
- Style/RegexpLiteral:
20
- Enabled: false
21
-
22
- Metrics/AbcSize:
23
- Enabled: false
24
-
25
- Style/PerlBackrefs:
26
- Enabled: false
27
-
28
- ClassLength:
29
- Enabled: false
30
-
31
- CyclomaticComplexity:
32
- Enabled: false
33
-
34
- Documentation:
35
- Enabled: false
36
-
37
- Encoding:
38
- Enabled: false
39
-
40
- FileName:
41
- Enabled: false
42
-
43
- IfUnlessModifier:
44
- Enabled: false
45
-
46
- MethodLength:
47
- Enabled: false
48
-
49
- ModuleFunction:
50
- Enabled: false
1
+ ---
2
+ inherit_gem:
3
+ rubocop-fnando: .rubocop.yml
51
4
 
52
- OneLineConditional:
53
- Enabled: false
54
-
55
- ParameterLists:
56
- Enabled: false
57
-
58
- Proc:
59
- Enabled: false
60
-
61
- SingleLineBlockParams:
62
- Enabled: false
63
-
64
- VariableInterpolation:
65
- Enabled: false
66
-
67
- Style/TrailingCommaInLiteral:
68
- Enabled: false
69
-
70
- WhileUntilModifier:
71
- Enabled: false
72
-
73
- PredicateName:
74
- NamePrefixBlacklist:
75
- - is_
76
-
77
- StringLiterals:
78
- EnforcedStyle: double_quotes
79
-
80
- DotPosition:
81
- EnforcedStyle: leading
82
-
83
- SpaceBeforeBlockBraces:
84
- EnforcedStyle: space
85
-
86
- SpaceInsideBlockBraces:
87
- EnforcedStyle: no_space
88
-
89
- DoubleNegation:
90
- Enabled: false
91
-
92
- SpaceInsideBlockBraces:
93
- SpaceBeforeBlockParameters: false
94
-
95
- SpaceInsideHashLiteralBraces:
96
- Enabled: false
97
-
98
- PercentLiteralDelimiters:
99
- PreferredDelimiters:
100
- '%': '{}'
101
- '%i': '{}'
102
- '%q': '{}'
103
- '%Q': '{}'
104
- '%r': '{}'
105
- '%s': '{}'
106
- '%w': '{}'
107
- '%W': '{}'
108
- '%x': '{}'
109
-
110
- Style/CollectionMethods:
111
- PreferredMethods:
112
- collect: 'map'
113
- collect!: 'map!'
114
- inject: 'reduce'
115
- detect: 'find'
116
- find_all: 'select'
5
+ AllCops:
6
+ TargetRubyVersion: 3.0
7
+ NewCops: enable
8
+ Exclude:
9
+ - vendor/**/*
10
+ - gemfiles/**/*
File without changes
data/Gemfile.lock ADDED
@@ -0,0 +1,139 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ boppers (0.0.11)
5
+ aitch
6
+ thor
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ addressable (2.8.1)
12
+ public_suffix (>= 2.0.2, < 6.0)
13
+ aitch (1.2.1)
14
+ nokogiri
15
+ awesome_print (1.9.2)
16
+ axiom-types (0.1.1)
17
+ descendants_tracker (~> 0.0.4)
18
+ ice_nine (~> 0.11.0)
19
+ thread_safe (~> 0.3, >= 0.3.1)
20
+ buftok (0.2.0)
21
+ byebug (11.1.3)
22
+ coderay (1.1.3)
23
+ coercible (1.0.0)
24
+ descendants_tracker (~> 0.0.1)
25
+ date (3.3.3)
26
+ descendants_tracker (0.0.4)
27
+ thread_safe (~> 0.3, >= 0.3.1)
28
+ docile (1.4.0)
29
+ domain_name (0.5.20190701)
30
+ unf (>= 0.0.5, < 1.0.0)
31
+ equalizer (0.0.11)
32
+ excon (0.95.0)
33
+ ffi (1.15.5)
34
+ ffi-compiler (1.0.1)
35
+ ffi (>= 1.0.0)
36
+ rake
37
+ http (4.4.1)
38
+ addressable (~> 2.3)
39
+ http-cookie (~> 1.0)
40
+ http-form_data (~> 2.2)
41
+ http-parser (~> 1.2.0)
42
+ http-cookie (1.0.5)
43
+ domain_name (~> 0.5)
44
+ http-form_data (2.3.0)
45
+ http-parser (1.2.3)
46
+ ffi-compiler (>= 1.0, < 2.0)
47
+ http_parser.rb (0.6.0)
48
+ ice_nine (0.11.2)
49
+ mail (2.8.0)
50
+ mini_mime (>= 0.1.1)
51
+ net-imap
52
+ net-pop
53
+ net-smtp
54
+ memoizable (0.4.2)
55
+ thread_safe (~> 0.3, >= 0.3.1)
56
+ method_source (1.0.0)
57
+ mini_mime (1.1.2)
58
+ minitest (5.16.3)
59
+ minitest-utils (0.4.8)
60
+ minitest
61
+ multipart-post (2.2.3)
62
+ naught (1.1.0)
63
+ net-imap (0.3.4)
64
+ date
65
+ net-protocol
66
+ net-pop (0.1.2)
67
+ net-protocol
68
+ net-protocol (0.2.1)
69
+ timeout
70
+ net-smtp (0.3.3)
71
+ net-protocol
72
+ nokogiri (1.13.10-arm64-darwin)
73
+ racc (~> 1.4)
74
+ pry (0.14.1)
75
+ coderay (~> 1.1)
76
+ method_source (~> 1.0)
77
+ pry-byebug (3.10.1)
78
+ byebug (~> 11.0)
79
+ pry (>= 0.13, < 0.15)
80
+ pry-meta (0.0.10)
81
+ awesome_print
82
+ pry
83
+ pry-byebug
84
+ pry-remote
85
+ pry-remote (0.1.8)
86
+ pry (~> 0.9)
87
+ slop (~> 3.0)
88
+ public_suffix (5.0.1)
89
+ racc (1.6.2)
90
+ rake (13.0.6)
91
+ simple_oauth (0.3.1)
92
+ simplecov (0.22.0)
93
+ docile (~> 1.1)
94
+ simplecov-html (~> 0.11)
95
+ simplecov_json_formatter (~> 0.1)
96
+ simplecov-html (0.12.3)
97
+ simplecov_json_formatter (0.1.4)
98
+ slop (3.6.0)
99
+ telegram_bot (0.0.8)
100
+ excon (>= 0.30.0)
101
+ virtus (>= 1.0.0)
102
+ thor (1.2.1)
103
+ thread_safe (0.3.6)
104
+ timeout (0.3.1)
105
+ twitter (7.0.0)
106
+ addressable (~> 2.3)
107
+ buftok (~> 0.2.0)
108
+ equalizer (~> 0.0.11)
109
+ http (~> 4.0)
110
+ http-form_data (~> 2.0)
111
+ http_parser.rb (~> 0.6.0)
112
+ memoizable (~> 0.4.0)
113
+ multipart-post (~> 2.0)
114
+ naught (~> 1.0)
115
+ simple_oauth (~> 0.3.0)
116
+ unf (0.1.4)
117
+ unf_ext
118
+ unf_ext (0.0.8.2)
119
+ virtus (2.0.0)
120
+ axiom-types (~> 0.1)
121
+ coercible (~> 1.0)
122
+ descendants_tracker (~> 0.0, >= 0.0.3)
123
+
124
+ PLATFORMS
125
+ arm64-darwin-22
126
+
127
+ DEPENDENCIES
128
+ boppers!
129
+ bundler
130
+ mail
131
+ minitest-utils
132
+ pry-meta
133
+ rake
134
+ simplecov
135
+ telegram_bot
136
+ twitter
137
+
138
+ BUNDLED WITH
139
+ 2.3.26
data/README.md CHANGED
@@ -1,8 +1,5 @@
1
- ![Boppers](https://github.com/fnando/boppers/raw/master/images/logo.png)
1
+ ![Boppers](https://github.com/fnando/boppers/raw/main/images/logo.png)
2
2
 
3
- [![Travis-CI](https://travis-ci.org/fnando/boppers.png)](https://travis-ci.org/fnando/boppers)
4
- [![GPA](https://codeclimate.com/github/fnando/boppers/badges/gpa.svg)](https://codeclimate.com/github/fnando/boppers)
5
- [![Test Coverage](https://codeclimate.com/github/fnando/boppers/badges/coverage.svg)](https://codeclimate.com/github/fnando/boppers)
6
3
  [![Gem](https://img.shields.io/gem/v/boppers.svg)](https://rubygems.org/gems/boppers)
7
4
  [![Gem](https://img.shields.io/gem/dt/boppers.svg)](https://rubygems.org/gems/boppers)
8
5
 
@@ -26,11 +23,13 @@ Or install it yourself as:
26
23
 
27
24
  ## Using the CLI
28
25
 
29
- To create a new app, use `boppers app [YOUR APP NAME]`. This will generate a structure so you can just configure your boppers and notifiers.
26
+ To create a new app, use `boppers app [YOUR APP NAME]`. This will generate a
27
+ structure so you can just configure your boppers and notifiers.
30
28
 
31
29
  ## Boppers
32
30
 
33
- A bopper is a bot. Basically is a class that responds to `#call`. For instance, a lambda.
31
+ A bopper is a bot. Basically is a class that responds to `#call`. For instance,
32
+ a lambda.
34
33
 
35
34
  ```ruby
36
35
  Boppers.configure do |config|
@@ -40,7 +39,9 @@ Boppers.configure do |config|
40
39
  end
41
40
  ```
42
41
 
43
- By default, boppers are executed every 60 seconds. If you create a class, you can define your custom interval by creating a method `#interval`. The following example changes the interval to `15 seconds`.
42
+ By default, boppers are executed every 60 seconds. If you create a class, you
43
+ can define your custom interval by creating a method `#interval`. The following
44
+ example changes the interval to `15 seconds`.
44
45
 
45
46
  ```ruby
46
47
  class Clock
@@ -58,11 +59,15 @@ Boppers.configure do |config|
58
59
  end
59
60
  ```
60
61
 
61
- The `Boppers.notify` method expects a event name (the recommended value is the bot's name), a title, message and a hash of options (it's up to the notifier to use the options).
62
+ The `Boppers.notify(event_name, title: message: options: {})` method expects a
63
+ event name (the recommended value is the bot's name), a title, message and a
64
+ hash of options (it's up to the notifier to use the options).
62
65
 
63
66
  ### Distributing boppers
64
67
 
65
- I encourage you to share your boppers. I even added a command to generate a common structure, so you don't have to think about how to organize it. Let's say you want to distribute the clock bopper above.
68
+ I encourage you to share your boppers. I even added a command to generate a
69
+ common structure, so you don't have to think about how to organize it. Let's say
70
+ you want to distribute the clock bopper above.
66
71
 
67
72
  ```
68
73
  $ boppers plugin clock --type bopper
@@ -85,15 +90,21 @@ require "boppers/clock/version"
85
90
  module Boppers
86
91
  class Clock
87
92
  def call
88
- Boppers.notify(:clock, title: "Clock", message: "Now is #{Time.now}")
93
+ Boppers.notify(
94
+ :clock,
95
+ title: "Clock",
96
+ message: "Now is #{Time.now}"
97
+ )
89
98
  end
90
99
  end
91
100
  end
92
101
  ```
93
102
 
94
- Change the `boppers-clock.gemspec` file accordingly (add a description, author name and email).
103
+ Change the `boppers-clock.gemspec` file accordingly (add a description, author
104
+ name and email).
95
105
 
96
- If you're writing tests, use `Boppers::Testing::BopperLinter` to lint your bopper (some basic validations will be made).
106
+ If you're writing tests, use `Boppers::Testing::BopperLinter` to lint your
107
+ bopper (some basic validations will be made).
97
108
 
98
109
  ```ruby
99
110
  # frozen_string_literal: true
@@ -108,11 +119,14 @@ class BoppersClockTest < Minitest::Test
108
119
  end
109
120
  ```
110
121
 
111
- Then make a commit and run `rake release` to distribute it (I'm assuming your Rubygems account is already configured).
122
+ Then make a commit and run `rake release` to distribute it (I'm assuming your
123
+ Rubygems account is already configured).
112
124
 
113
125
  ## Notifiers
114
126
 
115
- A notifier is basically a class that responds to `#call(title, message, options)`. The following example implements a `stderr` notifier.
127
+ A notifier is basically a class that responds to
128
+ `#call(title, message, options)`. The following example implements a `stderr`
129
+ notifier.
116
130
 
117
131
  ```ruby
118
132
  class Stderr
@@ -134,7 +148,8 @@ Boppers.configure do |config|
134
148
  end
135
149
  ```
136
150
 
137
- You can specify which messages a notifier will receive by setting `subscribe:`, like the following:
151
+ You can specify which messages a notifier will receive by setting `subscribe:`,
152
+ like the following:
138
153
 
139
154
  ```ruby
140
155
  Boppers.configure do |config|
@@ -142,11 +157,15 @@ Boppers.configure do |config|
142
157
  end
143
158
  ```
144
159
 
145
- Now this notifier will only be triggered when `Boppers.notify(:clock, *args)` is called, ignoring other boppers.
160
+ Now this notifier will only be triggered when `Boppers.notify(:clock, **kargs)`
161
+ is called, ignoring other boppers.
146
162
 
147
163
  ### Distributing notifiers
148
164
 
149
- The idea is pretty much the same as creating a bopper. Use the command `boppers plugin [NAME] --type notifier` to generate a file structure. Then configure the plugin accordingly. There's a a linter for notifiers: `Boppers::Testing::NotifierLinter`.
165
+ The idea is pretty much the same as creating a bopper. Use the command
166
+ `boppers plugin [NAME] --type notifier` to generate a file structure. Then
167
+ configure the plugin accordingly. There's a a linter for notifiers:
168
+ `Boppers::Testing::NotifierLinter`.
150
169
 
151
170
  ### Available notifiers
152
171
 
@@ -162,7 +181,8 @@ By default, Boppers comes with the following notifiers.
162
181
 
163
182
  #### Hipchat
164
183
 
165
- 1. Create a "Send Notification" room API token at `https://[SUBDOMAIN].hipchat.com/rooms`.
184
+ 1. Create a "Send Notification" room API token at
185
+ `https://[SUBDOMAIN].hipchat.com/rooms`.
166
186
  2. The room id is available at the "Summary" section as "API ID".
167
187
 
168
188
  ```ruby
@@ -223,10 +243,13 @@ end
223
243
 
224
244
  #### Telegram
225
245
 
226
- 1. [Create a bot](https://core.telegram.org/bots#6-botfather). The returned API token must be defined as `api_token:`.
246
+ 1. [Create a bot](https://core.telegram.org/bots#6-botfather). The returned API
247
+ token must be defined as `api_token:`.
227
248
  2. Send a message to the bot.
228
- 3. Run `ruby setup/telegram.rb` locally to get the channel id. You may need to install the dependencies with `bundle install` before doing it so.
229
- 4. Set the channel as `channel_id: <channel id>`. Sometimes id can be a negative number and this is important.
249
+ 3. Run `ruby setup/telegram.rb` locally to get the channel id. You may need to
250
+ install the dependencies with `bundle install` before doing it so.
251
+ 4. Set the channel as `channel_id: <channel id>`. Sometimes id can be a negative
252
+ number and this is important.
230
253
 
231
254
  ```ruby
232
255
  Boppers.configure do |config|
@@ -237,15 +260,18 @@ Boppers.configure do |config|
237
260
  end
238
261
  ```
239
262
 
240
- You can run `boppers setup telegram`, which will basically guide like those steps above. No tokens will be saved locally or remotely in any form.
263
+ You can run `boppers setup telegram`, which will basically guide like those
264
+ steps above. No tokens will be saved locally or remotely in any form.
241
265
 
242
266
  #### Twitter
243
267
 
244
268
  1. Create an user for your bot.
245
269
  2. Follow your bot, and make your bot follow you.
246
- 3. Create a new Twitter application under your bot's account at https://apps.twitter.com/app/new
270
+ 3. Create a new Twitter application under your bot's account at
271
+ https://apps.twitter.com/app/new
247
272
  4. Go to "Keys and Access Tokens" and create a new access token.
248
- 5. Set `consumer_key:`, `consumer_secret:`, `access_token:` and `access_secret:` named arguments, all available under "Keys and Access Token".
273
+ 5. Set `consumer_key:`, `consumer_secret:`, `access_token:` and `access_secret:`
274
+ named arguments, all available under "Keys and Access Token".
249
275
  6. Set the user that'll receive the notification as `user: <username>`.
250
276
 
251
277
  ```ruby
@@ -262,9 +288,13 @@ end
262
288
 
263
289
  ## Deploying to Heroku
264
290
 
265
- I'm assuming you installed the gem with `gem install boppers` and generated your app.
291
+ I'm assuming you installed the gem with `gem install boppers` and generated your
292
+ app.
266
293
 
267
- Add your configuration to `config/boppers.rb`. Also make sure you don't hardcode any sensitive value, like API tokens or passwords. Use [env_vars](https://rubygems.org/gems/env_vars) to manage access to your environment variables.
294
+ Add your configuration to `config/boppers.rb`. Also make sure you don't hardcode
295
+ any sensitive value, like API tokens or passwords. Use
296
+ [superconfig](https://rubygems.org/gems/superconfig) to manage access to your
297
+ environment variables.
268
298
 
269
299
  Now, configure Heroku. Create a new app for this.
270
300
 
@@ -289,7 +319,7 @@ Make a commit and deploy to your Heroku account.
289
319
  ```
290
320
  git add .
291
321
  git commit -m "Initial commit"
292
- git push heroku master
322
+ git push heroku main
293
323
  ```
294
324
 
295
325
  Scale up the boppers worker:
@@ -306,18 +336,30 @@ heroku dyno:type worker=hobby
306
336
 
307
337
  ## Development
308
338
 
309
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
339
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run
340
+ `rake test` to run the tests. You can also run `bin/console` for an interactive
341
+ prompt that will allow you to experiment.
310
342
 
311
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
343
+ To install this gem onto your local machine, run `bundle exec rake install`. To
344
+ release a new version, update the version number in `version.rb`, and then run
345
+ `bundle exec rake release`, which will create a git tag for the version, push
346
+ git commits and tags, and push the `.gem` file to
347
+ [rubygems.org](https://rubygems.org).
312
348
 
313
349
  ## Contributing
314
350
 
315
- Bug reports and pull requests are welcome on GitHub at https://github.com/fnando/boppers. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
351
+ Bug reports and pull requests are welcome on GitHub at
352
+ https://github.com/fnando/boppers. This project is intended to be a safe,
353
+ welcoming space for collaboration, and contributors are expected to adhere to
354
+ the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
316
355
 
317
356
  ## License
318
357
 
319
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
358
+ The gem is available as open source under the terms of the
359
+ [MIT License](https://opensource.org/licenses/MIT).
320
360
 
321
361
  ## Code of Conduct
322
362
 
323
- Everyone interacting in the Boppers project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/fnando/boppers/blob/master/CODE_OF_CONDUCT.md).
363
+ Everyone interacting in the Boppers project’s codebases, issue trackers, chat
364
+ rooms and mailing lists is expected to follow the
365
+ [code of conduct](https://github.com/fnando/boppers/blob/main/CODE_OF_CONDUCT.md).
data/bin/console CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require "bundler/setup"
4
5
  require "boppers"
data/boppers.gemspec CHANGED
@@ -6,29 +6,31 @@ Gem::Specification.new do |spec|
6
6
  spec.name = "boppers"
7
7
  spec.version = Boppers::VERSION
8
8
  spec.authors = ["Nando Vieira"]
9
- spec.email = ["fnando.vieira@gmail.com"]
9
+ spec.email = ["me@fnando.com"]
10
10
 
11
11
  spec.summary = "A simple bot framework for individuals."
12
12
  spec.description = spec.summary
13
13
  spec.homepage = "https://rubygems.org/gems/boppers"
14
14
  spec.license = "MIT"
15
+ spec.required_ruby_version = ">= 3.0.0"
16
+ spec.metadata = {"rubygems_mfa_required" => "true"}
15
17
 
16
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
17
19
  f.match(%r{^(test|spec|features)/})
18
20
  end
19
21
  spec.bindir = "exe"
20
22
  spec.executables = spec.files.grep(%r{^exe/}) {|f| File.basename(f) }
21
23
  spec.require_paths = ["lib"]
22
24
 
23
- spec.add_dependency "thor"
24
25
  spec.add_dependency "aitch"
26
+ spec.add_dependency "thor"
25
27
 
26
28
  spec.add_development_dependency "bundler"
27
- spec.add_development_dependency "rake"
29
+ spec.add_development_dependency "mail"
28
30
  spec.add_development_dependency "minitest-utils"
29
- spec.add_development_dependency "simplecov"
30
31
  spec.add_development_dependency "pry-meta"
31
- spec.add_development_dependency "mail"
32
+ spec.add_development_dependency "rake"
33
+ spec.add_development_dependency "simplecov"
32
34
  spec.add_development_dependency "telegram_bot"
33
35
  spec.add_development_dependency "twitter"
34
36
  end
data/lib/boppers/cli.rb CHANGED
@@ -21,7 +21,7 @@ module Boppers
21
21
  end
22
22
 
23
23
  desc "version", "Prints the Boppers version information"
24
- map %w{-v --version} => :version
24
+ map %w[-v --version] => :version
25
25
 
26
26
  def version
27
27
  say "Boppers v#{VERSION}"
@@ -36,7 +36,7 @@ module Boppers
36
36
  def plugin(name)
37
37
  require "boppers/generator/plugin"
38
38
 
39
- unless %w{bopper notifier}.include?(options[:type])
39
+ unless %w[bopper notifier].include?(options[:type])
40
40
  message = "ERROR: --type needs to be either 'bopper' or 'notifier'"
41
41
  shell.error shell.set_color(message, :red)
42
42
  exit 1
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source "https://rubygems.org"
2
4
 
3
5
  gem "boppers"
4
- gem "env_vars"
6
+ gem "superconfig"
5
7
 
6
8
  # Search for plugins:
7
9
  # https://rubygems.org/search?query=boppers
@@ -8,7 +8,7 @@ Bundler.require
8
8
  # information about notifiers.
9
9
  require "boppers/notifier/stdout"
10
10
 
11
- Config = Env::Vars.new do
11
+ Config = SuperConfig.new do
12
12
  # mandatory :sendgrid_username, string
13
13
  # mandatory :sendgrid_password, string
14
14
  # mandatory :sendgrid_domain, string
@@ -50,7 +50,12 @@ Boppers.configure do |config|
50
50
  # A bopper is anything that responds to #call, like a lambda.
51
51
  # The following example returns the current time.
52
52
  config.boppers << lambda do
53
- Boppers.notify("Current time", "Now is #{Time.now}")
53
+ $stdout.sync = true
54
+ Boppers.notify(
55
+ :time,
56
+ title: "Current time",
57
+ message: "Now is #{Time.now}"
58
+ )
54
59
  end
55
60
 
56
61
  # A bopper can also configure the polling interval by defining a
@@ -68,7 +73,11 @@ Boppers.configure do |config|
68
73
  #
69
74
  # def call
70
75
  # @count += 1
71
- # Boppers.notify("Counter", "[#{Time.now}] Current count is #{@count}")
76
+ # Boppers.notify(
77
+ # :counter,
78
+ # title: "Counter",
79
+ # message: "[#{Time.now}] Current count is #{@count}"
80
+ # )
72
81
  # end
73
82
  # end
74
83
  #
@@ -12,10 +12,10 @@ module Boppers
12
12
  end
13
13
 
14
14
  def copy_files
15
- copy_file "gems.rb"
15
+ copy_file "Gemfile"
16
16
  copy_file "Procfile"
17
17
  copy_file "config/boppers.rb"
18
- copy_file ".gitgnore"
18
+ copy_file ".gitignore"
19
19
  copy_file ".env"
20
20
  end
21
21