This repository has been archived by the owner on Mar 30, 2023. It is now read-only.
forked from rwjblue/X12
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
166 lines (146 loc) · 4.69 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#--
# This file is part of the X12Parser library that provides tools to
# manipulate X12 messages using Ruby native syntax.
#
# http://x12parser.rubyforge.org
#
# Copyright (C) 2008 APP Design, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
# $Id: Rakefile 92 2009-05-13 22:12:10Z ikk $
#++
require 'rubygems'
require 'rake'
require 'rake/clean'
require 'rake/testtask'
require 'rake/packagetask'
require 'rdoc/task'
require 'rubygems/package_task'
require 'fileutils'
require 'pp'
require File.join(File.dirname(__FILE__), 'lib', 'x12')
PKG_NAME = 'X12'
PKG_VERSION = X12::VERSION
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
PKG_DESTINATION = "../#{PKG_NAME}"
CLEAN.include(
'**/*.log',
'doc/**/*',
'**/*.tmp'
)
CLEAN.exclude(
)
begin
require 'jeweler'
Jeweler::Tasks.new do |s|
s.name = "X12"
s.summary = "EDI X12 parsing for ruby"
s.email = "jkane@acumenholdings.com"
s.homepage = "http://github.com/acumenbrands/X12"
s.description = "EDI X12 parsing for ruby"
s.authors = ["Jim Kane"]
s.files = FileList["[A-Z]*", "{bin,generators,lib,test}/**/*", 'lib/jeweler/templates/.gitignore']
end
rescue LoadError
puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
end
#puts "Files to clobber: #{CLOBBER}"
#puts "Files to clean: #{CLEAN}"
desc "Default Task"
task :default => [ :example, :test ]
desc 'Run examples'
task :example do |x|
Dir['example/*.rb'].each {|f|
puts "Running #{f}"
ruby '-I', 'lib', f do |ok, res|
fail "Command failed (status = #{res.exitstatus})" unless ok
end
}
end
desc 'Run examples in scratch dir'
task :scratch do |x|
Dir['scratch/p270.rb'].each {|f|
puts "Running #{f}"
ruby '-I', 'lib', f do |ok, res|
fail "Command failed (status = #{res.exitstatus})" unless ok
end
}
end
desc 'Run tests in test dir'
Rake::TestTask.new do |t|
# t.libs << "test"
t.test_files = Dir['test/tc_*.rb']
# t.test_files = Dir['test/tc_factory_270interchange.rb']
# t.test_files = Dir['test/tc_parse_270interchange.rb']
t.verbose = true
end
file 'doc/index.html' => ['misc/rdoc_template.rb' ]
task :rdoc => ['doc/index.html']
# Generate the RDoc documentation
Rake::RDocTask.new { |rdoc|
rdoc.rdoc_dir = 'doc'
rdoc.title = "X12 -- an X12 parsing library"
rdoc.options << '--line-numbers' << '--inline-source' << '--main' << 'README'
rdoc.template = 'misc/rdoc_template.rb'
rdoc.rdoc_files.include('README')
rdoc.rdoc_files.include('CHANGELOG')
rdoc.rdoc_files.include('TODO')
rdoc.rdoc_files.include('lib/**/*.rb')
}
# Create compressed packages by running 'rake gem'
desc "gem task"
task :gem => [ :clobber, :rdoc ]
# Here's how to look inside the gem package:
# ~..>tar xvf package.gem; gunzip data.tar.gz metadata.gz; tar xvf data.tar; cat metadata
spec = Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = PKG_NAME
s.version = PKG_VERSION
s.summary = 'X12 parsing and generation library'
s.description = 'Library to parse X12 messages and manipulate their loops, segments, fields, composites, and validation tables.'
s.author = 'APP Design, Inc.'
s.email = 'info@appdesign.com'
s.rubyforge_project = PKG_NAME
s.homepage = "http://www.appdesign.com"
s.has_rdoc = true
s.requirements << 'none'
s.require_path = 'lib'
s.autorequire = 'x12'
[
"Rakefile",
"README",
"TODO",
"CHANGELOG",
"COPYING",
"doc/**/*",
"lib/**/*",
"test/**/*",
"example/**/*",
"misc/**/*"
].each do |i|
s.files += Dir.glob(i).delete_if do
|x| x =~ /.*~/
end
end
puts "Files included into the GEM:" if $VERBOSE
pp s.files if $VERBOSE
s.test_files = Dir.glob( "test/tc_*rb" )
end
Gem::PackageTask.new(spec) do |p|
p.gem_spec = spec
p.need_tar = true
p.need_zip = true
end