augeas 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ba9ebbb3fbea59d2f722866713c6ff12fc52d9ea
4
- data.tar.gz: 6e09cb5ef788772f2cde0dbf896092f7055cb644
3
+ metadata.gz: d142e1976cf654e05190a66f4d934d095eb4e82f
4
+ data.tar.gz: 7a302a310e4d3ac87fe1d8ce3437c61613f5de92
5
5
  SHA512:
6
- metadata.gz: 2171c37b81a34c693adda647b3cc4fdd6342c091cd8ce04078bda5edd672148990b7f2555a48ba007b6904da6019c570c826e251ddfd71b38729df9f127391b9
7
- data.tar.gz: aa62e622d2456f7813d34dfbcf23a1b8610d826af9dae105cb301192338052480c449d1f605d764027f9a195a80c79749fa51d3adb3ae101b7c03406c0dc890b
6
+ metadata.gz: 5e54d8684e75db6d46e6b3645d4f5ee7346021bdc5998bc1d180610eeecd18077eabc35c7e6db32e5ab2d1da30724220ccc7e09c7224ea305c215862e319943b
7
+ data.tar.gz: 30a9d6d1b2d9535b7f5f852f64f571fd32515be6b144cc7d3ba43c24dba30ba000922daeb76c67ecf6a4432ca30f8e99c6391668874a13cfd035ab8f36b997d4
data/Rakefile CHANGED
@@ -12,7 +12,7 @@ require 'rake/testtask'
12
12
  require 'rubygems/package_task'
13
13
 
14
14
  GEM_NAME='augeas'
15
- GEM_VERSION='0.6.1'
15
+ GEM_VERSION='0.6.2'
16
16
  EXT_CONF='ext/augeas/extconf.rb'
17
17
  MAKEFILE="ext/augeas/Makefile"
18
18
  AUGEAS_MODULE="ext/augeas/_augeas.so"
@@ -82,14 +82,14 @@ SPEC = Gem::Specification.new do |s|
82
82
  s.name = GEM_NAME
83
83
  s.version = GEM_VERSION
84
84
  s.email = "dot.doom@gmail.com"
85
- s.homepage = "http://augeas.net/"
85
+ s.homepage = "https://github.com/dotdoom/augeas"
86
86
  s.summary = "Ruby bindings for augeas"
87
- s.authors = [ "Bryan Kearney", "David Lutterkort", "Ionut Artarisi", "Artem Sheremet" ]
87
+ s.authors = ["Bryan Kearney", "David Lutterkort", "Ionut Artarisi", "Artem Sheremet"]
88
88
  s.files = PKG_FILES
89
89
  s.licenses = ['LGPLv2']
90
90
  s.required_ruby_version = '>= 1.8.7'
91
91
  s.extensions = "ext/augeas/extconf.rb"
92
- s.description = "Provides bindings for augeas."
92
+ s.description = "A fork of ruby-augeas (bindings for augeas) with exceptions support."
93
93
  s.add_development_dependency "rake"
94
94
  s.add_development_dependency "rdoc"
95
95
  end
@@ -508,9 +508,7 @@ void Init__augeas() {
508
508
  DEF_AUG_ERR(EMVDESC);
509
509
  DEF_AUG_ERR(ECMDRUN);
510
510
  DEF_AUG_ERR(EBADARG);
511
- #ifdef AUG_ELABEL
512
511
  DEF_AUG_ERR(ELABEL);
513
- #endif
514
512
  #undef DEF_AUG_ERR
515
513
 
516
514
  /* Define the methods */
@@ -255,8 +255,8 @@ class Augeas
255
255
  begin
256
256
  run_command :augeas_save
257
257
  rescue Augeas::CommandExecutionError => e
258
- raise e, "Saving failed. Search the augeas tree in /augeas//error"+
259
- "for the actual errors."
258
+ raise e, 'Saving failed. Search the augeas tree in /augeas//error ' <<
259
+ 'for the actual errors.'
260
260
  end
261
261
 
262
262
  nil
@@ -87,57 +87,6 @@ class TestAugeas < Test::Unit::TestCase
87
87
  assert_equal(foo, 'bar')
88
88
  end
89
89
 
90
- def test_load
91
- aug = aug_create(no_load: true)
92
- assert_equal([], aug.match("/files/etc/*"))
93
- aug.rm("/augeas/load/*");
94
- assert_nothing_raised {
95
- aug.load
96
- }
97
- assert_equal([], aug.match("/files/etc/*"))
98
- end
99
-
100
- def test_transform
101
- aug = aug_create(no_load: true)
102
- aug.clear_transforms
103
- aug.transform(:lens => "Hosts.lns",
104
- :incl => "/etc/hosts")
105
- assert_raise(ArgumentError) {
106
- aug.transform(:name => "Fstab",
107
- :incl => [ "/etc/fstab" ],
108
- :excl => [ "*~", "*.rpmnew" ])
109
- }
110
- aug.transform(:lens => "Inittab",
111
- :incl => "/etc/inittab")
112
- aug.transform(:lens => "Fstab.lns",
113
- :incl => "/etc/fstab*",
114
- :excl => "*~")
115
- assert_equal(["/augeas/load/Fstab", "/augeas/load/Fstab/excl",
116
- "/augeas/load/Fstab/incl", "/augeas/load/Fstab/lens",
117
- "/augeas/load/Hosts", "/augeas/load/Hosts/incl",
118
- "/augeas/load/Hosts/lens", "/augeas/load/Inittab",
119
- "/augeas/load/Inittab/incl",
120
- "/augeas/load/Inittab/lens"],
121
- aug.match("/augeas/load//*").sort)
122
- aug.load
123
- assert_equal(["/files/etc/hosts", "/files/etc/inittab"],
124
- aug.match("/files/etc/*").sort)
125
- end
126
-
127
- def test_defvar
128
- Augeas::create(root: "/dev/null") do |aug|
129
- aug.set("/a/b", "bval")
130
- aug.set("/a/c", "cval")
131
- assert aug.defvar("var", "/a/b")
132
- assert_equal(["/a/b"], aug.match("$var"))
133
- assert aug.defvar("var", nil)
134
- assert_raises(SystemCallError) {
135
- aug.match("$var")
136
- }
137
- assert ! aug.defvar("var", "/foo/")
138
- end
139
- end
140
-
141
90
  def test_close
142
91
  aug = Augeas::create(:root => "/tmp", :save_mode => :newfile)
143
92
  assert_equal("newfile", aug.get("/augeas/save"))
@@ -273,19 +222,15 @@ class TestAugeas < Test::Unit::TestCase
273
222
  assert aug.defvar("var", "/a/b")
274
223
  assert_equal(["/a/b"], aug.match("$var"))
275
224
  assert aug.defvar("var", nil)
276
- assert_raises(SystemCallError) {
225
+ assert_raises(Augeas::InvalidPathError) {
277
226
  aug.match("$var")
278
227
  }
279
- assert ! aug.defvar("var", "/foo/")
228
+ assert_raises(Augeas::InvalidPathError) {
229
+ aug.defvar("var", "/foo/")
230
+ }
280
231
  end
281
232
  end
282
233
 
283
- def test_defnode
284
- aug = aug_create
285
- assert aug.defnode("x", "/files/etc/hosts/*[ipaddr = '127.0.0.1']", nil)
286
- assert_equal(["/files/etc/hosts/1"], aug.match("$x"))
287
- end
288
-
289
234
  def test_insert_before
290
235
  aug = aug_create
291
236
  aug.set("/parent/child", "foo")
@@ -383,20 +328,6 @@ class TestAugeas < Test::Unit::TestCase
383
328
  assert_equal(aug.get("/files/etc/group/disk/user"), nil)
384
329
  end
385
330
 
386
- def test_setm
387
- aug = aug_create
388
-
389
- aug.setm("/files/etc/group/*[label() =~ regexp(\"rpc.*\")]",
390
- "users", "testuser1")
391
- assert_equal(aug.get("/files/etc/group/rpc/users"), "testuser1")
392
- assert_equal(aug.get("/files/etc/group/rpcuser/users"), "testuser1")
393
-
394
- aug.setm("/files/etc/group/*[label() =~ regexp(\"rpc.*\")]/users",
395
- nil, "testuser2")
396
- assert_equal(aug.get("/files/etc/group/rpc/users"), "testuser2")
397
- assert_equal(aug.get("/files/etc/group/rpcuser/users"), "testuser2")
398
- end
399
-
400
331
  def test_setm_invalid_path
401
332
  aug = aug_create
402
333
  assert_raises (Augeas::InvalidPathError) { aug.setm("[]", "bar", "baz") }
@@ -438,16 +369,6 @@ class TestAugeas < Test::Unit::TestCase
438
369
  assert err[:details]
439
370
  end
440
371
 
441
- def test_defvar
442
- Augeas::create(:root => "/dev/null") do |aug|
443
- aug.set("/a/b", "bval")
444
- aug.set("/a/c", "cval")
445
- assert aug.defvar("var", "/a/b")
446
- assert_equal(["/a/b"], aug.match("$var"))
447
- assert aug.defvar("var", nil)
448
- end
449
- end
450
-
451
372
  def test_defvar_invalid_path
452
373
  aug = aug_create
453
374
  assert_raises(Augeas::InvalidPathError) { aug.defvar('var', 'F#@!$#@') }
@@ -464,20 +385,6 @@ class TestAugeas < Test::Unit::TestCase
464
385
  assert_raises (Augeas::InvalidPathError) { aug.defnode('x', '//', nil)}
465
386
  end
466
387
 
467
- def test_span
468
- aug = aug_create
469
-
470
- aug.set("/augeas/span", "enable")
471
- aug.rm("/files/etc")
472
- aug.load
473
-
474
- span = aug.span("/files/etc/ssh/sshd_config/Protocol")
475
- assert_not_nil(span[:filename])
476
- assert_equal(29..37, span[:label])
477
- assert_equal(38..39, span[:value])
478
- assert_equal(29..40, span[:span])
479
- end
480
-
481
388
  def test_span_no_span_info
482
389
  aug = aug_create
483
390
  # this error should be raised because we haven't enabled the span
@@ -510,28 +417,6 @@ class TestAugeas < Test::Unit::TestCase
510
417
  assert_equal("enable", aug.get("/augeas/span"))
511
418
  end
512
419
 
513
- def test_set
514
- aug = aug_create
515
- aug.set("/files/etc/group/disk/user[last()+1]",["user1","user2"])
516
- assert_equal( aug.get("/files/etc/group/disk/user[1]"),"root" )
517
- assert_equal( aug.get("/files/etc/group/disk/user[2]"),"user1" )
518
- assert_equal( aug.get("/files/etc/group/disk/user[3]"),"user2" )
519
-
520
- aug.set("/files/etc/group/new_group/user[last()+1]",
521
- "nuser1",["nuser2","nuser3"])
522
- assert_equal( aug.get("/files/etc/group/new_group/user[1]"),"nuser1")
523
- assert_equal( aug.get("/files/etc/group/new_group/user[2]"),"nuser2" )
524
- assert_equal( aug.get("/files/etc/group/new_group/user[3]"),"nuser3" )
525
-
526
- aug.rm("/files/etc/group/disk/user")
527
- aug.set("/files/etc/group/disk/user[last()+1]","testuser")
528
- assert_equal( aug.get("/files/etc/group/disk/user"),"testuser")
529
-
530
- aug.rm("/files/etc/group/disk/user")
531
- aug.set("/files/etc/group/disk/user[last()+1]", nil)
532
- assert_equal( aug.get("/files/etc/group/disk/user"), nil)
533
- end
534
-
535
420
  def test_setm
536
421
  aug = aug_create
537
422
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: augeas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Kearney
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-01-19 00:00:00.000000000 Z
14
+ date: 2014-01-24 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rake
@@ -41,7 +41,7 @@ dependencies:
41
41
  - - '>='
42
42
  - !ruby/object:Gem::Version
43
43
  version: '0'
44
- description: Provides bindings for augeas.
44
+ description: A fork of ruby-augeas (bindings for augeas) with exceptions support.
45
45
  email: dot.doom@gmail.com
46
46
  executables: []
47
47
  extensions:
@@ -61,7 +61,7 @@ files:
61
61
  - tests/root/etc/inittab
62
62
  - tests/root/etc/ssh/sshd_config
63
63
  - tests/tc_augeas.rb
64
- homepage: http://augeas.net/
64
+ homepage: https://github.com/dotdoom/augeas
65
65
  licenses:
66
66
  - LGPLv2
67
67
  metadata: {}