sixarm_ruby_fab 1.1.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/Rakefile +1 -0
  4. data/lib/sixarm_ruby_fab/agent.rb +2 -0
  5. data/lib/sixarm_ruby_fab/basic.rb +3 -1
  6. data/lib/sixarm_ruby_fab/company.rb +2 -0
  7. data/lib/sixarm_ruby_fab/date.rb +2 -0
  8. data/lib/sixarm_ruby_fab/datetime.rb +2 -0
  9. data/lib/sixarm_ruby_fab/email.rb +2 -0
  10. data/lib/sixarm_ruby_fab/files.rb +5 -3
  11. data/lib/sixarm_ruby_fab/forgery/uri.rb +3 -1
  12. data/lib/sixarm_ruby_fab/geo.rb +46 -5
  13. data/lib/sixarm_ruby_fab/id.rb +4 -2
  14. data/lib/sixarm_ruby_fab/internet.rb +2 -0
  15. data/lib/sixarm_ruby_fab/locale.rb +2 -0
  16. data/lib/sixarm_ruby_fab/mime.rb +2 -0
  17. data/lib/sixarm_ruby_fab/names.rb +2 -0
  18. data/lib/sixarm_ruby_fab/password.rb +2 -0
  19. data/lib/sixarm_ruby_fab/phone.rb +2 -0
  20. data/lib/sixarm_ruby_fab/postal.rb +2 -0
  21. data/lib/sixarm_ruby_fab/text.rb +2 -0
  22. data/lib/sixarm_ruby_fab/time.rb +2 -0
  23. data/lib/sixarm_ruby_fab/twitter.rb +7 -5
  24. data/lib/sixarm_ruby_fab/username.rb +2 -0
  25. data/lib/sixarm_ruby_fab/uuid.rb +2 -0
  26. data/lib/sixarm_ruby_fab.rb +22 -23
  27. data/test/sixarm_ruby_fab_test/agent_test.rb +1 -3
  28. data/test/sixarm_ruby_fab_test/basic_test.rb +2 -4
  29. data/test/sixarm_ruby_fab_test/company_test.rb +1 -3
  30. data/test/sixarm_ruby_fab_test/date_test.rb +1 -3
  31. data/test/sixarm_ruby_fab_test/datetime_test.rb +1 -3
  32. data/test/sixarm_ruby_fab_test/email_test.rb +1 -3
  33. data/test/sixarm_ruby_fab_test/files_test.rb +1 -3
  34. data/test/sixarm_ruby_fab_test/forgery/uri_test.rb +2 -0
  35. data/test/sixarm_ruby_fab_test/geo_test.rb +1 -3
  36. data/test/sixarm_ruby_fab_test/id_test.rb +3 -5
  37. data/test/sixarm_ruby_fab_test/internet_test.rb +1 -3
  38. data/test/sixarm_ruby_fab_test/locale_test.rb +1 -3
  39. data/test/sixarm_ruby_fab_test/mime_test.rb +1 -3
  40. data/test/sixarm_ruby_fab_test/names_test.rb +1 -3
  41. data/test/sixarm_ruby_fab_test/password_test.rb +1 -3
  42. data/test/sixarm_ruby_fab_test/phone_test.rb +1 -3
  43. data/test/sixarm_ruby_fab_test/postal_test.rb +1 -3
  44. data/test/sixarm_ruby_fab_test/text_test.rb +1 -3
  45. data/test/sixarm_ruby_fab_test/time_test.rb +1 -3
  46. data/test/sixarm_ruby_fab_test/twitter_test.rb +5 -7
  47. data/test/sixarm_ruby_fab_test/username_test.rb +1 -3
  48. data/test/sixarm_ruby_fab_test/uuid_test.rb +1 -3
  49. data/test/sixarm_ruby_fab_test.rb +4 -28
  50. data.tar.gz.sig +0 -0
  51. metadata +99 -22
  52. metadata.gz.sig +0 -0
  53. data/lib/sixarm_ruby_fab/forgery/geo.rb +0 -56
  54. data/test/sixarm_ruby_fab_test/forgery/geo_test.rb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4bb23d1dcfc00a9592417fa87f2ab8bf1fe735674c7dfe05d974725d3c20f4ab
4
- data.tar.gz: 943ad29c5241acfb8589f8e1e29dec53ae56b0cb5abfec1dfa3a1e1f16ea4366
3
+ metadata.gz: a8ea5b62def63cc5fc794e55f5b496df442fe065fea91e72257af090e249712e
4
+ data.tar.gz: b374a651f184b8d74b7100402927e773ca9882416a17ccc7bebb8008b6e6033c
5
5
  SHA512:
6
- metadata.gz: 8f42fa0d5ad1c4e3c9546b1b26926128e5ad30e6d0f20a2aefc421c22f10ca4ef1e1b1c59336d8476ac8646c7ca91bfd719d569cbe93f1678035c8a133911185
7
- data.tar.gz: f0d7dd59d982d526748a872e8e265086d9d18526a221fa0f012314b58d19c0fd05299ebf527c2679c53930871d9de8a8cc5b0b6fc863b33b7fd7977e7acaf9e1
6
+ metadata.gz: dd7374d728fe994514f7c5c631e321b95a6c01a8576740a76e64a23b1094c057f5a845dbfec2856c30e07d970e193a5fe367d6e9452c3996a23aa98df6077aa6
7
+ data.tar.gz: 155bbcd5987239abc8a42900d5faab1d6b4274fbb45821264158fb5ba033a175ffec0058796fcb2d0640b704f0dcaf2d78f62bb04ed3ee737162e0000483f104
checksums.yaml.gz.sig CHANGED
Binary file
data/Rakefile CHANGED
@@ -8,3 +8,4 @@ Rake::TestTask.new(:test) do |t|
8
8
  t.libs.push("lib", "test")
9
9
  t.pattern = "test/**/*.rb"
10
10
  end
11
+ task :default => [:test]
@@ -1,3 +1,5 @@
1
+ # -*- coding: utf-8 -*-
2
+
1
3
  class Fab
2
4
 
3
5
  AGENT_LIST = [
@@ -1,3 +1,5 @@
1
+ # -*- coding: utf-8 -*-
2
+
1
3
  class Fab
2
4
 
3
5
  # Fab a boolean, either true or false.
@@ -23,7 +25,7 @@ class Fab
23
25
  # * min: 1
24
26
  # * max: 5
25
27
  #
26
- # @return [Fixnum] a random number
28
+ # @return [Integer] a random number
27
29
  #
28
30
  def rating(options = {})
29
31
  rand((options[:min] || 1)..(options[:max] || 5))
@@ -1,3 +1,5 @@
1
+ # -*- coding: utf-8 -*-
2
+
1
3
  class Fab
2
4
 
3
5
  # Fab a company name.
@@ -1,3 +1,5 @@
1
+ # -*- coding: utf-8 -*-
2
+
1
3
  class Fab
2
4
 
3
5
  # Fab a random date.
@@ -1,3 +1,5 @@
1
+ # -*- coding: utf-8 -*-
2
+
1
3
  class Fab
2
4
 
3
5
  # Fab a random datetime.
@@ -1,3 +1,5 @@
1
+ # -*- coding: utf-8 -*-
2
+
1
3
  class Fab
2
4
 
3
5
  # Fab an email address.
@@ -1,3 +1,5 @@
1
+ # -*- coding: utf-8 -*-
2
+
1
3
  class Fab
2
4
 
3
5
  CHARS = ('a'..'z').to_a
@@ -26,9 +28,9 @@ class Fab
26
28
  # @returns [String] a base name
27
29
  #
28
30
  def basename(options = {})
29
- intention = basename_intension(options[:intension_length] ? options.merge(length: intension_length) : options)
30
- extention = basename_extension(options[:extension_length] ? options.merge(length: extension_length) : options)
31
- "#{basename_intension}.#{basename_extension}"
31
+ intension = basename_intension(options[:intension_length] ? options.merge(length: intension_length) : options)
32
+ extension = basename_extension(options[:extension_length] ? options.merge(length: extension_length) : options)
33
+ "#{intension}.#{extension}"
32
34
  end
33
35
 
34
36
  # Fab a file base name intension e.g. "myfile"
@@ -1,8 +1,10 @@
1
+ # -*- coding: utf-8 -*-
2
+
1
3
  require "forgery"
4
+
2
5
  # Generates random Interet URI information.
3
6
  class Forgery::Internet < Forgery
4
7
 
5
- # Return a latitude in the range -90.0 to +90.0 as a float.
6
8
  def self.uri
7
9
  ext = ['com','net','org','edu','gov','mil','au','br','cn','in','it','mx','jp','com.uk','com.au','com.ca'].sample
8
10
  host = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9'].sample(rand(5)+15).join
@@ -1,21 +1,62 @@
1
+ # -*- coding: utf-8 -*-
2
+
1
3
  class Fab
2
4
 
3
5
  # Fab a random latitude.
4
- # Delegate to Forgery::Geo.latitude.
5
6
  #
6
- # @returns [Float] a random latitude
7
+ # @returns [Float] a random latitude in the range -90.0 to +90.0
7
8
  #
8
9
  def latitude
9
- Forgery::Geo.latitude
10
+ rand * 180.0 - 90.0
11
+ end
12
+
13
+ # Return a latitude's degrees component in the range -180 to +180 as an integer.
14
+ def latitude_degrees
15
+ rand(360)-180
16
+ end
17
+
18
+ # Return a latitude's minutes component in the range 0 to 60 as an integer.
19
+ def latitude_minutes
20
+ rand(60)
21
+ end
22
+
23
+ # Return a latitude's seconds component in the range 0 to 60 as an integer.
24
+ def latitude_seconds
25
+ rand(60)
26
+ end
27
+
28
+ # Return a latitude's direction component, either "N" (north) or "S" (south)
29
+ def latitude_direction
30
+ ["N","S"].sample
10
31
  end
11
32
 
12
33
  # Fab a random longitude.
13
34
  # Delegate to Forgery::Geo.longitude.
14
35
  #
15
- # @returns [Float] a random longitude
36
+ # @returns [Float] a random longitude in the range -180.0 to +180.0
16
37
  #
17
38
  def longitude
18
- Forgery::Geo.longitude
39
+ rand * 360.0 - 180.0
40
+ end
41
+
42
+ # Return a longitude's degrees component in the range -180 to +180 as an integer.
43
+ def longitude_degrees
44
+ rand(360)-180
45
+ end
46
+
47
+ # Return a longitude's minutes component in the range 0 to 60 as an integer.
48
+ def longitude_minutes
49
+ rand(60)
50
+ end
51
+
52
+ # Return a longitude's seconds component in the range 0 to 60 as an integer.
53
+ def longitude_seconds
54
+ rand(60)
19
55
  end
20
56
 
57
+ # Return a longitude's direction component, either "E" (east) or "W" (west)
58
+ def longitude_direction
59
+ ["E","W"].sample
60
+ end
61
+
21
62
  end
@@ -1,3 +1,5 @@
1
+ # -*- coding: utf-8 -*-
2
+
1
3
  class Fab
2
4
 
3
5
  # Fab a random id.
@@ -7,7 +9,7 @@ class Fab
7
9
  # * min: 1
8
10
  # * max: 30000
9
11
  #
10
- # @returns [Fixnum] a random id
12
+ # @returns [Integer] a random id
11
13
  #
12
14
  def id(options = {})
13
15
  rand((options[:min] || 1)..(options[:max] || 30000))
@@ -19,7 +21,7 @@ class Fab
19
21
  #
20
22
  # * size: 3
21
23
  #
22
- # @returns [Array[Fixnum]] a list of random ids
24
+ # @returns [Array[Integer]] a list of random ids
23
25
  #
24
26
  def ids(options = {})
25
27
  (options[:size] || 3).times.map{ id(options) }
@@ -1,3 +1,5 @@
1
+ # -*- coding: utf-8 -*-
2
+
1
3
  class Fab
2
4
 
3
5
  # Fab a random URI.
@@ -1,3 +1,5 @@
1
+ # -*- coding: utf-8 -*-
2
+
1
3
  class Fab
2
4
 
3
5
  LANGUAGE_CODE_ISO6391_LIST = [
@@ -1,3 +1,5 @@
1
+ # -*- coding: utf-8 -*-
2
+
1
3
  class Fab
2
4
 
3
5
  # Fab a random content type part e.g. "image/jpeg".
@@ -1,3 +1,5 @@
1
+ # -*- coding: utf-8 -*-
2
+
1
3
  class Fab
2
4
 
3
5
  # Fab a random given name.
@@ -1,3 +1,5 @@
1
+ # -*- coding: utf-8 -*-
2
+
1
3
  class Fab
2
4
 
3
5
  # Fab a random password.
@@ -1,3 +1,5 @@
1
+ # -*- coding: utf-8 -*-
2
+
1
3
  class Fab
2
4
 
3
5
  # Fab a random phone number string.
@@ -1,3 +1,5 @@
1
+ # -*- coding: utf-8 -*-
2
+
1
3
  class Fab
2
4
 
3
5
  # Fab a random street address.
@@ -1,3 +1,5 @@
1
+ # -*- coding: utf-8 -*-
2
+
1
3
  class Fab
2
4
 
3
5
  NAME_CHARS = "aabcdeeefghiijklmnoopqrrssttuuvwxyz".split(//)
@@ -1,3 +1,5 @@
1
+ # -*- coding: utf-8 -*-
2
+
1
3
  class Fab
2
4
 
3
5
  # Fab a random time.
@@ -1,3 +1,5 @@
1
+ # -*- coding: utf-8 -*-
2
+
1
3
  class Fab
2
4
 
3
5
  # Fab a Twitter screen name.
@@ -7,7 +9,7 @@ class Fab
7
9
  #
8
10
  # * none
9
11
  #
10
- # @return [Fixnum] a screen name
12
+ # @return [Integer] a screen name
11
13
  #
12
14
  def twitter_screen_name(options = {})
13
15
  username(options)
@@ -20,7 +22,7 @@ class Fab
20
22
  # * min
21
23
  # * max
22
24
  #
23
- # @return [Fixnum] a user id
25
+ # @return [Integer] a user id
24
26
  #
25
27
  def twitter_user_id(options = {})
26
28
  rand((options[:min] || 10000000)..(options[:max] || 100000000))
@@ -49,7 +51,7 @@ class Fab
49
51
  # * min: 0
50
52
  # * max: 999
51
53
  #
52
- # @return [Fixnum] a retweet count
54
+ # @return [Integer] a retweet count
53
55
  #
54
56
  def twitter_retweet_count(options = {})
55
57
  rand((options[:min] || 0)..(options[:max] || 999))
@@ -62,7 +64,7 @@ class Fab
62
64
  # * min: 0
63
65
  # * max: 999
64
66
  #
65
- # @return [Fixnum] a favorite count
67
+ # @return [Integer] a favorite count
66
68
  #
67
69
  def twitter_favorite_count(options = {})
68
70
  rand((options[:min] || 0)..(options[:max] || 999))
@@ -75,7 +77,7 @@ class Fab
75
77
  # * min: 1000000000
76
78
  # * max: 9000000000
77
79
  #
78
- # @return [Fixnum] a tweet id
80
+ # @return [Integer] a tweet id
79
81
  #
80
82
  def twitter_tweet_id(options = {})
81
83
  rand((options[:min] || 1000000000)..(options[:max] || 9000000000))
@@ -1,3 +1,5 @@
1
+ # -*- coding: utf-8 -*-
2
+
1
3
  class Fab
2
4
 
3
5
  # Fab a username.
@@ -1,3 +1,5 @@
1
+ # -*- coding: utf-8 -*-
2
+
1
3
  class Fab
2
4
 
3
5
  # Fab a random UUID.
@@ -6,35 +6,34 @@ Please see README
6
6
  require "pathname"
7
7
  require "securerandom"
8
8
  require "forgery" # gem
9
- require "sixarm_ruby_fab/forgery/geo"
10
9
  require "sixarm_ruby_fab/forgery/uri"
11
10
 
12
11
  class Fab
13
- AZ = ('a'..'z').to_a
12
+ AZ = ("a".."z").to_a
14
13
  end
15
14
 
16
15
  [
17
- 'agent',
18
- 'basic',
19
- 'company',
20
- 'date',
21
- 'datetime',
22
- 'email',
23
- 'files',
24
- 'geo',
25
- 'id',
26
- 'internet',
27
- 'locale',
28
- 'mime',
29
- 'names',
30
- 'password',
31
- 'phone',
32
- 'postal',
33
- 'text',
34
- 'time',
35
- 'twitter',
36
- 'username',
37
- 'uuid'
16
+ "agent",
17
+ "basic",
18
+ "company",
19
+ "date",
20
+ "datetime",
21
+ "email",
22
+ "files",
23
+ "geo",
24
+ "id",
25
+ "internet",
26
+ "locale",
27
+ "mime",
28
+ "names",
29
+ "password",
30
+ "phone",
31
+ "postal",
32
+ "text",
33
+ "time",
34
+ "twitter",
35
+ "username",
36
+ "uuid"
38
37
  ].each{|x|
39
38
  require "sixarm_ruby_fab/#{x}.rb"
40
39
  }
@@ -1,7 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- require "minitest/autorun"
3
- require "simplecov"
4
- SimpleCov.start
2
+ require "sixarm_ruby_fab_test"
5
3
 
6
4
  describe Fab do
7
5
 
@@ -1,7 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- require "minitest/autorun"
3
- require "simplecov"
4
- SimpleCov.start
2
+ require "sixarm_ruby_fab_test"
5
3
 
6
4
  describe Fab do
7
5
 
@@ -40,7 +38,7 @@ describe Fab do
40
38
  end
41
39
 
42
40
  it "is a number" do
43
- @x.must_be_kind_of Fixnum
41
+ @x.must_be_kind_of Integer
44
42
  end
45
43
 
46
44
  end
@@ -1,7 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- require "minitest/autorun"
3
- require "simplecov"
4
- SimpleCov.start
2
+ require "sixarm_ruby_fab_test"
5
3
 
6
4
  describe Fab do
7
5
 
@@ -1,7 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- require "minitest/autorun"
3
- require "simplecov"
4
- SimpleCov.start
2
+ require "sixarm_ruby_fab_test"
5
3
 
6
4
  describe Fab do
7
5
 
@@ -1,7 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- require "minitest/autorun"
3
- require "simplecov"
4
- SimpleCov.start
2
+ require "sixarm_ruby_fab_test"
5
3
 
6
4
  describe Fab do
7
5
 
@@ -1,7 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- require "minitest/autorun"
3
- require "simplecov"
4
- SimpleCov.start
2
+ require "sixarm_ruby_fab_test"
5
3
 
6
4
  describe Fab do
7
5
 
@@ -1,7 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- require "minitest/autorun"
3
- require "simplecov"
4
- SimpleCov.start
2
+ require "sixarm_ruby_fab_test"
5
3
 
6
4
  describe Fab do
7
5
 
@@ -0,0 +1,2 @@
1
+ # -*- coding: utf-8 -*-
2
+ require "sixarm_ruby_fab_test"
@@ -1,7 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- require "minitest/autorun"
3
- require "simplecov"
4
- SimpleCov.start
2
+ require "sixarm_ruby_fab_test"
5
3
 
6
4
  describe Fab do
7
5
 
@@ -1,7 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- require "minitest/autorun"
3
- require "simplecov"
4
- SimpleCov.start
2
+ require "sixarm_ruby_fab_test"
5
3
 
6
4
  describe Fab do
7
5
 
@@ -14,7 +12,7 @@ describe Fab do
14
12
  end
15
13
 
16
14
  it "is an integer" do
17
- @x.must_be_kind_of Fixnum
15
+ @x.must_be_kind_of Integer
18
16
  end
19
17
 
20
18
  end
@@ -26,7 +24,7 @@ describe Fab do
26
24
  end
27
25
 
28
26
  it "is a list of integer items" do
29
- @x.each{|x| x.must_be_kind_of Fixnum}
27
+ @x.each{|x| x.must_be_kind_of Integer}
30
28
  end
31
29
 
32
30
  end
@@ -1,7 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- require "minitest/autorun"
3
- require "simplecov"
4
- SimpleCov.start
2
+ require "sixarm_ruby_fab_test"
5
3
 
6
4
  describe Fab do
7
5
 
@@ -1,7 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- require "minitest/autorun"
3
- require "simplecov"
4
- SimpleCov.start
2
+ require "sixarm_ruby_fab_test"
5
3
 
6
4
  describe Fab do
7
5
 
@@ -1,7 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- require "minitest/autorun"
3
- require "simplecov"
4
- SimpleCov.start
2
+ require "sixarm_ruby_fab_test"
5
3
 
6
4
  describe Fab do
7
5
 
@@ -1,7 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- require "minitest/autorun"
3
- require "simplecov"
4
- SimpleCov.start
2
+ require "sixarm_ruby_fab_test"
5
3
 
6
4
  describe Fab do
7
5
 
@@ -1,7 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- require "minitest/autorun"
3
- require "simplecov"
4
- SimpleCov.start
2
+ require "sixarm_ruby_fab_test"
5
3
 
6
4
  describe Fab do
7
5
 
@@ -1,7 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- require "minitest/autorun"
3
- require "simplecov"
4
- SimpleCov.start
2
+ require "sixarm_ruby_fab_test"
5
3
 
6
4
  describe Fab do
7
5
 
@@ -1,7 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- require "minitest/autorun"
3
- require "simplecov"
4
- SimpleCov.start
2
+ require "sixarm_ruby_fab_test"
5
3
 
6
4
  describe Fab do
7
5
 
@@ -1,7 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- require "minitest/autorun"
3
- require "simplecov"
4
- SimpleCov.start
2
+ require "sixarm_ruby_fab_test"
5
3
 
6
4
  describe Fab do
7
5
 
@@ -1,7 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- require "minitest/autorun"
3
- require "simplecov"
4
- SimpleCov.start
2
+ require "sixarm_ruby_fab_test"
5
3
 
6
4
  describe Fab do
7
5
 
@@ -1,7 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- require "minitest/autorun"
3
- require "simplecov"
4
- SimpleCov.start
2
+ require "sixarm_ruby_fab_test"
5
3
 
6
4
  describe Fab do
7
5
 
@@ -30,7 +28,7 @@ describe Fab do
30
28
  end
31
29
 
32
30
  it "is an integer" do
33
- @x.must_be_kind_of Fixnum
31
+ @x.must_be_kind_of Integer
34
32
  end
35
33
 
36
34
  it "is a large number-- we choose 8 digits for our implmentation" do
@@ -66,7 +64,7 @@ describe Fab do
66
64
  end
67
65
 
68
66
  it "is a count" do
69
- @x.must_be_kind_of Fixnum
67
+ @x.must_be_kind_of Integer
70
68
  end
71
69
 
72
70
  end
@@ -78,7 +76,7 @@ describe Fab do
78
76
  end
79
77
 
80
78
  it "is a count" do
81
- @x.must_be_kind_of Fixnum
79
+ @x.must_be_kind_of Integer
82
80
  end
83
81
 
84
82
  end
@@ -90,7 +88,7 @@ describe Fab do
90
88
  end
91
89
 
92
90
  it "is an id" do
93
- @x.must_be_kind_of Fixnum
91
+ @x.must_be_kind_of Integer
94
92
  end
95
93
 
96
94
  end
@@ -1,7 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- require "minitest/autorun"
3
- require "simplecov"
4
- SimpleCov.start
2
+ require "sixarm_ruby_fab_test"
5
3
 
6
4
  describe Fab do
7
5
 
@@ -1,7 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- require "minitest/autorun"
3
- require "simplecov"
4
- SimpleCov.start
2
+ require "sixarm_ruby_fab_test"
5
3
 
6
4
  describe Fab do
7
5
 
@@ -1,32 +1,8 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  require "minitest/autorun"
3
3
  require "simplecov"
4
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
5
+ SimpleCov::Formatter::HTMLFormatter,
6
+ ])
4
7
  SimpleCov.start
5
- require "sixarm_ruby_fab"
6
-
7
- [
8
- 'agent',
9
- 'basic',
10
- 'company',
11
- 'date',
12
- 'datetime',
13
- 'email',
14
- 'files',
15
- 'geo',
16
- 'id',
17
- 'internet',
18
- 'locale',
19
- 'mime',
20
- 'names',
21
- 'password',
22
- 'phone',
23
- 'postal',
24
- 'text',
25
- 'time',
26
- 'twitter',
27
- 'username',
28
- 'uuid'
29
- ].each{|x|
30
- require "sixarm_ruby_fab_test/#{x}_test.rb"
31
- }
32
-
8
+ require "sixarm_ruby_fab"
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sixarm_ruby_fab
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - SixArm
@@ -39,7 +39,7 @@ cert_chain:
39
39
  tzpk/VnZXj7Ek/earx+N/Z+Wtnl2xENm5IF8SFPeI1HFa9NH47pqtxF1YKpNIEVc
40
40
  2xa2BNHSePe7tys/2hbmZuyMu8X5ERmovsabSXB3a+YwtJh5c2jhA21wF7986s0q
41
41
  -----END CERTIFICATE-----
42
- date: 2018-04-02 00:00:00.000000000 Z
42
+ date: 2018-06-23 00:00:00.000000000 Z
43
43
  dependencies:
44
44
  - !ruby/object:Gem::Dependency
45
45
  name: forgery
@@ -67,7 +67,7 @@ dependencies:
67
67
  requirements:
68
68
  - - ">="
69
69
  - !ruby/object:Gem::Version
70
- version: 5.7.0
70
+ version: 5.11.3
71
71
  - - "<"
72
72
  - !ruby/object:Gem::Version
73
73
  version: '6'
@@ -77,7 +77,7 @@ dependencies:
77
77
  requirements:
78
78
  - - ">="
79
79
  - !ruby/object:Gem::Version
80
- version: 5.7.0
80
+ version: 5.11.3
81
81
  - - "<"
82
82
  - !ruby/object:Gem::Version
83
83
  version: '6'
@@ -105,29 +105,29 @@ dependencies:
105
105
  name: rake
106
106
  requirement: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">"
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: 10.4.2
110
+ version: 12.3.1
111
111
  - - "<"
112
112
  - !ruby/object:Gem::Version
113
- version: '11'
113
+ version: '13'
114
114
  type: :development
115
115
  prerelease: false
116
116
  version_requirements: !ruby/object:Gem::Requirement
117
117
  requirements:
118
- - - ">"
118
+ - - ">="
119
119
  - !ruby/object:Gem::Version
120
- version: 10.4.2
120
+ version: 12.3.1
121
121
  - - "<"
122
122
  - !ruby/object:Gem::Version
123
- version: '11'
123
+ version: '13'
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: simplecov
126
126
  requirement: !ruby/object:Gem::Requirement
127
127
  requirements:
128
128
  - - ">="
129
129
  - !ruby/object:Gem::Version
130
- version: 0.10.0
130
+ version: 0.16.1
131
131
  - - "<"
132
132
  - !ruby/object:Gem::Version
133
133
  version: '2'
@@ -137,30 +137,110 @@ dependencies:
137
137
  requirements:
138
138
  - - ">="
139
139
  - !ruby/object:Gem::Version
140
- version: 0.10.0
140
+ version: 0.16.1
141
141
  - - "<"
142
142
  - !ruby/object:Gem::Version
143
143
  version: '2'
144
144
  - !ruby/object:Gem::Dependency
145
- name: coveralls
145
+ name: flog
146
146
  requirement: !ruby/object:Gem::Requirement
147
147
  requirements:
148
148
  - - ">="
149
149
  - !ruby/object:Gem::Version
150
- version: 0.8.2
150
+ version: 4.6.2
151
151
  - - "<"
152
152
  - !ruby/object:Gem::Version
153
- version: '2'
153
+ version: '5'
154
154
  type: :development
155
155
  prerelease: false
156
156
  version_requirements: !ruby/object:Gem::Requirement
157
157
  requirements:
158
158
  - - ">="
159
159
  - !ruby/object:Gem::Version
160
- version: 0.8.2
160
+ version: 4.6.2
161
161
  - - "<"
162
162
  - !ruby/object:Gem::Version
163
- version: '2'
163
+ version: '5'
164
+ - !ruby/object:Gem::Dependency
165
+ name: flay
166
+ requirement: !ruby/object:Gem::Requirement
167
+ requirements:
168
+ - - ">="
169
+ - !ruby/object:Gem::Version
170
+ version: 2.12.0
171
+ - - "<"
172
+ - !ruby/object:Gem::Version
173
+ version: '3'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: 2.12.0
181
+ - - "<"
182
+ - !ruby/object:Gem::Version
183
+ version: '3'
184
+ - !ruby/object:Gem::Dependency
185
+ name: reek
186
+ requirement: !ruby/object:Gem::Requirement
187
+ requirements:
188
+ - - ">="
189
+ - !ruby/object:Gem::Version
190
+ version: 4.8.1
191
+ - - "<"
192
+ - !ruby/object:Gem::Version
193
+ version: '5'
194
+ type: :development
195
+ prerelease: false
196
+ version_requirements: !ruby/object:Gem::Requirement
197
+ requirements:
198
+ - - ">="
199
+ - !ruby/object:Gem::Version
200
+ version: 4.8.1
201
+ - - "<"
202
+ - !ruby/object:Gem::Version
203
+ version: '5'
204
+ - !ruby/object:Gem::Dependency
205
+ name: rubycritic
206
+ requirement: !ruby/object:Gem::Requirement
207
+ requirements:
208
+ - - ">="
209
+ - !ruby/object:Gem::Version
210
+ version: 3.4.0
211
+ - - "<"
212
+ - !ruby/object:Gem::Version
213
+ version: '4'
214
+ type: :development
215
+ prerelease: false
216
+ version_requirements: !ruby/object:Gem::Requirement
217
+ requirements:
218
+ - - ">="
219
+ - !ruby/object:Gem::Version
220
+ version: 3.4.0
221
+ - - "<"
222
+ - !ruby/object:Gem::Version
223
+ version: '4'
224
+ - !ruby/object:Gem::Dependency
225
+ name: rubocop
226
+ requirement: !ruby/object:Gem::Requirement
227
+ requirements:
228
+ - - ">="
229
+ - !ruby/object:Gem::Version
230
+ version: 0.57.2
231
+ - - "<"
232
+ - !ruby/object:Gem::Version
233
+ version: '1'
234
+ type: :development
235
+ prerelease: false
236
+ version_requirements: !ruby/object:Gem::Requirement
237
+ requirements:
238
+ - - ">="
239
+ - !ruby/object:Gem::Version
240
+ version: 0.57.2
241
+ - - "<"
242
+ - !ruby/object:Gem::Version
243
+ version: '1'
164
244
  description: Generate sample names, places, agents, tweets, etc.
165
245
  email: sixarm@sixarm.com
166
246
  executables: []
@@ -176,7 +256,6 @@ files:
176
256
  - lib/sixarm_ruby_fab/datetime.rb
177
257
  - lib/sixarm_ruby_fab/email.rb
178
258
  - lib/sixarm_ruby_fab/files.rb
179
- - lib/sixarm_ruby_fab/forgery/geo.rb
180
259
  - lib/sixarm_ruby_fab/forgery/uri.rb
181
260
  - lib/sixarm_ruby_fab/geo.rb
182
261
  - lib/sixarm_ruby_fab/id.rb
@@ -200,7 +279,6 @@ files:
200
279
  - test/sixarm_ruby_fab_test/datetime_test.rb
201
280
  - test/sixarm_ruby_fab_test/email_test.rb
202
281
  - test/sixarm_ruby_fab_test/files_test.rb
203
- - test/sixarm_ruby_fab_test/forgery/geo_test.rb
204
282
  - test/sixarm_ruby_fab_test/forgery/uri_test.rb
205
283
  - test/sixarm_ruby_fab_test/geo_test.rb
206
284
  - test/sixarm_ruby_fab_test/id_test.rb
@@ -233,7 +311,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
233
311
  requirements:
234
312
  - - ">="
235
313
  - !ruby/object:Gem::Version
236
- version: '2.2'
314
+ version: '2.5'
237
315
  required_rubygems_version: !ruby/object:Gem::Requirement
238
316
  requirements:
239
317
  - - ">="
@@ -241,7 +319,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
241
319
  version: '0'
242
320
  requirements: []
243
321
  rubyforge_project:
244
- rubygems_version: 2.7.6
322
+ rubygems_version: 2.7.7
245
323
  signing_key:
246
324
  specification_version: 4
247
325
  summary: SixArm.com → Ruby → Fab gem to fabricate sample data for testing
@@ -268,5 +346,4 @@ test_files:
268
346
  - test/sixarm_ruby_fab_test/twitter_test.rb
269
347
  - test/sixarm_ruby_fab_test/username_test.rb
270
348
  - test/sixarm_ruby_fab_test/uuid_test.rb
271
- - test/sixarm_ruby_fab_test/forgery/geo_test.rb
272
349
  - test/sixarm_ruby_fab_test/forgery/uri_test.rb
metadata.gz.sig CHANGED
Binary file
@@ -1,56 +0,0 @@
1
- require "forgery"
2
-
3
- # Generates random geographic information.
4
- class Forgery::Geo < Forgery
5
-
6
- # Return a latitude in the range -90.0 to +90.0 as a float.
7
- def self.latitude
8
- rand * 180.0 - 90.0
9
- end
10
-
11
- # Return a latitude's degrees component in the range -180 to +180 as an integer.
12
- def self.latitude_degrees
13
- rand(360)-180
14
- end
15
-
16
- # Return a latitude's minutes component in the range 0 to 60 as an integer.
17
- def self.latitude_minutes
18
- rand(60)
19
- end
20
-
21
- # Return a latitude's seconds component in the range 0 to 60 as an integer.
22
- def self.latitude_seconds
23
- rand(60)
24
- end
25
-
26
- # Return a latitude's direction component, either "N" (north) or "S" (south)
27
- def self.latitude_direction
28
- ['N','S'].sample
29
- end
30
-
31
- # Return a longitude in the range -180.0 to +180.0 as a float.
32
- def self.longitude
33
- rand * 360.0 - 180.0
34
- end
35
-
36
- # Return a longitude's degrees component in the range -180 to +180 as an integer.
37
- def self.longitude_degrees
38
- rand(360)-180
39
- end
40
-
41
- # Return a longitude's minutes component in the range 0 to 60 as an integer.
42
- def self.longitude_minutes
43
- rand(60)
44
- end
45
-
46
- # Return a longitude's seconds component in the range 0 to 60 as an integer.
47
- def self.longitude_seconds
48
- rand(60)
49
- end
50
-
51
- # Return a longitude's direction component, either "E" (east) or "W" (west)
52
- def self.longitude_direction
53
- ["E","W"].sample
54
- end
55
-
56
- end
File without changes