apphunk 0.3.1 → 0.4.0
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.
- data/README.rdoc +1 -1
- data/VERSION +1 -1
- data/apphunk.gemspec +2 -2
- data/lib/apphunk.rb +10 -10
- metadata +2 -2
data/README.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.4.0
|
data/apphunk.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{apphunk}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.4.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Andreas Wolff"]
|
12
|
-
s.date = %q{
|
12
|
+
s.date = %q{2010-01-14}
|
13
13
|
s.description = %q{Apphunk is a library that allows your applications (currently only Ruby AND Rails) to send messages to Apphunk.com}
|
14
14
|
s.email = %q{andreas@apphunk.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/apphunk.rb
CHANGED
@@ -9,7 +9,7 @@ module Apphunk
|
|
9
9
|
|
10
10
|
class << self
|
11
11
|
|
12
|
-
# Default options to be used for Apphunk.
|
12
|
+
# Default options to be used for Apphunk.post. Initialized by Apphunk::Config.
|
13
13
|
attr_accessor :default_options
|
14
14
|
|
15
15
|
# Sends a +message+ to your remote inbox at apphunk.com
|
@@ -21,18 +21,18 @@ module Apphunk
|
|
21
21
|
#
|
22
22
|
# ==== Examples
|
23
23
|
#
|
24
|
-
# Apphunk.
|
25
|
-
# Apphunk.
|
26
|
-
# Apphunk.
|
24
|
+
# Apphunk.post("Yet another hello world")
|
25
|
+
# Apphunk.post("Tag me baby", :tags => 'apphunk, doc, examples', :trails => { :user_id => 5 })
|
26
|
+
# Apphunk.post("I'm on my way to a different project", :token => 'secret_project_access_token')
|
27
27
|
#
|
28
|
-
def
|
28
|
+
def post(message, options = {})
|
29
29
|
options = (self.default_options || {}).merge(options)
|
30
30
|
Apphunk::Proxy.send_message_to_apphunkd(message, options)
|
31
31
|
end
|
32
32
|
|
33
33
|
# Send messages with predefined options in a block
|
34
34
|
#
|
35
|
-
# Yields the Apphunk module which can be used to send messages via Apphunk.
|
35
|
+
# Yields the Apphunk module which can be used to send messages via Apphunk.post,
|
36
36
|
# but temporarily merges the provided +options+ with Apphunk.default_options.
|
37
37
|
# Can be used to send a bunch of messages with the same options.
|
38
38
|
#
|
@@ -41,12 +41,12 @@ module Apphunk
|
|
41
41
|
# For a list of available options see Apphunk::Config.
|
42
42
|
#
|
43
43
|
# ==== Examples
|
44
|
-
# Apphunk.
|
45
|
-
# apphunk.
|
46
|
-
# apphunk.
|
44
|
+
# Apphunk.post_with_options(:tags => 'hello world') do |apphunk|
|
45
|
+
# apphunk.post("A messages with tags")
|
46
|
+
# apphunk.post("Another messages with the same tags")
|
47
47
|
# end
|
48
48
|
#
|
49
|
-
def
|
49
|
+
def post_with_options(options = {}, &block)
|
50
50
|
preserved_defaults = self.default_options
|
51
51
|
self.default_options = (self.default_options || {}).merge(options)
|
52
52
|
yield self
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apphunk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Wolff
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2010-01-14 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|