modified dir struct
authorTamas Jung <tamasjung@gmail.com>
Wed, 10 Nov 2010 21:45:45 +0000 (22:45 +0100)
committerTamas Jung <tamasjung@gmail.com>
Wed, 10 Nov 2010 21:45:45 +0000 (22:45 +0100)
42 files changed:
.autotest [new file with mode: 0644]
.gitignore
History.txt [new file with mode: 0644]
Manifest.txt [new file with mode: 0644]
PostInstall.txt [new file with mode: 0644]
README.rdoc [new file with mode: 0644]
Rakefile [new file with mode: 0644]
ext/arc_get.cpp [moved from src/arc_get.cpp with 100% similarity]
ext/arc_get.h [moved from src/arc_get.h with 100% similarity]
ext/arc_libs.h [moved from src/arc_libs.h with 100% similarity]
ext/arc_stat.cpp [moved from src/arc_stat.cpp with 100% similarity]
ext/arc_stat.h [moved from src/arc_stat.h with 100% similarity]
ext/arc_submit.cpp [moved from src/arc_submit.cpp with 100% similarity]
ext/arc_submit.h [moved from src/arc_submit.h with 100% similarity]
ext/arcclientc.cpp [moved from src/arcclientc.cpp with 100% similarity]
ext/arcclientc.h [moved from src/arcclientc.h with 100% similarity]
ext/common_utils.cpp [moved from src/common_utils.cpp with 100% similarity]
ext/common_utils.h [moved from src/common_utils.h with 100% similarity]
ext/config.h [moved from src/config.h with 100% similarity]
ext/extconf.rb [moved from ruby/ext/extconf.rb with 93% similarity]
ext/logger.h [moved from src/logger.h with 100% similarity]
ext/prefix_header.h [moved from src/prefix_header.h with 100% similarity]
lib/arc_client_c_wrapper.rb [moved from ruby/lib/arc_client_c_wrapper.rb with 100% similarity]
lib/arc_client_r.rb [moved from ruby/lib/arc_client_r.rb with 100% similarity]
lib/ffi_libc.rb [moved from ruby/lib/ffi_libc.rb with 100% similarity]
lib/gp-arc-client-c.rb [new file with mode: 0644]
ruby/21879128810430113901471/err.txt [deleted file]
ruby/21879128810430113901471/out.txt [deleted file]
ruby/218791288114550534117300/err.txt [deleted file]
ruby/218791288114550534117300/out.txt [deleted file]
ruby/test_job_list.xml [deleted file]
script/console [new file with mode: 0755]
script/destroy [new file with mode: 0755]
script/generate [new file with mode: 0755]
tasks/extconf.rake [new file with mode: 0644]
tasks/extconf/arc_client_c.rake [new file with mode: 0644]
test/test.rb [moved from ruby/test.rb with 100% similarity]
test/test_base.rb [moved from ruby/tests/test_base.rb with 100% similarity]
test/test_get.rb [moved from ruby/tests/test_get.rb with 100% similarity]
test/test_helper.rb [moved from ruby/tests/test_helper.rb with 86% similarity]
test/test_stat.rb [moved from ruby/tests/test_stat.rb with 100% similarity]
test/test_submit.rb [moved from ruby/tests/test_submit.rb with 93% similarity]

diff --git a/.autotest b/.autotest
new file mode 100644 (file)
index 0000000..452c567
--- /dev/null
+++ b/.autotest
@@ -0,0 +1,9 @@
+Autotest.add_hook :initialize do |at|
+  at.add_mapping(/ext\/.*\/(.*)\.[ch]/) do |_, m|
+        ["test/test_#{m[1]}_extn.rb"]
+      end
+end
+
+Autotest.add_hook :run_command do |at|
+  system "rake compile"
+end
index 6db0746..ad635c6 100644 (file)
@@ -1,2 +1,10 @@
 build
 arcclientc.xcodeproj
+Makefile
+    *.o
+    *.bundle
+    *.so
+    *.dll
+    pkg
+    doc
+    .DS_Store
diff --git a/History.txt b/History.txt
new file mode 100644 (file)
index 0000000..de7f87f
--- /dev/null
@@ -0,0 +1,4 @@
+=== 0.0.1 2010-11-10
+
+* 1 major enhancement:
+  * Initial release
diff --git a/Manifest.txt b/Manifest.txt
new file mode 100644 (file)
index 0000000..12fc338
--- /dev/null
@@ -0,0 +1,32 @@
+History.txt
+Manifest.txt
+PostInstall.txt
+README.rdoc
+Rakefile
+ext/extconf.rb
+lib/arc_client_c_wrapper.rb
+lib/arc_client_r.rb
+lib/ffi_libc.rb
+test/test_base.rb
+test/test_get.rb
+test/test_helper.rb
+test/test_stat.rb
+test/test_submit.rb
+script/console
+script/destroy
+script/generate
+ext/arc_get.cpp
+ext/arc_get.h
+ext/arc_libs.h
+ext/arc_stat.cpp
+ext/arc_stat.h
+ext/arc_submit.cpp
+ext/arc_submit.h
+ext/arcclientc.cpp
+ext/arcclientc.h
+ext/common_utils.cpp
+ext/common_utils.h
+ext/config.h
+ext/logger.h
+ext/prefix_header.h
+
diff --git a/PostInstall.txt b/PostInstall.txt
new file mode 100644 (file)
index 0000000..80f7797
--- /dev/null
@@ -0,0 +1,7 @@
+
+For more information on gp-arc-client-c, see http://gp-arc-client-c.rubyforge.org
+
+NOTE: Change this information in PostInstall.txt 
+You can also delete it if you don't want it.
+
+
diff --git a/README.rdoc b/README.rdoc
new file mode 100644 (file)
index 0000000..1b04005
--- /dev/null
@@ -0,0 +1,48 @@
+= gp-arc-client-c
+
+* http://github.com/#{github_username}/#{project_name}
+
+== DESCRIPTION:
+
+FIX (describe your package)
+
+== FEATURES/PROBLEMS:
+
+* FIX (list of features or problems)
+
+== SYNOPSIS:
+
+  FIX (code sample of usage)
+
+== REQUIREMENTS:
+
+* FIX (list of requirements)
+
+== INSTALL:
+
+* FIX (sudo gem install, anything else)
+
+== LICENSE:
+
+(The MIT License)
+
+Copyright (c) 2010 FIXME full name
+
+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.
\ No newline at end of file
diff --git a/Rakefile b/Rakefile
new file mode 100644 (file)
index 0000000..7b1a351
--- /dev/null
+++ b/Rakefile
@@ -0,0 +1,26 @@
+require 'rubygems'\r
+gem 'hoe', '>= 2.1.0'\r
+require 'hoe'\r
+require 'fileutils'\r
+require './lib/gp-arc-client-c'\r
+\r
+Hoe.plugin :newgem\r
+# Hoe.plugin :website\r
+# Hoe.plugin :cucumberfeatures\r
+\r
+# Generate all the Rake tasks\r
+# Run 'rake -T' to see list of generated tasks (from gem root directory)\r
+$hoe = Hoe.spec 'gp-arc-client-c' do\r
+  self.developer 'FIXME full name', 'FIXME email'\r
+  self.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required\r
+  self.rubyforge_name       = self.name # TODO this is default value\r
+  # self.extra_deps         = [['activesupport','>= 2.0.2']]\r
+\r
+end\r
+\r
+require 'newgem/tasks'\r
+Dir['tasks/**/*.rake'].each { |t| load t }\r
+\r
+# TODO - want other tests/tasks run by default? Add them to the list\r
+# remove_task :default\r
+# task :default => [:spec, :features]\r
similarity index 100%
rename from src/arc_get.cpp
rename to ext/arc_get.cpp
similarity index 100%
rename from src/arc_get.h
rename to ext/arc_get.h
similarity index 100%
rename from src/arc_libs.h
rename to ext/arc_libs.h
similarity index 100%
rename from src/arc_stat.cpp
rename to ext/arc_stat.cpp
similarity index 100%
rename from src/arc_stat.h
rename to ext/arc_stat.h
similarity index 100%
rename from src/arc_submit.cpp
rename to ext/arc_submit.cpp
similarity index 100%
rename from src/arc_submit.h
rename to ext/arc_submit.h
similarity index 100%
rename from src/arcclientc.cpp
rename to ext/arcclientc.cpp
similarity index 100%
rename from src/arcclientc.h
rename to ext/arcclientc.h
similarity index 100%
rename from src/common_utils.cpp
rename to ext/common_utils.cpp
similarity index 100%
rename from src/common_utils.h
rename to ext/common_utils.h
similarity index 100%
rename from src/config.h
rename to ext/config.h
similarity index 93%
rename from ruby/ext/extconf.rb
rename to ext/extconf.rb
index 8fb210d..06a12b0 100644 (file)
@@ -17,7 +17,7 @@ dirs.split.each do |dir|
 end
 
 
-["/opt/local"].each do |prefix|
+["/opt/local", "/usr/lib"].each do |prefix|
 
   find_header "libxml/xmlmemory.h", "#{prefix}/include/libxml2"
   find_header "sigc++/slot.h", "#{prefix}/include/sigc++-2.0"
similarity index 100%
rename from src/logger.h
rename to ext/logger.h
similarity index 100%
rename from src/prefix_header.h
rename to ext/prefix_header.h
similarity index 100%
rename from ruby/lib/arc_client_r.rb
rename to lib/arc_client_r.rb
similarity index 100%
rename from ruby/lib/ffi_libc.rb
rename to lib/ffi_libc.rb
diff --git a/lib/gp-arc-client-c.rb b/lib/gp-arc-client-c.rb
new file mode 100644 (file)
index 0000000..10adc8f
--- /dev/null
@@ -0,0 +1,6 @@
+$:.unshift(File.dirname(__FILE__)) unless
+  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
+
+module GpArcClientC
+  VERSION = '0.0.1'
+end
\ No newline at end of file
diff --git a/ruby/21879128810430113901471/err.txt b/ruby/21879128810430113901471/err.txt
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/ruby/21879128810430113901471/out.txt b/ruby/21879128810430113901471/out.txt
deleted file mode 100644 (file)
index 7bee7a7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Linux interop 2.6.26-2-686-bigmem #1 SMP Thu Sep 16 20:29:07 UTC 2010 i686 GNU/Linux
diff --git a/ruby/218791288114550534117300/err.txt b/ruby/218791288114550534117300/err.txt
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/ruby/218791288114550534117300/out.txt b/ruby/218791288114550534117300/out.txt
deleted file mode 100644 (file)
index 7bee7a7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Linux interop 2.6.26-2-686-bigmem #1 SMP Thu Sep 16 20:29:07 UTC 2010 i686 GNU/Linux
diff --git a/ruby/test_job_list.xml b/ruby/test_job_list.xml
deleted file mode 100644 (file)
index 026fa4d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<ArcConfig/>
\ No newline at end of file
diff --git a/script/console b/script/console
new file mode 100755 (executable)
index 0000000..07b0879
--- /dev/null
@@ -0,0 +1,10 @@
+#!/usr/bin/env ruby
+# File: script/console
+irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
+
+libs =  " -r irb/completion"
+# Perhaps use a console_lib to store any extra methods I may want available in the cosole
+# libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
+libs <<  " -r #{File.dirname(__FILE__) + '/../lib/gp-arc-client-c.rb'}"
+puts "Loading gp-arc-client-c gem"
+exec "#{irb} #{libs} --simple-prompt"
\ No newline at end of file
diff --git a/script/destroy b/script/destroy
new file mode 100755 (executable)
index 0000000..e48464d
--- /dev/null
@@ -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! [:rubygems, :newgem, :newgem_theme, :test_unit]
+RubiGen::Scripts::Destroy.new.run(ARGV)
diff --git a/script/generate b/script/generate
new file mode 100755 (executable)
index 0000000..c27f655
--- /dev/null
@@ -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! [:rubygems, :newgem, :newgem_theme, :test_unit]
+RubiGen::Scripts::Generate.new.run(ARGV)
diff --git a/tasks/extconf.rake b/tasks/extconf.rake
new file mode 100644 (file)
index 0000000..d95b449
--- /dev/null
@@ -0,0 +1,13 @@
+namespace :extconf do
+  desc "Compiles the Ruby extension"
+  task :compile
+end
+
+task :compile => "extconf:compile"
+
+task :test => :compile
+
+BIN = "*.{bundle,jar,so,obj,pdb,lib,def,exp}"
+$hoe.clean_globs |= ["ext/**/#{BIN}", "lib/**/#{BIN}", 'ext/**/Makefile']
+$hoe.spec.require_paths = Dir['{lib,ext/*}']
+$hoe.spec.extensions = FileList["ext/**/extconf.rb"].to_a
diff --git a/tasks/extconf/arc_client_c.rake b/tasks/extconf/arc_client_c.rake
new file mode 100644 (file)
index 0000000..3802101
--- /dev/null
@@ -0,0 +1,43 @@
+namespace :extconf do
+  extension = File.basename(__FILE__, '.rake')
+
+  ext = "ext/#{extension}"
+  ext_so = "#{ext}/#{extension}.#{Config::CONFIG['DLEXT']}"
+  ext_files = FileList[
+    "#{ext}/*.c",
+    "#{ext}/*.h",
+    "#{ext}/*.rl",
+    "#{ext}/extconf.rb",
+    "#{ext}/Makefile",
+    # "lib"
+  ]
+
+
+  task :compile => extension do
+    if Dir.glob("**/#{extension}.{o,so,dll}").length == 0
+      STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
+      STDERR.puts "Gem actually failed to build.  Your system is"
+      STDERR.puts "NOT configured properly to build #{GEM_NAME}."
+      STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
+      exit(1)
+    end
+  end
+
+  desc "Builds just the #{extension} extension"
+  task extension.to_sym => ["#{ext}/Makefile", ext_so ]
+
+  file "#{ext}/Makefile" => ["#{ext}/extconf.rb"] do
+    Dir.chdir(ext) do ruby "extconf.rb" end
+  end
+
+  file ext_so => ext_files do
+    Dir.chdir(ext) do
+      sh(PLATFORM =~ /win32/ ? 'nmake' : 'make') do |ok, res|
+        if !ok
+          require "fileutils"
+          FileUtils.rm Dir.glob('*.{so,o,dll,bundle}')
+        end
+      end
+    end
+  end
+end
\ No newline at end of file
similarity index 100%
rename from ruby/test.rb
rename to test/test.rb
similarity index 100%
rename from ruby/tests/test_base.rb
rename to test/test_base.rb
similarity index 100%
rename from ruby/tests/test_get.rb
rename to test/test_get.rb
similarity index 86%
rename from ruby/tests/test_helper.rb
rename to test/test_helper.rb
index e74674b..8c42534 100644 (file)
@@ -12,8 +12,9 @@ UNAME_JSDL = <<-EO_XML
     </JobIdentification>
     <Application>
      <posix:POSIXApplication>
-        <posix:Executable>/bin/uname</posix:Executable>
-             <posix:Argument>-a</posix:Argument>
+        <posix:Executable>uname</posix:Executable>
+             <posix:Argument>-s</posix:Argument>
+             <posix:Argument>-n</posix:Argument>
         <posix:Output>out.txt</posix:Output>
         <posix:Error>err.txt</posix:Error>
       </posix:POSIXApplication>
similarity index 100%
rename from ruby/tests/test_stat.rb
rename to test/test_stat.rb
similarity index 93%
rename from ruby/tests/test_submit.rb
rename to test/test_submit.rb
index 4106bea..e6fd9a0 100644 (file)
@@ -3,7 +3,7 @@ require 'arc_client_r'
 
 class TestSubmit < ::Test::Unit::TestCase
   
-  def xtest_base
+  def test_base
     arc_client = ArcClientR.new
     message, job_id = arc_client.submit(["-e", UNAME_JSDL, "-j", "test_job_list.xml"])
     p message