Mailinglist Archive: yast-commit (1914 mails)

< Previous Next >
[yast-commit] <rest-service> basesystem : Hide implementation (packagekit) in 'resolvable' base class
  • From: Klaus Kämpf <kkaempf@xxxxxxx>
  • Date: Thu, 10 Sep 2009 11:39:58 +0200
  • Message-id: <E1MlgmZ-0006Q0-Io@xxxxxxxxxxxxxxxx>
ref: refs/heads/basesystem
commit 6ba5d11babc8ca84a6b305508f18f70218d70cd6
Author: Klaus Kämpf <kkaempf@xxxxxxx>
Date: Thu Sep 10 11:39:58 2009 +0200

Hide implementation (packagekit) in 'resolvable' base class
---
plugins/patches/app/models/package.rb | 8 ++------
plugins/patches/app/models/patch.rb | 19 ++-----------------
plugins/patches/app/models/resolvable.rb | 10 +++++++++-
3 files changed, 13 insertions(+), 24 deletions(-)

diff --git a/plugins/patches/app/models/package.rb
b/plugins/patches/app/models/package.rb
index 96e10e6..47a7511 100644
--- a/plugins/patches/app/models/package.rb
+++ b/plugins/patches/app/models/package.rb
@@ -1,10 +1,6 @@
-require 'packagekit'
+require 'resolvable'

-class Package < PackageKitModule
-
- attr_accessor :resolvable_id,
- :name,
- :version
+class Package < Resolvable

def to_xml( options = {} )
xml = options[:builder] ||= Builder::XmlMarkup.new(options)
diff --git a/plugins/patches/app/models/patch.rb
b/plugins/patches/app/models/patch.rb
index eaf0e58..c7625bf 100644
--- a/plugins/patches/app/models/patch.rb
+++ b/plugins/patches/app/models/patch.rb
@@ -1,22 +1,7 @@
-require 'packagekit'
+require 'resolvable'

# Model for patches available via package kit
-class Patch < PackageKitModule
-
- attr_accessor :resolvable_id,
- :kind,
- :name,
- :arch,
- :repo,
- :summary
-
- def id
- @resolvable_id
- end
-
- def id=(id_val)
- @resolvable_id = id_val
- end
+class Patch < Resolvable

# returns the modification time of
# the patch status, which you can use
diff --git a/plugins/patches/app/models/resolvable.rb
b/plugins/patches/app/models/resolvable.rb
index 5f7c654..fc25636 100644
--- a/plugins/patches/app/models/resolvable.rb
+++ b/plugins/patches/app/models/resolvable.rb
@@ -3,7 +3,15 @@ require 'socket'
require 'thread'

# Model for patches available via package kit
-class PackageKitModule
+class Resolvable
+
+ attr_accessor :resolvable_id,
+ :kind,
+ :name,
+ :version,
+ :arch,
+ :repo,
+ :summary

def id
@resolvable_id
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages