boty 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +4 -0
  3. data/Gemfile +1 -1
  4. data/Gemfile.lock +18 -1
  5. data/README.md +39 -3
  6. data/Rakefile +1 -1
  7. data/boty.gemspec +9 -5
  8. data/lib/boty.rb +2 -1
  9. data/lib/boty/action.rb +26 -35
  10. data/lib/boty/action_description.rb +24 -0
  11. data/lib/boty/bot.rb +36 -25
  12. data/lib/boty/dsl.rb +3 -3
  13. data/lib/boty/eventable.rb +4 -3
  14. data/lib/boty/http.rb +3 -4
  15. data/lib/boty/locale.rb +12 -13
  16. data/lib/boty/logger.rb +14 -3
  17. data/lib/boty/rspec.rb +15 -16
  18. data/lib/boty/session.rb +7 -8
  19. data/lib/boty/slack.rb +11 -3
  20. data/lib/boty/slack/channel.rb +2 -1
  21. data/lib/boty/slack/chat.rb +5 -1
  22. data/lib/boty/slack/rtm.rb +1 -1
  23. data/lib/boty/slack/url.rb +10 -5
  24. data/lib/boty/slack/user.rb +2 -1
  25. data/lib/boty/slack/users.rb +1 -1
  26. data/lib/boty/version.rb +1 -1
  27. data/script/knows.rb +10 -9
  28. data/script/pug.rb +5 -1
  29. data/spec/boty/bot_spec.rb +89 -72
  30. data/spec/boty/cli_spec.rb +5 -5
  31. data/spec/boty/dsl_spec.rb +12 -13
  32. data/spec/boty/rspec_spec.rb +2 -1
  33. data/spec/boty/script_loader_spec.rb +8 -6
  34. data/spec/boty/session_spec.rb +2 -2
  35. data/spec/boty/slack/chat_spec.rb +18 -18
  36. data/spec/boty/slack/im_spec.rb +4 -4
  37. data/spec/boty/slack/message_spec.rb +11 -9
  38. data/spec/boty/slack/rtm_spec.rb +3 -3
  39. data/spec/boty/slack/url_spec.rb +5 -5
  40. data/spec/boty/slack/users_spec.rb +23 -23
  41. data/spec/happy_path_spec.rb +19 -18
  42. data/spec/script/i18n_spec.rb +18 -10
  43. data/spec/script/knows_spec.rb +8 -7
  44. data/spec/script/pug_spec.rb +27 -10
  45. data/spec/script/remember_spec.rb +27 -21
  46. data/spec/spec_helper.rb +4 -3
  47. data/spec/support/em_support.rb +1 -3
  48. data/spec/support/faraday_support.rb +0 -1
  49. data/spec/support/faye_support.rb +9 -6
  50. data/spec/support/file_system_matchers.rb +4 -4
  51. data/spec/support/logger_support.rb +9 -12
  52. data/spec/support/session_support.rb +26 -15
  53. data/spec/support/slack_support.rb +9 -6
  54. data/spec/support/template_project_support.rb +24 -23
  55. data/spec/support/thor_support.rb +3 -3
  56. data/template/project/%bot_name%.rb +4 -1
  57. data/template/project/spec/spec_helper.rb +4 -2
  58. metadata +21 -4
@@ -3,11 +3,11 @@ module ThorSupport
3
3
  def capture(stream)
4
4
  begin
5
5
  stream = stream.to_s
6
- eval "$#{stream} = StringIO.new"
6
+ instance_eval "$#{stream} = StringIO.new"
7
7
  yield
8
- result = eval("$#{stream}").string
8
+ result = instance_eval("$#{stream}").string
9
9
  ensure
10
- eval("$#{stream} = #{stream.upcase}")
10
+ instance_eval("$#{stream} = #{stream.upcase}")
11
11
  end
12
12
 
13
13
  result
@@ -1,6 +1,9 @@
1
- require "bundler"; Bundler.setup
1
+ require "bundler"
2
+ Bundler.setup
3
+
2
4
  if defined? Dotenv
3
5
  Dotenv.load
4
6
  Dotenv.overload ".env.local"
5
7
  end
8
+
6
9
  require "boty"
@@ -1,8 +1,10 @@
1
- require "bundler"; Bundler.require :default, :test
1
+ require "bundler"
2
+ Bundler.require :default, :test
3
+
2
4
  require "boty"
3
5
  require "boty/rspec"
4
6
 
5
- Dir["./spec/support/**/*.rb"].each { |f| require f }
7
+ Dir["./spec/support/**/*.rb"].each do |f| require f end
6
8
 
7
9
  RSpec.configure do |config|
8
10
  config.include Boty::RSpec::Bot, bot: true
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Valeriano
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-12-11 00:00:00.000000000 Z
11
+ date: 2015-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eventmachine
@@ -150,8 +150,23 @@ dependencies:
150
150
  - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
- description: Boty is intendted to be a framework for construction of automated Slack
154
- Bots for your needs.
153
+ - !ruby/object:Gem::Dependency
154
+ name: rubocop
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ description: |-
168
+ Boty is intendted to be a framework for construction of
169
+ automated Slack Bots for your needs.
155
170
  email:
156
171
  - ricardo.valeriano@gmail.com
157
172
  executables:
@@ -161,6 +176,7 @@ extra_rdoc_files: []
161
176
  files:
162
177
  - ".env"
163
178
  - ".gitignore"
179
+ - ".rubocop.yml"
164
180
  - ".travis.yml"
165
181
  - CODE_OF_CONDUCT.md
166
182
  - Gemfile
@@ -180,6 +196,7 @@ files:
180
196
  - gemfiles/Gemfile.rbx
181
197
  - lib/boty.rb
182
198
  - lib/boty/action.rb
199
+ - lib/boty/action_description.rb
183
200
  - lib/boty/bot.rb
184
201
  - lib/boty/cli.rb
185
202
  - lib/boty/dsl.rb