ssc 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.2
1
+ 0.4.3
@@ -50,8 +50,8 @@ module SSC
50
50
  require_appliance do |appliance|
51
51
  params= {:all_repos => options.all_repos} if options.all_repos
52
52
  software= appliance.search_software(search_string, params)
53
- say_array software.collect do |software|
54
- "#{software.name} v#{software.version}. Repo Id: #{software.repository_id}"
53
+ software.collect do |software|
54
+ say "#{software.name} v#{software.version}. Repo Id: #{software.repository_id}"
55
55
  end
56
56
  end
57
57
  end
@@ -88,7 +88,7 @@ module SSC
88
88
  require_appliance do |appliance|
89
89
  response= appliance.add_package(name)
90
90
  say case response['state']
91
- when "fixed"
91
+ when "changed"
92
92
  "Package Added. State: #{response['state']}"
93
93
  when "equal"
94
94
  "Package Not Added."
@@ -38,10 +38,13 @@ module SSC
38
38
  params= {:filter => search_string}
39
39
  params= params.merge({:base_system => options.base_system}) if options.base_system
40
40
  repos= StudioApi::Repository.find(:all, :params => params)
41
- say_array(repos.collect do |repo|
42
- "#{repo.id}.) #{repo.name}: #{repo.base_url}
43
- #{[repo.matches.software_name].flatten.join(', ')}\n"
44
- end)
41
+ repos.collect do |repo|
42
+ # for some reason some repos don't have a base_url
43
+ if repo.respond_to?('base_url')
44
+ say "#{repo.id}.) #{repo.name}: #{repo.base_url}
45
+ #{[repo.matches.attributes["software_name"]].flatten.join(', ')}\n"
46
+ end
47
+ end
45
48
  end
46
49
 
47
50
  desc "repository list", "list all repositories in a given appliance"
@@ -71,7 +74,7 @@ module SSC
71
74
  if options.remote?
72
75
  require_appliance do |appliance|
73
76
  response= appliance.add_repository(repo_ids)
74
- say "Added"+( response.collect{|repos| repos.name} ).join(", ")
77
+ say "Added "+( response.collect{|repos| repos.name} ).join(", ")
75
78
  end
76
79
  else
77
80
  repo_file= RepositoryFile.new
@@ -5,19 +5,30 @@ module SSC
5
5
  desc 'template list_sets', 'list all available template sets'
6
6
  require_authorization
7
7
  def list_sets
8
- templates= StudioApi::TemplateSet.find(:all)
8
+ templates= get_templates
9
9
  say_array templates.collect {|template| template.name}
10
10
  end
11
11
 
12
12
  desc 'template list SET_NAME', 'show details of a particular template set'
13
13
  require_authorization
14
14
  def list(name)
15
- template_set= StudioApi::TemplateSet.find(name)
16
- out = [template_set.name+' : '+template_set.description]
17
- out += template_set.template.collect do |appliance|
18
- "#{appliance.appliance_id}: #{appliance.name}"
15
+ template_set= get_templates.select{|t| t.name == name}[0]
16
+
17
+ if template_set.nil?
18
+ say "Template set called '#{name}' was not found."
19
+ else
20
+ out = [template_set.name+' : '+template_set.description]
21
+ out += template_set.template.collect do |appliance|
22
+ "#{appliance.appliance_id}: #{appliance.name}"
23
+ end
24
+ say_array out
19
25
  end
20
- say_array out
26
+ end
27
+
28
+ private
29
+
30
+ def get_templates
31
+ StudioApi::TemplateSet.find(:all)
21
32
  end
22
33
  end
23
34
  end
data/ssc.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ssc}
8
- s.version = "0.4.2"
8
+ s.version = "0.4.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ratan Sebastian"]
12
- s.date = %q{2011-09-06}
12
+ s.date = %q{2011-09-07}
13
13
  s.default_executable = %q{ssc}
14
14
  s.description = %q{Command-line client for Suse Studio}
15
15
  s.email = %q{rjsvaljean@gmail.com}
@@ -21,7 +21,7 @@ class TestRepository < Test::Unit::TestCase
21
21
 
22
22
  context "search" do
23
23
  setup do
24
- @default_mock_repo.stubs(:matches).returns(stub(:software_name => ''))
24
+ @default_mock_repo.stubs(:matches).returns(stub(:attributes => ''))
25
25
  StudioApi::Repository.expects(:find).with(:all, has_entry(:params, {:filter => 'search_string'})).returns([@default_mock_repo])
26
26
  end
27
27
  should "search all repos" do
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 2
9
- version: 0.4.2
8
+ - 3
9
+ version: 0.4.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ratan Sebastian
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-09-06 00:00:00 +02:00
17
+ date: 2011-09-07 00:00:00 +02:00
18
18
  default_executable: ssc
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency