suppository 0.0.3 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MGVlYmFkYTM5ODQwNGI1MDJlODA5YWQwMWMwYmNjOTNiY2I5ZjdlNg==
4
+ MzUzYWU5N2UzZWUyMTQ5MjNhYzBlMWVmNzY3MzkwZjU2YTcyYjM4YQ==
5
5
  data.tar.gz: !binary |-
6
- M2FjZjA0ODRlNDczYTZjOWIwOWIwNDgzMjU1MmEyYTE4NmI1ODc2YQ==
6
+ ZWI3ZGNhN2VmYWY5NTU2ZmI1ZDYyYTczZDE3OTdhZjk5NzY0MjQ1MA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Y2Q5NTlkYTBiNWU3NDJjMWQyNjYxNWU1NjhjZDBmODNhYzgzMTk2OTAzMTc2
10
- NWVjYmI3MzRhMzY5NGExYWY5MDlhZTU5OTc4Yjc1MjQ3MTVjOTEzODk5NjMx
11
- ZDUxMmUzYmIyMzkxYzFkZjM1MGI1ODg2NzIyMTJmNjk2MTY4Yjg=
9
+ MjUxYmNmOTVjN2U1NzhhNmI3N2M3OWFhNzJhZTM2YjdkYzY1OGM4ODZmMWEy
10
+ YjRjNTQ4YTA5ZGM0NDUyYWI2ZWYwMDUyZWY5NGQ0YzQ0MGE1NzVjNGY5OGNk
11
+ NTQ0MjMyYzdlZTZjMjViODYyYjk0ZDBkYjA0ZGZlYWRjYTNlM2E=
12
12
  data.tar.gz: !binary |-
13
- NGFlZGYwYTU4NWQzZWYwOGIxM2E5Y2ZjNzliMzkwMDkyNjIyZjk2YjJmYmE4
14
- NjA4N2FkYzYyZjgzNmFkODg5ZDU0MzM3NzEzZGEzMTBmNzgwMjU1MDkzOTVh
15
- MThhM2MzYzIyM2I0NmVkYzhiN2IyYjI5MTNlNWRjNTFjMTExODY=
13
+ MDEyOTY0NTU2MTk2YjMwZjllZWQyMDhkNWQ1Y2M1YmJhOGViM2QyZjQ4ODY3
14
+ ZjJhMGFhOThjYjMzNTRiYzNkNWQ1M2E1YjcyNDdlNGZlMGRjM2UwZTVlNzUz
15
+ MzQ2YzkzZGMzM2IyMDY2OTA1Nzk4OWNhNDEzYTFhZTI0ZmRjMWM=
data/Guardfile CHANGED
@@ -23,8 +23,8 @@
23
23
  #
24
24
  # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
25
25
 
26
- guard :rspec , cmd: 'bundle exec rspec' do
26
+ guard :rspec, cmd: 'bundle exec rspec' do
27
27
  watch(%r{^spec/.+_spec\.rb$})
28
28
  watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
29
- watch('spec/spec_helper.rb') { "spec" }
29
+ watch('spec/spec_helper.rb') { 'spec' }
30
30
  end
data/README.md CHANGED
@@ -71,7 +71,7 @@ This will run all the tests and then create a gem file. NOTE: Only files tracked
71
71
 
72
72
  Check everything build and the tests pass
73
73
 
74
- $ bundle exec build
74
+ $ bundle exec rake build
75
75
 
76
76
  Create release using GitFlow (http://danielkummer.github.io/git-flow-cheatsheet/)
77
77
 
data/Rakefile CHANGED
@@ -4,11 +4,11 @@ require 'rspec/core/rake_task'
4
4
  require 'rubocop/rake_task'
5
5
  require 'suppository/version'
6
6
 
7
- desc "Run Code quality checks and tests "
8
- task :default => [:clean,:rubocop,:test]
7
+ desc 'Run Code quality checks and tests '
8
+ task default: [:clean, :rubocop, :test]
9
9
 
10
- desc "Run Code quality checks, tests and then create Gem File"
11
- task :build => [:clean,:rubocop,:test,:gem]
10
+ desc 'Run Code quality checks, tests and then create Gem File'
11
+ task build: [:clean, :rubocop, :test, :gem]
12
12
 
13
13
  CLEAN.include("suppository-#{Suppository::VERSION}.gem")
14
14
  CLEAN.include('coverage')
@@ -18,8 +18,8 @@ task :test do
18
18
  t.pattern = 'spec/**/*_spec.rb'
19
19
  t.verbose = false
20
20
  end
21
-
22
- Rake::Task["spec"].execute
21
+
22
+ Rake::Task['spec'].execute
23
23
  end
24
24
 
25
25
  task :rubocop do
@@ -30,5 +30,5 @@ task :rubocop do
30
30
  end
31
31
 
32
32
  task :gem do
33
- system "gem build suppository.gemspec"
33
+ system 'gem build suppository.gemspec'
34
34
  end
data/bin/suppository CHANGED
@@ -5,16 +5,16 @@ require_relative '../lib/suppository/cli'
5
5
  require_relative '../lib/suppository/logger'
6
6
  require_relative '../lib/suppository/help'
7
7
 
8
- std_trap = trap("INT") { exit! 130 } # no backtrace thanks
8
+ std_trap = trap('INT') { exit! 130 } # no backtrace thanks
9
9
 
10
10
  begin
11
- trap("INT", std_trap) # restore default CTRL-C handler
11
+ trap('INT', std_trap) # restore default CTRL-C handler
12
12
  Suppository::CLI.run(ARGV)
13
13
  rescue UsageError
14
- Suppository::Logger.log_error "Invalid usage"
14
+ Suppository::Logger.log_error 'Invalid usage'
15
15
  abort Suppository.help
16
16
  rescue SystemExit
17
- puts "Kernel.exit" if ARGV.verbose?
17
+ puts 'Kernel.exit' if ARGV.verbose?
18
18
  raise
19
19
  rescue Interrupt => e
20
20
  puts # seemingly a newline is typical
@@ -30,7 +30,3 @@ rescue Exception => e
30
30
  puts e.backtrace
31
31
  exit 1
32
32
  end
33
-
34
-
35
-
36
-
@@ -72,18 +72,27 @@ module Suppository
72
72
  def create_dist_file(master_file, deb)
73
73
  @repository.archs.each do |arch|
74
74
  FileUtils.ln_s master_file, dist_file(arch, deb), force: true
75
- update_packages master_file, arch
75
+ update_packages arch
76
76
  end
77
77
  end
78
78
 
79
- def update_packages(master_file, arch)
80
- deb = Suppository::MasterDeb.new(master_file)
79
+ def update_packages(arch)
81
80
  file = package_file(arch)
82
- package_info = Suppository::Package.new(internal_path(arch), deb).content
83
- open(file, 'a') { |f| f.puts package_info }
81
+ FileUtils.rm(file)
82
+ FileUtils.rm("#{file}.gz")
83
+ Dir.glob("#{component_path}/binary-#{arch}/*deb").each do |deb_link|
84
+ update_package(deb_link, arch)
85
+ end
84
86
  Suppository::Gzip.compress file
85
87
  end
86
88
 
89
+ def update_package(deb_link, arch)
90
+ master_file = File.symlink?(deb_link) ? File.readlink(deb_link) : deb_link
91
+ deb = Suppository::MasterDeb.new(master_file)
92
+ package_info = Suppository::Package.new(internal_path(arch), deb).content
93
+ open(package_file(arch), 'a') { |f| f.puts package_info }
94
+ end
95
+
87
96
  def dist_file(arch, deb)
88
97
  filename = Suppository::MasterDeb.new(suppository_file(deb)).filename
89
98
  "#{component_path}/binary-#{arch}/#{filename}"
@@ -68,7 +68,7 @@ module Suppository
68
68
  end
69
69
 
70
70
  def packages
71
- @packages ||= Dir.glob("#{@dist_path}/*/*/Packages*")
71
+ @packages ||= Dir.glob("#{@dist_path}/*/*/Packages*").sort
72
72
  end
73
73
 
74
74
  def puts_hash(f, hash)
@@ -85,7 +85,7 @@ module Suppository
85
85
  end
86
86
 
87
87
  def architectures
88
- directories("#{@dist_path}/*/*").collect { |d| d.split('-')[1] }.uniq.join(' ')
88
+ directories("#{@dist_path}/*/*").collect { |d| d.split('-')[1] }.uniq.sort.join(' ')
89
89
  end
90
90
 
91
91
  def directories(path_pattern)
@@ -4,8 +4,8 @@ module Suppository
4
4
 
5
5
  def initialize(path)
6
6
  @path = File.expand_path(path)
7
- @dists = %w(natty lucid precise saucy trusty)
8
- @archs = %w(amd64 i386)
7
+ @dists = %w(natty lucid precise saucy trusty).sort
8
+ @archs = %w(amd64 i386).sort
9
9
  @suppository = "#{@path}/.suppository"
10
10
  end
11
11
 
@@ -1,3 +1,3 @@
1
1
  module Suppository
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.6'
3
3
  end
data/spec/spec_helper.rb CHANGED
@@ -3,19 +3,18 @@ require 'fakefs/spec_helpers'
3
3
  require 'rspec/mocks/standalone'
4
4
  require 'stringio'
5
5
  require 'simplecov'
6
- require "codeclimate-test-reporter"
6
+ require 'codeclimate-test-reporter'
7
7
  CodeClimate::TestReporter.start
8
8
 
9
9
  SimpleCov.start do
10
10
  SimpleCov.minimum_coverage 100
11
- SimpleCov.add_filter "/spec/"
11
+ SimpleCov.add_filter '/spec/'
12
12
  end
13
13
 
14
14
  lib = File.expand_path('../lib', __FILE__)
15
15
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
16
16
 
17
- RSpec.configure do |config|
18
-
17
+ RSpec.configure do |config|
19
18
  config.before do
20
19
  $stdout = StringIO.new
21
20
  end
@@ -23,8 +22,8 @@ RSpec.configure do |config|
23
22
  config.after(:all) do
24
23
  $stdout = STDOUT
25
24
  end
26
-
27
- config.filter_run :focus => true
25
+
26
+ config.filter_run focus: true
28
27
  config.run_all_when_everything_filtered = true
29
28
  config.color = true
30
29
  config.mock_with :rspec
@@ -32,24 +31,20 @@ RSpec.configure do |config|
32
31
  config.raise_errors_for_deprecations!
33
32
  end
34
33
 
35
-
36
- def get_exception
37
- e_message = ""
38
- begin
34
+ def get_exception
35
+ e_message = ''
36
+ begin
39
37
  yield
40
38
  rescue => e
41
39
  e_message = e.message
42
- end
40
+ end
43
41
  e_message
44
42
  end
45
43
 
46
44
  def deb_file
47
- File.expand_path(File.dirname(__FILE__)+"../../fixtures/curl_7.22.0-3ubuntu4.11_amd64.deb")
45
+ File.expand_path(File.dirname(__FILE__) + '../../fixtures/curl_7.22.0-3ubuntu4.11_amd64.deb')
48
46
  end
49
47
 
50
48
  def deb_file_glob
51
- File.expand_path(File.dirname(__FILE__)+"../../fixtures/*.deb")
49
+ File.expand_path(File.dirname(__FILE__) + '../../fixtures/*.deb')
52
50
  end
53
-
54
-
55
-
@@ -7,9 +7,8 @@ require 'suppository/create_command'
7
7
  require 'suppository/exceptions'
8
8
 
9
9
  describe Suppository::AddCommand do
10
-
11
10
  before(:each) do
12
- repository_path = "/tmp/supposotory_test_#{Time.now.to_f}"
11
+ repository_path = "/tmp/suppository_test_#{Time.now.to_f}"
13
12
  @file_name = 'e5ca0a9797acda4bfe8404524f0976b3_b37ce9b17405d93c323c0b8bbe167c6f2dccfe02_5a315c56bc34f1ffed365f9aa50bbb36916e5a8fae8614f00d952983d4316555.deb'
14
13
  @second_file = '2f860ed12d2ad99bacc78d95fb9e7989_323ee30c17a0ca4bbb2b95032fc79f84f4ca26f2_66bce137768403d517468a1f70bd98644558cd000f250dd8cc2faeedda5d4b2f.deb'
15
14
  @repository = Suppository::Repository.new(repository_path)
@@ -32,26 +31,26 @@ describe Suppository::AddCommand do
32
31
  expect(File.file?("#{@repository.suppository}/#{@file_name}")).to be_truthy
33
32
  end
34
33
 
35
- describe "expects release to work -" do
34
+ describe 'expects release to work -' do
36
35
  before(:each) do
37
36
  release = double(Suppository::Release)
38
37
  expect(release).to receive(:create)
39
38
  expect(Suppository::Release).to receive(:new).with(@repository.path, @dist, false) { release }
40
39
  end
41
40
 
42
- it "add suppository file" do
41
+ it 'add suppository file' do
43
42
  @adder.run
44
43
  expect(File.file?("#{@repository.suppository}/#{@file_name}")).to be_truthy
45
44
  end
46
45
 
47
- it "supports globs for deb file" do
46
+ it 'supports globs for deb file' do
48
47
  @adder = Suppository::AddCommand.new([@repository.path, @dist, @component, deb_file_glob])
49
48
  @adder.run
50
49
  expect(File.file?("#{@repository.suppository}/#{@file_name}")).to be_truthy
51
50
  expect(File.file?("#{@repository.suppository}/#{@second_file}")).to be_truthy
52
51
  end
53
52
 
54
- it "adds package to dists" do
53
+ it 'adds package to dists' do
55
54
  @adder.run
56
55
  @repository.dists.each do |dist|
57
56
  @repository.archs.each do |arch|
@@ -64,8 +63,7 @@ describe Suppository::AddCommand do
64
63
  end
65
64
  end
66
65
 
67
-
68
- it "updates Packages file" do
66
+ it 'updates Packages file' do
69
67
  supository_file = "#{@repository.suppository}/#{@file_name}"
70
68
  @adder.run
71
69
  @repository.archs.each do |arch|
@@ -78,7 +76,7 @@ describe Suppository::AddCommand do
78
76
  end
79
77
  end
80
78
 
81
- it "updates Packages.gz file" do
79
+ it 'updates Packages.gz file' do
82
80
  supository_file = "#{@repository.suppository}/#{@file_name}"
83
81
  @adder.run
84
82
  @repository.archs.each do |arch|
@@ -86,56 +84,54 @@ describe Suppository::AddCommand do
86
84
  path = "#{@repository.path}/#{internal_path}"
87
85
  packages_path = "#{path}/Packages.gz"
88
86
  deb = Suppository::MasterDeb.new(supository_file)
89
- content = Suppository::Package.new(internal_path,deb).content
90
- result =""
91
- Zlib::GzipReader.open(packages_path) {|gz|
87
+ content = Suppository::Package.new(internal_path, deb).content
88
+ result = ''
89
+ Zlib::GzipReader.open(packages_path) do|gz|
92
90
  result << gz.read
93
- }
91
+ end
94
92
 
95
93
  expect(result).to match content
96
94
  end
97
95
  end
98
96
  end
99
-
100
- it "cant add package to new dists" do
101
- adder = Suppository::AddCommand.new([@repository.path, 'new_dist', @component, deb_file])
102
- expect {
103
- adder.run
104
- }.to raise_error(InvalidDistribution)
97
+
98
+ it 'cant add package to new dists' do
99
+ adder = Suppository::AddCommand.new([@repository.path, 'new_dist', @component, deb_file])
100
+ expect do
101
+ adder.run
102
+ end.to raise_error(InvalidDistribution)
105
103
  end
106
-
107
- it "cant add package to new component" do
104
+
105
+ it 'cant add package to new component' do
108
106
  adder = Suppository::AddCommand.new([@repository.path, @dist, 'testing', deb_file])
109
- expect {
107
+ expect do
110
108
  adder.run
111
- }.to raise_error(InvalidComponent)
109
+ end.to raise_error(InvalidComponent)
112
110
  end
113
-
114
- it "cant add package to non existant repository" do
111
+
112
+ it 'cant add package to non existant repository' do
115
113
  adder = Suppository::AddCommand.new(['boom', @dist, 'testing', deb_file])
116
-
117
- expect {
114
+
115
+ expect do
118
116
  adder.run
119
- }.to raise_error(InvalidRepositoryError)
117
+ end.to raise_error(InvalidRepositoryError)
120
118
  end
121
-
122
- it "needs non nil arguments" do
123
- expect {
119
+
120
+ it 'needs non nil arguments' do
121
+ expect do
124
122
  Suppository::AddCommand.new(nil)
125
- }.to raise_error(UsageError)
123
+ end.to raise_error(UsageError)
126
124
  end
127
-
128
- it "needs arguments" do
129
- expect {
125
+
126
+ it 'needs arguments' do
127
+ expect do
130
128
  Suppository::AddCommand.new([])
131
- }.to raise_error(UsageError)
129
+ end.to raise_error(UsageError)
132
130
  end
133
131
 
134
- it "needs four arguments" do
135
- expect {
132
+ it 'needs four arguments' do
133
+ expect do
136
134
  Suppository::AddCommand.new([@repository.path, @dist, 'testing'])
137
- }.to raise_error(UsageError)
135
+ end.to raise_error(UsageError)
138
136
  end
139
-
140
137
  end
141
-
@@ -7,44 +7,41 @@ require 'suppository/create_command'
7
7
  require 'suppository/add_command'
8
8
 
9
9
  describe Suppository::CLI do
10
-
11
10
  before(:each) do
12
11
  @path = '/tmp/repo123'
13
12
  @repository = double(Suppository::Repository)
14
13
  end
15
-
16
- it "shows current version" do
14
+
15
+ it 'shows current version' do
17
16
  command = double(Suppository::VersionCommand)
18
- expect(Suppository::VersionCommand).to receive(:new).with([]) {command}
17
+ expect(Suppository::VersionCommand).to receive(:new).with([]) { command }
19
18
  expect(command).to receive(:run)
20
19
  Suppository::CLI.run(['version'])
21
20
  end
22
-
23
- it "can create new repository" do
21
+
22
+ it 'can create new repository' do
24
23
  creator = double(Suppository::CreateCommand)
25
- expect(Suppository::CreateCommand).to receive(:new).with([@path]) {creator}
24
+ expect(Suppository::CreateCommand).to receive(:new).with([@path]) { creator }
26
25
  expect(creator).to receive(:run)
27
26
  Suppository::CLI.run(['create', @path])
28
27
  end
29
-
30
- it "can add deb repository" do
28
+
29
+ it 'can add deb repository' do
31
30
  adder = double(Suppository::AddCommand)
32
- expect(Suppository::AddCommand).to receive(:new).with([@path, 'trusty', '/tmp/example.deb']) {adder}
33
- expect(adder).to receive(:run)
34
- Suppository::CLI.run(['add', @path , 'trusty', '/tmp/example.deb'])
31
+ expect(Suppository::AddCommand).to receive(:new).with([@path, 'trusty', '/tmp/example.deb']) { adder }
32
+ expect(adder).to receive(:run)
33
+ Suppository::CLI.run(['add', @path, 'trusty', '/tmp/example.deb'])
35
34
  end
36
-
37
- it "rase usage error for empty args" do
38
- expect {
35
+
36
+ it 'rase usage error for empty args' do
37
+ expect do
39
38
  Suppository::CLI.run([])
40
- }.to raise_error(UsageError)
39
+ end.to raise_error(UsageError)
41
40
  end
42
-
43
- it "rase usage error for invalid command" do
44
- expect {
41
+
42
+ it 'rase usage error for invalid command' do
43
+ expect do
45
44
  Suppository::CLI.run(['bla'])
46
- }.to raise_error(UsageError)
45
+ end.to raise_error(UsageError)
47
46
  end
48
47
  end
49
-
50
-
@@ -4,23 +4,18 @@ require 'suppository/command_runner'
4
4
  require 'suppository/exceptions'
5
5
 
6
6
  describe Suppository::CommandRunner do
7
-
8
- it "run command" do
7
+ it 'run command' do
9
8
  runner = Suppository::CommandRunner.new('echo', '1234')
10
9
  expect(runner.run).to eql("1234\n")
11
10
  end
12
-
13
- it "command not found" do
11
+
12
+ it 'command not found' do
14
13
  runner = Suppository::CommandRunner.new('notavalidcommand')
15
14
  expect { runner.run }.to raise_error(CommandMissingError)
16
15
  end
17
-
18
- it "command error" do
16
+
17
+ it 'command error' do
19
18
  runner = Suppository::CommandRunner.new('man', '--invalidoption')
20
19
  expect { runner.run }.to raise_error(CommandError)
21
20
  end
22
-
23
-
24
21
  end
25
-
26
-
@@ -4,33 +4,31 @@ require 'suppository/create_command'
4
4
  require 'suppository/repository'
5
5
 
6
6
  describe Suppository::CreateCommand do
7
-
8
7
  before(:each) do
9
8
  repository_path = "/tmp/suppository_test_#{Time.now.to_f}"
10
9
  @repository = Suppository::Repository.new(repository_path)
11
10
  @creator = Suppository::CreateCommand.new([@repository.path])
12
11
  end
13
-
12
+
14
13
  after(:each) do
15
- FileUtils.rm_r(@repository.path) if File.directory?(@repository.path)
14
+ FileUtils.rm_r(@repository.path) if File.directory?(@repository.path)
16
15
  end
17
16
 
18
- it "can create new repository" do
19
- expect{@creator.run}.to output("==> Created new Repository - #{@repository.path}\n").to_stdout
17
+ it 'can create new repository' do
18
+ expect { @creator.run }.to output("==> Created new Repository - #{@repository.path}\n").to_stdout
20
19
  end
21
20
 
22
-
23
- it "creates repository root folder" do
21
+ it 'creates repository root folder' do
24
22
  @creator.run
25
23
  expect(File.directory?(@repository.path)).to be_truthy
26
24
  end
27
25
 
28
- it "creates a .supository file" do
26
+ it 'creates a .supository file' do
29
27
  @creator.run
30
28
  expect(File.directory?("#{@repository.path}/.suppository")).to be_truthy
31
29
  end
32
-
33
- it "creates a Packages file" do
30
+
31
+ it 'creates a Packages file' do
34
32
  @creator.run
35
33
  @repository.dists.each do |dist|
36
34
  @repository.archs.each do |arch|
@@ -38,24 +36,23 @@ describe Suppository::CreateCommand do
38
36
  end
39
37
  end
40
38
  end
41
-
42
- it "creates a Packages.gz file" do
39
+
40
+ it 'creates a Packages.gz file' do
43
41
  @creator.run
44
42
  @repository.dists.each do |dist|
45
43
  @repository.archs.each do |arch|
46
- file_name = "#{@repository.path}/dists/#{dist}/internal/binary-#{arch}/Packages.gz"
44
+ file_name = "#{@repository.path}/dists/#{dist}/internal/binary-#{arch}/Packages.gz"
47
45
  expect(Zlib::GzipReader.open(file_name)).to be_truthy
48
46
  end
49
47
  end
50
48
  end
51
49
 
52
-
53
- it "aborts if file suppository already exists" do
50
+ it 'aborts if file suppository already exists' do
54
51
  FileUtils.mkdir_p @repository.suppository
55
- expect(get_exception{@creator.run}).to eql "#{@repository.path} is already a repository"
52
+ expect(get_exception { @creator.run }).to eql "#{@repository.path} is already a repository"
56
53
  end
57
54
 
58
- it "creates folder structure" do
55
+ it 'creates folder structure' do
59
56
  @creator.run
60
57
  @repository.dists.each do |dist|
61
58
  @repository.archs.each do |arch|
@@ -63,18 +60,16 @@ describe Suppository::CreateCommand do
63
60
  end
64
61
  end
65
62
  end
66
-
67
- it "needs non nil arguments" do
68
- expect {
63
+
64
+ it 'needs non nil arguments' do
65
+ expect do
69
66
  Suppository::CreateCommand.new(nil)
70
- }.to raise_error(UsageError)
67
+ end.to raise_error(UsageError)
71
68
  end
72
-
73
- it "needs arguments" do
74
- expect {
69
+
70
+ it 'needs arguments' do
71
+ expect do
75
72
  Suppository::CreateCommand.new([])
76
- }.to raise_error(UsageError)
73
+ end.to raise_error(UsageError)
77
74
  end
78
-
79
75
  end
80
-
@@ -3,34 +3,31 @@ require 'spec_helper'
3
3
  require 'suppository/dpkg_deb_line'
4
4
 
5
5
  describe Suppository::DpkgDebLine do
6
-
7
- it "field" do
6
+ it 'field' do
8
7
  line = 'Depends: libc6 (>= 2.14), libcurl3 (>= 7.16.2-1), zlib1g (>= 1:1.1.4)'
9
8
  values = Suppository::DpkgDebLine.new(line).attributes
10
9
  expect(values['Depends']).to eql 'libc6 (>= 2.14), libcurl3 (>= 7.16.2-1), zlib1g (>= 1:1.1.4)'
11
10
  end
12
-
13
- it "description first line" do
11
+
12
+ it 'description first line' do
14
13
  line = 'Description: Get a file from an HTTP, HTTPS or FTP server'
15
14
  values = Suppository::DpkgDebLine.new(line).attributes
16
15
  expect(values['Description']).to eql 'Get a file from an HTTP, HTTPS or FTP server'
17
16
  end
18
-
19
- it "description other line" do
17
+
18
+ it 'description other line' do
20
19
  line = ' curl is a client to get files from servers using any of the supported'
21
20
  values = Suppository::DpkgDebLine.new(line).attributes
22
21
  expect(values['Description']).to eql ' curl is a client to get files from servers using any of the supported'
23
22
  end
24
-
25
- it "dot" do
23
+
24
+ it 'dot' do
26
25
  line = ' .'
27
26
  values = Suppository::DpkgDebLine.new(line).attributes
28
27
  expect(values['Description']).to eql ' .'
29
28
  end
30
-
31
- it "handles invalid" do
32
- expect(get_exception{Suppository::DpkgDebLine.new "Boom Bang"}).to eql "can't parse line - 'Boom Bang'"
29
+
30
+ it 'handles invalid' do
31
+ expect(get_exception { Suppository::DpkgDebLine.new 'Boom Bang' }).to eql "can't parse line - 'Boom Bang'"
33
32
  end
34
-
35
33
  end
36
-