Author: dmacvicar Date: Sat Dec 22 18:16:14 2007 New Revision: 8144 URL: http://svn.opensuse.org/viewcvs/zypp?rev=8144&view=rev Log: Follow conventions!!!! Ruby module names must be capitalized, but the convention for Ruby feature names is to use lowercase names. So, for example, the Etc extension module is imported by requiring the etc feature: # The feature name begins with a lowercase letter... require 'etc' # ... but the module name begins with an uppercase letter puts "Your login name: #{Etc.getlogin}" Also, having a pure ruby wrapper allows for extending the native module with pure ruby code. We want to AVOID C code. Modified: trunk/sat-solver/bindings/ruby/CMakeLists.txt trunk/sat-solver/bindings/ruby/tests/pool.rb trunk/sat-solver/bindings/ruby/tests/solvable.rb Modified: trunk/sat-solver/bindings/ruby/CMakeLists.txt URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/bindings/ruby/CMakeLists.txt?rev=8144&r1=8143&r2=8144&view=diff ============================================================================== --- trunk/sat-solver/bindings/ruby/CMakeLists.txt (original) +++ trunk/sat-solver/bindings/ruby/CMakeLists.txt Sat Dec 22 18:16:14 2007 @@ -1,5 +1,7 @@ ADD_SUBDIRECTORY(tests) - + +INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/tools") + EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['vendorarchdir']" OUTPUT_VARIABLE RUBY_VENDOR_ARCH_DIR) MESSAGE(STATUS "Ruby executable: ${RUBY_EXECUTABLE}") @@ -22,15 +24,15 @@ DEPENDS ${SWIG_OUTPUT} ) -SET(SatSolver_SRCS "${CMAKE_CURRENT_BINARY_DIR}/libsatsolver_wrap.c" "${CMAKE_SOURCE_DIR}/tools/repo_rpmdb.c") -ADD_LIBRARY( SatSolver SHARED ${SatSolver_SRCS}) -SET_TARGET_PROPERTIES( SatSolver PROPERTIES PREFIX "" ) -ADD_DEPENDENCIES( SatSolver glue ) - -INCLUDE_DIRECTORIES( ${RUBY_INCLUDE_PATH} ${CMAKE_SOURCE_DIR}/tools ) -TARGET_LINK_LIBRARIES( SatSolver satsolver ) -TARGET_LINK_LIBRARIES( SatSolver ${RUBY_LIBRARY} ) -TARGET_LINK_LIBRARIES( SatSolver ${DB43_LIBRARY} ) - -INSTALL(TARGETS SatSolver LIBRARY DESTINATION ${RUBY_VENDOR_ARCH_DIR}) -#INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/satsolver.rb DESTINATION ${RUBY_VENDORLIB_DIR} ) \ No newline at end of file +SET(satsolverx_SRCS "${CMAKE_CURRENT_BINARY_DIR}/libsatsolver_wrap.c" ) +ADD_LIBRARY( satsolverx SHARED "${satsolverx_SRCS}" ) +SET_TARGET_PROPERTIES( satsolverx PROPERTIES PREFIX "" ) +ADD_DEPENDENCIES( satsolverx glue ) + +INCLUDE_DIRECTORIES( ${RUBY_INCLUDE_PATH} ) +TARGET_LINK_LIBRARIES( satsolverx satsolver ) +TARGET_LINK_LIBRARIES( satsolverx ${RUBY_LIBRARY} ) + +INSTALL(TARGETS satsolverx LIBRARY DESTINATION ${RUBY_VENDOR_ARCH_DIR}) +CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/satsolver.rb ${CMAKE_CURRENT_BINARY_DIR}/satsolver.rb COPYONLY ) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/satsolver.rb DESTINATION ${RUBY_VENDORLIB_DIR} ) Modified: trunk/sat-solver/bindings/ruby/tests/pool.rb URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/bindings/ruby/tests/pool.rb?rev=8144&r1=8143&r2=8144&view=diff ============================================================================== --- trunk/sat-solver/bindings/ruby/tests/pool.rb (original) +++ trunk/sat-solver/bindings/ruby/tests/pool.rb Sat Dec 22 18:16:14 2007 @@ -1,7 +1,7 @@ $: << "../../../build/bindings/ruby" # test Pool require 'test/unit' -require 'SatSolver' +require 'satsolver' class PoolTest < Test::Unit::TestCase def test_pool Modified: trunk/sat-solver/bindings/ruby/tests/solvable.rb URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/bindings/ruby/tests/solvable.rb?rev=8144&r1=8143&r2=8144&view=diff ============================================================================== --- trunk/sat-solver/bindings/ruby/tests/solvable.rb (original) +++ trunk/sat-solver/bindings/ruby/tests/solvable.rb Sat Dec 22 18:16:14 2007 @@ -1,7 +1,7 @@ $: << "../../../build/bindings/ruby" # test Solvable require 'test/unit' -require 'SatSolver' +require 'satsolver' def show_dep name, deps return unless deps -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org