faker 1.4.0 → 1.4.1

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ced120390f0205e9fa10ec66d97c988b01a0ab19
4
- data.tar.gz: fc059c6b0a2986f815b9420ff3cdc3c01c6954cf
3
+ metadata.gz: 388ce6e6400da23238b626370b32f0294421df15
4
+ data.tar.gz: 87d1240d2e49881fd848834b6541334dbc750bb1
5
5
  SHA512:
6
- metadata.gz: bed9f65081c40bbf04890929acb89ba1cba7e0fa6ebd3936778e70bb67ca94f32d1ed653462e5161795aff15ea1f3a56f681731a420ae4692443e46d5aa9de35
7
- data.tar.gz: e22e1878b5b92680fd6dd19803fdf191f32c133a2e32595bbf670edf7b837aded3c5b6522469b7547a12ae8adf67f1dad1700400590b875c1acb433b4f1e23a2
6
+ metadata.gz: fbad50f565fa058744b4bdad1ff92cf0cb741535b86dd3d0d56cc7ddd15b4acdf337ea67390dc89359d2f94225b586e6fce5c5411880020c917ffa33ad91096c
7
+ data.tar.gz: 1d7601d9c39cc6b981f1763f63069d8215f9e8666e16d7ee242bcc8ce5072bda0e1ae5ecea8d7ec74b37372a6d85b97a4031d7b92c116553331dc0a7a37c07bd
@@ -1,3 +1,6 @@
1
+ == 1.4.1 2014-07-04
2
+ * Bugfix and cleanup
3
+
1
4
  == 1.4.0 2014-07-03
2
5
  * Many enhancements and bugfixes
3
6
 
data/README.md CHANGED
@@ -349,12 +349,7 @@ rest.
349
349
 
350
350
  Contributing
351
351
  ------------
352
- If you'd like to contribute code or formats/data for another locale, fork
353
- the project at [github](https://github.com/stympy/faker), make your changes,
354
- then send a pull request.
355
-
356
- **note**
357
- Run `bundle install` and `rake test` to confirm tests are passing.
352
+ See [CONTRIBUTING.md](https://github.com/stympy/faker/blob/master/CONTRIBUTING.md).
358
353
 
359
354
  Contact
360
355
  -------
@@ -28,7 +28,7 @@ module Faker
28
28
  end
29
29
 
30
30
  def time_zone
31
- bothify(fetch('address.time_zone'))
31
+ fetch('address.time_zone')
32
32
  end
33
33
 
34
34
  alias_method :zip, :zip_code
@@ -41,18 +41,18 @@ module Faker
41
41
 
42
42
  def generate_base8_ean
43
43
  values = regexify(/\d{7}/)
44
- check_digit = values.split(//).each_with_index.inject(0){ |s, (v, i)| s + v.to_i * EAN_CHECK_DIGIT8[i] } % 10
45
- values << (10 - check_digit).to_s
44
+ check_digit = 10 - values.split(//).each_with_index.inject(0){ |s, (v, i)| s + v.to_i * EAN_CHECK_DIGIT8[i] } % 10
45
+ values << (check_digit == 10 ? 0 : check_digit).to_s
46
46
  end
47
47
 
48
48
  def generate_base13_ean
49
49
  values = regexify(/\d{12}/)
50
- check_digit = values.split(//).each_with_index.inject(0){ |s, (v, i)| s + v.to_i * EAN_CHECK_DIGIT13[i] } % 10
51
- values << (10 - check_digit).to_s
50
+ check_digit = 10 - values.split(//).each_with_index.inject(0){ |s, (v, i)| s + v.to_i * EAN_CHECK_DIGIT13[i] } % 10
51
+ values << (check_digit == 10 ? 0 : check_digit).to_s
52
52
  end
53
53
 
54
- EAN_CHECK_DIGIT8 = [3, 1, 3, 1, 3, 1, 3, 1]
55
- EAN_CHECK_DIGIT13 = [1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1]
54
+ EAN_CHECK_DIGIT8 = [3, 1, 3, 1, 3, 1, 3]
55
+ EAN_CHECK_DIGIT13 = [1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3]
56
56
 
57
57
  def rut_verificator_digit(rut)
58
58
  total = rut.to_s.rjust(8, '0').split(//).zip(%w(3 2 7 6 5 4 3 2)).collect{|a, b| a.to_i * b.to_i}.inject(:+)
@@ -45,17 +45,17 @@ module Faker
45
45
  end
46
46
  end
47
47
  end
48
- end
49
48
 
50
- private
49
+ private
51
50
 
52
- # If an array or range is passed, a random value will be selected.
53
- # All other values are simply returned.
54
- def self.resolve(value)
55
- case value
56
- when Array then value[rand(value.size)]
57
- when Range then rand((value.last+1) - value.first) + value.first
58
- else value
51
+ # If an array or range is passed, a random value will be selected.
52
+ # All other values are simply returned.
53
+ def resolve(value)
54
+ case value
55
+ when Array then value[rand(value.size)]
56
+ when Range then rand((value.last+1) - value.first) + value.first
57
+ else value
58
+ end
59
59
  end
60
60
  end
61
61
  end
@@ -1,3 +1,3 @@
1
1
  module Faker #:nodoc:
2
- VERSION = "1.4.0"
2
+ VERSION = "1.4.1"
3
3
  end
@@ -116,7 +116,9 @@ en:
116
116
  - "#{first_name} #{last_name}"
117
117
 
118
118
  phone_number:
119
- formats: ['###-###-####', '(###)###-####', '1-###-###-####', '###.###.####', '###-###-####', '(###)###-####', '1-###-###-####', '###.###.####', '###-###-#### x###', '(###)###-#### x###', '1-###-###-#### x###', '###.###.#### x###', '###-###-#### x####', '(###)###-#### x####', '1-###-###-#### x####', '###.###.#### x####', '###-###-#### x#####', '(###)###-#### x#####', '1-###-###-#### x#####', '###.###.#### x#####']
119
+ formats: ['###-###-####', '(###) ###-####', '1-###-###-####', '###.###.####', '###-###-####', '(###) ###-####', '1-###-###-####', '###.###.####', '###-###-#### x###', '(###) ###-#### x###', '1-###-###-#### x###', '###.###.#### x###', '###-###-#### x####', '(###) ###-#### x####', '1-###-###-#### x####', '###.###.#### x####', '###-###-#### x#####', '(###) ###-#### x#####', '1-###-###-#### x#####', '###.###.#### x#####']
120
+ cell_phone:
121
+ formats: ['###-###-####', '(###) ###-####', '1-###-###-####', '###.###.####']
120
122
 
121
123
  business:
122
124
  credit_card_numbers: ['1234-2121-1221-1211', '1212-1221-1121-1234', '1211-1221-1234-2201', '1228-1221-1221-1431']
@@ -9,10 +9,7 @@ class TestFakerCompany < Test::Unit::TestCase
9
9
  assert @tester.duns_number.match(/\d\d-\d\d\d-\d\d\d\d/)
10
10
  end
11
11
 
12
- require "open-uri"
13
12
  def test_logo
14
- open("#{ @tester.logo }") do |f|
15
- assert f.readline.include?("GIF")
16
- end
13
+ assert @tester.logo.match(%r{http://www.biz-logo.com/examples/\d+\.gif})
17
14
  end
18
- end
15
+ end
@@ -36,10 +36,10 @@ class TestFakerStreet < Test::Unit::TestCase
36
36
  assert_match(/Wide Cheerful Path \d \(Green Door\)/, Faker::Address.street_address(:include_secondary))
37
37
  end
38
38
  end
39
-
39
+
40
40
  def test_street_address_with_locale_fallback
41
41
  I18n.with_locale('en-GB') do
42
- assert_match(/^\d+ \w+ \w+/, Faker::Address.street_address)
42
+ assert_match(/^\d+ [\w']+ \w+/, Faker::Address.street_address)
43
43
  end
44
44
  end
45
45
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Curtis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-03 00:00:00.000000000 Z
11
+ date: 2014-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n