pyre 0.3.0 → 0.3.1

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.
@@ -1,3 +1,12 @@
1
+ == 0.3.1 / 2008-03-14
2
+
3
+ * Improved methods
4
+ * Pyre::Campfire#room raises an exception if given a block and the room is
5
+ not found
6
+ * General cleanup
7
+ * Changed weird "begin raise Exception end" blocks to just "raise Exception".
8
+ I thought I had a reason for it, but I guess not.
9
+
1
10
  == 0.3.0 / 2008-02-20
2
11
 
3
12
  * Huge enhancement!
data/README.txt CHANGED
@@ -13,7 +13,7 @@ Pyre owes a great deal of debt to Tinder (http://tinder.rubyforge.org)
13
13
  Features:
14
14
  * Speak in a Campfire room!
15
15
  * Paste in a Campfire room!
16
- * More reliable determination of whether your login was successful than Tinder!
16
+ * Upload to a Campfire room!
17
17
 
18
18
  Problems:
19
19
  * No public tests (I have them on my box, but you can't see them (passwords!))
@@ -1,7 +1,7 @@
1
1
  # Pyre: Because there isn't a real API for Campfire.
2
2
  module Pyre
3
3
  # :stopdoc:
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.1'
5
5
  LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
6
6
  PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
7
7
  # :startdoc:
@@ -31,7 +31,7 @@ module Pyre
31
31
  login_form.fields.name('email_address').value = email
32
32
  login_form.fields.name('password').value = password
33
33
  @agent.submit(login_form)
34
- logged_in? or begin raise LoginError end
34
+ logged_in? or raise LoginError
35
35
  end
36
36
 
37
37
  # Log out. Returns true on success.
@@ -79,8 +79,12 @@ module Pyre
79
79
  find_room_by_id(identifier)
80
80
  end
81
81
  if block_given?
82
- yield room
83
- room.leave
82
+ if room
83
+ yield room
84
+ room.leave
85
+ else
86
+ raise NavigationError, "No such room: #{identifier}"
87
+ end
84
88
  end
85
89
  room
86
90
  end
@@ -13,7 +13,7 @@ module Pyre
13
13
  # Enter the room. Returns true on success.
14
14
  def join
15
15
  @campfire.agent.get(@url)
16
- joined? or begin raise NavigationError end
16
+ joined? or raise NavigationError
17
17
  end
18
18
 
19
19
  # Leave the room. Returns true on success.
@@ -21,7 +21,7 @@ module Pyre
21
21
  if joined?
22
22
  leave = @campfire.agent.current_page.links.detect {|link| link.text == 'Leave'}
23
23
  @campfire.agent.post(leave.uri)
24
- not joined? or begin raise NavigationError end
24
+ not joined? or raise NavigationError
25
25
  end
26
26
  end
27
27
 
@@ -35,7 +35,7 @@ module Pyre
35
35
  result = submit_chat_form(message)
36
36
  success = (result.uri.to_s == "#{@url}/speak")
37
37
  join
38
- success or begin raise CommunicationError end
38
+ success or raise CommunicationError
39
39
  end
40
40
 
41
41
  # Paste +message+ to the room. Joins the room if necessary. Returns true on success.
@@ -43,7 +43,7 @@ module Pyre
43
43
  result = submit_chat_form(message, 'paste' => 'true')
44
44
  success = (result.links.detect {|link| link.text == 'View paste'} and result.uri.to_s == "#{@url}/speak")
45
45
  join
46
- success or begin raise CommunicationError end
46
+ success or raise CommunicationError
47
47
  end
48
48
 
49
49
  # Upload a file (named +filename+) to the room. Joins the room if necessary. Returns true on success.
@@ -54,7 +54,7 @@ module Pyre
54
54
  result = @campfire.agent.submit(upload_form)
55
55
  join
56
56
  success = @campfire.agent.current_page.search(%Q{ul[@id="file_list"]//a[@href$="/#{File.basename(filename)}"]}).size > 0
57
- success or begin raise UploadError end
57
+ success or raise UploadError
58
58
  end
59
59
 
60
60
  def inspect #:nodoc:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pyre
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Shea
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-02-20 00:00:00 -07:00
12
+ date: 2008-03-14 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -19,7 +19,7 @@ dependencies:
19
19
  requirements:
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 0.7.0
22
+ version: 0.7.4
23
23
  version:
24
24
  description: Pyre is a library for interacting with Campfire, the web-based group chat site from 37signals. Pyre owes a great deal of debt to Tinder (http://tinder.rubyforge.org)
25
25
  email: chris@ruby.tie-rack.org