Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
francois committed Sep 9, 2008
0 parents commit 5755b21
Show file tree
Hide file tree
Showing 9 changed files with 131 additions and 0 deletions.
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2008 François Beausoleil

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.
28 changes: 28 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
= QuickenParser

This is a quick'n'dirty gem to parse Quicken QFX format.

Given an input stream, or a file, this library will return Ruby structures
representing the transactions, accounts and credit cards contained in the
file / stream.

== Example

objects = QuickenParser.parse(STDIN)
objects.transactions.length #=> 281
objects.accounts.length #=> 3
account = objects.accounts.first
#=> <QuickenParser::Account ...>
account.number #=> "123456789012"
account.currency #=> "CAD"
account.bank_id #=> "900000100"
account.transactions.length #=> 97
account.transactions.timespan #=> Sun Aug 31, 2008..Sat Sep 13
account.transactions.each do |transaction|
transaction.type #=> "DEBIT"
transaction.amount #=> <Money @cents=13209, @currency="CAD">
transaction.timestamp #=> Sun Aug 31, 2008 08:15 AM
transaction.name #=> "..."
transaction.memo #=> "..."
transaction.id #=> "932374"
end
46 changes: 46 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
require 'rubygems'
require 'rake/gempackagetask'
require 'rubygems/specification'
require 'date'

GEM = "quicken_parser"
GEM_VERSION = "0.0.1"
AUTHOR = "François Beausoleil"
EMAIL = "francois@teksol.info"
HOMEPAGE = "http://github.com/francois/quicken_parser"
SUMMARY = "This is a quick'n'dirty gem to parse Quicken QFX format."

spec = Gem::Specification.new do |s|
s.name = GEM
s.version = GEM_VERSION
s.platform = Gem::Platform::RUBY
s.has_rdoc = true
s.extra_rdoc_files = ["README", "LICENSE", "TODO"]
s.summary = SUMMARY
s.description = s.summary
s.author = AUTHOR
s.email = EMAIL
s.homepage = HOMEPAGE

s.add_dependency "money", "~> 1.7"

s.require_path = "lib"
s.autorequire = GEM
s.files = %w(LICENSE README Rakefile TODO) + Dir.glob("{lib,specs}/**/*")
end

Rake::GemPackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
end

desc "install the gem locally"
task :install => [:package] do
sh %{sudo gem install pkg/#{GEM}-#{GEM_VERSION}}
end

desc "create a gemspec file"
task :make_spec do
File.open("#{GEM}.gemspec", "w") do |file|
file.puts spec.to_ruby
end
end
Empty file added TODO
Empty file.
Empty file added lib/quicken_parser.rb
Empty file.
14 changes: 14 additions & 0 deletions script/destroy
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env ruby
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))

begin
require 'rubigen'
rescue LoadError
require 'rubygems'
require 'rubigen'
end
require 'rubigen/scripts/destroy'

ARGV.shift if ['--help', '-h'].include?(ARGV[0])
RubiGen::Base.use_component_sources! [:newgem_simple, :test_unit]
RubiGen::Scripts::Destroy.new.run(ARGV)
14 changes: 14 additions & 0 deletions script/generate
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env ruby
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))

begin
require 'rubigen'
rescue LoadError
require 'rubygems'
require 'rubigen'
end
require 'rubigen/scripts/generate'

ARGV.shift if ['--help', '-h'].include?(ARGV[0])
RubiGen::Base.use_component_sources! [:newgem_simple, :test_unit]
RubiGen::Scripts::Generate.new.run(ARGV)
7 changes: 7 additions & 0 deletions spec/quicken_parser_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require File.dirname(__FILE__) + '/spec_helper'

describe "quicken_parser" do
it "should do nothing" do
true.should == true
end
end
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$TESTING=true
$:.push File.join(File.dirname(__FILE__), '..', 'lib')

0 comments on commit 5755b21

Please sign in to comment.