cinch-lastactive 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: eff5483272f48167f951c872bf2f7f3b0a08d47d
4
+ data.tar.gz: a1e7da2e586b9ab44737f94f3b813293bd6015a0
5
+ SHA512:
6
+ metadata.gz: 60364b92148a793170f183dce572f57f551bcdc288a07e7e07017ceba71b713971ffe82b56e58adc5fc994a492e96e7cd1a3024c58bd841266f86eb8ced3f188
7
+ data.tar.gz: 43088a700d3e43b13b435014e7707b15021e32bc74654e5f6d67dc15fd32762ffa10386d5acd9e4adfd89d45d89c4936b968113db888957aece3770d4a656f1e
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in cinch-lastactive.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Brian Haberer
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # Cinch::Lastactive
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/cinch-lastactive.png)](http://badge.fury.io/rb/cinch-lastactive)
4
+ [![Dependency Status](https://gemnasium.com/bhaberer/cinch-lastactive.png)](https://gemnasium.com/bhaberer/cinch-lastactive)
5
+ [![Build Status](https://travis-ci.org/bhaberer/cinch-lastactive.png?branch=master)](https://travis-ci.org/bhaberer/cinch-lastactive)
6
+ [![Coverage Status](https://coveralls.io/repos/bhaberer/cinch-lastactive/badge.png?branch=master)](https://coveralls.io/r/bhaberer/cinch-lastactive?branch=master)
7
+ [![Code Climate](https://codeclimate.com/github/bhaberer/cinch-lastactive.png)](https://codeclimate.com/github/bhaberer/cinch-lastactive)
8
+
9
+ Cinch plugin to inform new channel joiners when the last activity was.
10
+
11
+ Note: This will be spammy in high traffic rooms!
12
+
13
+ ## Installation
14
+
15
+ Add this line to your application's Gemfile:
16
+
17
+ gem 'cinch-lastactive'
18
+
19
+ And then execute:
20
+
21
+ $ bundle
22
+
23
+ Or install it yourself as:
24
+
25
+ $ gem install cinch-lastactive
26
+
27
+ ## Usage
28
+
29
+ TODO: Write usage instructions here
30
+
31
+ ## Contributing
32
+
33
+ 1. Fork it ( http://github.com/<my-github-username>/cinch-lastactive/fork )
34
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
35
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
36
+ 4. Push to the branch (`git push origin my-new-feature`)
37
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,29 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'cinch/plugins/lastactive/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'cinch-lastactive'
8
+ spec.version = Cinch::Plugins::LastActive::VERSION
9
+ spec.authors = ['Brian Haberer']
10
+ spec.email = ['bhaberer@gmail.com']
11
+ spec.summary = %q{Cinch Plugin to greet vistors.}
12
+ spec.description = %q{Cinch Plugin to greet users with the time since last activity}
13
+ spec.homepage = 'https://github.com/bhaberer/cinch-lastactive'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_development_dependency 'bundler', '~> 1.5'
22
+ spec.add_development_dependency 'rake'
23
+ spec.add_development_dependency 'rspec'
24
+ spec.add_development_dependency 'coveralls'
25
+ spec.add_development_dependency 'cinch-test'
26
+
27
+ spec.add_dependency 'cinch', '~> 2.0.12'
28
+ spec.add_dependency 'cinch-toolbox'
29
+ end
@@ -0,0 +1,2 @@
1
+ require 'cinch/plugins/lastactive/version'
2
+ require 'cinch/plugins/lastactive'
@@ -0,0 +1,31 @@
1
+ require 'cinch'
2
+ require 'cinch/toolbox'
3
+
4
+ module Cinch::Plugins
5
+ class LastActive
6
+ include Cinch::Plugin
7
+
8
+ listen_to :join, method: :join_respond
9
+ listen_to :channel, method: :update_time
10
+
11
+ def initialize(*args)
12
+ super
13
+ @time = Time.now
14
+ end
15
+
16
+ def join_respond(m)
17
+ return if m.user.nick == @bot.nick
18
+ m.reply "Hello, #{m.user.nick}. The last activity was #{time_passed} ago."
19
+ end
20
+
21
+ def update_time(m)
22
+ @time = Time.now
23
+ end
24
+
25
+ private
26
+
27
+ def time_passed
28
+ Cinch::Toolbox.time_format(Time.now - @time)
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,7 @@
1
+ module Cinch
2
+ module Plugins
3
+ class LastActive
4
+ VERSION = '0.0.1'
5
+ end
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,151 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cinch-lastactive
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Brian Haberer
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-06-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.5'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: coveralls
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: cinch-test
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ! '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ! '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: cinch
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ version: 2.0.12
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ version: 2.0.12
97
+ - !ruby/object:Gem::Dependency
98
+ name: cinch-toolbox
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ! '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description: Cinch Plugin to greet users with the time since last activity
112
+ email:
113
+ - bhaberer@gmail.com
114
+ executables: []
115
+ extensions: []
116
+ extra_rdoc_files: []
117
+ files:
118
+ - .gitignore
119
+ - Gemfile
120
+ - LICENSE.txt
121
+ - README.md
122
+ - Rakefile
123
+ - cinch-lastactive.gemspec
124
+ - lib/cinch-lastactive.rb
125
+ - lib/cinch/plugins/lastactive.rb
126
+ - lib/cinch/plugins/lastactive/version.rb
127
+ homepage: https://github.com/bhaberer/cinch-lastactive
128
+ licenses:
129
+ - MIT
130
+ metadata: {}
131
+ post_install_message:
132
+ rdoc_options: []
133
+ require_paths:
134
+ - lib
135
+ required_ruby_version: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - ! '>='
138
+ - !ruby/object:Gem::Version
139
+ version: '0'
140
+ required_rubygems_version: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ! '>='
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
145
+ requirements: []
146
+ rubyforge_project:
147
+ rubygems_version: 2.2.2
148
+ signing_key:
149
+ specification_version: 4
150
+ summary: Cinch Plugin to greet vistors.
151
+ test_files: []