fizz_buzz 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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1f1ceadaec7c346d2238cd0ec9f6ad0fde0166ce
4
+ data.tar.gz: 2a12c3f344e401277db610aea13ee73f0403a7fe
5
+ SHA512:
6
+ metadata.gz: c8c0fd1a54c8167f93be8bd31b26cdc52f527fc72054b8652f139b388eb4990a1eb585a72403506f568321753d24a47d9aa4351dca2e6b00361870c8f51803a3
7
+ data.tar.gz: 9bf60466d2f6024863d4ac548600da23f7b35ac4c02b63d43a75caf8ac48809b5714604141ec9c1566623cc955f851aba13ba8db282f42d7b38b9186665f047a
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in fizz_buzz.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Mike Enriquez
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # FizzBuzz
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'fizz_buzz'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install fizz_buzz
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it ( http://github.com/<my-github-username>/fizz_buzz/fork )
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/fizzbuzz ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'fizz_buzz'
4
+
5
+ num = ARGV[0]
6
+
7
+ puts FizzBuzz::Fizzer.fizz num.to_i
data/fizz_buzz.gemspec ADDED
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'fizz_buzz/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "fizz_buzz"
8
+ spec.version = FizzBuzz::VERSION
9
+ spec.authors = ["Mike Enriquez", "Charlotte Chang", "Aaron Campbell"]
10
+ spec.email = ["mike@enriquez.me", "charlottechang.ny@gmail.com", "aaronthefff@gmail.com"]
11
+ spec.summary = "solves fizzbuzz"
12
+ spec.description = "created with love from Cleveland Ruby Brigade"
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.5"
22
+ spec.add_development_dependency "rake"
23
+
24
+ spec.add_development_dependency "rspec"
25
+ end
data/lib/fizz_buzz.rb ADDED
@@ -0,0 +1,5 @@
1
+ require "fizz_buzz/version"
2
+ require 'fizzer'
3
+ module FizzBuzz
4
+ # Your code goes here...
5
+ end
@@ -0,0 +1,3 @@
1
+ module FizzBuzz
2
+ VERSION = "0.0.1"
3
+ end
data/lib/fizzer.rb ADDED
@@ -0,0 +1,17 @@
1
+ module FizzBuzz
2
+ class Fizzer
3
+
4
+ def self.fizz num
5
+ if num % 15 == 0
6
+ "fizzbuzz"
7
+ elsif num % 3 == 0
8
+ "fizz"
9
+ elsif num % 5 == 0
10
+ "buzz"
11
+ else
12
+ num
13
+ end
14
+ end
15
+
16
+ end
17
+ end
@@ -0,0 +1,38 @@
1
+ require 'rspec'
2
+ require 'fizzer'
3
+
4
+ describe 'FizzBuzz::Fizzer' do
5
+
6
+ describe ".fizz" do
7
+
8
+ it "returns fizz if input is 3" do
9
+ expect(FizzBuzz::Fizzer.fizz(3)).to eq('fizz')
10
+ end
11
+
12
+ it "returns fizz if input is 6" do
13
+ expect(FizzBuzz::Fizzer.fizz(6)).to eq('fizz')
14
+ end
15
+
16
+ it "returns 4 if input is 4" do
17
+ expect(FizzBuzz::Fizzer.fizz(4)).to eq(4)
18
+ end
19
+
20
+ it "returns 1 if input is 1" do
21
+ expect(FizzBuzz::Fizzer.fizz(1)).to eq(1)
22
+ end
23
+
24
+ it "returns 2 if input is 2" do
25
+ expect(FizzBuzz::Fizzer.fizz(2)).to eq(2)
26
+ end
27
+
28
+ it "returns buzz if input is 5" do
29
+ expect(FizzBuzz::Fizzer.fizz(5)).to eq('buzz')
30
+ end
31
+
32
+ it "returns fizzbuzz if input is 15" do
33
+ expect(FizzBuzz::Fizzer.fizz(15)).to eq('fizzbuzz')
34
+ end
35
+
36
+ end
37
+
38
+ end
metadata ADDED
@@ -0,0 +1,103 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fizz_buzz
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Mike Enriquez
8
+ - Charlotte Chang
9
+ - Aaron Campbell
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2014-10-02 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: bundler
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - "~>"
20
+ - !ruby/object:Gem::Version
21
+ version: '1.5'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - "~>"
27
+ - !ruby/object:Gem::Version
28
+ version: '1.5'
29
+ - !ruby/object:Gem::Dependency
30
+ name: rake
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ type: :development
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ - !ruby/object:Gem::Dependency
44
+ name: rspec
45
+ requirement: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ type: :development
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ description: created with love from Cleveland Ruby Brigade
58
+ email:
59
+ - mike@enriquez.me
60
+ - charlottechang.ny@gmail.com
61
+ - aaronthefff@gmail.com
62
+ executables:
63
+ - fizzbuzz
64
+ extensions: []
65
+ extra_rdoc_files: []
66
+ files:
67
+ - ".gitignore"
68
+ - Gemfile
69
+ - LICENSE.txt
70
+ - README.md
71
+ - Rakefile
72
+ - bin/fizzbuzz
73
+ - fizz_buzz.gemspec
74
+ - lib/fizz_buzz.rb
75
+ - lib/fizz_buzz/version.rb
76
+ - lib/fizzer.rb
77
+ - spec/fizz_buzz_spec.rb
78
+ homepage: ''
79
+ licenses:
80
+ - MIT
81
+ metadata: {}
82
+ post_install_message:
83
+ rdoc_options: []
84
+ require_paths:
85
+ - lib
86
+ required_ruby_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ required_rubygems_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ requirements: []
97
+ rubyforge_project:
98
+ rubygems_version: 2.2.2
99
+ signing_key:
100
+ specification_version: 4
101
+ summary: solves fizzbuzz
102
+ test_files:
103
+ - spec/fizz_buzz_spec.rb