s-3po 0.2.0 → 0.3.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: 89544fe67ba616e85dd1e1082c660f2fd58c67e0
4
- data.tar.gz: b24bdffaaaa62a6e9fdf3d36311afcfe6546bc2c
3
+ metadata.gz: 5534a0273b457003e6efb4559b03922a54ddb260
4
+ data.tar.gz: df93ec41046fd6b6e841e2cf8d3aaf8763543f42
5
5
  SHA512:
6
- metadata.gz: eda02a76d6de6c43feb16692efe305c70078fb97dafb1dca8b008ab7d4f4a71aaecd45fc709ea7676eeb6e83356bd8f1470d5aa0232cf695cb087ed25b884dba
7
- data.tar.gz: f1110abfaf267702766c3ffb24011938e5a14b62bea80cf8f551fc297699a4b50c8965e4d3862442720cb1a9cb03e527f5e6e3e343cd757926d4000ac1e053c5
6
+ metadata.gz: 5b10e34853cc749b02f0c9bba592741cdb5eff564562d7611169b4ff62fc7fe74543f9098b2f81143f908f4f3fb888694456a3e9f0e41139b257aa332f263b4a
7
+ data.tar.gz: 463c6c21d7a511c74d5ea1bd99e6f3af6cf8d49678b46513b8b3d310583e57ad08fc7936d7fce09cbcc5ced4360fce6c7648e934402ecfb4500d07bbde4952f5
data/README.md CHANGED
@@ -44,7 +44,7 @@ puts json
44
44
  # => {"type":"message","channel":"CABC123","text":"<!channel>: what's up, ya all?","id":0}
45
45
  ```
46
46
 
47
- See [YARD Doc](http://www.rubydoc.info/github/kenjij/s-3po) for more info.
47
+ See [YARD Doc](http://www.rubydoc.info/gems/s-3po) for more info.
48
48
 
49
49
  ## What's Next
50
50
 
@@ -5,6 +5,14 @@ module S3PO
5
5
 
6
6
  class Generator
7
7
 
8
+ def self.generate_ping(id = nil)
9
+ @id ||= 0
10
+ msg = {type: 'ping'}
11
+ msg[:id] = id ? id : @id
12
+ @id += 1 unless id
13
+ return JSON.fast_generate(msg)
14
+ end
15
+
8
16
  def self.generate_message(message, id = nil)
9
17
  @id ||= 0
10
18
  obj = message.object
data/lib/s-3po.rb CHANGED
@@ -25,4 +25,10 @@ module S3PO
25
25
  return Generator.generate_message(message)
26
26
  end
27
27
 
28
+ # Generate JSON ping to send to Slack.
29
+ # @return [String] JSON ready to send to Slack
30
+ def self.generate_ping
31
+ return Generator.generate_ping()
32
+ end
33
+
28
34
  end
data/s-3po.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 's-3po'
3
- s.version = '0.2.0'
3
+ s.version = '0.3.0'
4
4
  s.authors = ['Ken J.']
5
5
  s.email = ['kenjij@gmail.com']
6
6
  s.description = %q{Slack message formatter gem}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s-3po
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken J.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-15 00:00:00.000000000 Z
11
+ date: 2015-05-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Slack message formatter gem
14
14
  email: