bosdk 0.1.2-universal-java-1.6 → 1.0.0-universal-java-1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- = BOSDK.gem
1
+ = BOSDK.gem v1.0.0
2
2
 
3
3
  == Description
4
4
 
@@ -15,14 +15,24 @@ A JRuby wrapper for the Business Objects SDK
15
15
 
16
16
  require 'bosdk'
17
17
  include BOSDK
18
- boe = EnterpriseSession.new('cms', 'Administrator', '')
18
+ session = EnterpriseSession.new('cms', 'Administrator', '')
19
19
 
20
20
  stmt = "SELECT TOP 10 * FROM CI_SYSTEMOBJECTS WHERE SI_KIND='User'"
21
- boe.query(stmt).each do |obj|
21
+ session.query(stmt).each do |obj|
22
22
  puts obj.path
23
23
  end
24
24
 
25
- boe.disconnect
25
+ session.disconnect
26
+
27
+ Alternatively you can use the #connect closure.
28
+
29
+ require 'bosdk'
30
+ BOSDK.connect('cms', 'Administrator', '') do |session|
31
+ stmt = "SELECT TOP 10 * FROM CI_SYSTEMOBJECTS WHERE SI_KIND='User'"
32
+ session.query(stmt).each do |obj|
33
+ puts obj.path
34
+ end
35
+ end
26
36
 
27
37
  == Resources
28
38
 
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ task :rdoc do
9
9
  end
10
10
 
11
11
  desc 'build gem'
12
- task :gem => :rdoc do
12
+ task :gem do
13
13
  sh 'gem build bosdk.gemspec'
14
14
  end
15
15
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "bosdk"
3
- s.version = "0.1.2"
3
+ s.version = "1.0.0"
4
4
 
5
5
  s.author = "Shane Emmons"
6
6
  s.description = "A JRuby wrapper for the Business Objects Java SDK"
@@ -26,3 +26,12 @@ include_class "com.crystaldecisions.sdk.framework.CrystalEnterprise"
26
26
 
27
27
  require 'bosdk/enterprise_session'
28
28
  require 'bosdk/info_object'
29
+
30
+ module BOSDK
31
+ # A closure over EnterpriseSession
32
+ def BOSDK.connect(cms, username, password, &block)
33
+ session = EnterpriseSession.new(cms, username, password)
34
+ yield session
35
+ session.disconnect
36
+ end
37
+ end
@@ -31,6 +31,7 @@ module BOSDK
31
31
  title <=> other_infoobject.title
32
32
  end
33
33
 
34
+ # Forwards method to underlying IInfoObject and stores the results
34
35
  def method_missing(method, *args)
35
36
  eval "return @#{method.to_s}" if instance_variables.include?("@#{method.to_s}")
36
37
  if @obj.respond_to?(method)
@@ -39,6 +40,7 @@ module BOSDK
39
40
  super
40
41
  end
41
42
 
43
+ # Returns true if underlying IInfoObject#respond_to? is true
42
44
  def respond_to?(method)
43
45
  @obj.respond_to?(method) || super
44
46
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bosdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 1.0.0
5
5
  platform: universal-java-1.6
6
6
  authors:
7
7
  - Shane Emmons