Compare commits
No commits in common. "7221a3e9d860575a006fe68b3a42dd7386c1fe4d" and "e1eeb03e56f86be005b09823cf52becd31a66bd2" have entirely different histories.
7221a3e9d8
...
e1eeb03e56
5 changed files with 17 additions and 125 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +0,0 @@
|
||||||
*.gem
|
|
59
Makefile
59
Makefile
|
@ -1,59 +0,0 @@
|
||||||
DESTDIR=
|
|
||||||
|
|
||||||
NAME=xtm-utils
|
|
||||||
GEMNAME=xtm-utils
|
|
||||||
RUBYVERSION=1.8
|
|
||||||
|
|
||||||
BINDIR=$(DESTDIR)/usr/bin
|
|
||||||
MANDIR=$(DESTDIR)/usr/share/man
|
|
||||||
LIBDIR=$(DESTDIR)/usr/lib/ruby/$(RUBYVERSION)
|
|
||||||
DOCDIR=$(DESTDIR)/usr/share/doc/$(NAME)
|
|
||||||
|
|
||||||
RDOC=rdoc$(RUBYVERSION)
|
|
||||||
#RDOC=rdoc1.9
|
|
||||||
all: doc test
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -fr doc *.gem
|
|
||||||
|
|
||||||
build:
|
|
||||||
|
|
||||||
.PHONY: doc doc-reader
|
|
||||||
doc-reader: doc
|
|
||||||
xdg-open file://`pwd`/doc/api/index.html
|
|
||||||
|
|
||||||
doc:
|
|
||||||
rm -fr doc/api
|
|
||||||
$(RDOC) \
|
|
||||||
--promiscuous \
|
|
||||||
--inline-source \
|
|
||||||
--line-numbers \
|
|
||||||
-o doc/api lib/
|
|
||||||
# --diagram
|
|
||||||
|
|
||||||
.PHONY: test
|
|
||||||
test:
|
|
||||||
$(MAKE) -C test
|
|
||||||
|
|
||||||
install: doc test
|
|
||||||
# install libraries
|
|
||||||
#
|
|
||||||
find lib -name '*.rb' |while read FILE ; do \
|
|
||||||
FILEPATH=`echo $$FILE |sed -e "s~^lib~$(LIBDIR)~"` ; \
|
|
||||||
install -D -o root -g root -m 644 $$FILE $$FILEPATH ; \
|
|
||||||
done
|
|
||||||
# install binaries
|
|
||||||
find bin -name '*.rb' |while read FILE ; do \
|
|
||||||
FILEPATH=`echo $$FILE |sed -e "s~^bin~$(BINDIR)~"` ; \
|
|
||||||
install -D -o root -g root -m 755 $$FILE $$FILEPATH ; \
|
|
||||||
done
|
|
||||||
# install documentation
|
|
||||||
rm -fr $(DOCDIR)
|
|
||||||
mkdir -p $(DOCDIR)
|
|
||||||
cp -a doc $(DOCDIR)
|
|
||||||
|
|
||||||
gem:
|
|
||||||
gem build $(GEMNAME).gemspec
|
|
||||||
|
|
||||||
gem_install:
|
|
||||||
gem install $(GEMNAME)*.gem
|
|
|
@ -1,36 +0,0 @@
|
||||||
#!/usr/bin/ruby -d
|
|
||||||
|
|
||||||
require 'rake'
|
|
||||||
|
|
||||||
spec = Gem::Specification.new do |s|
|
|
||||||
s.author = 'Glenn Y. Rolland'
|
|
||||||
s.email = 'glenux@glenux.net'
|
|
||||||
s.homepage = 'http://glenux.github.com/xtm-utils/'
|
|
||||||
|
|
||||||
s.signing_key = ENV['GEM_PRIVATE_KEY']
|
|
||||||
s.cert_chain = ENV['GEM_CERTIFICATE_CHAIN']
|
|
||||||
|
|
||||||
s.name = 'xtm-utils'
|
|
||||||
s.version = '0.1'
|
|
||||||
s.summary = 'A set of tools for joining or splitting files using the XTM format.'
|
|
||||||
s.description = ' xtm-utils is a set of tools for joining or splitting files using the XTM format .' \
|
|
||||||
'It is an open-source replacement for the the closed-source binary provided by the XtremSplit website.'
|
|
||||||
|
|
||||||
s.required_ruby_version = '>= 1.8.5'
|
|
||||||
|
|
||||||
s.require_paths = ['xtmfile']
|
|
||||||
s.files = FileList[
|
|
||||||
"xtmfile/*.rb",
|
|
||||||
"bin/*",
|
|
||||||
].to_a + [
|
|
||||||
"Makefile",
|
|
||||||
"xtm-utils.gemspec",
|
|
||||||
"COPYING",
|
|
||||||
"README.rdoc"
|
|
||||||
]
|
|
||||||
s.files.reject! { |fn| fn.include? "coverage" }
|
|
||||||
|
|
||||||
puts "== GEM CONTENT =="
|
|
||||||
puts s.files
|
|
||||||
puts "== /GEM CONTENT =="
|
|
||||||
end
|
|
|
@ -3,7 +3,6 @@ require 'rubygems'
|
||||||
gem 'bindata', '~> 1.2.1'
|
gem 'bindata', '~> 1.2.1'
|
||||||
require 'bindata'
|
require 'bindata'
|
||||||
|
|
||||||
# FIXME: set default values for header fields
|
|
||||||
module XtmFile
|
module XtmFile
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,30 +1,19 @@
|
||||||
|
|
||||||
require 'xtmfile/header'
|
|
||||||
|
|
||||||
module XtmFile
|
module XtmFile
|
||||||
class Splitter
|
class Splitter
|
||||||
attr_reader :parts_size
|
attr_reader :parts, :parts_size
|
||||||
def initialize input_filename
|
def initialize input_filename
|
||||||
@input_filename = input_filename
|
@input_filename = input_filename
|
||||||
|
@parts = 0
|
||||||
# create and initialize header
|
@parts_size = 0
|
||||||
@header = Header.new
|
end
|
||||||
@header.filename_str = @input_filename
|
|
||||||
end
|
def parts= count
|
||||||
|
end
|
||||||
def parts= count
|
|
||||||
@header.filecount = count
|
def parts_size= size
|
||||||
@parts_size = @header.filesize / count
|
end
|
||||||
end
|
|
||||||
|
def start
|
||||||
def parts_size= size
|
end
|
||||||
count = @header.filesize / size
|
end
|
||||||
remain = @header.filesize % size
|
|
||||||
count += 1 if remain > 0
|
|
||||||
@header.filecount = count
|
|
||||||
end
|
|
||||||
|
|
||||||
def start
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue