pay-bills 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4d40fd4e7a8f0082b57a9e027c9124ca958afc6e
4
+ data.tar.gz: 0c1cbd8c2c0e50945017cc24a8d346dce9172e03
5
+ SHA512:
6
+ metadata.gz: 2c3d273d4c91dd73abfef41ab25297d3fe393ef76edaeb78ad6cfeac4842fb98419327151b2cbb778da75db1d8c4903bca6fd6c3006ab06323b50d5a10a75cf7
7
+ data.tar.gz: 171f063b2d859c050ec6f867dca6f34e7fa5cf03cafceb86d380b11e5601d34e3e46361744c3a57d44f8a3838b0d2afc2fff1fc56b1781ba1a4c793809fe8103
@@ -0,0 +1,15 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
15
+ *.gem
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in pay-bills.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Kavinder Dhaliwal
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.
@@ -0,0 +1,45 @@
1
+ # Pay-Bills
2
+
3
+ I usually pay my bills around the same time every month. The process is pretty manual and I don't like to sign up for auto-bill pay for most services. This gem allows you to set a configuration file with the actions to open relevant web pages.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'pay-bills'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install pay-bills
20
+
21
+ ## Usage
22
+
23
+ *NOTE* Gem is still under construction and probably very buggy.
24
+
25
+ 1. Set configuration file:
26
+
27
+ config.yml
28
+
29
+ bill: credit-card
30
+ action:
31
+ browser: www.credit-card.com
32
+
33
+ 2. From you command line
34
+
35
+ pay-bills
36
+
37
+ For the above example, this will open a browser window with `www.credit-card.com` as the url.
38
+
39
+ ## Contributing
40
+
41
+ 1. Fork it ( https://github.com/[my-github-username]/pay-bills/fork )
42
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
43
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
44
+ 4. Push to the branch (`git push origin my-new-feature`)
45
+ 5. Create a new Pull Request
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,20 @@
1
+ #! /usr/bin/env ruby
2
+
3
+ require 'pay_bills'
4
+ require 'main'
5
+
6
+ Main {
7
+
8
+ mode "open" do
9
+ def run
10
+ PayBills.pay_bills
11
+ end
12
+ end
13
+
14
+ mode "edit" do
15
+ def run
16
+ PayBills.edit_bills
17
+ end
18
+ end
19
+
20
+ }
@@ -0,0 +1,38 @@
1
+ require 'yaml'
2
+ module PayBills
3
+ extend self
4
+ DIR_PATH = File.join(Dir.home, "pay_bills")
5
+ FILE_PATH = File.join(DIR_PATH, "config.yml")
6
+
7
+ def pay_bills
8
+ config = get_config
9
+ p config
10
+ abort unless config["bills"] #TODO: Handle this better
11
+ config["bills"].each do |service, site|
12
+ system("open", site)
13
+ end
14
+ end
15
+
16
+ def edit_bills
17
+ system("vim", FILE_PATH)
18
+ end
19
+
20
+ private
21
+
22
+ def set_config
23
+ puts "seting config"
24
+ Dir.mkdir(DIR_PATH) unless Dir.exists?(DIR_PATH)
25
+ File.open(FILE_PATH, "w+") do |f|
26
+ f.write "bills:\n"
27
+ end
28
+ end
29
+
30
+ def get_config
31
+ if File.exists?(FILE_PATH)
32
+ YAML.load(File.open(FILE_PATH))
33
+ else
34
+ set_config
35
+ self.get_config
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,3 @@
1
+ module PayBills
2
+ VERSION = "0.0.1"
3
+ end
@@ -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 'pay_bills/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "pay-bills"
8
+ spec.version = PayBills::VERSION
9
+ spec.authors = ["Kavinder Dhaliwal"]
10
+ spec.email = ["kavinderd@gmail.com"]
11
+ spec.summary = %q{Pay your Bills}
12
+ spec.description = %q{Easy Command Line utility to open your bill websites}
13
+ spec.homepage = "https://github.com/kavinderd/pay-bills"
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_runtime_dependency 'main'
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.7"
24
+ spec.add_development_dependency "rake", "~> 10.0"
25
+ end
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pay-bills
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Kavinder Dhaliwal
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-09-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: main
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.7'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ description: Easy Command Line utility to open your bill websites
56
+ email:
57
+ - kavinderd@gmail.com
58
+ executables:
59
+ - pay-bills
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".gitignore"
64
+ - Gemfile
65
+ - LICENSE.txt
66
+ - README.md
67
+ - Rakefile
68
+ - bin/pay-bills
69
+ - lib/pay_bills.rb
70
+ - lib/pay_bills/version.rb
71
+ - pay-bills.gemspec
72
+ homepage: https://github.com/kavinderd/pay-bills
73
+ licenses:
74
+ - MIT
75
+ metadata: {}
76
+ post_install_message:
77
+ rdoc_options: []
78
+ require_paths:
79
+ - lib
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ requirements: []
91
+ rubyforge_project:
92
+ rubygems_version: 2.2.2
93
+ signing_key:
94
+ specification_version: 4
95
+ summary: Pay your Bills
96
+ test_files: []