api-moip-assinaturas 0.2.7 → 0.2.10

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZTE1ZjljMDBiMmZmODI3ZDg2OTMzOTc2ZTM4ZGRlMGY1MmVmNThlZA==
4
+ MTM2YjYyM2QwNWRkZTY4MjEzMjdhYzhiMmE3ZDc2ZThmYmUyNzEwYQ==
5
5
  data.tar.gz: !binary |-
6
- ZmI1OTQ4OWUwMmZjZTAyMDAxMTkwOTI2MWNlMGRlNTAwMWNhNDM1YQ==
6
+ YjllZmJjMDczNjM3M2FjNzFmNmYzZWRhNTQ3MTRhYmRlMjk1MmRkMA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ODI2ZmQyOTI2OWMwZWM5ODFhOTcyZWZlNjdiMGZkMWU0ZGMwYTgzMDRhNjky
10
- MzYwNWU4OWNkZmNiNGYxNzJjNmQ2ODk0ZDVkYmQ1ZWE1YjM1YzUzMzA1ZGU4
11
- ZjI1NTI1NDI1M2Q5ZTYyYmY0YWE2YjIwMWQ1NGU5YTlhNGZlY2E=
9
+ ZDZkYTg5NTMxZjE4NWQyOGVjYWRkMDQyNDNkMTUyNzRhMTU4NmRlOWFmOGJj
10
+ Y2E0MTQ5YjhmOTEyYzM3ZjMzNjgwZGI3OWFmMGNhOGQxOTM5ODYwNmFhYWY1
11
+ YzNmN2RkOGQxOTM2MGY1Y2UzMjE1YjdhMjZjYmZlY2VlZGFhZGQ=
12
12
  data.tar.gz: !binary |-
13
- MTNjNjYzOGEyZDEyODFkZmViZDUyMzZlNmNjYmI3MmIzZGViMjM4ZDJlNzcz
14
- NjA1YTIxMjA4M2UwODVkMzRkOWE2NDczNzkxMThlYTU1ZWFjN2NhZWZkZmQy
15
- YzRmMmZmYzAzN2ZjODhiYTMwNmIwM2Q0N2VkMjg2ODliODJmZjc=
13
+ NzhiZGI5NWVlNGIyOTc5NDUzZTI4MTZmM2Y3NzUxYzJhMzRjN2YyYWQxMTBk
14
+ NjhiZDYwZWFhZDI1YzQ2OGM3MTM2YzUzNDVhYWE5ZTJlYmYxZjNhNDY2MGY5
15
+ ZjU5NzAyZmQ0NzAxZDUwODBiYThjNTM5NjA4NWRhNmNjYWFiNDk=
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'api-moip-assinaturas'
6
- s.version = '0.2.7'
6
+ s.version = '0.2.10'
7
7
  s.date = '2013-07-02'
8
8
  s.summary = "Moip Assinaturas by Pixxel"
9
9
  s.description = "Gem desenvolvida para atender aos requisitos do moip api de assinaturas"
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.email = 'douglas@pixxel.net.br'
12
12
  s.homepage = 'https://github.com/xdougx/api-moip-assinaturas'
13
13
  s.license = 'Apache Licence 2.0'
14
- s.files = Dir["{lib/**/*.rb,lib/locales/*.yml,README.rdoc,test/**/*.rb,Rakefile,*.gemspec}"]
14
+ s.files = Dir["{lib/**/*.rb,lib/**/*.yml,README.rdoc,test/**/*.rb,Rakefile,*.gemspec}"]
15
15
  s.require_paths = ["lib"]
16
16
 
17
17
  s.required_ruby_version = '>= 1.9.3'
data/lib/moip.rb CHANGED
@@ -1,6 +1,10 @@
1
1
  module Moip
2
2
  end
3
3
 
4
+ # locales
5
+ require 'i18n'
6
+ I18n.load_path << File.dirname(__FILE__) + '/moip/locale/en.yml'
7
+
4
8
  # imports para o startup
5
9
  require 'httparty'
6
10
  require 'json'
@@ -14,6 +18,4 @@ require 'moip/models/customer'
14
18
  require 'moip/models/invoice'
15
19
  require 'moip/models/payment'
16
20
  require 'moip/models/plan'
17
- require 'moip/models/subscription'
18
-
19
- I18n.load_path << File.dirname(__FILE__) + '/locales/en.yml'
21
+ require 'moip/models/subscription'
@@ -0,0 +1,4 @@
1
+ en:
2
+ presence_of_address: "can't be blank"
3
+ presence_of_billing_info: "can't be blank"
4
+ invalid_format: "invalid format"
@@ -12,7 +12,7 @@ class Moip::Customer < Moip::Model
12
12
  :phone_number, :birthdate_day, :birthdate_month,
13
13
  :birthdate_year, :presence => true
14
14
 
15
- validates_format_of :email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i
15
+ validates_format_of :email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i, :message => I18n.t("invalid_format")
16
16
 
17
17
  validate :validates_presence_of_address, :validates_presence_of_billing_info
18
18
 
@@ -53,7 +53,7 @@ class Moip::Customer < Moip::Model
53
53
  end
54
54
 
55
55
  def validates_presence_of_address
56
- self.errors.add :address, I18n.t("moip.errors.presence_of_address") and return if @address.nil?
56
+ self.errors.add :address, I18n.t("presence_of_address") and return if @address.nil?
57
57
 
58
58
  if @address.valid?
59
59
  true
@@ -63,7 +63,7 @@ class Moip::Customer < Moip::Model
63
63
  end
64
64
 
65
65
  def validates_presence_of_billing_info
66
- self.errors.add :billing_info, I18n.t("moip.errors.presence_of_billing_info") and return if @billing_info.nil?
66
+ self.errors.add :billing_info, I18n.t("presence_of_billing_info") and return if @billing_info.nil?
67
67
 
68
68
  if @billing_info.valid?
69
69
  true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api-moip-assinaturas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Douglas Rossignolli
@@ -170,7 +170,7 @@ files:
170
170
  - lib/moip/models/subscription.rb
171
171
  - lib/moip/webhooks.rb
172
172
  - lib/moip.rb
173
- - lib/locales/en.yml
173
+ - lib/moip/locale/en.yml
174
174
  - api_moip_assinaturas.gemspec
175
175
  homepage: https://github.com/xdougx/api-moip-assinaturas
176
176
  licenses:
data/lib/locales/en.yml DELETED
@@ -1,5 +0,0 @@
1
- en:
2
- moip:
3
- errors:
4
- presence_of_address: "can't be blank"
5
- presence_of_billing_info: "can't be blank"