self-notifo 0.3.0 → 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 CHANGED
@@ -3,9 +3,11 @@
3
3
  The self-notifo gem allows you to send Notifo (http://notifo.com) notifications to your own Notifo account from your Rails app.
4
4
 
5
5
  == Installation
6
+
6
7
  $ gem install self-notifo
7
8
 
8
9
  == Usage
10
+
9
11
  Sign up for a Notifo account (it's free). Take note of your API Username and API Secret (find on your account settings page on the Notifo site).
10
12
  Download and install one of Notifo's mobile, desktop or other apps from their site.
11
13
 
@@ -29,10 +31,14 @@ You can also override the settings in self-notifo.yml:
29
31
 
30
32
  See https://api.notifo.com/docs/notifications for more info on the Notifo API.
31
33
 
34
+ == Note on Tests
35
+
36
+ If you don't want to have notifications sent from your test environment while you run your tests, change send_in_test to false in self-notifo.yml.
37
+
32
38
  == Dependencies
33
39
 
34
40
  * Ruby on Rails, version 2.3.6 or newer.
35
- * self-notifo likes to party with John Nunemaker's awesome httparty[http://github.com/jnunemaker/httparty] version 0.6.1 or newer.
41
+ * self-notifo likes to party with John Nunemaker's fun loving httparty[http://github.com/jnunemaker/httparty] version 0.6.1 or newer.
36
42
 
37
43
  == Note on Patches/Pull Requests
38
44
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.4.0
@@ -1,3 +1,4 @@
1
+ send_in_test: true
1
2
  label: <%= actions[1] %>
2
3
  auth:
3
4
  username: <%= name %>
data/lib/self-notifo.rb CHANGED
@@ -10,11 +10,16 @@ class SelfNotifo
10
10
  # Optional parameters can be added:
11
11
  # SelfNotifo.new(:msg => "My message.", :label => "My Label", :title => "My Title", :uri => "http://some-relevant-address.com")
12
12
  # The message label defaults to the value set in self-notifo.yml
13
+ # If you do not wish for notifications to be sent from your test environment while you run your tests, change the value of
14
+ # send_in_test to false in self-notifo.yml.
13
15
  def initialize(params)
16
+ send_in_test = true
17
+
14
18
  begin
15
19
  config = YAML.load_file("#{Rails.root}/config/self-notifo.yml")
16
20
  username = config['auth']['username']
17
21
  api_secret = config['auth']['api_secret']
22
+ send_in_test = config['send_in_test']
18
23
  params[:label] = config['label'] if params[:label].blank?
19
24
  rescue Errno::ENOENT
20
25
  if params[:username].blank? && params[:api_secret].blank?
@@ -24,8 +29,9 @@ class SelfNotifo
24
29
  api_secret = params[:api_secret]
25
30
  end
26
31
  end
32
+
27
33
  self.class.basic_auth username, api_secret
28
- send_notification(params)
34
+ send_notification(params) if RAILS_ENV != 'test' || (RAILS_ENV == 'test' && send_in_test)
29
35
  end
30
36
 
31
37
  private
data/self-notifo.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{self-notifo}
8
- s.version = "0.3.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 = ["Gaelian Ditchburn"]
12
- s.date = %q{2010-09-19}
12
+ s.date = %q{2010-09-23}
13
13
  s.description = %q{The self-notifo gem sends notifications to your own Notifo account from your Rails application.}
14
14
  s.email = %q{gaelian.ditchburn@gmail.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: self-notifo
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 3
8
+ - 4
9
9
  - 0
10
- version: 0.3.0
10
+ version: 0.4.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Gaelian Ditchburn
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-19 00:00:00 +10:00
18
+ date: 2010-09-23 00:00:00 +10:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency