Skip to content
This repository has been archived by the owner on Jan 7, 2018. It is now read-only.

Commit

Permalink
Update related with the new interface for config_context gem
Browse files Browse the repository at this point in the history
  • Loading branch information
jjuarez committed Jun 3, 2011
1 parent d8844af commit 05d67cb
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
12 changes: 5 additions & 7 deletions Rakefile
Expand Up @@ -9,7 +9,7 @@ end


begin
require File.join( File.dirname( __FILE__ ), %w[lib version.rb] )
require File.join( File.dirname( __FILE__ ), %w[lib ldap-shell-utils version.rb] )
rescue LoadError => le
fail( le.message )
end
Expand All @@ -35,14 +35,14 @@ task :build =>[:clean] do

Jeweler::Tasks.new do |gemspec|

gemspec.name = Version::NAME
gemspec.version = Version::VERSION
gemspec.rubyforge_project = "http://github.com/jjuarez/#{Version::NAME}"
gemspec.name = LdapShellUtils::Version::NAME
gemspec.version = LdapShellUtils::Version::VERSION
gemspec.rubyforge_project = "http://github.com/jjuarez/#{LdapShellUtils::Version::NAME}"
gemspec.license = 'MIT License'
gemspec.summary = 'A minimal ldapsearch wrapper'
gemspec.description = 'This is a simple wrapper over ldapsearch util avoiding base64 dn and others gotchas'
gemspec.email = 'javier.juarez@gmail.com'
gemspec.homepage = "http://github.com/jjuarez/#{Version::NAME}"
gemspec.homepage = "http://github.com/jjuarez/#{LdapShellUtils::Version::NAME}"
gemspec.authors = ['Javier Juarez']
gemspec.files = Dir[ 'lib/**/*.rb' ] + Dir[ 'test/**/*.rb' ]
gemspec.executables = ['lsu']
Expand All @@ -51,8 +51,6 @@ task :build =>[:clean] do
gemspec.add_runtime_dependency( 'slop' )
gemspec.add_runtime_dependency( 'config_context' )
end

Jeweler::RubygemsDotOrgTasks.new
end


Expand Down
5 changes: 3 additions & 2 deletions lib/ldap-shell-utils/cli_application.rb
Expand Up @@ -14,8 +14,9 @@ def print_entry( entry )

def run( options )

ConfigContext.load( File.expand_path( options[:config] ) )
results = LdapConnection.new( ConfigContext.url, ConfigContext.all ).search( options[:filter], options[:attributes], options[:audit] )
ConfigContext.configure( File.expand_path( options[:config] ) )

results = LdapConnection.new( ConfigContext.url, ConfigContext.to_hash ).search( options[:filter], options[:attributes], options[:audit] )
results.each { |e| print_entry( e ) } if results
rescue Exception => e
$stderr.puts( e.message )
Expand Down
3 changes: 1 addition & 2 deletions lib/ldap-shell-utils/ldap_connection.rb
Expand Up @@ -29,8 +29,7 @@ def initialize( url, config )
}

@configuration[:encryption] = { :method => :simple_tls } if( @uri.scheme.to_sym == :ldaps )

@connection = Net::LDAP.new( @configuration )
@connection = Net::LDAP.new( @configuration )

self
rescue Exception => e
Expand Down
12 changes: 12 additions & 0 deletions lib/ldap-shell-utils/version.rb
@@ -0,0 +1,12 @@
module LdapShellUtils
module Version
INFO = {
:major =>0,
:minor =>0,
:patch =>3
}

NAME = 'ldap-shell-utils'
VERSION = [ INFO[:major], INFO[:minor], INFO[:patch] ].join( '.' )
end
end
10 changes: 0 additions & 10 deletions lib/version.rb

This file was deleted.

0 comments on commit 05d67cb

Please sign in to comment.