atheme 0.0.2 → 0.0.3

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: 965a87f20ccbdf56a383fefbaf857c1855886cdb
4
- data.tar.gz: 699192c08b30c5ea61a518697f0519eed8252fe7
3
+ metadata.gz: b15500edb979b29e50bc1cb01f91e5507be129c8
4
+ data.tar.gz: 35f5730fa0e94e25971eef9e50f6600834add6ba
5
5
  SHA512:
6
- metadata.gz: 9a5c2372e79507f0bac68b003081fb968e214e9887548754fd6f9b2a06ac08b79996bd8b37c222b3981b16fcaeccf5131d05235274ec2059dea5a3fb8ff24e23
7
- data.tar.gz: a1c8f12fdc3b0ac1c97cc313381f0a548a3fd510a9e8ae39496bddc57343de59af89052dc163e3986e428329700ded8c3a51b67d027c4a1e7f3e5506b3e9a877
6
+ metadata.gz: c7ae6e9f1c3cbfc740d65ffa8300229ad43a18be4d5c443e597d2ba11a1adffa2f1c6a068cf035319305b5fbe91346a5b9b229c82d105d3a376421a5a513c7ee
7
+ data.tar.gz: a72b4205d9bf18f369f0465add1310298d81652e1e3407f4c2a999cd1471597f50b3728454a6efec72edc29109dbe63716c39c0610fdca8acd5671bb730e1041
data/README.md CHANGED
@@ -26,11 +26,13 @@ You need to be using [Atheme IRC Services](http://www.atheme.net) with httpd and
26
26
 
27
27
  ```ruby
28
28
  Atheme.configure do |config|
29
- config.url = 'http://example.com'
29
+ config.hostname = 'example.com'
30
30
  config.port = 9876
31
31
  end
32
32
  ```
33
33
 
34
+ Optional: `protocol` (default http)
35
+
34
36
  ### Authentication
35
37
 
36
38
  ```ruby
data/lib/atheme.rb CHANGED
@@ -17,7 +17,7 @@ module Atheme
17
17
  extend Authenticate
18
18
 
19
19
  def self.server
20
- XMLRPC::Client.new2("#{Atheme.url}:#{Atheme.port}/xmlrpc")
20
+ XMLRPC::Client.new2("#{Atheme.protocol}://#{Atheme.hostname}:#{Atheme.port}/xmlrpc")
21
21
  end
22
22
 
23
23
  def self.call(*args)
@@ -1,15 +1,9 @@
1
1
  module Atheme::Configuration
2
- VALID_CONFIG_OPTIONS = [:url, :port].freeze
3
-
4
- attr_accessor *VALID_CONFIG_OPTIONS
2
+ attr_accessor :hostname, :port, :protocol
5
3
 
6
4
  def configure
7
- yield self
8
- end
5
+ self.protocol ||= 'http'
9
6
 
10
- def options
11
- VALID_CONFIG_OPTIONS.inject({}) do |option, key|
12
- option.merge!(key => send(key))
13
- end
7
+ yield self
14
8
  end
15
9
  end
@@ -1,3 +1,3 @@
1
1
  module Atheme
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
@@ -1,7 +1,8 @@
1
1
  # Change this to your testing services xmlrpc information
2
2
 
3
- url: http://example.com
3
+ hostname: example.com
4
4
  port: 1234
5
+ protocol: http
5
6
 
6
7
  nick: a_nick_that_exists
7
8
  password: the_nicks_password
@@ -3,11 +3,13 @@ require 'spec_helper'
3
3
  describe Atheme::Configuration do
4
4
  it 'should have a port' do
5
5
  expect(Atheme.port).to eql atheme_config['port']
6
- expect(Atheme.options[:port]).to eql atheme_config['port']
7
6
  end
8
7
 
9
8
  it 'should have a url' do
10
- expect(Atheme.url).to eql atheme_config['url']
11
- expect(Atheme.options[:url]).to eql atheme_config['url']
9
+ expect(Atheme.hostname).to eql atheme_config['hostname']
10
+ end
11
+
12
+ it 'should have a protocol' do
13
+ expect(Atheme.protocol).to eql atheme_config['protocol']
12
14
  end
13
15
  end
data/spec/spec_helper.rb CHANGED
@@ -11,7 +11,8 @@ end
11
11
  def configure_atheme
12
12
  Atheme.configure do |config|
13
13
  config.port = atheme_config['port']
14
- config.url = atheme_config['url']
14
+ config.hostname = atheme_config['hostname']
15
+ config.protocol = atheme_config['protocol']
15
16
  end
16
17
  end
17
18
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atheme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Newton