irckitten 0.0.2 → 0.0.3

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.
Files changed (4) hide show
  1. data/.gitignore +1 -0
  2. data/README.md +18 -0
  3. data/lib/irckitten.rb +14 -1
  4. metadata +1 -1
data/.gitignore CHANGED
@@ -0,0 +1 @@
1
+ *.gem
data/README.md CHANGED
@@ -1,2 +1,20 @@
1
1
  Ruby gem to do IRCCat based on SRV records. No longer do you have to
2
2
  configure shit, that's what DNS is for.
3
+
4
+
5
+ So in your code, just do this:
6
+ <pre>
7
+ require 'irckitten'
8
+
9
+ IrcKitten::msg 'Thing broke... that is bad.'
10
+ </pre>
11
+
12
+ And it will look up your IRCCat server, via
13
+ '_irccat._tcp.yourdomain.example.org.' (and port), and try and send the
14
+ message to there.
15
+
16
+ Kind of ignores DNS search order and just chops chunks off your hostname
17
+ and searches there.
18
+
19
+ On 1.8.7 will try and use system_timer to do network timeouts. If it isn't
20
+ there, or you're on 1.9, then it just uses timeout.
@@ -46,8 +46,21 @@ module IrcKitten
46
46
 
47
47
  private
48
48
 
49
+ def self.getmyhostname
50
+ hostname = Socket.gethostname
51
+
52
+ if hostname.count( '.' ) < 1
53
+ hostname = Socket.gethostbyname( Socket.gethostname ).first
54
+ end
55
+
56
+ # if we can't get it, return false and bail.
57
+ return false if hostname.count( '.' ) < 1
58
+
59
+ hostname
60
+ end
61
+
49
62
  def self.givemedomains
50
- @myhostname ||= Socket.gethostname
63
+ @myhostname ||= self.getmyhostname
51
64
  currentdomain = @myhostname
52
65
 
53
66
  domain = []
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: irckitten
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: