ruboty-gen 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 008edf104512ebfafab0d77002e02c3e0f96d195
4
- data.tar.gz: b7179803f61b57615355ec38896d723b73d2ec8b
3
+ metadata.gz: b0c354a8883b91d2ebfbc07b727cab59e91a2807
4
+ data.tar.gz: 6ab253e502f895e28c50d577f3cbcef946fec520
5
5
  SHA512:
6
- metadata.gz: a34deaf81cf1af040b25bad3098c2e7d2a18e2888ee56f33c0d0eaba640fd3b492c5a16322945231cdd4b96b5cfb276d89175d14003c3e658adf0ca4def957dc
7
- data.tar.gz: f21c86e410cbcdc61f8d6f2bc512909aa25968b50dcccf2183049a3061ab2aeb612c9a2c544a84f1919586a43794cbc250e7aafb503138223cc0b73212e0448d
6
+ metadata.gz: 4af2b9edb5b61ab6b2308c79f57f2429ed0fd3165aaee8de6ca3ed79fa2e0a87df542c9e2f62e27bad4e059d91f229ecfe09372987a5ed7acffcfa20e5b20179
7
+ data.tar.gz: 331c59dcb975636d502d5e6bae01e4bf4ec930bcc63d6c2feaabcac7039952022e846b79d569a9359ee2434a6fdd41f5c651414a3a804d0e7b884ec0e31df8b8
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Ruboty::Gen
1
+ # Ruboty::Gen [![Gem Version](https://badge.fury.io/rb/ruboty-gen.svg)](http://badge.fury.io/rb/ruboty-gen)
2
2
 
3
3
  generators for creating ruboty plugin.
4
4
 
@@ -20,6 +20,7 @@ module Ruboty
20
20
  end
21
21
 
22
22
  desc "gem GEM [OPTIONS]", "Creates a skeleton for creating a ruboty plugin"
23
+ option :rescue, type: :boolean, desc: 'generate rescue logic'
23
24
  def gem(name, *actions)
24
25
  actions = [name] if actions.size.zero?
25
26
  Bundler::CLI::Gem.new(options, "ruboty-#{name}", self).run
@@ -42,9 +42,11 @@ module Ruboty
42
42
  }
43
43
 
44
44
  thor.template(File.join('ruboty/handlers/newgem.rb.tt'), File.join(target, "lib/ruboty/handlers/#{ruboty_plugin_name}.rb"), opts)
45
+ action_template = @options['rescue'] ? 'newgem_rescue.rb.tt' : 'newgem.rb.tt'
45
46
  actions.each do |action|
46
47
  opts[:constant_action] = camelize(action)
47
- thor.template(File.join('ruboty/newgem/actions/newgem.rb.tt'), File.join(target, "lib/ruboty/#{ruboty_plugin_name}/actions/#{action}.rb"), opts)
48
+ opts[:action] = action
49
+ thor.template(File.join("ruboty/newgem/actions/#{action_template}"), File.join(target, "lib/ruboty/#{ruboty_plugin_name}/actions/#{action}.rb"), opts)
48
50
  end
49
51
  end
50
52
 
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module Gen
3
- VERSION = "1.1.0"
3
+ VERSION = "1.2.0"
4
4
  end
5
5
  end
@@ -0,0 +1,19 @@
1
+ module Ruboty
2
+ module <%= config[:ruboty_plugin_constant_name] %>
3
+ module Actions
4
+ class <%= config[:constant_action] %> < Ruboty::Actions::Base
5
+ def call
6
+ message.reply(<%= config[:action] %>)
7
+ end
8
+
9
+ private
10
+
11
+ def <%= config[:action] %>
12
+ "TODO: write your logic."
13
+ rescue => e
14
+ e.message
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty-gen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - block_given?
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-24 00:00:00.000000000 Z
11
+ date: 2014-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -75,6 +75,7 @@ files:
75
75
  - templates/newgem/newgem.gemspec.tt
76
76
  - templates/ruboty/handlers/newgem.rb.tt
77
77
  - templates/ruboty/newgem/actions/newgem.rb.tt
78
+ - templates/ruboty/newgem/actions/newgem_rescue.rb.tt
78
79
  homepage: https://github.com/blockgiven/ruboty-gen
79
80
  licenses:
80
81
  - MIT