rfetion 0.3.7 → 0.3.8
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/VERSION +1 -1
- data/lib/rfetion/fetion.rb +2 -4
- data/rfetion.gemspec +2 -3
- metadata +2 -3
- data/lib/contact.rb +0 -0
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.3.
|
|
1
|
+
0.3.8
|
data/lib/rfetion/fetion.rb
CHANGED
|
@@ -48,10 +48,8 @@ class Fetion
|
|
|
48
48
|
fetion.get_buddy_list
|
|
49
49
|
fetion.get_contacts_info
|
|
50
50
|
fetion.contacts.each do |contact|
|
|
51
|
-
if friends.include? contact.mobile_no.to_s
|
|
51
|
+
if friends.include? contact.mobile_no.to_s or friends.any? { |friend| contact.uri.index(friend) }
|
|
52
52
|
fetion.send_sms(contact.uri, content)
|
|
53
|
-
elsif friends.any? { |friend| contact.uri.index(friend) }
|
|
54
|
-
fetion.send_sms
|
|
55
53
|
end
|
|
56
54
|
end
|
|
57
55
|
fetion.logout
|
|
@@ -167,7 +165,7 @@ class Fetion
|
|
|
167
165
|
response.body.scan(%r{<events>.*?</events>}).each do |events|
|
|
168
166
|
doc = REXML::Document.new(events)
|
|
169
167
|
doc.elements.each("events/event/results/contacts/contact") do |contact|
|
|
170
|
-
attrs = contact.
|
|
168
|
+
attrs = contact.children.size == 0 ? {} : contact.children.first.attributes
|
|
171
169
|
@contacts << Contact.new(contact.attributes["uri"], attrs)
|
|
172
170
|
end
|
|
173
171
|
end
|
data/rfetion.gemspec
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = %q{rfetion}
|
|
8
|
-
s.version = "0.3.
|
|
8
|
+
s.version = "0.3.8"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["Richard Huang"]
|
|
12
|
-
s.date = %q{2009-
|
|
12
|
+
s.date = %q{2009-11-03}
|
|
13
13
|
s.description = %q{rfetion is a ruby gem for China Mobile fetion service that you can send SMS free.}
|
|
14
14
|
s.email = %q{flyerhzm@gmail.com}
|
|
15
15
|
s.executables = ["rfetion", "rfetion"]
|
|
@@ -21,7 +21,6 @@ Gem::Specification.new do |s|
|
|
|
21
21
|
"Rakefile",
|
|
22
22
|
"VERSION",
|
|
23
23
|
"bin/rfetion",
|
|
24
|
-
"lib/contact.rb",
|
|
25
24
|
"lib/rfetion.rb",
|
|
26
25
|
"lib/rfetion/command.rb",
|
|
27
26
|
"lib/rfetion/contact.rb",
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rfetion
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Richard Huang
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2009-
|
|
12
|
+
date: 2009-11-03 00:00:00 +08:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
@@ -36,7 +36,6 @@ files:
|
|
|
36
36
|
- Rakefile
|
|
37
37
|
- VERSION
|
|
38
38
|
- bin/rfetion
|
|
39
|
-
- lib/contact.rb
|
|
40
39
|
- lib/rfetion.rb
|
|
41
40
|
- lib/rfetion/command.rb
|
|
42
41
|
- lib/rfetion/contact.rb
|
data/lib/contact.rb
DELETED
|
File without changes
|