clieop 0.2.1 → 0.2.2

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.
data/.gitignore CHANGED
@@ -2,3 +2,5 @@ clieop-*.gem
2
2
  .svn/
3
3
  .DS_Store
4
4
  /.bundle/
5
+ Gemfile.lock
6
+ *.rbc
data/.infinity_test ADDED
@@ -0,0 +1,8 @@
1
+ infinity_test do
2
+
3
+ use :rubies => %w(1.8.7 1.9.2 ree jruby rbx), :test_framework => :rspec
4
+
5
+ before(:each_ruby) do |environment|
6
+ environment.system('bundle install')
7
+ end
8
+ end
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2008-2010 Willem van Bergen & Leon Berenschot
1
+ Copyright (c) 2008-2011 Willem van Bergen & Leon Berenschot
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.rdoc CHANGED
@@ -16,7 +16,7 @@ directions: accounts payable and accounts receivable. For accounts receivable,
16
16
  you need proper authorization from your bank.
17
17
 
18
18
  For more information about the CLIEOP file format, see:
19
- http://www.ingbank.nl/ing/downloadables/eclieop1.pdf
19
+ http://www.equens.com/support/filelayout/index.jsp
20
20
 
21
21
  == Usage
22
22
 
data/clieop.gemspec CHANGED
@@ -3,15 +3,15 @@ Gem::Specification.new do |s|
3
3
 
4
4
  # Do not set version and date yourself, this will be done automatically
5
5
  # by the gem release script.
6
- s.version = "0.2.1"
7
- s.date = "2010-12-09"
6
+ s.version = "0.2.2"
7
+ s.date = "2011-09-23"
8
8
 
9
9
  s.summary = "A pure Ruby implementation to write CLIEOP files"
10
10
  s.description = "This library is a pure Ruby, MIT licensed implementation of the CLIEOP03 transaction format. CLIEOP03 can be used to communicate direct debt transactions with your (Dutch) bank."
11
11
 
12
12
  s.authors = ['Willem van Bergen', 'Leon Berenschot']
13
13
  s.email = ['willem@vanbergen.org', 'LeipeLeon@gmail.com']
14
- s.homepage = 'http://github.com/wvanbergen/clieop/wikis'
14
+ s.homepage = 'http://github.com/wvanbergen/clieop/wiki'
15
15
 
16
16
  s.add_development_dependency('rake')
17
17
  s.add_development_dependency('rspec', '~> 2.2')
@@ -19,6 +19,6 @@ Gem::Specification.new do |s|
19
19
 
20
20
  # Do not set files and test_files yourself, this will be done automatically
21
21
  # by the gem release script.
22
- s.files = %w(.gitignore .rspec Gemfile Gemfile.lock MIT-LICENSE README.rdoc Rakefile autotest/discover.rb clieop.gemspec doc/clieop03.pdf init.rb lib/clieop.rb lib/clieop/batch.rb lib/clieop/file.rb lib/clieop/record.rb spec/clieop/batch_spec.rb spec/clieop/file_spec.rb spec/clieop/record_spec.rb spec/clieop_spec.rb spec/spec_helper.rb tasks/github-gem.rake)
22
+ s.files = %w(.gitignore .infinity_test .rspec Gemfile MIT-LICENSE README.rdoc Rakefile autotest/discover.rb clieop.gemspec doc/clieop03.pdf lib/clieop.rb lib/clieop/batch.rb lib/clieop/file.rb lib/clieop/record.rb spec/clieop/batch_spec.rb spec/clieop/file_spec.rb spec/clieop/record_spec.rb spec/clieop_spec.rb spec/spec_helper.rb tasks/github-gem.rake)
23
23
  s.test_files = %w(spec/clieop/batch_spec.rb spec/clieop/file_spec.rb spec/clieop/record_spec.rb spec/clieop_spec.rb)
24
24
  end
data/lib/clieop/batch.rb CHANGED
@@ -83,9 +83,7 @@ module Clieop
83
83
 
84
84
  end
85
85
 
86
- def to_s
87
- self.to_clieop
88
- end
86
+ alias_method :to_s, :to_clieop
89
87
 
90
88
  # creates a batch for payments from a given account
91
89
  def self.payment_batch(batch_info = {})
@@ -110,6 +108,5 @@ module Clieop
110
108
  def transaction_is_payment?
111
109
  @batch_info[:transaction_group] == 10
112
110
  end
113
-
114
111
  end
115
- end
112
+ end
data/lib/clieop/file.rb CHANGED
@@ -20,7 +20,7 @@ module Clieop
20
20
  end
21
21
 
22
22
  # Alias for to_clieop
23
- alias :to_s :to_clieop
23
+ alias_method :to_s, :to_clieop
24
24
 
25
25
  def payment_batch(options)
26
26
  @batches << Clieop::Batch.payment_batch(options)
data/lib/clieop/record.rb CHANGED
@@ -105,10 +105,6 @@ module Clieop
105
105
  line.ljust(50) + "\r\n"
106
106
  end
107
107
 
108
- def to_s
109
- self.to_clieop
110
- end
111
-
108
+ alias_method :to_s, :to_clieop
112
109
  end
113
-
114
- end
110
+ end
data/lib/clieop.rb CHANGED
@@ -1,9 +1,9 @@
1
1
  require 'date'
2
2
 
3
3
  module Clieop
4
- VERSION = "0.2.1"
4
+ VERSION = "0.2.2"
5
5
  end
6
6
 
7
- require 'clieop/record.rb'
8
- require 'clieop/file.rb'
9
- require 'clieop/batch.rb'
7
+ require 'clieop/record'
8
+ require 'clieop/file'
9
+ require 'clieop/batch'
@@ -7,10 +7,8 @@ describe Clieop::File do
7
7
  it "should create 'filename' and put the CLIEOP data in it" do
8
8
  file = mock('file')
9
9
  File.should_receive(:open).with("filename", "w").and_yield(file)
10
- file.should_receive(:write).with("0001A091210CLIEOP03 1 \r\n9999A \r\n")
10
+ file.should_receive(:write).with("0001A#{Date.today.strftime('%d%m%y')}CLIEOP03 1 \r\n9999A \r\n")
11
11
  subject.save('filename')
12
12
  end
13
-
14
13
  end
15
-
16
14
  end
data/spec/spec_helper.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'rubygems'
2
- require 'bundler'
3
- Bundler.require(:default, :development)
2
+ require 'bundler/setup'
3
+ require 'clieop'
4
4
 
5
5
  RSpec.configure do |config|
6
-
6
+ # nothing special
7
7
  end
@@ -13,8 +13,8 @@ module GithubGem
13
13
 
14
14
  # Detects the main include file of this project using heuristics
15
15
  def self.detect_main_include
16
- if detect_gemspec_file =~ /^(\.*)\.gemspec$/ && File.exist?("lib/#{$1}.rb")
17
- "lib/#{$1}.rb"
16
+ if File.exist?(File.expand_path("../lib/#{File.basename(detect_gemspec_file, '.gemspec').gsub(/-/, '/')}.rb", detect_gemspec_file))
17
+ "lib/#{File.basename(detect_gemspec_file, '.gemspec').gsub(/-/, '/')}.rb"
18
18
  elsif FileList['lib/*.rb'].length == 1
19
19
  FileList['lib/*.rb'].first
20
20
  else
@@ -24,6 +24,8 @@ module GithubGem
24
24
 
25
25
  class RakeTasks
26
26
 
27
+ include Rake::DSL if Rake.const_defined?('DSL')
28
+
27
29
  attr_reader :gemspec, :modified_files
28
30
  attr_accessor :gemspec_file, :task_namespace, :main_include, :root_dir, :spec_pattern, :test_pattern, :remote, :remote_branch, :local_branch
29
31
 
@@ -220,7 +222,7 @@ module GithubGem
220
222
 
221
223
  def check_version_task
222
224
  raise "#{ENV['VERSION']} is not a valid version number!" if ENV['VERSION'] && !Gem::Version.correct?(ENV['VERSION'])
223
- proposed_version = Gem::Version.new(ENV['VERSION'].dup || gemspec.version)
225
+ proposed_version = Gem::Version.new((ENV['VERSION'] || gemspec.version).dup)
224
226
  raise "This version (#{proposed_version}) is not higher than the highest tagged version (#{newest_version})" if newest_version >= proposed_version
225
227
  end
226
228
 
@@ -339,22 +341,26 @@ module GithubGem
339
341
 
340
342
  # Updates the tasks file using the latest file found on Github
341
343
  def update_tasks_task
342
- require 'net/http'
343
-
344
- server = 'github.com'
345
- path = '/wvanbergen/github-gem/raw/master/tasks/github-gem.rake'
344
+ require 'net/https'
345
+ require 'uri'
346
+
347
+ uri = URI.parse('https://raw.github.com/wvanbergen/github-gem/master/tasks/github-gem.rake')
348
+ http = Net::HTTP.new(uri.host, uri.port)
349
+ http.use_ssl = true
350
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
351
+ response = http.request(Net::HTTP::Get.new(uri.path))
346
352
 
347
- Net::HTTP.start(server) do |http|
348
- response = http.get(path)
353
+ if Net::HTTPSuccess === response
349
354
  open(__FILE__, "w") { |file| file.write(response.body) }
350
- end
351
-
352
- relative_file = File.expand_path(__FILE__).sub(%r[^#{@root_dir}/], '')
353
- if `#{git} ls-files -m #{relative_file}`.split("\n").any?
354
- sh git, 'add', relative_file
355
- sh git, 'commit', '-m', "Updated to latest gem release management tasks."
355
+ relative_file = File.expand_path(__FILE__).sub(%r[^#{@root_dir}/], '')
356
+ if `#{git} ls-files -m #{relative_file}`.split("\n").any?
357
+ sh git, 'add', relative_file
358
+ sh git, 'commit', '-m', "Updated to latest gem release management tasks."
359
+ else
360
+ puts "Release managament tasks already are at the latest version."
361
+ end
356
362
  else
357
- puts "Release managament tasks already are at the latest version."
363
+ raise "Download failed with HTTP status #{response.code}!"
358
364
  end
359
365
  end
360
366
  end
metadata CHANGED
@@ -1,90 +1,71 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: clieop
3
- version: !ruby/object:Gem::Version
4
- hash: 21
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 2
9
- - 1
10
- version: 0.2.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.2
5
+ prerelease:
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Willem van Bergen
14
9
  - Leon Berenschot
15
10
  autorequire:
16
11
  bindir: bin
17
12
  cert_chain: []
18
-
19
- date: 2010-12-09 00:00:00 +01:00
13
+ date: 2011-09-23 00:00:00.000000000 -04:00
20
14
  default_executable:
21
- dependencies:
22
- - !ruby/object:Gem::Dependency
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
23
17
  name: rake
24
- prerelease: false
25
- requirement: &id001 !ruby/object:Gem::Requirement
18
+ requirement: &2153186320 !ruby/object:Gem::Requirement
26
19
  none: false
27
- requirements:
28
- - - ">="
29
- - !ruby/object:Gem::Version
30
- hash: 3
31
- segments:
32
- - 0
33
- version: "0"
20
+ requirements:
21
+ - - ! '>='
22
+ - !ruby/object:Gem::Version
23
+ version: '0'
34
24
  type: :development
35
- version_requirements: *id001
36
- - !ruby/object:Gem::Dependency
37
- name: rspec
38
25
  prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
26
+ version_requirements: *2153186320
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: &2153185700 !ruby/object:Gem::Requirement
40
30
  none: false
41
- requirements:
31
+ requirements:
42
32
  - - ~>
43
- - !ruby/object:Gem::Version
44
- hash: 7
45
- segments:
46
- - 2
47
- - 2
48
- version: "2.2"
33
+ - !ruby/object:Gem::Version
34
+ version: '2.2'
49
35
  type: :development
50
- version_requirements: *id002
51
- - !ruby/object:Gem::Dependency
52
- name: ZenTest
53
36
  prerelease: false
54
- requirement: &id003 !ruby/object:Gem::Requirement
37
+ version_requirements: *2153185700
38
+ - !ruby/object:Gem::Dependency
39
+ name: ZenTest
40
+ requirement: &2153185140 !ruby/object:Gem::Requirement
55
41
  none: false
56
- requirements:
42
+ requirements:
57
43
  - - ~>
58
- - !ruby/object:Gem::Version
59
- hash: 19
60
- segments:
61
- - 4
62
- - 4
63
- version: "4.4"
44
+ - !ruby/object:Gem::Version
45
+ version: '4.4'
64
46
  type: :development
65
- version_requirements: *id003
66
- description: This library is a pure Ruby, MIT licensed implementation of the CLIEOP03 transaction format. CLIEOP03 can be used to communicate direct debt transactions with your (Dutch) bank.
67
- email:
47
+ prerelease: false
48
+ version_requirements: *2153185140
49
+ description: This library is a pure Ruby, MIT licensed implementation of the CLIEOP03
50
+ transaction format. CLIEOP03 can be used to communicate direct debt transactions
51
+ with your (Dutch) bank.
52
+ email:
68
53
  - willem@vanbergen.org
69
54
  - LeipeLeon@gmail.com
70
55
  executables: []
71
-
72
56
  extensions: []
73
-
74
57
  extra_rdoc_files: []
75
-
76
- files:
58
+ files:
77
59
  - .gitignore
60
+ - .infinity_test
78
61
  - .rspec
79
62
  - Gemfile
80
- - Gemfile.lock
81
63
  - MIT-LICENSE
82
64
  - README.rdoc
83
65
  - Rakefile
84
66
  - autotest/discover.rb
85
67
  - clieop.gemspec
86
68
  - doc/clieop03.pdf
87
- - init.rb
88
69
  - lib/clieop.rb
89
70
  - lib/clieop/batch.rb
90
71
  - lib/clieop/file.rb
@@ -96,40 +77,31 @@ files:
96
77
  - spec/spec_helper.rb
97
78
  - tasks/github-gem.rake
98
79
  has_rdoc: true
99
- homepage: http://github.com/wvanbergen/clieop/wikis
80
+ homepage: http://github.com/wvanbergen/clieop/wiki
100
81
  licenses: []
101
-
102
82
  post_install_message:
103
83
  rdoc_options: []
104
-
105
- require_paths:
84
+ require_paths:
106
85
  - lib
107
- required_ruby_version: !ruby/object:Gem::Requirement
86
+ required_ruby_version: !ruby/object:Gem::Requirement
108
87
  none: false
109
- requirements:
110
- - - ">="
111
- - !ruby/object:Gem::Version
112
- hash: 3
113
- segments:
114
- - 0
115
- version: "0"
116
- required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ! '>='
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ required_rubygems_version: !ruby/object:Gem::Requirement
117
93
  none: false
118
- requirements:
119
- - - ">="
120
- - !ruby/object:Gem::Version
121
- hash: 3
122
- segments:
123
- - 0
124
- version: "0"
94
+ requirements:
95
+ - - ! '>='
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
125
98
  requirements: []
126
-
127
99
  rubyforge_project:
128
- rubygems_version: 1.3.7
100
+ rubygems_version: 1.6.2
129
101
  signing_key:
130
102
  specification_version: 3
131
103
  summary: A pure Ruby implementation to write CLIEOP files
132
- test_files:
104
+ test_files:
133
105
  - spec/clieop/batch_spec.rb
134
106
  - spec/clieop/file_spec.rb
135
107
  - spec/clieop/record_spec.rb
data/Gemfile.lock DELETED
@@ -1,28 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- clieop (0.2.0)
5
-
6
- GEM
7
- remote: http://rubygems.org/
8
- specs:
9
- ZenTest (4.4.1)
10
- diff-lcs (1.1.2)
11
- rake (0.8.7)
12
- rspec (2.2.0)
13
- rspec-core (~> 2.2)
14
- rspec-expectations (~> 2.2)
15
- rspec-mocks (~> 2.2)
16
- rspec-core (2.2.1)
17
- rspec-expectations (2.2.0)
18
- diff-lcs (~> 1.1.2)
19
- rspec-mocks (2.2.0)
20
-
21
- PLATFORMS
22
- ruby
23
-
24
- DEPENDENCIES
25
- ZenTest (~> 4.4)
26
- clieop!
27
- rake
28
- rspec (~> 2.2)
data/init.rb DELETED
@@ -1 +0,0 @@
1
- require 'clieop'