cinch-toolbox 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -0
- data/cinch-toolbox.gemspec +2 -1
- data/lib/cinch/toolbox.rb +8 -0
- data/lib/cinch/toolbox/version.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- metadata +21 -6
data/README.md
CHANGED
@@ -44,6 +44,9 @@ Or install it yourself as:
|
|
44
44
|
|
45
45
|
## Changelog
|
46
46
|
|
47
|
+
* 1.0.3
|
48
|
+
* [Enhancement] Added `Toolbox.sent_via_private_message?` for restricting commands to use in
|
49
|
+
channel only
|
47
50
|
* 1.0.2
|
48
51
|
* [Enhancement] Reorged the file layout a bit to be more canonical (`require cinch/toolbox`
|
49
52
|
now instead of `require cinch-toolbox`.
|
data/cinch-toolbox.gemspec
CHANGED
@@ -21,7 +21,8 @@ Gem::Specification.new do |gem|
|
|
21
21
|
gem.add_development_dependency 'rspec'
|
22
22
|
gem.add_development_dependency 'coveralls'
|
23
23
|
gem.add_development_dependency 'fakeweb', '~> 1.3'
|
24
|
+
gem.add_development_dependency 'cinch-test'
|
24
25
|
|
25
|
-
gem.add_dependency 'nokogiri', '~> 1.
|
26
|
+
gem.add_dependency 'nokogiri', '~> 1.6.0'
|
26
27
|
gem.add_dependency 'patron', '~> 0.4.18'
|
27
28
|
end
|
data/lib/cinch/toolbox.rb
CHANGED
@@ -83,6 +83,14 @@ module Cinch
|
|
83
83
|
return text
|
84
84
|
end
|
85
85
|
|
86
|
+
# Simple check to make sure people are using a command via the main channel for plugins that
|
87
|
+
# require a channel for context.
|
88
|
+
def Toolbox.sent_via_private_message?(m, error = "You must use that command in the main channel.")
|
89
|
+
return false unless m.channel.nil?
|
90
|
+
m.user.msg error
|
91
|
+
return true
|
92
|
+
end
|
93
|
+
|
86
94
|
# Used to render a period of time in a uniform string.
|
87
95
|
# There is probably a much better way to do this, so FIXME
|
88
96
|
# @param [Fixnum] secs Number of seconds to render into a string.
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cinch-toolbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -75,6 +75,22 @@ dependencies:
|
|
75
75
|
- - ~>
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '1.3'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: cinch-test
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
78
94
|
- !ruby/object:Gem::Dependency
|
79
95
|
name: nokogiri
|
80
96
|
requirement: !ruby/object:Gem::Requirement
|
@@ -82,7 +98,7 @@ dependencies:
|
|
82
98
|
requirements:
|
83
99
|
- - ~>
|
84
100
|
- !ruby/object:Gem::Version
|
85
|
-
version: 1.
|
101
|
+
version: 1.6.0
|
86
102
|
type: :runtime
|
87
103
|
prerelease: false
|
88
104
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -90,7 +106,7 @@ dependencies:
|
|
90
106
|
requirements:
|
91
107
|
- - ~>
|
92
108
|
- !ruby/object:Gem::Version
|
93
|
-
version: 1.
|
109
|
+
version: 1.6.0
|
94
110
|
- !ruby/object:Gem::Dependency
|
95
111
|
name: patron
|
96
112
|
requirement: !ruby/object:Gem::Requirement
|
@@ -146,11 +162,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
162
|
version: '0'
|
147
163
|
requirements: []
|
148
164
|
rubyforge_project:
|
149
|
-
rubygems_version: 1.8.
|
165
|
+
rubygems_version: 1.8.25
|
150
166
|
signing_key:
|
151
167
|
specification_version: 3
|
152
168
|
summary: Common methods used in Cinch Plugins.
|
153
169
|
test_files:
|
154
170
|
- spec/cinch-toolbox_spec.rb
|
155
171
|
- spec/spec_helper.rb
|
156
|
-
has_rdoc:
|