Permalink
Browse files

Renamed gem.

  • Loading branch information...
0 parents commit 6a04f65b5630296a6645de15219ddc1c9aaabd39 Rian Rainey committed Mar 22, 2013
Showing with 130 additions and 0 deletions.
  1. +17 −0 .gitignore
  2. +4 −0 Gemfile
  3. +22 −0 LICENSE.txt
  4. +30 −0 README.md
  5. +1 −0 Rakefile
  6. +29 −0 lib/square-charger.rb
  7. +5 −0 lib/square-charger/version.rb
  8. +22 −0 square-charger.gemspec
@@ -0,0 +1,17 @@
+*.gem
+*.rbc
+.bundle
+.config
+.yardoc
+Gemfile.lock
+InstalledFiles
+_yardoc
+coverage
+doc/
+lib/bundler/man
+pkg
+rdoc
+spec/reports
+test/tmp
+test/version_tmp
+tmp
@@ -0,0 +1,4 @@
+source 'https://rubygems.org'
+
+# Specify your gem's dependencies in square-charger.gemspec
+gemspec
@@ -0,0 +1,22 @@
+Copyright (c) 2013 Rian Rainey
+
+MIT License
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,30 @@
+# SquareCharger
+
+Square Charger determines the amount of money to charge a customer to ensure you get the amount owed after Square takes their fees. Square charges variable fees based largely on the presence of the customer's credit card and can be burdensome. This gems helps alleviate that pain.
+
+## Installation
+
+Add this line to your application's Gemfile:
+
+ gem 'square-charger'
+
+And then execute:
+
+ $ bundle
+
+Or install it yourself as:
+
+ $ gem install square-charger
+
+## Usage
+
+TODO: Write usage instructions here
+
+## Contributing
+
+1. Fork it
+2. Create your feature branch (`git checkout -b my-new-feature`)
+3. Commit your changes (`git commit -am 'Add some feature'`)
+4. Push to the branch (`git push origin my-new-feature`)
+5. Create new Pull Request
+
@@ -0,0 +1 @@
+require "bundler/gem_tasks"
@@ -0,0 +1,29 @@
+require "square-charger/version"
+
+puts "--------------------------------------"
+puts "---Welcome to the Square Calculator---"
+puts "--------------------------------------"
+
+# Output commas in large numbers
+def comma_numbers(number, delimiter = ',')
+ number.to_s.reverse.gsub(%r{([0-9]{3}(?=([0-9])))}, "\\1#{delimiter}").reverse
+end
+
+# Get Amount Owed
+puts "\tHow much do you want to get paid?"
+amount = gets.chomp # Read in from command line
+
+# Is CC Present
+puts "\tIs the credit card physically present? Enter Y or N"
+ccPresent = gets.chomp
+
+if ccPresent.downcase == "y" # CC is Present
+ transactionFee = 0.0275
+ total = amount.to_i / (1 - transactionFee)
+else # CC is Absent
+ transactionFee = 0.035
+ fixedFee = 0.15
+ total = (amount.to_i + fixedFee) / (1 - transactionFee)
+end
+
+puts "The total amount to charge is: $#{ comma_numbers(total.round(2)) }"
@@ -0,0 +1,5 @@
+module Square
+ module Charger
+ VERSION = "0.0.1"
+ end
+end
@@ -0,0 +1,22 @@
+# -*- encoding: utf-8 -*-
+lib = File.expand_path('../lib', __FILE__)
+$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
+require 'square-charger/version'
+
+Gem::Specification.new do |gem|
+ gem.name = "square-charger"
+ gem.version = Square::Charger::VERSION
+ gem.authors = ["Rian Rainey"]
+ gem.email = ["rian@rianrainey.com"]
+ gem.description = %q{Calculate amount to charge customers to ensure you get the amount owed after Square takes their fees.}
+ gem.summary = %q{Square Charger determines the amount of money to charge a customer to ensure you
+ get the amount owed after Square takes their fees. Square charges variable fees
+ based largely on the presence of the customer's credit card and can be burdensome.
+ This gems helps alleviate that pain.}
+ gem.homepage = "https://github.com/rianrainey/Square-Charger"
+
+ gem.files = `git ls-files`.split($/)
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
+ gem.require_paths = ["lib"]
+end

0 comments on commit 6a04f65

Please sign in to comment.