4info 1.2.3 → 1.2.4

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.
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{4info}
8
- s.version = "1.2.3"
8
+ s.version = "1.2.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jack Danger Canty"]
@@ -31,7 +31,7 @@ You can also specify which attributes you'd like to use instead of the defaults
31
31
  Turning the thing on
32
32
  ---
33
33
 
34
- Because it can be expensive to send TXTs accidentally it's required that you manually configure FourInfo in your app. Put this line in config/initializers/sms.rb or config/environment.rb or anything that loads when the app starts:
34
+ Because it can be expensive to send TXTs accidentally, it's required that you manually configure FourInfo in your app. Put this line in config/environments/production.rb or anything that loads _only_ in your production environment:
35
35
 
36
36
  FourInfo.mode = :live
37
37
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.3
1
+ 1.2.4
@@ -1,7 +1,10 @@
1
1
  module FourInfo
2
- Gateway = URI.parse 'http://gateway.4info.net/msg'
3
-
4
2
  class << self
3
+ def gateway
4
+ require 'net/http'
5
+ URI.parse 'http://gateway.4info.net/msg'
6
+ end
7
+
5
8
  def mode
6
9
  @@mode ||= :test
7
10
  end
@@ -61,7 +61,7 @@ module FourInfo
61
61
  if :live == FourInfo.mode
62
62
  start do |http|
63
63
  http.post(
64
- FourInfo::Gateway.path,
64
+ FourInfo.gateway.path,
65
65
  body,
66
66
  {'Content-Type' => 'text/xml'}
67
67
  ).read_body
@@ -75,7 +75,7 @@ module FourInfo
75
75
  net = config[:proxy].blank? ?
76
76
  Net::HTTP :
77
77
  Net::HTTP::Proxy(*config[:proxy].split(":"))
78
- net.start(FourInfo::Gateway.host, FourInfo::Gateway.port) do |http|
78
+ net.start(FourInfo.gateway.host, FourInfo.gateway.port) do |http|
79
79
  yield http
80
80
  end
81
81
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: 4info
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Danger Canty