mensario 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/README.markdown +5 -5
  2. data/VERSION +1 -1
  3. data/lib/mensario.rb +22 -20
  4. data/mensario.gemspec +7 -7
  5. metadata +62 -64
@@ -10,14 +10,14 @@ This gem allows us to perform the following operations through the mensario API:
10
10
  There are three ways to set configuration parameters of Mensario:
11
11
 
12
12
  ### Separately
13
- Mensario::license( "PERT123446423" )
14
- Mensario::username( "caer3456" )
13
+ Mensario::license = "PERT123446423"
14
+ Mensario::username = "caer3456"
15
15
 
16
16
  ### Block of code
17
17
  Mensario::set_config do |m|
18
- m.license( "PERT123446423" )
19
- m.username( "caer3456" )
20
- m.password( "frt3gg5" )
18
+ m.license = "PERT123446423"
19
+ m.username = "caer3456"
20
+ m.password = "frt3gg5"
21
21
  end
22
22
 
23
23
  ### Through a YAML file
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.3.0
@@ -38,23 +38,25 @@ class Mensario
38
38
  # Store config
39
39
  @@config = {}
40
40
 
41
- # Use undefined methods to set the values of license number,
42
- # username or password
41
+ # Set the value of the license number
43
42
  #
44
- # @example Valid calls:
45
- # Mensario.license( "PTIY124434534" )
46
- # Mensario.username( "crnb3222" )
47
- # Mensario.password( "smsacblwenk" )
48
- # @example Invalid calls:
49
- # Mensario.license = "PTIY124434534"
43
+ # @param [String] license License number
44
+ def self.license=(license)
45
+ @@config[:license] = license
46
+ end
47
+
48
+ # Set the value of the username of license
49
+ #
50
+ # @param [String] username Username
51
+ def self.username=(username)
52
+ @@config[:username] = username
53
+ end
54
+
55
+ # Set the value of the password of license
50
56
  #
51
- # @param [Symbol] method Method called that is missing
52
- # @param [Array] params Params in the call
53
- # @param [Block] block Block code in method
54
- def self.method_missing( method, *params, &block )
55
- raise NoMethodError, "undefined method #{method}" unless [:license, :username, :password].include? method
56
- raise ArgumentError, "wrong number of arguments(#{params.length} for 1)" unless params.length == 1
57
- @@config[method] = params[0]
57
+ # @param [String] password Password
58
+ def self.password=(password)
59
+ @@config[:password] = password
58
60
  end
59
61
 
60
62
  # Set configuration parameters license, username and password
@@ -62,9 +64,9 @@ class Mensario
62
64
  #
63
65
  # @example
64
66
  # Mensario::set_config do |m|
65
- # m.license( "ASDER1234512" )
66
- # m.username( "caee4444" )
67
- # m.password( "xcderfa23" )
67
+ # m.license = "ASDER1234512"
68
+ # m.username = "caee4444"
69
+ # m.password = "xcderfa23"
68
70
  # end
69
71
  def self.set_config
70
72
  yield self
@@ -102,7 +104,7 @@ class Mensario
102
104
 
103
105
  result = XmlSimple.xml_in(response.body)
104
106
 
105
- raise MensarioApiException.new(result['result'].first) unless result['result'].first == 'OK'
107
+ raise MensarioApiException.new(result['result'].first), result['result'].first unless result['result'].first == 'OK'
106
108
  return result
107
109
  end
108
110
 
@@ -139,7 +141,7 @@ class Mensario
139
141
  # @return [Integer] Id of sms
140
142
  def self.send_message(opts = {})
141
143
  date = opts[:date] || '00000000000000'
142
- date = date.to_s.gsub(/\s|[:-]/, '')[0..13] if date.class == Time
144
+ date = date.strftime('%Y%m%d%H%M%S') if date.class == Time
143
145
 
144
146
  xml = {
145
147
  'timezone' => [ opts[:timezone] || '' ],
@@ -4,13 +4,13 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{mensario}
8
- s.version = "0.2.0"
7
+ s.name = "mensario"
8
+ s.version = "0.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Javier Aranda", "Juan Antonio Galisteo"]
12
- s.date = %q{2011-06-06}
13
- s.description = %q{This gem allow us to send, check status and destroy sms using the Mensario service api}
12
+ s.date = "2011-12-13"
13
+ s.description = "This gem allow us to send, check status and destroy sms using the Mensario service api"
14
14
  s.email = ["jaranda@nosolosoftware.biz", "jgalisteo@nosolosoftware.biz"]
15
15
  s.extra_rdoc_files = [
16
16
  "README.markdown"
@@ -25,11 +25,11 @@ Gem::Specification.new do |s|
25
25
  "lib/mensario/http_exception.rb",
26
26
  "mensario.gemspec"
27
27
  ]
28
- s.homepage = %q{http://github.com/nosolosoftware/mensario}
28
+ s.homepage = "http://github.com/nosolosoftware/mensario"
29
29
  s.licenses = ["GPL-3"]
30
30
  s.require_paths = ["lib"]
31
- s.rubygems_version = %q{1.7.2}
32
- s.summary = %q{Wrapper around Mensario API}
31
+ s.rubygems_version = "1.8.10"
32
+ s.summary = "Wrapper around Mensario API"
33
33
 
34
34
  if s.respond_to? :specification_version then
35
35
  s.specification_version = 3
metadata CHANGED
@@ -1,106 +1,104 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: mensario
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
4
5
  prerelease:
5
- version: 0.2.0
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Javier Aranda
9
9
  - Juan Antonio Galisteo
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
-
14
- date: 2011-06-06 00:00:00 Z
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
13
+ date: 2011-12-13 00:00:00.000000000Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
17
16
  name: xml-simple
18
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: &12320440 !ruby/object:Gem::Requirement
19
18
  none: false
20
- requirements:
19
+ requirements:
21
20
  - - ~>
22
- - !ruby/object:Gem::Version
21
+ - !ruby/object:Gem::Version
23
22
  version: 1.0.15
24
23
  type: :runtime
25
24
  prerelease: false
26
- version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
25
+ version_requirements: *12320440
26
+ - !ruby/object:Gem::Dependency
28
27
  name: yard
29
- requirement: &id002 !ruby/object:Gem::Requirement
28
+ requirement: &12319780 !ruby/object:Gem::Requirement
30
29
  none: false
31
- requirements:
30
+ requirements:
32
31
  - - ~>
33
- - !ruby/object:Gem::Version
32
+ - !ruby/object:Gem::Version
34
33
  version: 0.7.1
35
34
  type: :runtime
36
35
  prerelease: false
37
- version_requirements: *id002
38
- - !ruby/object:Gem::Dependency
36
+ version_requirements: *12319780
37
+ - !ruby/object:Gem::Dependency
39
38
  name: jeweler
40
- requirement: &id003 !ruby/object:Gem::Requirement
39
+ requirement: &12319080 !ruby/object:Gem::Requirement
41
40
  none: false
42
- requirements:
41
+ requirements:
43
42
  - - ~>
44
- - !ruby/object:Gem::Version
43
+ - !ruby/object:Gem::Version
45
44
  version: 1.6.0
46
45
  type: :development
47
46
  prerelease: false
48
- version_requirements: *id003
49
- - !ruby/object:Gem::Dependency
47
+ version_requirements: *12319080
48
+ - !ruby/object:Gem::Dependency
50
49
  name: rake
51
- requirement: &id004 !ruby/object:Gem::Requirement
50
+ requirement: &12250360 !ruby/object:Gem::Requirement
52
51
  none: false
53
- requirements:
52
+ requirements:
54
53
  - - ~>
55
- - !ruby/object:Gem::Version
54
+ - !ruby/object:Gem::Version
56
55
  version: 0.8.7
57
56
  type: :development
58
57
  prerelease: false
59
- version_requirements: *id004
60
- - !ruby/object:Gem::Dependency
58
+ version_requirements: *12250360
59
+ - !ruby/object:Gem::Dependency
61
60
  name: cucumber
62
- requirement: &id005 !ruby/object:Gem::Requirement
61
+ requirement: &12249560 !ruby/object:Gem::Requirement
63
62
  none: false
64
- requirements:
63
+ requirements:
65
64
  - - ~>
66
- - !ruby/object:Gem::Version
65
+ - !ruby/object:Gem::Version
67
66
  version: 0.10.2
68
67
  type: :development
69
68
  prerelease: false
70
- version_requirements: *id005
71
- - !ruby/object:Gem::Dependency
69
+ version_requirements: *12249560
70
+ - !ruby/object:Gem::Dependency
72
71
  name: rspec
73
- requirement: &id006 !ruby/object:Gem::Requirement
72
+ requirement: &12248940 !ruby/object:Gem::Requirement
74
73
  none: false
75
- requirements:
74
+ requirements:
76
75
  - - ~>
77
- - !ruby/object:Gem::Version
76
+ - !ruby/object:Gem::Version
78
77
  version: 2.6.0
79
78
  type: :development
80
79
  prerelease: false
81
- version_requirements: *id006
82
- - !ruby/object:Gem::Dependency
80
+ version_requirements: *12248940
81
+ - !ruby/object:Gem::Dependency
83
82
  name: rdiscount
84
- requirement: &id007 !ruby/object:Gem::Requirement
83
+ requirement: &12248200 !ruby/object:Gem::Requirement
85
84
  none: false
86
- requirements:
85
+ requirements:
87
86
  - - ~>
88
- - !ruby/object:Gem::Version
87
+ - !ruby/object:Gem::Version
89
88
  version: 1.6.8
90
89
  type: :development
91
90
  prerelease: false
92
- version_requirements: *id007
93
- description: This gem allow us to send, check status and destroy sms using the Mensario service api
94
- email:
91
+ version_requirements: *12248200
92
+ description: This gem allow us to send, check status and destroy sms using the Mensario
93
+ service api
94
+ email:
95
95
  - jaranda@nosolosoftware.biz
96
96
  - jgalisteo@nosolosoftware.biz
97
97
  executables: []
98
-
99
98
  extensions: []
100
-
101
- extra_rdoc_files:
99
+ extra_rdoc_files:
102
100
  - README.markdown
103
- files:
101
+ files:
104
102
  - COPYING
105
103
  - README.markdown
106
104
  - VERSION
@@ -110,31 +108,31 @@ files:
110
108
  - lib/mensario/http_exception.rb
111
109
  - mensario.gemspec
112
110
  homepage: http://github.com/nosolosoftware/mensario
113
- licenses:
111
+ licenses:
114
112
  - GPL-3
115
113
  post_install_message:
116
114
  rdoc_options: []
117
-
118
- require_paths:
115
+ require_paths:
119
116
  - lib
120
- required_ruby_version: !ruby/object:Gem::Requirement
117
+ required_ruby_version: !ruby/object:Gem::Requirement
121
118
  none: false
122
- requirements:
123
- - - ">="
124
- - !ruby/object:Gem::Version
125
- version: "0"
126
- required_rubygems_version: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ! '>='
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ segments:
124
+ - 0
125
+ hash: -4460156243388578858
126
+ required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  none: false
128
- requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- version: "0"
128
+ requirements:
129
+ - - ! '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
132
  requirements: []
133
-
134
133
  rubyforge_project:
135
- rubygems_version: 1.7.2
134
+ rubygems_version: 1.8.10
136
135
  signing_key:
137
136
  specification_version: 3
138
137
  summary: Wrapper around Mensario API
139
138
  test_files: []
140
-