bovem 2.2.2 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. data/Gemfile +6 -6
  2. data/README.md +1 -0
  3. data/bovem.gemspec +1 -1
  4. data/doc/Bovem.html +5 -5
  5. data/doc/Bovem/Configuration.html +21 -157
  6. data/doc/Bovem/Console.html +39 -39
  7. data/doc/Bovem/ConsoleMethods.html +5 -5
  8. data/doc/Bovem/ConsoleMethods/Interactions.html +21 -21
  9. data/doc/Bovem/ConsoleMethods/Interactions/ClassMethods.html +9 -9
  10. data/doc/Bovem/ConsoleMethods/Logging.html +71 -73
  11. data/doc/Bovem/ConsoleMethods/Logging/ClassMethods.html +9 -9
  12. data/doc/Bovem/ConsoleMethods/Output.html +20 -28
  13. data/doc/Bovem/ConsoleMethods/StyleHandling.html +5 -5
  14. data/doc/Bovem/ConsoleMethods/StyleHandling/ClassMethods.html +7 -7
  15. data/doc/Bovem/Errors.html +5 -5
  16. data/doc/Bovem/Errors/InvalidConfiguration.html +5 -5
  17. data/doc/Bovem/Errors/InvalidLogger.html +5 -5
  18. data/doc/Bovem/Logger.html +126 -69
  19. data/doc/Bovem/Shell.html +16 -16
  20. data/doc/Bovem/ShellMethods.html +5 -5
  21. data/doc/Bovem/ShellMethods/Directories.html +10 -12
  22. data/doc/Bovem/ShellMethods/Execute.html +7 -7
  23. data/doc/Bovem/ShellMethods/General.html +7 -7
  24. data/doc/Bovem/ShellMethods/Read.html +7 -7
  25. data/doc/Bovem/ShellMethods/Write.html +7 -7
  26. data/doc/Bovem/Version.html +7 -7
  27. data/doc/_index.html +6 -6
  28. data/doc/class_list.html +3 -2
  29. data/doc/file.README.html +7 -6
  30. data/doc/file_list.html +2 -1
  31. data/doc/frames.html +1 -1
  32. data/doc/index.html +7 -6
  33. data/doc/js/full_list.js +7 -2
  34. data/doc/method_list.html +72 -183
  35. data/doc/top-level-namespace.html +5 -5
  36. data/lib/bovem.rb +1 -1
  37. data/lib/bovem/configuration.rb +11 -33
  38. data/lib/bovem/console.rb +34 -39
  39. data/lib/bovem/logger.rb +6 -9
  40. data/lib/bovem/shell.rb +25 -26
  41. data/lib/bovem/version.rb +2 -2
  42. data/spec/bovem/configuration_spec.rb +7 -22
  43. data/spec/bovem/console_spec.rb +1 -1
  44. data/spec/bovem/shell_spec.rb +9 -10
  45. data/spec/coverage_helper.rb +3 -0
  46. metadata +5 -5
@@ -14,10 +14,10 @@ module Bovem
14
14
  MAJOR = 2
15
15
 
16
16
  # The minor version.
17
- MINOR = 2
17
+ MINOR = 3
18
18
 
19
19
  # The patch version.
20
- PATCH = 2
20
+ PATCH = 0
21
21
 
22
22
  # The current version number of Bovem.
23
23
  STRING = [MAJOR, MINOR, PATCH].compact.join(".")
@@ -16,7 +16,7 @@ describe Bovem::Configuration do
16
16
 
17
17
  describe "#parse" do
18
18
  it "reads a valid configuration file" do
19
- file = ::File.open(test_prefix, "w") {|f| f.write("config.property = 1234") }
19
+ ::File.open(test_prefix, "w") {|f| f.write("config.property = 1234") }
20
20
 
21
21
  config = BaseConfiguration.new(test_prefix)
22
22
  expect(config.property).to eq(1234)
@@ -24,22 +24,22 @@ describe Bovem::Configuration do
24
24
  end
25
25
 
26
26
  it "reject a missing or unreadable file" do
27
- expect { config = BaseConfiguration.new("/non-existing")}.to raise_error(::Bovem::Errors::InvalidConfiguration)
27
+ expect { BaseConfiguration.new("/non-existing")}.to raise_error(::Bovem::Errors::InvalidConfiguration)
28
28
  end
29
29
 
30
30
  it "reject an invalid configuration" do
31
- file1 = ::File.open("#{test_prefix}-1", "w") {|f| f.write("config.property = ") }
32
- file2 = ::File.open("#{test_prefix}-2", "w") {|f| f.write("config.non_property = 1234") }
31
+ ::File.open("#{test_prefix}-1", "w") {|f| f.write("config.property = ") }
32
+ ::File.open("#{test_prefix}-2", "w") {|f| f.write("config.non_property = 1234") }
33
33
 
34
- expect { config = BaseConfiguration.new("#{test_prefix}-1")}.to raise_error(::Bovem::Errors::InvalidConfiguration)
35
- expect { config = BaseConfiguration.new("#{test_prefix}-2")}.to raise_error(::Bovem::Errors::InvalidConfiguration)
34
+ expect { BaseConfiguration.new("#{test_prefix}-1")}.to raise_error(::Bovem::Errors::InvalidConfiguration)
35
+ expect { BaseConfiguration.new("#{test_prefix}-2")}.to raise_error(::Bovem::Errors::InvalidConfiguration)
36
36
 
37
37
  File.unlink("#{test_prefix}-1")
38
38
  File.unlink("#{test_prefix}-2")
39
39
  end
40
40
 
41
41
  it "allows overrides" do
42
- file = ::File.open("#{test_prefix}", "w") {|f| f.write("config.property = 1234") }
42
+ ::File.open("#{test_prefix}", "w") {|f| f.write("config.property = 1234") }
43
43
 
44
44
  config = BaseConfiguration.new(test_prefix, {property: 5678, non_property: 1234})
45
45
  expect(config.property).to eq(5678)
@@ -47,19 +47,4 @@ describe Bovem::Configuration do
47
47
  File.unlink(test_prefix)
48
48
  end
49
49
  end
50
-
51
- describe ".property" do
52
- it "add the property to the object" do
53
- subject = BaseConfiguration.new
54
-
55
- expect(subject.respond_to?(:new_property)).to be_false
56
- expect(subject.respond_to?(:new_property=)).to be_false
57
- BaseConfiguration.property(:new_property, default: "VALUE")
58
- expect(subject.respond_to?(:new_property)).to be_true
59
- expect(subject.respond_to?(:new_property=)).to be_true
60
- expect(subject.new_property).to eq("VALUE")
61
- subject.new_property = "NEW VALUE"
62
- expect(subject.new_property).to eq("NEW VALUE")
63
- end
64
- end
65
50
  end
@@ -184,7 +184,7 @@ describe Bovem::Console do
184
184
  console.stub(:line_width).and_return(80)
185
185
 
186
186
  expect(console.format_right(message)).to eq("\e[A\e[0G\e[#{75}CABCDE")
187
- expect(console.format_right(message, 10)).to eq("\e[A\e[0G\e[#{5}CABCDE")
187
+ expect(console.format_right(message, 10)).to eq("\e[A\e[0G\e[#{-5}CABCDE")
188
188
  expect(console.format_right(extended_message)).to eq("\e[A\e[0G\e[#{75}CABC\e[AD\e[3mE")
189
189
  expect(console.format_right(message, nil, false)).to eq("\e[0G\e[#{75}CABCDE")
190
190
  console.stub(:line_width).and_return(10)
@@ -37,7 +37,7 @@ describe Bovem::Shell do
37
37
 
38
38
  describe "#run" do
39
39
  before(:each) do
40
- ::Open4::stub(:popen4) do |_a, _b, _c, _d| OpenStruct.new(exitstatus: 0) end
40
+ ::Open4::stub(:popen4) do |_, _, _, _| OpenStruct.new(exitstatus: 0) end
41
41
  end
42
42
 
43
43
  it "should show a message" do
@@ -65,7 +65,7 @@ describe Bovem::Shell do
65
65
 
66
66
  it "should show a exit message" do
67
67
  i = -1
68
- ::Open4::stub(:popen4) do |_a, _b, _c, _d|
68
+ ::Open4::stub(:popen4) do |_, _, _, _|
69
69
  i += 1
70
70
  OpenStruct.new(exitstatus: i)
71
71
  end
@@ -87,8 +87,8 @@ describe Bovem::Shell do
87
87
  end
88
88
 
89
89
  it "should raise a exception for failures" do
90
- ::Open4::stub(:popen4) {|_a, _b, _c, _d| OpenStruct.new(exitstatus: 1) }
91
- expect { shell.run("echo1 OK", nil, true, false, false, false, false) }.to_not raise_error(SystemExit)
90
+ ::Open4::stub(:popen4) {|_, _, _, _| OpenStruct.new(exitstatus: 1) }
91
+ expect { shell.run("echo1 OK", nil, true, false, false, false, false) }.not_to raise_error
92
92
  expect { shell.run("echo1 OK", nil, true, false, false) }.to raise_error(SystemExit)
93
93
  end
94
94
  end
@@ -333,7 +333,6 @@ describe Bovem::Shell do
333
333
  let(:target){ File.expand_path("~") }
334
334
 
335
335
  it "should execute block in other directory and return true" do
336
- owd = Dir.pwd
337
336
  dir = ""
338
337
 
339
338
  shell.within_directory(target) do
@@ -341,7 +340,7 @@ describe Bovem::Shell do
341
340
  dir = "OK"
342
341
  end
343
342
 
344
- expect(shell.within_directory(target) { dir = "OK" }).to be_true
343
+ expect(dir).to eq("OK")
345
344
  end
346
345
 
347
346
  it "should change and restore directory" do
@@ -357,11 +356,11 @@ describe Bovem::Shell do
357
356
  it "should change but not restore directory" do
358
357
  owd = Dir.pwd
359
358
 
360
- shell.within_directory(target) do
359
+ shell.within_directory(target, false) do
361
360
  expect(Dir.pwd).to eq(target)
362
361
  end
363
362
 
364
- expect(Dir.pwd).not_to eq(target)
363
+ expect(Dir.pwd).not_to eq(owd)
365
364
  end
366
365
 
367
366
  it "should show messages" do
@@ -376,11 +375,11 @@ describe Bovem::Shell do
376
375
  expect(dir).to eq("")
377
376
 
378
377
  Dir.stub(:chdir).and_raise(ArgumentError)
379
- expect(shell.within_directory("/") { dir = "OK" }).to be_false
378
+ expect(shell.within_directory("/") { true }).to be_false
380
379
 
381
380
  Dir.unstub(:chdir)
382
381
  Dir.stub(:pwd).and_return("/invalid")
383
- expect(shell.within_directory("/") { dir = "OK" }).to be_false
382
+ expect(shell.within_directory("/") { true }).to be_false
384
383
  end
385
384
  end
386
385
 
@@ -6,6 +6,9 @@
6
6
 
7
7
  require "pathname"
8
8
  require "simplecov"
9
+ require "coveralls"
10
+
11
+ Coveralls.wear!
9
12
 
10
13
  SimpleCov.start do
11
14
  root = Pathname.new(File.dirname(__FILE__)) + ".."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bovem
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
4
+ version: 2.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-13 00:00:00.000000000 Z
12
+ date: 2013-07-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: lazier
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 2.8.1
21
+ version: 3.2.2
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: 2.8.1
29
+ version: 3.2.2
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: open4
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  version: '0'
131
131
  segments:
132
132
  - 0
133
- hash: -4341278524255618315
133
+ hash: -290835472069004173
134
134
  requirements: []
135
135
  rubyforge_project: bovem
136
136
  rubygems_version: 1.8.25