ruboty 1.1.3 → 1.1.4

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: bf066ff16d0dbb8e878b95d5ab87d814645172f2
4
- data.tar.gz: d35e34502bfbdf709be6167d219d8d4fafe81346
3
+ metadata.gz: aa15654d16ccd04937bfe8b9bf7fb83a690e7a39
4
+ data.tar.gz: d24a8b185b355c529113bb5c5161debd6138686b
5
5
  SHA512:
6
- metadata.gz: 87d3c303221569c797e7332cf11e1d7bc1b59215c4f328d689e521692f11453ab13acd351cabf566fa6ca5211c40e0d866d21c1a70e8639ca386647eb70ffd87
7
- data.tar.gz: c7acb9f14fb3842ac6e677dc04b3c5121128bad802a407b42d5ae432be862185fcdbd9390f9acf5beffa8806af1256b4216360757a69ab539f8514da71002309
6
+ metadata.gz: db0cb0d37fcd362d5980c5ca050aacc9e74f6505849b2d4afb328ef0fb9cafdaaf5590ed5dcd28316a410c156522173e9094daef037788eaea0effb50d4dec22
7
+ data.tar.gz: a99bab4ff80aa6a6a3be9d50ba5baa86c034fe9aeaa61f548c6f093d2e648923d7b0d0b76cfa317e2f55ceda0b515c6b415be9166f5223cd0e6421bff6ad8a17
@@ -1,3 +1,6 @@
1
+ ## 1.1.4
2
+ - Support slop version 4
3
+
1
4
  ## 1.1.3
2
5
  - Fix slop version (thx @parroty)
3
6
 
@@ -47,6 +47,7 @@ require "ruboty/brains/memory"
47
47
  require "ruboty/command_builder"
48
48
  require "ruboty/commands/base"
49
49
  require "ruboty/commands/generate"
50
+ require "ruboty/commands/help"
50
51
  require "ruboty/commands/run"
51
52
  require "ruboty/handlers/base"
52
53
  require "ruboty/handlers/help"
@@ -15,15 +15,23 @@ module Ruboty
15
15
  private
16
16
 
17
17
  def command_class
18
- options[:generate] ? Commands::Generate : Commands::Run
18
+ case
19
+ when options[:generate]
20
+ Commands::Generate
21
+ when options[:help]
22
+ Commands::Help
23
+ else
24
+ Commands::Run
25
+ end
19
26
  end
20
27
 
21
28
  def options
22
- Slop.parse!(arguments, help: true) do
23
- on("dotenv", "Load .env before running.")
24
- on("g", "generate", "Generate a new chatterbot with ./ruboty/ directory if specified.")
25
- on("l", "load=", "Load a ruby file before running.")
26
- end.to_hash
29
+ Slop.parse(arguments) do |options|
30
+ options.on("--dotenv", "Load .env before running.")
31
+ options.on("-g", "--generate", "Generate a new chatterbot with ./ruboty/ directory if specified.")
32
+ options.on("-h", "--help", "Display this help message.")
33
+ options.on("-l", "--load=", "Load a ruby file before running.")
34
+ end
27
35
  end
28
36
  memoize :options
29
37
  end
@@ -0,0 +1,10 @@
1
+ module Ruboty
2
+ module Commands
3
+ class Help < Base
4
+ def call
5
+ puts options
6
+ exit
7
+ end
8
+ end
9
+ end
10
+ end
@@ -1,3 +1,3 @@
1
1
  module Ruboty
2
- VERSION = "1.1.3"
2
+ VERSION = "1.1.4"
3
3
  end
@@ -20,9 +20,8 @@ Gem::Specification.new do |spec|
20
20
  spec.add_dependency "bundler"
21
21
  spec.add_dependency "dotenv"
22
22
  spec.add_dependency "mem"
23
- spec.add_dependency "slop", "~> 3.6"
23
+ spec.add_dependency "slop"
24
24
  spec.add_development_dependency "codeclimate-test-reporter", ">= 0.3.0"
25
- spec.add_development_dependency "pry"
26
25
  spec.add_development_dependency "rake"
27
26
  spec.add_development_dependency "rspec", "2.14.1"
28
27
  spec.add_development_dependency "simplecov"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
@@ -70,16 +70,16 @@ dependencies:
70
70
  name: slop
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '3.6'
75
+ version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '3.6'
82
+ version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: codeclimate-test-reporter
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -94,20 +94,6 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: 0.3.0
97
- - !ruby/object:Gem::Dependency
98
- name: pry
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
97
  - !ruby/object:Gem::Dependency
112
98
  name: rake
113
99
  requirement: !ruby/object:Gem::Requirement
@@ -180,6 +166,7 @@ files:
180
166
  - lib/ruboty/command_builder.rb
181
167
  - lib/ruboty/commands/base.rb
182
168
  - lib/ruboty/commands/generate.rb
169
+ - lib/ruboty/commands/help.rb
183
170
  - lib/ruboty/commands/run.rb
184
171
  - lib/ruboty/env.rb
185
172
  - lib/ruboty/env/missing_required_key_error.rb