income-tax 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (718) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +4 -0
  3. data/Gemfile +11 -0
  4. data/Gemfile.lock +60 -0
  5. data/LICENSE +22 -0
  6. data/income-tax.gemspec +12 -0
  7. data/lib/income-tax.rb +1 -0
  8. data/lib/income_tax/countries/afghanistan.rb +10 -0
  9. data/lib/income_tax/countries/aland.rb +10 -0
  10. data/lib/income_tax/countries/albania.rb +12 -0
  11. data/lib/income_tax/countries/algeria.rb +13 -0
  12. data/lib/income_tax/countries/american_samoa.rb +10 -0
  13. data/lib/income_tax/countries/andorra.rb +9 -0
  14. data/lib/income_tax/countries/angola.rb +23 -0
  15. data/lib/income_tax/countries/anguilla.rb +8 -0
  16. data/lib/income_tax/countries/antigua_and_barbuda.rb +11 -0
  17. data/lib/income_tax/countries/argentina.rb +16 -0
  18. data/lib/income_tax/countries/armenia.rb +11 -0
  19. data/lib/income_tax/countries/aruba.rb +23 -0
  20. data/lib/income_tax/countries/australia.rb +32 -0
  21. data/lib/income_tax/countries/austria.rb +14 -0
  22. data/lib/income_tax/countries/azerbaijan.rb +11 -0
  23. data/lib/income_tax/countries/bahamas.rb +8 -0
  24. data/lib/income_tax/countries/bahrain.rb +8 -0
  25. data/lib/income_tax/countries/bangladesh.rb +42 -0
  26. data/lib/income_tax/countries/barbados.rb +28 -0
  27. data/lib/income_tax/countries/belarus.rb +9 -0
  28. data/lib/income_tax/countries/belgium.rb +14 -0
  29. data/lib/income_tax/countries/belize.rb +11 -0
  30. data/lib/income_tax/countries/benin.rb +13 -0
  31. data/lib/income_tax/countries/bermuda.rb +8 -0
  32. data/lib/income_tax/countries/bhutan.rb +14 -0
  33. data/lib/income_tax/countries/bolivia.rb +9 -0
  34. data/lib/income_tax/countries/bosnia_and_herzegovina.rb +9 -0
  35. data/lib/income_tax/countries/botswana.rb +11 -0
  36. data/lib/income_tax/countries/bouvet_island.rb +10 -0
  37. data/lib/income_tax/countries/brazil.rb +14 -0
  38. data/lib/income_tax/countries/british_indian_ocean_territory.rb +10 -0
  39. data/lib/income_tax/countries/brunei.rb +8 -0
  40. data/lib/income_tax/countries/bulgaria.rb +9 -0
  41. data/lib/income_tax/countries/burkina_faso.rb +16 -0
  42. data/lib/income_tax/countries/burundi.rb +12 -0
  43. data/lib/income_tax/countries/cambodia.rb +14 -0
  44. data/lib/income_tax/countries/cameroon.rb +13 -0
  45. data/lib/income_tax/countries/canada.rb +13 -0
  46. data/lib/income_tax/countries/cape_verde.rb +14 -0
  47. data/lib/income_tax/countries/caribbean_netherlands.rb +15 -0
  48. data/lib/income_tax/countries/cayman_islands.rb +8 -0
  49. data/lib/income_tax/countries/central_african_republic.rb +11 -0
  50. data/lib/income_tax/countries/chad.rb +17 -0
  51. data/lib/income_tax/countries/chile.rb +20 -0
  52. data/lib/income_tax/countries/china.rb +17 -0
  53. data/lib/income_tax/countries/christmas_island.rb +8 -0
  54. data/lib/income_tax/countries/cocos_keeling_islands.rb +8 -0
  55. data/lib/income_tax/countries/colombia.rb +14 -0
  56. data/lib/income_tax/countries/comoros.rb +16 -0
  57. data/lib/income_tax/countries/congo.rb +9 -0
  58. data/lib/income_tax/countries/congo_republic.rb +14 -0
  59. data/lib/income_tax/countries/cook_islands.rb +13 -0
  60. data/lib/income_tax/countries/costa_rica.rb +30 -0
  61. data/lib/income_tax/countries/croatia.rb +12 -0
  62. data/lib/income_tax/countries/cuba.rb +12 -0
  63. data/lib/income_tax/countries/curacao.rb +15 -0
  64. data/lib/income_tax/countries/cyprus.rb +14 -0
  65. data/lib/income_tax/countries/czech_republic.rb +9 -0
  66. data/lib/income_tax/countries/denmark.rb +12 -0
  67. data/lib/income_tax/countries/djibouti.rb +14 -0
  68. data/lib/income_tax/countries/dominica.rb +13 -0
  69. data/lib/income_tax/countries/dominican_republic.rb +13 -0
  70. data/lib/income_tax/countries/ecuador.rb +18 -0
  71. data/lib/income_tax/countries/egypt.rb +14 -0
  72. data/lib/income_tax/countries/el_salvador.rb +9 -0
  73. data/lib/income_tax/countries/equatorial_guinea.rb +16 -0
  74. data/lib/income_tax/countries/eritrea.rb +9 -0
  75. data/lib/income_tax/countries/estonia.rb +9 -0
  76. data/lib/income_tax/countries/ethiopia.rb +16 -0
  77. data/lib/income_tax/countries/falkland_islands.rb +12 -0
  78. data/lib/income_tax/countries/faroe_islands.rb +9 -0
  79. data/lib/income_tax/countries/fiji.rb +20 -0
  80. data/lib/income_tax/countries/finland.rb +14 -0
  81. data/lib/income_tax/countries/france.rb +34 -0
  82. data/lib/income_tax/countries/french_guiana.rb +8 -0
  83. data/lib/income_tax/countries/french_polynesia.rb +8 -0
  84. data/lib/income_tax/countries/french_southern_territories.rb +8 -0
  85. data/lib/income_tax/countries/gabon.rb +17 -0
  86. data/lib/income_tax/countries/gambia.rb +15 -0
  87. data/lib/income_tax/countries/georgia.rb +9 -0
  88. data/lib/income_tax/countries/germany.rb +58 -0
  89. data/lib/income_tax/countries/ghana.rb +14 -0
  90. data/lib/income_tax/countries/gibraltar.rb +15 -0
  91. data/lib/income_tax/countries/greece.rb +11 -0
  92. data/lib/income_tax/countries/greenland.rb +9 -0
  93. data/lib/income_tax/countries/grenada.rb +11 -0
  94. data/lib/income_tax/countries/guadeloupe.rb +14 -0
  95. data/lib/income_tax/countries/guam.rb +10 -0
  96. data/lib/income_tax/countries/guatemala.rb +13 -0
  97. data/lib/income_tax/countries/guernsey.rb +9 -0
  98. data/lib/income_tax/countries/guinea.rb +13 -0
  99. data/lib/income_tax/countries/guinea_bissau.rb +9 -0
  100. data/lib/income_tax/countries/guyana.rb +11 -0
  101. data/lib/income_tax/countries/haiti.rb +9 -0
  102. data/lib/income_tax/countries/heard_and_mcdonald_islands.rb +8 -0
  103. data/lib/income_tax/countries/honduras.rb +9 -0
  104. data/lib/income_tax/countries/hong_kong.rb +15 -0
  105. data/lib/income_tax/countries/hungary.rb +9 -0
  106. data/lib/income_tax/countries/iceland.rb +12 -0
  107. data/lib/income_tax/countries/india.rb +14 -0
  108. data/lib/income_tax/countries/indonesia.rb +14 -0
  109. data/lib/income_tax/countries/iran.rb +14 -0
  110. data/lib/income_tax/countries/iraq.rb +9 -0
  111. data/lib/income_tax/countries/ireland.rb +24 -0
  112. data/lib/income_tax/countries/isle_of_man.rb +11 -0
  113. data/lib/income_tax/countries/israel.rb +16 -0
  114. data/lib/income_tax/countries/italy.rb +14 -0
  115. data/lib/income_tax/countries/ivory_coast.rb +14 -0
  116. data/lib/income_tax/countries/jamaica.rb +11 -0
  117. data/lib/income_tax/countries/japan.rb +15 -0
  118. data/lib/income_tax/countries/jersey.rb +9 -0
  119. data/lib/income_tax/countries/jordan.rb +14 -0
  120. data/lib/income_tax/countries/kazakhstan.rb +9 -0
  121. data/lib/income_tax/countries/kenya.rb +14 -0
  122. data/lib/income_tax/countries/kiribati.rb +9 -0
  123. data/lib/income_tax/countries/kosovo.rb +13 -0
  124. data/lib/income_tax/countries/kuwait.rb +8 -0
  125. data/lib/income_tax/countries/kyrgyzstan.rb +9 -0
  126. data/lib/income_tax/countries/laos.rb +15 -0
  127. data/lib/income_tax/countries/latvia.rb +9 -0
  128. data/lib/income_tax/countries/lebanon.rb +15 -0
  129. data/lib/income_tax/countries/lesotho.rb +13 -0
  130. data/lib/income_tax/countries/liberia.rb +13 -0
  131. data/lib/income_tax/countries/libya.rb +12 -0
  132. data/lib/income_tax/countries/liechtenstein.rb +9 -0
  133. data/lib/income_tax/countries/lithuania.rb +9 -0
  134. data/lib/income_tax/countries/luxembourg.rb +33 -0
  135. data/lib/income_tax/countries/macao.rb +19 -0
  136. data/lib/income_tax/countries/macedonia.rb +9 -0
  137. data/lib/income_tax/countries/madagascar.rb +11 -0
  138. data/lib/income_tax/countries/malawi.rb +12 -0
  139. data/lib/income_tax/countries/malaysia.rb +18 -0
  140. data/lib/income_tax/countries/maldives.rb +8 -0
  141. data/lib/income_tax/countries/mali.rb +9 -0
  142. data/lib/income_tax/countries/malta.rb +36 -0
  143. data/lib/income_tax/countries/marshall_islands.rb +11 -0
  144. data/lib/income_tax/countries/martinique.rb +14 -0
  145. data/lib/income_tax/countries/mauritania.rb +12 -0
  146. data/lib/income_tax/countries/mauritius.rb +9 -0
  147. data/lib/income_tax/countries/mayotte.rb +8 -0
  148. data/lib/income_tax/countries/mexico.rb +20 -0
  149. data/lib/income_tax/countries/micronesia.rb +9 -0
  150. data/lib/income_tax/countries/moldova.rb +13 -0
  151. data/lib/income_tax/countries/monaco.rb +9 -0
  152. data/lib/income_tax/countries/mongolia.rb +9 -0
  153. data/lib/income_tax/countries/montenegro.rb +11 -0
  154. data/lib/income_tax/countries/montserrat.rb +14 -0
  155. data/lib/income_tax/countries/morocco.rb +15 -0
  156. data/lib/income_tax/countries/mozambique.rb +14 -0
  157. data/lib/income_tax/countries/myanmar.rb +15 -0
  158. data/lib/income_tax/countries/namibia.rb +16 -0
  159. data/lib/income_tax/countries/nauru.rb +8 -0
  160. data/lib/income_tax/countries/nepal.rb +28 -0
  161. data/lib/income_tax/countries/netherlands.rb +13 -0
  162. data/lib/income_tax/countries/netherlands_antilles.rb +15 -0
  163. data/lib/income_tax/countries/new_caledonia.rb +14 -0
  164. data/lib/income_tax/countries/new_zealand.rb +13 -0
  165. data/lib/income_tax/countries/nicaragua.rb +32 -0
  166. data/lib/income_tax/countries/niger.rb +16 -0
  167. data/lib/income_tax/countries/nigeria.rb +15 -0
  168. data/lib/income_tax/countries/niue.rb +13 -0
  169. data/lib/income_tax/countries/norfolk_island.rb +9 -0
  170. data/lib/income_tax/countries/north_korea.rb +8 -0
  171. data/lib/income_tax/countries/northern_mariana_islands.rb +10 -0
  172. data/lib/income_tax/countries/norway.rb +13 -0
  173. data/lib/income_tax/countries/oman.rb +8 -0
  174. data/lib/income_tax/countries/pakistan.rb +21 -0
  175. data/lib/income_tax/countries/palau.rb +12 -0
  176. data/lib/income_tax/countries/palestinian_territory.rb +15 -0
  177. data/lib/income_tax/countries/panama.rb +12 -0
  178. data/lib/income_tax/countries/papua_new_guinea.rb +15 -0
  179. data/lib/income_tax/countries/paraguay.rb +9 -0
  180. data/lib/income_tax/countries/peru.rb +11 -0
  181. data/lib/income_tax/countries/philippines.rb +16 -0
  182. data/lib/income_tax/countries/pitcairn.rb +12 -0
  183. data/lib/income_tax/countries/poland.rb +12 -0
  184. data/lib/income_tax/countries/portugal.rb +14 -0
  185. data/lib/income_tax/countries/puerto_rico.rb +9 -0
  186. data/lib/income_tax/countries/qatar.rb +8 -0
  187. data/lib/income_tax/countries/reunion.rb +8 -0
  188. data/lib/income_tax/countries/romania.rb +9 -0
  189. data/lib/income_tax/countries/russia.rb +9 -0
  190. data/lib/income_tax/countries/rwanda.rb +12 -0
  191. data/lib/income_tax/countries/saint_barthelemy.rb +8 -0
  192. data/lib/income_tax/countries/saint_helena.rb +9 -0
  193. data/lib/income_tax/countries/saint_kitts_and_nevis.rb +8 -0
  194. data/lib/income_tax/countries/saint_lucia.rb +14 -0
  195. data/lib/income_tax/countries/saint_martin.rb +14 -0
  196. data/lib/income_tax/countries/saint_pierre_and_miquelon.rb +21 -0
  197. data/lib/income_tax/countries/saint_vincent_and_the_grenedines.rb +13 -0
  198. data/lib/income_tax/countries/samoa.rb +13 -0
  199. data/lib/income_tax/countries/san_marino.rb +17 -0
  200. data/lib/income_tax/countries/sao_tome_and_principe.rb +9 -0
  201. data/lib/income_tax/countries/saudi_arabia.rb +8 -0
  202. data/lib/income_tax/countries/senegal.rb +19 -0
  203. data/lib/income_tax/countries/serbia.rb +13 -0
  204. data/lib/income_tax/countries/seychelles.rb +9 -0
  205. data/lib/income_tax/countries/sierra_leone.rb +13 -0
  206. data/lib/income_tax/countries/singapore.rb +43 -0
  207. data/lib/income_tax/countries/sint_maarten.rb +15 -0
  208. data/lib/income_tax/countries/slovakia.rb +11 -0
  209. data/lib/income_tax/countries/slovenia.rb +13 -0
  210. data/lib/income_tax/countries/solomon_islands.rb +16 -0
  211. data/lib/income_tax/countries/somalia.rb +15 -0
  212. data/lib/income_tax/countries/south_africa.rb +15 -0
  213. data/lib/income_tax/countries/south_georgia_and_the_south_sandwich_islands.rb +10 -0
  214. data/lib/income_tax/countries/south_korea.rb +13 -0
  215. data/lib/income_tax/countries/south_sudan.rb +12 -0
  216. data/lib/income_tax/countries/spain.rb +14 -0
  217. data/lib/income_tax/countries/sri_lanka.rb +9 -0
  218. data/lib/income_tax/countries/sudan.rb +9 -0
  219. data/lib/income_tax/countries/suriname.rb +14 -0
  220. data/lib/income_tax/countries/svalbard_and_jan_mayen.rb +9 -0
  221. data/lib/income_tax/countries/swaziland.rb +9 -0
  222. data/lib/income_tax/countries/sweden.rb +12 -0
  223. data/lib/income_tax/countries/switzerland/aargau.rb +12 -0
  224. data/lib/income_tax/countries/switzerland/appenzell_inner.rb +12 -0
  225. data/lib/income_tax/countries/switzerland/appenzell_outer.rb +11 -0
  226. data/lib/income_tax/countries/switzerland/basel_city.rb +11 -0
  227. data/lib/income_tax/countries/switzerland/basel_land.rb +11 -0
  228. data/lib/income_tax/countries/switzerland/bern.rb +10 -0
  229. data/lib/income_tax/countries/switzerland/canton.rb +36 -0
  230. data/lib/income_tax/countries/switzerland/data/aargau.dat +0 -0
  231. data/lib/income_tax/countries/switzerland/data/appenzell_inner.dat +0 -0
  232. data/lib/income_tax/countries/switzerland/data/appenzell_outer.dat +0 -0
  233. data/lib/income_tax/countries/switzerland/data/basel_city.dat +0 -0
  234. data/lib/income_tax/countries/switzerland/data/basel_land.dat +0 -0
  235. data/lib/income_tax/countries/switzerland/data/bern.dat +0 -0
  236. data/lib/income_tax/countries/switzerland/data/fribourg.dat +0 -0
  237. data/lib/income_tax/countries/switzerland/data/geneva.dat +0 -0
  238. data/lib/income_tax/countries/switzerland/data/glarus.dat +0 -0
  239. data/lib/income_tax/countries/switzerland/data/grisons.dat +0 -0
  240. data/lib/income_tax/countries/switzerland/data/jura.dat +0 -0
  241. data/lib/income_tax/countries/switzerland/data/lucerne.dat +0 -0
  242. data/lib/income_tax/countries/switzerland/data/neuchatel.dat +0 -0
  243. data/lib/income_tax/countries/switzerland/data/nidwalden.dat +0 -0
  244. data/lib/income_tax/countries/switzerland/data/obwalden.dat +0 -0
  245. data/lib/income_tax/countries/switzerland/data/schaffhausen.dat +0 -0
  246. data/lib/income_tax/countries/switzerland/data/schwyz.dat +0 -0
  247. data/lib/income_tax/countries/switzerland/data/solothurn.dat +0 -0
  248. data/lib/income_tax/countries/switzerland/data/st_gallen.dat +0 -0
  249. data/lib/income_tax/countries/switzerland/data/thurgau.dat +0 -0
  250. data/lib/income_tax/countries/switzerland/data/ticino.dat +0 -0
  251. data/lib/income_tax/countries/switzerland/data/uri.dat +0 -0
  252. data/lib/income_tax/countries/switzerland/data/valais.dat +0 -0
  253. data/lib/income_tax/countries/switzerland/data/vaud.dat +0 -0
  254. data/lib/income_tax/countries/switzerland/data/zug.dat +0 -0
  255. data/lib/income_tax/countries/switzerland/data/zurich.dat +0 -0
  256. data/lib/income_tax/countries/switzerland/federal.rb +46 -0
  257. data/lib/income_tax/countries/switzerland/fribourg.rb +11 -0
  258. data/lib/income_tax/countries/switzerland/geneva.rb +12 -0
  259. data/lib/income_tax/countries/switzerland/glarus.rb +12 -0
  260. data/lib/income_tax/countries/switzerland/grisons.rb +11 -0
  261. data/lib/income_tax/countries/switzerland/jura.rb +11 -0
  262. data/lib/income_tax/countries/switzerland/lucerne.rb +11 -0
  263. data/lib/income_tax/countries/switzerland/neuchatel.rb +12 -0
  264. data/lib/income_tax/countries/switzerland/nidwalden.rb +11 -0
  265. data/lib/income_tax/countries/switzerland/obwalden.rb +11 -0
  266. data/lib/income_tax/countries/switzerland/schaffhausen.rb +12 -0
  267. data/lib/income_tax/countries/switzerland/schwyz.rb +11 -0
  268. data/lib/income_tax/countries/switzerland/solothurn.rb +12 -0
  269. data/lib/income_tax/countries/switzerland/st_gallen.rb +12 -0
  270. data/lib/income_tax/countries/switzerland/thurgau.rb +12 -0
  271. data/lib/income_tax/countries/switzerland/ticino.rb +11 -0
  272. data/lib/income_tax/countries/switzerland/uri.rb +11 -0
  273. data/lib/income_tax/countries/switzerland/valais.rb +10 -0
  274. data/lib/income_tax/countries/switzerland/vaud.rb +11 -0
  275. data/lib/income_tax/countries/switzerland/zug.rb +12 -0
  276. data/lib/income_tax/countries/switzerland/zurich.rb +12 -0
  277. data/lib/income_tax/countries/switzerland.rb +62 -0
  278. data/lib/income_tax/countries/syria.rb +12 -0
  279. data/lib/income_tax/countries/taiwan.rb +14 -0
  280. data/lib/income_tax/countries/tajikistan.rb +13 -0
  281. data/lib/income_tax/countries/tanzania.rb +53 -0
  282. data/lib/income_tax/countries/thailand.rb +17 -0
  283. data/lib/income_tax/countries/timor_leste.rb +11 -0
  284. data/lib/income_tax/countries/togo.rb +9 -0
  285. data/lib/income_tax/countries/tokelau.rb +15 -0
  286. data/lib/income_tax/countries/tonga.rb +12 -0
  287. data/lib/income_tax/countries/trinidad_and_tobago.rb +11 -0
  288. data/lib/income_tax/countries/tunisia.rb +15 -0
  289. data/lib/income_tax/countries/turkey.rb +13 -0
  290. data/lib/income_tax/countries/turkmenistan.rb +9 -0
  291. data/lib/income_tax/countries/turks_and_caicos_islands.rb +8 -0
  292. data/lib/income_tax/countries/tuvalu.rb +9 -0
  293. data/lib/income_tax/countries/uganda.rb +13 -0
  294. data/lib/income_tax/countries/ukraine.rb +9 -0
  295. data/lib/income_tax/countries/united_arab_emirates.rb +8 -0
  296. data/lib/income_tax/countries/united_kingdom.rb +13 -0
  297. data/lib/income_tax/countries/united_states/alabama.rb +24 -0
  298. data/lib/income_tax/countries/united_states/alaska.rb +10 -0
  299. data/lib/income_tax/countries/united_states/arizona.rb +29 -0
  300. data/lib/income_tax/countries/united_states/arkansas.rb +29 -0
  301. data/lib/income_tax/countries/united_states/california.rb +39 -0
  302. data/lib/income_tax/countries/united_states/colorado.rb +10 -0
  303. data/lib/income_tax/countries/united_states/connecticut.rb +31 -0
  304. data/lib/income_tax/countries/united_states/dc.rb +16 -0
  305. data/lib/income_tax/countries/united_states/delaware.rb +31 -0
  306. data/lib/income_tax/countries/united_states/federal.rb +40 -0
  307. data/lib/income_tax/countries/united_states/florida.rb +10 -0
  308. data/lib/income_tax/countries/united_states/georgia.rb +32 -0
  309. data/lib/income_tax/countries/united_states/hawaii.rb +43 -0
  310. data/lib/income_tax/countries/united_states/idaho.rb +34 -0
  311. data/lib/income_tax/countries/united_states/illinois.rb +10 -0
  312. data/lib/income_tax/countries/united_states/indiana.rb +10 -0
  313. data/lib/income_tax/countries/united_states/iowa.rb +39 -0
  314. data/lib/income_tax/countries/united_states/kansas.rb +23 -0
  315. data/lib/income_tax/countries/united_states/kentucky.rb +31 -0
  316. data/lib/income_tax/countries/united_states/louisiana.rb +26 -0
  317. data/lib/income_tax/countries/united_states/maine.rb +23 -0
  318. data/lib/income_tax/countries/united_states/maryland.rb +35 -0
  319. data/lib/income_tax/countries/united_states/massachusetts.rb +10 -0
  320. data/lib/income_tax/countries/united_states/michigan.rb +10 -0
  321. data/lib/income_tax/countries/united_states/minnesota.rb +27 -0
  322. data/lib/income_tax/countries/united_states/mississippi.rb +25 -0
  323. data/lib/income_tax/countries/united_states/missouri.rb +40 -0
  324. data/lib/income_tax/countries/united_states/montana.rb +34 -0
  325. data/lib/income_tax/countries/united_states/nebraska.rb +27 -0
  326. data/lib/income_tax/countries/united_states/nevada.rb +10 -0
  327. data/lib/income_tax/countries/united_states/new_hampshire.rb +10 -0
  328. data/lib/income_tax/countries/united_states/new_jersey.rb +32 -0
  329. data/lib/income_tax/countries/united_states/new_mexico.rb +27 -0
  330. data/lib/income_tax/countries/united_states/new_york.rb +35 -0
  331. data/lib/income_tax/countries/united_states/north_carolina.rb +10 -0
  332. data/lib/income_tax/countries/united_states/north_dakota.rb +17 -0
  333. data/lib/income_tax/countries/united_states/ohio.rb +37 -0
  334. data/lib/income_tax/countries/united_states/oklahoma.rb +33 -0
  335. data/lib/income_tax/countries/united_states/oregon.rb +28 -0
  336. data/lib/income_tax/countries/united_states/pennsylvania.rb +10 -0
  337. data/lib/income_tax/countries/united_states/rhode_island.rb +25 -0
  338. data/lib/income_tax/countries/united_states/south_carolina.rb +17 -0
  339. data/lib/income_tax/countries/united_states/south_dakota.rb +10 -0
  340. data/lib/income_tax/countries/united_states/state.rb +34 -0
  341. data/lib/income_tax/countries/united_states/tennessee.rb +10 -0
  342. data/lib/income_tax/countries/united_states/texas.rb +10 -0
  343. data/lib/income_tax/countries/united_states/utah.rb +10 -0
  344. data/lib/income_tax/countries/united_states/vermont.rb +29 -0
  345. data/lib/income_tax/countries/united_states/virginia.rb +16 -0
  346. data/lib/income_tax/countries/united_states/washington.rb +10 -0
  347. data/lib/income_tax/countries/united_states/west_virginia.rb +29 -0
  348. data/lib/income_tax/countries/united_states/wisconsin.rb +27 -0
  349. data/lib/income_tax/countries/united_states/wyoming.rb +10 -0
  350. data/lib/income_tax/countries/united_states.rb +93 -0
  351. data/lib/income_tax/countries/united_states_minor_outlying_islands.rb +8 -0
  352. data/lib/income_tax/countries/uruguay.rb +16 -0
  353. data/lib/income_tax/countries/uzbekistan.rb +15 -0
  354. data/lib/income_tax/countries/vanuatu.rb +8 -0
  355. data/lib/income_tax/countries/vatican.rb +8 -0
  356. data/lib/income_tax/countries/venezuela.rb +20 -0
  357. data/lib/income_tax/countries/vietnam.rb +17 -0
  358. data/lib/income_tax/countries/virgin_islands_british.rb +9 -0
  359. data/lib/income_tax/countries/virgin_islands_us.rb +8 -0
  360. data/lib/income_tax/countries/wallis_and_futuna.rb +8 -0
  361. data/lib/income_tax/countries/western_sahara.rb +8 -0
  362. data/lib/income_tax/countries/yemen.rb +11 -0
  363. data/lib/income_tax/countries/zambia.rb +13 -0
  364. data/lib/income_tax/countries/zimbabwe.rb +17 -0
  365. data/lib/income_tax/countries.rb +5 -0
  366. data/lib/income_tax/factory.rb +66 -0
  367. data/lib/income_tax/helpers.rb +25 -0
  368. data/lib/income_tax/models/delegate.rb +30 -0
  369. data/lib/income_tax/models/fixed_rate.rb +14 -0
  370. data/lib/income_tax/models/generic.rb +212 -0
  371. data/lib/income_tax/models/no_taxes.rb +7 -0
  372. data/lib/income_tax/models/not_implemented.rb +6 -0
  373. data/lib/income_tax/models/progressive.rb +103 -0
  374. data/lib/income_tax/models.rb +10 -0
  375. data/lib/income_tax/rate.rb +152 -0
  376. data/lib/income_tax/register.rb +35 -0
  377. data/lib/income_tax/version.rb +3 -0
  378. data/lib/income_tax.rb +17 -0
  379. data/locations.md +1763 -0
  380. data/readme.md +137 -0
  381. data/script/generate_switzerland.rb +87 -0
  382. data/spec/income_tax/countries/afghanistan_spec.rb +89 -0
  383. data/spec/income_tax/countries/aland_spec.rb +89 -0
  384. data/spec/income_tax/countries/albania_spec.rb +89 -0
  385. data/spec/income_tax/countries/algeria_spec.rb +89 -0
  386. data/spec/income_tax/countries/american_samoa_spec.rb +89 -0
  387. data/spec/income_tax/countries/andorra_spec.rb +89 -0
  388. data/spec/income_tax/countries/angola_spec.rb +89 -0
  389. data/spec/income_tax/countries/anguilla_spec.rb +89 -0
  390. data/spec/income_tax/countries/antigua_and_barbuda_spec.rb +89 -0
  391. data/spec/income_tax/countries/argentina_spec.rb +89 -0
  392. data/spec/income_tax/countries/armenia_spec.rb +89 -0
  393. data/spec/income_tax/countries/aruba_spec.rb +89 -0
  394. data/spec/income_tax/countries/australia_spec.rb +89 -0
  395. data/spec/income_tax/countries/austria_spec.rb +89 -0
  396. data/spec/income_tax/countries/azerbaijan_spec.rb +89 -0
  397. data/spec/income_tax/countries/bahamas_spec.rb +89 -0
  398. data/spec/income_tax/countries/bahrain_spec.rb +89 -0
  399. data/spec/income_tax/countries/bangladesh_spec.rb +89 -0
  400. data/spec/income_tax/countries/barbados_spec.rb +89 -0
  401. data/spec/income_tax/countries/belarus_spec.rb +89 -0
  402. data/spec/income_tax/countries/belgium_spec.rb +89 -0
  403. data/spec/income_tax/countries/belize_spec.rb +89 -0
  404. data/spec/income_tax/countries/benin_spec.rb +89 -0
  405. data/spec/income_tax/countries/bermuda_spec.rb +89 -0
  406. data/spec/income_tax/countries/bhutan_spec.rb +89 -0
  407. data/spec/income_tax/countries/bolivia_spec.rb +89 -0
  408. data/spec/income_tax/countries/bosnia_and_herzegovina_spec.rb +89 -0
  409. data/spec/income_tax/countries/botswana_spec.rb +89 -0
  410. data/spec/income_tax/countries/bouvet_island_spec.rb +89 -0
  411. data/spec/income_tax/countries/brazil_spec.rb +89 -0
  412. data/spec/income_tax/countries/british_indian_ocean_territory_spec.rb +89 -0
  413. data/spec/income_tax/countries/brunei_spec.rb +89 -0
  414. data/spec/income_tax/countries/bulgaria_spec.rb +89 -0
  415. data/spec/income_tax/countries/burkina_faso_spec.rb +89 -0
  416. data/spec/income_tax/countries/burundi_spec.rb +89 -0
  417. data/spec/income_tax/countries/cambodia_spec.rb +89 -0
  418. data/spec/income_tax/countries/cameroon_spec.rb +89 -0
  419. data/spec/income_tax/countries/canada_spec.rb +89 -0
  420. data/spec/income_tax/countries/cape_verde_spec.rb +89 -0
  421. data/spec/income_tax/countries/caribbean_netherlands_spec.rb +89 -0
  422. data/spec/income_tax/countries/cayman_islands_spec.rb +89 -0
  423. data/spec/income_tax/countries/central_african_republic_spec.rb +89 -0
  424. data/spec/income_tax/countries/chad_spec.rb +89 -0
  425. data/spec/income_tax/countries/chile_spec.rb +89 -0
  426. data/spec/income_tax/countries/china_spec.rb +89 -0
  427. data/spec/income_tax/countries/christmas_island_spec.rb +89 -0
  428. data/spec/income_tax/countries/cocos_keeling_islands_spec.rb +89 -0
  429. data/spec/income_tax/countries/colombia_spec.rb +89 -0
  430. data/spec/income_tax/countries/comoros_spec.rb +89 -0
  431. data/spec/income_tax/countries/congo_republic_spec.rb +89 -0
  432. data/spec/income_tax/countries/congo_spec.rb +89 -0
  433. data/spec/income_tax/countries/cook_islands_spec.rb +89 -0
  434. data/spec/income_tax/countries/costa_rica_spec.rb +89 -0
  435. data/spec/income_tax/countries/croatia_spec.rb +89 -0
  436. data/spec/income_tax/countries/cuba_spec.rb +89 -0
  437. data/spec/income_tax/countries/curacao_spec.rb +89 -0
  438. data/spec/income_tax/countries/cyprus_spec.rb +89 -0
  439. data/spec/income_tax/countries/czech_republic_spec.rb +89 -0
  440. data/spec/income_tax/countries/denmark_spec.rb +89 -0
  441. data/spec/income_tax/countries/djibouti_spec.rb +89 -0
  442. data/spec/income_tax/countries/dominica_spec.rb +89 -0
  443. data/spec/income_tax/countries/dominican_republic_spec.rb +89 -0
  444. data/spec/income_tax/countries/ecuador_spec.rb +89 -0
  445. data/spec/income_tax/countries/egypt_spec.rb +89 -0
  446. data/spec/income_tax/countries/el_salvador_spec.rb +89 -0
  447. data/spec/income_tax/countries/equatorial_guinea_spec.rb +89 -0
  448. data/spec/income_tax/countries/eritrea_spec.rb +89 -0
  449. data/spec/income_tax/countries/estonia_spec.rb +89 -0
  450. data/spec/income_tax/countries/ethiopia_spec.rb +89 -0
  451. data/spec/income_tax/countries/falkland_islands_spec.rb +89 -0
  452. data/spec/income_tax/countries/faroe_islands_spec.rb +89 -0
  453. data/spec/income_tax/countries/fiji_spec.rb +89 -0
  454. data/spec/income_tax/countries/finland_spec.rb +89 -0
  455. data/spec/income_tax/countries/france_spec.rb +89 -0
  456. data/spec/income_tax/countries/french_guiana_spec.rb +89 -0
  457. data/spec/income_tax/countries/french_polynesia_spec.rb +89 -0
  458. data/spec/income_tax/countries/french_southern_territories_spec.rb +89 -0
  459. data/spec/income_tax/countries/gabon_spec.rb +89 -0
  460. data/spec/income_tax/countries/gambia_spec.rb +89 -0
  461. data/spec/income_tax/countries/georgia_spec.rb +89 -0
  462. data/spec/income_tax/countries/germany_spec.rb +89 -0
  463. data/spec/income_tax/countries/ghana_spec.rb +89 -0
  464. data/spec/income_tax/countries/gibraltar_spec.rb +89 -0
  465. data/spec/income_tax/countries/greece_spec.rb +89 -0
  466. data/spec/income_tax/countries/greenland_spec.rb +89 -0
  467. data/spec/income_tax/countries/grenada_spec.rb +89 -0
  468. data/spec/income_tax/countries/guadeloupe_spec.rb +89 -0
  469. data/spec/income_tax/countries/guam_spec.rb +89 -0
  470. data/spec/income_tax/countries/guatemala_spec.rb +89 -0
  471. data/spec/income_tax/countries/guernsey_spec.rb +89 -0
  472. data/spec/income_tax/countries/guinea_bissau_spec.rb +89 -0
  473. data/spec/income_tax/countries/guinea_spec.rb +89 -0
  474. data/spec/income_tax/countries/guyana_spec.rb +89 -0
  475. data/spec/income_tax/countries/haiti_spec.rb +89 -0
  476. data/spec/income_tax/countries/heard_and_mcdonald_islands_spec.rb +89 -0
  477. data/spec/income_tax/countries/honduras_spec.rb +89 -0
  478. data/spec/income_tax/countries/hong_kong_spec.rb +89 -0
  479. data/spec/income_tax/countries/hungary_spec.rb +89 -0
  480. data/spec/income_tax/countries/iceland_spec.rb +89 -0
  481. data/spec/income_tax/countries/india_spec.rb +89 -0
  482. data/spec/income_tax/countries/indonesia_spec.rb +89 -0
  483. data/spec/income_tax/countries/iran_spec.rb +89 -0
  484. data/spec/income_tax/countries/iraq_spec.rb +89 -0
  485. data/spec/income_tax/countries/ireland_spec.rb +89 -0
  486. data/spec/income_tax/countries/isle_of_man_spec.rb +89 -0
  487. data/spec/income_tax/countries/israel_spec.rb +89 -0
  488. data/spec/income_tax/countries/italy_spec.rb +89 -0
  489. data/spec/income_tax/countries/ivory_coast_spec.rb +89 -0
  490. data/spec/income_tax/countries/jamaica_spec.rb +89 -0
  491. data/spec/income_tax/countries/japan_spec.rb +89 -0
  492. data/spec/income_tax/countries/jersey_spec.rb +89 -0
  493. data/spec/income_tax/countries/jordan_spec.rb +89 -0
  494. data/spec/income_tax/countries/kazakhstan_spec.rb +89 -0
  495. data/spec/income_tax/countries/kenya_spec.rb +89 -0
  496. data/spec/income_tax/countries/kiribati_spec.rb +89 -0
  497. data/spec/income_tax/countries/kosovo_spec.rb +89 -0
  498. data/spec/income_tax/countries/kuwait_spec.rb +89 -0
  499. data/spec/income_tax/countries/kyrgyzstan_spec.rb +89 -0
  500. data/spec/income_tax/countries/laos_spec.rb +89 -0
  501. data/spec/income_tax/countries/latvia_spec.rb +89 -0
  502. data/spec/income_tax/countries/lebanon_spec.rb +89 -0
  503. data/spec/income_tax/countries/lesotho_spec.rb +89 -0
  504. data/spec/income_tax/countries/liberia_spec.rb +89 -0
  505. data/spec/income_tax/countries/libya_spec.rb +89 -0
  506. data/spec/income_tax/countries/liechtenstein_spec.rb +89 -0
  507. data/spec/income_tax/countries/lithuania_spec.rb +89 -0
  508. data/spec/income_tax/countries/luxembourg_spec.rb +89 -0
  509. data/spec/income_tax/countries/macao_spec.rb +89 -0
  510. data/spec/income_tax/countries/macedonia_spec.rb +89 -0
  511. data/spec/income_tax/countries/madagascar_spec.rb +89 -0
  512. data/spec/income_tax/countries/malawi_spec.rb +89 -0
  513. data/spec/income_tax/countries/malaysia_spec.rb +89 -0
  514. data/spec/income_tax/countries/maldives_spec.rb +89 -0
  515. data/spec/income_tax/countries/mali_spec.rb +89 -0
  516. data/spec/income_tax/countries/malta_spec.rb +89 -0
  517. data/spec/income_tax/countries/marshall_islands_spec.rb +89 -0
  518. data/spec/income_tax/countries/martinique_spec.rb +89 -0
  519. data/spec/income_tax/countries/mauritania_spec.rb +89 -0
  520. data/spec/income_tax/countries/mauritius_spec.rb +89 -0
  521. data/spec/income_tax/countries/mayotte_spec.rb +89 -0
  522. data/spec/income_tax/countries/mexico_spec.rb +89 -0
  523. data/spec/income_tax/countries/micronesia_spec.rb +89 -0
  524. data/spec/income_tax/countries/moldova_spec.rb +89 -0
  525. data/spec/income_tax/countries/monaco_spec.rb +89 -0
  526. data/spec/income_tax/countries/mongolia_spec.rb +89 -0
  527. data/spec/income_tax/countries/montenegro_spec.rb +89 -0
  528. data/spec/income_tax/countries/montserrat_spec.rb +89 -0
  529. data/spec/income_tax/countries/morocco_spec.rb +89 -0
  530. data/spec/income_tax/countries/mozambique_spec.rb +89 -0
  531. data/spec/income_tax/countries/myanmar_spec.rb +89 -0
  532. data/spec/income_tax/countries/namibia_spec.rb +89 -0
  533. data/spec/income_tax/countries/nauru_spec.rb +89 -0
  534. data/spec/income_tax/countries/nepal_spec.rb +89 -0
  535. data/spec/income_tax/countries/netherlands_antilles_spec.rb +89 -0
  536. data/spec/income_tax/countries/netherlands_spec.rb +89 -0
  537. data/spec/income_tax/countries/new_caledonia_spec.rb +89 -0
  538. data/spec/income_tax/countries/new_zealand_spec.rb +89 -0
  539. data/spec/income_tax/countries/nicaragua_spec.rb +89 -0
  540. data/spec/income_tax/countries/niger_spec.rb +89 -0
  541. data/spec/income_tax/countries/nigeria_spec.rb +89 -0
  542. data/spec/income_tax/countries/niue_spec.rb +89 -0
  543. data/spec/income_tax/countries/norfolk_island_spec.rb +89 -0
  544. data/spec/income_tax/countries/north_korea_spec.rb +89 -0
  545. data/spec/income_tax/countries/northern_mariana_islands_spec.rb +89 -0
  546. data/spec/income_tax/countries/norway_spec.rb +89 -0
  547. data/spec/income_tax/countries/oman_spec.rb +89 -0
  548. data/spec/income_tax/countries/pakistan_spec.rb +89 -0
  549. data/spec/income_tax/countries/palau_spec.rb +89 -0
  550. data/spec/income_tax/countries/palestinian_territory_spec.rb +89 -0
  551. data/spec/income_tax/countries/panama_spec.rb +89 -0
  552. data/spec/income_tax/countries/papua_new_guinea_spec.rb +89 -0
  553. data/spec/income_tax/countries/paraguay_spec.rb +89 -0
  554. data/spec/income_tax/countries/peru_spec.rb +89 -0
  555. data/spec/income_tax/countries/philippines_spec.rb +89 -0
  556. data/spec/income_tax/countries/pitcairn_spec.rb +89 -0
  557. data/spec/income_tax/countries/poland_spec.rb +89 -0
  558. data/spec/income_tax/countries/portugal_spec.rb +89 -0
  559. data/spec/income_tax/countries/puerto_rico_spec.rb +89 -0
  560. data/spec/income_tax/countries/qatar_spec.rb +89 -0
  561. data/spec/income_tax/countries/reunion_spec.rb +89 -0
  562. data/spec/income_tax/countries/romania_spec.rb +89 -0
  563. data/spec/income_tax/countries/russia_spec.rb +89 -0
  564. data/spec/income_tax/countries/rwanda_spec.rb +89 -0
  565. data/spec/income_tax/countries/saint_barthelemy_spec.rb +89 -0
  566. data/spec/income_tax/countries/saint_helena_spec.rb +89 -0
  567. data/spec/income_tax/countries/saint_kitts_and_nevis_spec.rb +89 -0
  568. data/spec/income_tax/countries/saint_lucia_spec.rb +89 -0
  569. data/spec/income_tax/countries/saint_martin_spec.rb +89 -0
  570. data/spec/income_tax/countries/saint_pierre_and_miquelon_spec.rb +89 -0
  571. data/spec/income_tax/countries/saint_vincent_and_the_grenedines_spec.rb +89 -0
  572. data/spec/income_tax/countries/samoa_spec.rb +89 -0
  573. data/spec/income_tax/countries/san_marino_spec.rb +89 -0
  574. data/spec/income_tax/countries/sao_tome_and_principe_spec.rb +89 -0
  575. data/spec/income_tax/countries/saudi_arabia_spec.rb +89 -0
  576. data/spec/income_tax/countries/senegal_spec.rb +89 -0
  577. data/spec/income_tax/countries/serbia_spec.rb +89 -0
  578. data/spec/income_tax/countries/seychelles_spec.rb +89 -0
  579. data/spec/income_tax/countries/sierra_leone_spec.rb +89 -0
  580. data/spec/income_tax/countries/singapore_spec.rb +89 -0
  581. data/spec/income_tax/countries/sint_maarten_spec.rb +89 -0
  582. data/spec/income_tax/countries/slovakia_spec.rb +89 -0
  583. data/spec/income_tax/countries/slovenia_spec.rb +89 -0
  584. data/spec/income_tax/countries/solomon_islands_spec.rb +89 -0
  585. data/spec/income_tax/countries/somalia_spec.rb +89 -0
  586. data/spec/income_tax/countries/south_africa_spec.rb +89 -0
  587. data/spec/income_tax/countries/south_georgia_and_the_south_sandwich_islands_spec.rb +89 -0
  588. data/spec/income_tax/countries/south_korea_spec.rb +89 -0
  589. data/spec/income_tax/countries/south_sudan_spec.rb +89 -0
  590. data/spec/income_tax/countries/spain_spec.rb +89 -0
  591. data/spec/income_tax/countries/sri_lanka_spec.rb +89 -0
  592. data/spec/income_tax/countries/sudan_spec.rb +89 -0
  593. data/spec/income_tax/countries/suriname_spec.rb +89 -0
  594. data/spec/income_tax/countries/svalbard_and_jan_mayen_spec.rb +89 -0
  595. data/spec/income_tax/countries/swaziland_spec.rb +89 -0
  596. data/spec/income_tax/countries/sweden_spec.rb +89 -0
  597. data/spec/income_tax/countries/switzerland/aargau_spec.rb +89 -0
  598. data/spec/income_tax/countries/switzerland/appenzell_inner_spec.rb +89 -0
  599. data/spec/income_tax/countries/switzerland/appenzell_outer_spec.rb +89 -0
  600. data/spec/income_tax/countries/switzerland/basel_city_spec.rb +89 -0
  601. data/spec/income_tax/countries/switzerland/basel_land_spec.rb +89 -0
  602. data/spec/income_tax/countries/switzerland/bern_spec.rb +89 -0
  603. data/spec/income_tax/countries/switzerland/fribourg_spec.rb +89 -0
  604. data/spec/income_tax/countries/switzerland/geneva_spec.rb +89 -0
  605. data/spec/income_tax/countries/switzerland/glarus_spec.rb +89 -0
  606. data/spec/income_tax/countries/switzerland/grisons_spec.rb +89 -0
  607. data/spec/income_tax/countries/switzerland/jura_spec.rb +89 -0
  608. data/spec/income_tax/countries/switzerland/lucerne_spec.rb +89 -0
  609. data/spec/income_tax/countries/switzerland/neuchatel_spec.rb +89 -0
  610. data/spec/income_tax/countries/switzerland/nidwalden_spec.rb +89 -0
  611. data/spec/income_tax/countries/switzerland/obwalden_spec.rb +89 -0
  612. data/spec/income_tax/countries/switzerland/schaffhausen_spec.rb +89 -0
  613. data/spec/income_tax/countries/switzerland/schwyz_spec.rb +89 -0
  614. data/spec/income_tax/countries/switzerland/solothurn_spec.rb +89 -0
  615. data/spec/income_tax/countries/switzerland/st_gallen_spec.rb +89 -0
  616. data/spec/income_tax/countries/switzerland/thurgau_spec.rb +89 -0
  617. data/spec/income_tax/countries/switzerland/ticino_spec.rb +89 -0
  618. data/spec/income_tax/countries/switzerland/uri_spec.rb +89 -0
  619. data/spec/income_tax/countries/switzerland/valais_spec.rb +89 -0
  620. data/spec/income_tax/countries/switzerland/vaud_spec.rb +89 -0
  621. data/spec/income_tax/countries/switzerland/zug_spec.rb +89 -0
  622. data/spec/income_tax/countries/switzerland/zurich_spec.rb +89 -0
  623. data/spec/income_tax/countries/switzerland_spec.rb +89 -0
  624. data/spec/income_tax/countries/syria_spec.rb +89 -0
  625. data/spec/income_tax/countries/taiwan_spec.rb +89 -0
  626. data/spec/income_tax/countries/tajikistan_spec.rb +89 -0
  627. data/spec/income_tax/countries/tanzania_spec.rb +89 -0
  628. data/spec/income_tax/countries/thailand_spec.rb +89 -0
  629. data/spec/income_tax/countries/timor_leste_spec.rb +89 -0
  630. data/spec/income_tax/countries/togo_spec.rb +89 -0
  631. data/spec/income_tax/countries/tokelau_spec.rb +89 -0
  632. data/spec/income_tax/countries/tonga_spec.rb +89 -0
  633. data/spec/income_tax/countries/trinidad_and_tobago_spec.rb +89 -0
  634. data/spec/income_tax/countries/tunisia_spec.rb +89 -0
  635. data/spec/income_tax/countries/turkey_spec.rb +89 -0
  636. data/spec/income_tax/countries/turkmenistan_spec.rb +89 -0
  637. data/spec/income_tax/countries/turks_and_caicos_islands_spec.rb +89 -0
  638. data/spec/income_tax/countries/tuvalu_spec.rb +89 -0
  639. data/spec/income_tax/countries/uganda_spec.rb +89 -0
  640. data/spec/income_tax/countries/ukraine_spec.rb +89 -0
  641. data/spec/income_tax/countries/united_arab_emirates_spec.rb +89 -0
  642. data/spec/income_tax/countries/united_kingdom_spec.rb +89 -0
  643. data/spec/income_tax/countries/united_states/alabama_spec.rb +89 -0
  644. data/spec/income_tax/countries/united_states/alaska_spec.rb +89 -0
  645. data/spec/income_tax/countries/united_states/arizona_spec.rb +89 -0
  646. data/spec/income_tax/countries/united_states/arkansas_spec.rb +89 -0
  647. data/spec/income_tax/countries/united_states/california_spec.rb +89 -0
  648. data/spec/income_tax/countries/united_states/colorado_spec.rb +89 -0
  649. data/spec/income_tax/countries/united_states/connecticut_spec.rb +89 -0
  650. data/spec/income_tax/countries/united_states/dc_spec.rb +89 -0
  651. data/spec/income_tax/countries/united_states/delaware_spec.rb +89 -0
  652. data/spec/income_tax/countries/united_states/florida_spec.rb +89 -0
  653. data/spec/income_tax/countries/united_states/georgia_spec.rb +89 -0
  654. data/spec/income_tax/countries/united_states/hawaii_spec.rb +89 -0
  655. data/spec/income_tax/countries/united_states/idaho_spec.rb +89 -0
  656. data/spec/income_tax/countries/united_states/illinois_spec.rb +89 -0
  657. data/spec/income_tax/countries/united_states/indiana_spec.rb +89 -0
  658. data/spec/income_tax/countries/united_states/iowa_spec.rb +89 -0
  659. data/spec/income_tax/countries/united_states/kansas_spec.rb +89 -0
  660. data/spec/income_tax/countries/united_states/kentucky_spec.rb +89 -0
  661. data/spec/income_tax/countries/united_states/louisiana_spec.rb +89 -0
  662. data/spec/income_tax/countries/united_states/maine_spec.rb +89 -0
  663. data/spec/income_tax/countries/united_states/maryland_spec.rb +89 -0
  664. data/spec/income_tax/countries/united_states/massachusetts_spec.rb +89 -0
  665. data/spec/income_tax/countries/united_states/michigan_spec.rb +89 -0
  666. data/spec/income_tax/countries/united_states/minnesota_spec.rb +89 -0
  667. data/spec/income_tax/countries/united_states/mississippi_spec.rb +89 -0
  668. data/spec/income_tax/countries/united_states/missouri_spec.rb +89 -0
  669. data/spec/income_tax/countries/united_states/montana_spec.rb +89 -0
  670. data/spec/income_tax/countries/united_states/nebraska_spec.rb +89 -0
  671. data/spec/income_tax/countries/united_states/nevada_spec.rb +89 -0
  672. data/spec/income_tax/countries/united_states/new_hampshire_spec.rb +89 -0
  673. data/spec/income_tax/countries/united_states/new_jersey_spec.rb +89 -0
  674. data/spec/income_tax/countries/united_states/new_mexico_spec.rb +89 -0
  675. data/spec/income_tax/countries/united_states/new_york_spec.rb +89 -0
  676. data/spec/income_tax/countries/united_states/north_carolina_spec.rb +89 -0
  677. data/spec/income_tax/countries/united_states/north_dakota_spec.rb +89 -0
  678. data/spec/income_tax/countries/united_states/ohio_spec.rb +89 -0
  679. data/spec/income_tax/countries/united_states/oklahoma_spec.rb +89 -0
  680. data/spec/income_tax/countries/united_states/oregon_spec.rb +89 -0
  681. data/spec/income_tax/countries/united_states/pennsylvania_spec.rb +89 -0
  682. data/spec/income_tax/countries/united_states/rhode_island_spec.rb +89 -0
  683. data/spec/income_tax/countries/united_states/south_carolina_spec.rb +89 -0
  684. data/spec/income_tax/countries/united_states/south_dakota_spec.rb +89 -0
  685. data/spec/income_tax/countries/united_states/tennessee_spec.rb +89 -0
  686. data/spec/income_tax/countries/united_states/texas_spec.rb +89 -0
  687. data/spec/income_tax/countries/united_states/utah_spec.rb +89 -0
  688. data/spec/income_tax/countries/united_states/vermont_spec.rb +89 -0
  689. data/spec/income_tax/countries/united_states/virginia_spec.rb +89 -0
  690. data/spec/income_tax/countries/united_states/washington_spec.rb +89 -0
  691. data/spec/income_tax/countries/united_states/west_virginia_spec.rb +89 -0
  692. data/spec/income_tax/countries/united_states/wisconsin_spec.rb +89 -0
  693. data/spec/income_tax/countries/united_states/wyoming_spec.rb +89 -0
  694. data/spec/income_tax/countries/united_states_minor_outlying_islands_spec.rb +89 -0
  695. data/spec/income_tax/countries/united_states_spec.rb +89 -0
  696. data/spec/income_tax/countries/uruguay_spec.rb +89 -0
  697. data/spec/income_tax/countries/uzbekistan_spec.rb +89 -0
  698. data/spec/income_tax/countries/vanuatu_spec.rb +89 -0
  699. data/spec/income_tax/countries/vatican_spec.rb +89 -0
  700. data/spec/income_tax/countries/venezuela_spec.rb +89 -0
  701. data/spec/income_tax/countries/vietnam_spec.rb +89 -0
  702. data/spec/income_tax/countries/virgin_islands_british_spec.rb +89 -0
  703. data/spec/income_tax/countries/virgin_islands_us_spec.rb +89 -0
  704. data/spec/income_tax/countries/wallis_and_futuna_spec.rb +89 -0
  705. data/spec/income_tax/countries/western_sahara_spec.rb +89 -0
  706. data/spec/income_tax/countries/yemen_spec.rb +89 -0
  707. data/spec/income_tax/countries/zambia_spec.rb +89 -0
  708. data/spec/income_tax/countries/zimbabwe_spec.rb +89 -0
  709. data/spec/income_tax/models/fixed_rate_spec.rb +24 -0
  710. data/spec/income_tax/models/no_taxes_spec.rb +20 -0
  711. data/spec/income_tax/models/progressive_spec.rb +98 -0
  712. data/spec/income_tax/rate_spec.rb +257 -0
  713. data/spec/income_tax/register_spec.rb +14 -0
  714. data/spec/income_tax_spec.rb +9 -0
  715. data/spec/support/coverage.rb +16 -0
  716. data/spec/support/env.rb +12 -0
  717. data/spec/support.rb +3 -0
  718. metadata +760 -0
@@ -0,0 +1,98 @@
1
+ describe IncomeTax::Models::Progressive do
2
+ class ExampleModel < IncomeTax::Models::Progressive
3
+ level 100, "0%"
4
+ level 200, "10%"
5
+ level 300, "20%"
6
+ remainder "50%"
7
+ end
8
+
9
+ subject(:result) { ExampleModel.new(income: income, income_type: income_type) }
10
+
11
+ describe "from gross income" do
12
+ let(:income_type) { :gross }
13
+
14
+ describe "no income" do
15
+ let(:income) { 0 }
16
+ its(:rate) { should be == IncomeTax::Rate("0%") }
17
+ its(:gross_income) { should be == 0 }
18
+ its(:net_income) { should be == 0 }
19
+ its(:taxes) { should be == 0 }
20
+ end
21
+
22
+ describe "first bracket" do
23
+ let(:income) { 80 }
24
+ its(:rate) { should be == IncomeTax::Rate("0%") }
25
+ its(:gross_income) { should be == 80 }
26
+ its(:net_income) { should be == 80 }
27
+ its(:taxes) { should be == 0 }
28
+ end
29
+
30
+ describe "second bracket" do
31
+ let(:income) { 190 }
32
+ its(:rate) { should be == Rational(9, 190) }
33
+ its(:gross_income) { should be == 190 }
34
+ its(:net_income) { should be == 181 }
35
+ its(:taxes) { should be == 9 }
36
+ end
37
+
38
+ describe "third bracket" do
39
+ let(:income) { 290 }
40
+ its(:rate) { should be == Rational(28, 290) }
41
+ its(:gross_income) { should be == 290 }
42
+ its(:net_income) { should be == 262 }
43
+ its(:taxes) { should be == 28 }
44
+ end
45
+
46
+ describe "remainder" do
47
+ let(:income) { 5000 }
48
+ its(:rate) { should be == Rational(2380, 5000) }
49
+ its(:gross_income) { should be == 5000 }
50
+ its(:net_income) { should be == 2620 }
51
+ its(:taxes) { should be == 2380 }
52
+ end
53
+ end
54
+
55
+ describe "from gross income" do
56
+ let(:income_type) { :net }
57
+
58
+ describe "no income" do
59
+ let(:income) { 0 }
60
+ its(:rate) { should be == IncomeTax::Rate("0%") }
61
+ its(:gross_income) { should be == 0 }
62
+ its(:net_income) { should be == 0 }
63
+ its(:taxes) { should be == 0 }
64
+ end
65
+
66
+ describe "first bracket" do
67
+ let(:income) { 80 }
68
+ its(:rate) { should be == IncomeTax::Rate("0%") }
69
+ its(:gross_income) { should be == 80 }
70
+ its(:net_income) { should be == 80 }
71
+ its(:taxes) { should be == 0 }
72
+ end
73
+
74
+ describe "second bracket" do
75
+ let(:income) { 181 }
76
+ its(:rate) { should be == Rational(9, 190) }
77
+ its(:gross_income) { should be == 190 }
78
+ its(:net_income) { should be == 181 }
79
+ its(:taxes) { should be == 9 }
80
+ end
81
+
82
+ describe "third bracket" do
83
+ let(:income) { 262 }
84
+ its(:rate) { should be == Rational(28, 290) }
85
+ its(:gross_income) { should be == 290 }
86
+ its(:net_income) { should be == 262 }
87
+ its(:taxes) { should be == 28 }
88
+ end
89
+
90
+ describe "remainder" do
91
+ let(:income) { 2620 }
92
+ its(:rate) { should be == Rational(2380, 5000) }
93
+ its(:gross_income) { should be == 5000 }
94
+ its(:net_income) { should be == 2620 }
95
+ its(:taxes) { should be == 2380 }
96
+ end
97
+ end
98
+ end
@@ -0,0 +1,257 @@
1
+ describe IncomeTax::Rate do
2
+ subject(:rate) { IncomeTax::Rate(input) }
3
+ let(:input) { "20%" }
4
+
5
+ describe "calculating taxes" do
6
+ example { expect(rate.net(100)) .to eql(80) }
7
+ example { expect(rate.gross(80)) .to eql(100) }
8
+ example { expect(rate.gross_taxes(100)) .to eql(20) }
9
+ example { expect(rate.net_taxes(80)) .to eql(20) }
10
+
11
+ describe "with a negative tax rate" do
12
+ let(:input) { -20 }
13
+ example { expect(rate.net(100)) .to eql(120) }
14
+ example { expect(rate.gross(120)) .to eql(100) }
15
+ example { expect(rate.gross_taxes(100)) .to eql(-20) }
16
+ example { expect(rate.net_taxes(120)) .to eql(-20) }
17
+ end
18
+
19
+ describe "with a tax rate of 0%" do
20
+ let(:input) { 0 }
21
+ example { expect(rate.net(100)) .to eql(100) }
22
+ example { expect(rate.gross(100)) .to eql(100) }
23
+ example { expect(rate.gross_taxes(100)) .to eql(0) }
24
+ example { expect(rate.net_taxes(100)) .to eql(0) }
25
+ end
26
+
27
+ describe "with a tax rate of 100%" do
28
+ let(:input) { 1.0 }
29
+ example { expect(rate.net(100)) .to eql(0) }
30
+ example { expect(rate.net(0)) .to eql(0) }
31
+ example { expect(rate.gross_taxes(100)) .to eql(100) }
32
+ example { expect(rate.net_taxes(100)) .to eql(100) }
33
+
34
+ example { expect(rate.gross(100)).to be_infinite }
35
+ end
36
+ end
37
+
38
+ example { expect(rate) .to be_a(Numeric) }
39
+ example { expect(Numeric === rate) .to be }
40
+
41
+ describe "new" do
42
+ shared_examples "20%" do
43
+ its(:to_s) { should be == "20%" }
44
+ its(:to_r) { should be == 0.2r }
45
+ its(:to_f) { should be == 0.2 }
46
+ its(:to_i) { should be == 0 }
47
+ its(:to_d) { should be == "0.2".to_d }
48
+ its(:inspect) { should be == '#<IncomeTax::Rate:"20%">' }
49
+
50
+ example { String(rate) .should be == "20%" }
51
+ example { Rational(rate) .should be == 0.2r }
52
+ example { Float(rate) .should be == 0.2 }
53
+ example { Integer(rate) .should be == 0 }
54
+ example { BigDecimal(rate) .should be == "0.2".to_d }
55
+
56
+ describe "#==" do
57
+ it { should be == rate }
58
+ it { should be == IncomeTax::Rate("20%") }
59
+ it { should be == IncomeTax::Rate(0.2) }
60
+ it { should be == 0.2r }
61
+ it { should be == 0.2 }
62
+ it { should_not be == "20%" }
63
+ it { should_not be == 0.3r }
64
+ it { should_not be == 0.3 }
65
+ it { should_not be == IncomeTax::Rate("30%") }
66
+ it { should_not be == IncomeTax::Rate(0.3) }
67
+ end
68
+ end
69
+
70
+ describe "from float" do
71
+ include_examples "20%"
72
+ let(:input) { 0.2 }
73
+ end
74
+
75
+ describe "from rational" do
76
+ let(:input) { 0.2r }
77
+ include_examples "20%"
78
+ end
79
+
80
+ describe "from integer" do
81
+ let(:input) { 20 }
82
+ include_examples "20%"
83
+ end
84
+
85
+ describe "from string" do
86
+ let(:input) { "0.2" }
87
+ include_examples "20%"
88
+ end
89
+
90
+ describe "from percentage string" do
91
+ include_examples "20%"
92
+ end
93
+
94
+ describe "from two integers" do
95
+ subject(:rate) { IncomeTax::Rate(1,5) }
96
+ include_examples "20%"
97
+ end
98
+
99
+ describe "from percentage string with digits" do
100
+ let(:input) { "20.3%" }
101
+
102
+ its(:to_s) { should be == "20.3%" }
103
+ its(:to_r) { should be == 0.203r }
104
+ its(:to_f) { should be == 0.203 }
105
+ its(:to_d) { should be == "0.203".to_d }
106
+ end
107
+
108
+ describe "invalid string input" do
109
+ let(:input) { "foo" }
110
+
111
+ example do
112
+ expect { rate }.to \
113
+ raise_error(ArgumentError, 'cannot handle "foo" as rate input')
114
+ end
115
+ end
116
+ end
117
+
118
+ describe "#+" do
119
+ describe "with another rate" do
120
+ let(:other) { IncomeTax::Rate("50%") }
121
+ example { expect(rate + other).to be_eql(IncomeTax::Rate("70%")) }
122
+ example { expect(other + rate).to be_eql(IncomeTax::Rate("70%")) }
123
+ end
124
+
125
+ describe "with a float" do
126
+ let(:other) { 0.5 }
127
+ example { expect(rate + other).to be_eql(0.7) }
128
+ example { expect(other + rate).to be_eql(0.7) }
129
+ end
130
+
131
+ describe "with a rational" do
132
+ let(:other) { 0.5r }
133
+ example { expect(rate + other).to be_eql(0.7r) }
134
+ example { expect(other + rate).to be_eql(0.7r) }
135
+ end
136
+
137
+ describe "with a big decimal" do
138
+ let(:other) { "0.5".to_d }
139
+ example { expect(rate + other).to be_eql("0.7".to_d) }
140
+ example { expect(other + rate).to be_eql("0.7".to_d) }
141
+ end
142
+
143
+ describe "with an integer" do
144
+ let(:other) { 1 }
145
+ example { expect(rate + other).to be_eql(1.2r) }
146
+ example { expect(other + rate).to be_eql(1.2r) }
147
+
148
+ describe "based on rational" do
149
+ let(:input) { 0.2r }
150
+ example { expect(rate + other).to be_eql(1.2r) }
151
+ example { expect(other + rate).to be_eql(1.2r) }
152
+ end
153
+
154
+ describe "based on float" do
155
+ let(:input) { 0.2 }
156
+ example { expect(rate + other).to be_eql(1.2) }
157
+ example { expect(other + rate).to be_eql(1.2) }
158
+ end
159
+
160
+ describe "at 0%" do
161
+ let(:input) { 0 }
162
+ example { expect(rate + other).to be_eql(1) }
163
+ example { expect(other + rate).to be_eql(1) }
164
+ end
165
+
166
+ describe "at 100%" do
167
+ let(:input) { 1.0 }
168
+ example { expect(rate + other).to be_eql(2) }
169
+ example { expect(other + rate).to be_eql(2) }
170
+ end
171
+ end
172
+ end
173
+
174
+ describe "#-" do
175
+ describe "with another rate" do
176
+ let(:other) { IncomeTax::Rate("10%") }
177
+ example { expect(rate - other).to be_eql(IncomeTax::Rate("10%")) }
178
+ example { expect(other - rate).to be_eql(IncomeTax::Rate("-10%")) }
179
+ end
180
+
181
+ describe "with a float" do
182
+ let(:other) { 0.1 }
183
+ example { expect(rate - other).to be_eql(0.1) }
184
+ example { expect(other - rate).to be_eql(-0.1) }
185
+ end
186
+
187
+ describe "with a rational" do
188
+ let(:other) { 0.1r }
189
+ example { expect(rate - other).to be_eql(0.1r) }
190
+ example { expect(other - rate).to be_eql(-0.1r) }
191
+ end
192
+
193
+ describe "with a big decimal" do
194
+ let(:other) { "0.1".to_d }
195
+ example { expect(rate - other).to be_eql("0.1".to_d) }
196
+ example { expect(other - rate).to be_eql(-"0.1".to_d) }
197
+ end
198
+
199
+ describe "with an integer" do
200
+ let(:other) { 1 }
201
+ example { expect(rate - other).to be_eql(-0.8r) }
202
+ example { expect(other - rate).to be_eql(0.8r) }
203
+
204
+ describe "based on rational" do
205
+ let(:input) { 0.2r }
206
+ example { expect(rate - other).to be_eql(-0.8r) }
207
+ example { expect(other - rate).to be_eql(0.8r) }
208
+ end
209
+
210
+ describe "based on float" do
211
+ let(:input) { 0.2 }
212
+ example { expect(rate - other).to be_eql(-0.8) }
213
+ example { expect(other - rate).to be_eql(0.8) }
214
+ end
215
+
216
+ describe "at 0%" do
217
+ let(:input) { 0 }
218
+ example { expect(rate - other).to be_eql(-1) }
219
+ example { expect(other - rate).to be_eql(1) }
220
+ end
221
+
222
+ describe "at 100%" do
223
+ let(:input) { 1.0 }
224
+ example { expect(rate - other).to be_eql(0) }
225
+ example { expect(other - rate).to be_eql(0) }
226
+ end
227
+ end
228
+ end
229
+
230
+ describe "#-@" do
231
+ example { expect(-rate) .to be_eql(IncomeTax::Rate("-20%")) }
232
+ example { expect(-(-rate)) .to be_eql(IncomeTax::Rate("20%")) }
233
+ end
234
+
235
+ describe "#coerce" do
236
+ example("with a rate") { expect(rate.coerce(rate)) .to be == [ rate, rate ] }
237
+ example("with a rational") { expect(rate.coerce(0.3r)) .to be == [ 0.3r, 0.2r ] }
238
+ example("with a decirmal") { expect(rate.coerce("0.3".to_d)) .to be == [ "0.3".to_d, "0.2".to_d ] }
239
+ example("with an integer") { expect(rate.coerce(1)) .to be == [ 1.to_d, "0.2".to_d ] }
240
+ example("with a float") { expect(rate.coerce(0.3)) .to be == [ 0.3, 0.2 ] }
241
+ end
242
+
243
+ describe "as hash index" do
244
+ let(:hash) { { rate => 42 } }
245
+
246
+ # wanted to use the include matcher, but rspec uses Rate#== instead of Hash#include?
247
+ example { expect(hash[ rate ]).to be == 42 }
248
+ example { expect(hash[ IncomeTax::Rate("20%") ]).to be == 42 }
249
+ example { expect(hash[ IncomeTax::Rate(0.2r) ]).to be == 42 }
250
+ example { expect(hash[ rate.to_r ]).not_to be == 42 }
251
+ example { expect(hash[ rate.to_s ]).not_to be == 42 }
252
+ example { expect(hash[ rate.to_d ]).not_to be == 42 }
253
+ end
254
+
255
+ describe "with ranges" do
256
+ end
257
+ end
@@ -0,0 +1,14 @@
1
+ describe IncomeTax::Register do
2
+ subject(:register) { IncomeTax::Register.new("example") }
3
+ before { register.add("Foo And Bar", 42) }
4
+
5
+ example { expect(register["Foo And Bar"]) .to be == 42 }
6
+ example { expect(register["foo-bar"]) .to be == 42 }
7
+
8
+ example { expect(register) .to include("Foo And Bar") }
9
+ example { expect(register) .to include("foo and bar") }
10
+ example { expect(register) .to include("Foo Bar") }
11
+ example { expect(register) .to_not include("Foo") }
12
+
13
+ example { expect { register["Foo"] }.to raise_error(ArgumentError, 'unknown example "Foo"') }
14
+ end
@@ -0,0 +1,9 @@
1
+ require 'money'
2
+
3
+ describe IncomeTax do
4
+ example { expect(IncomeTax.new("DE", 60000).gross_income) .to be == 60000 }
5
+ example { expect(IncomeTax.new("DE", "€5k/mo").gross_income) .to be == 60000 }
6
+ example { expect(IncomeTax.new("DE", 60000, :net).net_income) .to be == 60000 }
7
+ example { expect(IncomeTax.new("DE", Money.new(6000000, "EUR")).gross_income) .to be == 60000 }
8
+ example { expect{IncomeTax.new(:DE, 60000)} .to raise_error(ArgumentError) }
9
+ end
@@ -0,0 +1,16 @@
1
+ if ENV["SKIP_COVERAGE"].to_i == 0
2
+ require 'simplecov'
3
+ require 'coveralls'
4
+
5
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
6
+ SimpleCov::Formatter::HTMLFormatter,
7
+ Coveralls::SimpleCov::Formatter
8
+ ]
9
+
10
+ SimpleCov.start do
11
+ project_name 'income-tax'
12
+ minimum_coverage 99
13
+ coverage_dir '.coverage'
14
+ add_filter '/spec/'
15
+ end
16
+ end
@@ -0,0 +1,12 @@
1
+ require 'bundler/setup'
2
+ require 'tool/warning_filter'
3
+ $-w = true
4
+
5
+ require 'rspec'
6
+ require 'rspec/its'
7
+
8
+ RSpec.configure do |config|
9
+ config.expect_with :rspec do |c|
10
+ c.syntax = [:should, :expect]
11
+ end
12
+ end
data/spec/support.rb ADDED
@@ -0,0 +1,3 @@
1
+ require 'support/env'
2
+ # require 'support/coverage'
3
+ require 'income_tax'