pongal 0.0.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2523ebedac9c76309fe4fa9a7ae7c3cacbaea1a1
4
+ data.tar.gz: 06c43982b0740b02f846a65c25f3f81a364809cd
5
+ SHA512:
6
+ metadata.gz: 7ae7634ebc05e47fdf1895b8b6bfc0937d2ced60b37f1949d7e38ba0e1defebc972fb66c5bdf3221e2e059d59566e7e7e99a21cfa279e23766d2c1cb62746501
7
+ data.tar.gz: 15c33a4ecbbc55c5cc8adf8ad5ef48e26dfbb35de037197821513d270cc823505057d3719af66830d7764f23292531b2192e9d37416405afa02c99190167054d
@@ -0,0 +1,2 @@
1
+ ## 0.0.1, released 2015-06-15
2
+ * Generate a random US state
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2015 Bala Paranj www.rubyplus.com
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,30 @@
1
+ Pongal
2
+ ====
3
+
4
+ Pongal is a simple gem for generating a valid random US state.
5
+
6
+ Description
7
+ -----------
8
+
9
+ This is useful in Geocoding applications that need to geocode. Use this gem to seed data in your applications.
10
+
11
+ Installation
12
+ ------------
13
+ gem install pongal
14
+
15
+ Usage and documentation
16
+ -----------------------
17
+
18
+ To get a random state, call the state method like this:
19
+ Pongal::Faker.state
20
+
21
+ To run the tests:
22
+ ruby test/test_state.rb
23
+
24
+ [homepage]: http://www.rubyplus.com/
25
+
26
+ License
27
+ -------
28
+ Released under the MIT License. See the [LICENSE][] file for further details.
29
+
30
+ [license]: LICENSE.md
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- mode: ruby -*-
3
+
4
+ require 'pongal/runner'
5
+
6
+ runner = Pongal::Runner.new
7
+ runner.run
@@ -0,0 +1,65 @@
1
+ module Pongal
2
+ class Faker
3
+ STATES =
4
+ [
5
+ ['Alabama', 'AL'],
6
+ ['Alaska', 'AK'],
7
+ ['Arizona', 'AZ'],
8
+ ['Arkansas', 'AR'],
9
+ ['California', 'CA'],
10
+ ['Colorado', 'CO'],
11
+ ['Connecticut', 'CT'],
12
+ ['Delaware', 'DE'],
13
+ ['District of Columbia', 'DC'],
14
+ ['Florida', 'FL'],
15
+ ['Georgia', 'GA'],
16
+ ['Hawaii', 'HI'],
17
+ ['Idaho', 'ID'],
18
+ ['Illinois', 'IL'],
19
+ ['Indiana', 'IN'],
20
+ ['Iowa', 'IA'],
21
+ ['Kansas', 'KS'],
22
+ ['Kentucky', 'KY'],
23
+ ['Louisiana', 'LA'],
24
+ ['Maine', 'ME'],
25
+ ['Maryland', 'MD'],
26
+ ['Massachusetts', 'MA'],
27
+ ['Michigan', 'MI'],
28
+ ['Minnesota', 'MN'],
29
+ ['Mississippi', 'MS'],
30
+ ['Missouri', 'MO'],
31
+ ['Montana', 'MT'],
32
+ ['Nebraska', 'NE'],
33
+ ['Nevada', 'NV'],
34
+ ['New Hampshire', 'NH'],
35
+ ['New Jersey', 'NJ'],
36
+ ['New Mexico', 'NM'],
37
+ ['New York', 'NY'],
38
+ ['North Carolina', 'NC'],
39
+ ['North Dakota', 'ND'],
40
+ ['Ohio', 'OH'],
41
+ ['Oklahoma', 'OK'],
42
+ ['Oregon', 'OR'],
43
+ ['Pennsylvania', 'PA'],
44
+ ['Puerto Rico', 'PR'],
45
+ ['Rhode Island', 'RI'],
46
+ ['South Carolina', 'SC'],
47
+ ['South Dakota', 'SD'],
48
+ ['Tennessee', 'TN'],
49
+ ['Texas', 'TX'],
50
+ ['Utah', 'UT'],
51
+ ['Vermont', 'VT'],
52
+ ['Virginia', 'VA'],
53
+ ['Washington', 'WA'],
54
+ ['West Virginia', 'WV'],
55
+ ['Wisconsin', 'WI'],
56
+ ['Wyoming', 'WY']
57
+ ]
58
+
59
+ def self.state
60
+ STATES[rand(0..51)]
61
+ end
62
+
63
+ end
64
+
65
+ end
@@ -0,0 +1,11 @@
1
+ require_relative 'faker'
2
+
3
+ module Pongal
4
+ class Runner
5
+
6
+ def run
7
+ Faker.state
8
+ end
9
+ end
10
+ end
11
+
@@ -0,0 +1,3 @@
1
+ class Pongal
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path("../lib/", __FILE__)
3
+ $LOAD_PATH.unshift lib unless $LOAD_PATH.include?(lib)
4
+ require "pongal/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.author = ["Bala Paranj"]
8
+ spec.description = %q(Pongal is a valid US state generator that can be used in Geocoding applications.)
9
+ spec.email = "support@zepho.com"
10
+ spec.executables = %w[pongal]
11
+ spec.files = %w[CHANGELOG.md LICENSE.md README.md pongal.gemspec]
12
+ spec.files += Dir.glob("bin/**/*")
13
+ spec.files += Dir.glob("lib/**/*.rb")
14
+ spec.files += Dir.glob("test/**/*")
15
+ spec.homepage = "http://rubyplus.com/"
16
+ spec.licenses = %w[MIT]
17
+ spec.name = "pongal"
18
+ spec.require_paths = %w[lib]
19
+ spec.required_rubygems_version = ">= 1.3.5"
20
+ spec.summary = 'Pongal is a simple gem for generating a valid random US state.'
21
+ spec.test_files = Dir["test/test*.rb"]
22
+ spec.version = Pongal::VERSION
23
+ end
@@ -0,0 +1,12 @@
1
+ require 'test/unit'
2
+ require_relative '../lib/pongal/faker'
3
+
4
+ class TestFaker < Test::Unit::TestCase
5
+
6
+ def test_generate_random_us_state
7
+ state = Pongal::Faker.state
8
+
9
+ assert_send([Pongal::Faker::STATES, :member?, state])
10
+ end
11
+
12
+ end
metadata ADDED
@@ -0,0 +1,54 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pongal
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Bala Paranj
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-06-22 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Pongal is a valid US state generator that can be used in Geocoding applications.
14
+ email: support@zepho.com
15
+ executables:
16
+ - pongal
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - CHANGELOG.md
21
+ - LICENSE.md
22
+ - README.md
23
+ - bin/pongal
24
+ - lib/pongal/faker.rb
25
+ - lib/pongal/runner.rb
26
+ - lib/pongal/version.rb
27
+ - pongal.gemspec
28
+ - test/test_state.rb
29
+ homepage: http://rubyplus.com/
30
+ licenses:
31
+ - MIT
32
+ metadata: {}
33
+ post_install_message:
34
+ rdoc_options: []
35
+ require_paths:
36
+ - lib
37
+ required_ruby_version: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ required_rubygems_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 1.3.5
47
+ requirements: []
48
+ rubyforge_project:
49
+ rubygems_version: 2.4.6
50
+ signing_key:
51
+ specification_version: 4
52
+ summary: Pongal is a simple gem for generating a valid random US state.
53
+ test_files:
54
+ - test/test_state.rb