octofacts 0.5.1 → 0.6.0

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
- SHA1:
3
- metadata.gz: 81814b534034d94c72703766bdf74677c4579445
4
- data.tar.gz: d7c7076e788a552c53855f597b5a880329bae392
2
+ SHA256:
3
+ metadata.gz: f0b8fc30fafad10604fd311c01a40ef6ea05d68a97d6342a42d2bb2232d72dd8
4
+ data.tar.gz: 04e8868b91adad87c9fe2619bcc7159db518cf69fe3b96e194c9909fb6b9aa51
5
5
  SHA512:
6
- metadata.gz: 9786350cf5faa765d96c4b33f8f5bfd7aa834c1a43882c0fdaca3ddf65c07c23cba35098d3cee7d19cf133617a3b3fdb62af2c7d1babd39a8a5aa1aafca0e59b
7
- data.tar.gz: 7d34ac32431cab5fb8b5b398b9e9a64927a102317b0557176ad635abfc83caf9db0d7fe3fc7e5346908d033d094c01929db58e0d55440d37101e24a8338dd1ce
6
+ metadata.gz: e64d9d5ad104119ec098ad882929d9e0906baf1a66a236f03f570b4340c3081498197eeaadc19be65562103f083b7bfaebeac1a02d49b638294106250fd3300b
7
+ data.tar.gz: f9fde2bda3bec8cf9e8f7db0df8f08cdb26a9e63e05465308d0918fe7e8b676ea827872b085be046396c8e3d1e54931d9f24bdb94a363e83b03379ef5e9fb8ca
data/.version CHANGED
@@ -1 +1 @@
1
- 0.5.1
1
+ 0.6.0
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Octofacts
2
3
  module Backends
3
4
  # This is a template class to define the minimum API to be implemented
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "yaml"
2
4
  require "set"
3
5
 
@@ -6,7 +8,6 @@ module Octofacts
6
8
  class Index < Base
7
9
  attr_reader :index_path, :fixture_path, :options
8
10
  attr_writer :facts
9
- attr_accessor :nodes
10
11
 
11
12
  def initialize(args = {})
12
13
  index_path = Octofacts::Util::Config.fetch(:octofacts_index_path, args)
@@ -44,7 +45,7 @@ module Octofacts
44
45
  add_fact_to_index(key) unless indexed_fact?(key)
45
46
  matching_nodes = index[key][value.to_s]
46
47
  raise Octofacts::Errors::NoFactsError if matching_nodes.nil?
47
- self.nodes = nodes & matching_nodes
48
+ @nodes = nodes & matching_nodes
48
49
  end
49
50
 
50
51
  self
@@ -61,7 +62,7 @@ module Octofacts
61
62
  end
62
63
  end
63
64
 
64
- self.nodes = matching_nodes
65
+ @nodes = matching_nodes
65
66
  self
66
67
  end
67
68
 
@@ -71,7 +72,7 @@ module Octofacts
71
72
  add_fact_to_index(key) unless indexed_fact?(key)
72
73
  matching_nodes = index[key][value.to_s]
73
74
  unless matching_nodes.nil?
74
- self.nodes = (matching_nodes.to_set + nodes.to_set).to_a
75
+ @nodes = (matching_nodes.to_set + nodes.to_set).to_a
75
76
  end
76
77
  end
77
78
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  require "yaml"
2
4
 
3
5
  module Octofacts
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Octofacts
2
3
  # Octofacts.from_file(filename, options) - Construct Octofacts::Facts from a filename.
3
4
  #
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Octofacts
2
3
  # Octofacts.from_index(options) - Construct Octofacts::Facts from an index file.
3
4
  #
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Octofacts
2
3
  class Errors
3
4
  class FactNotIndexed < RuntimeError; end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  require "yaml"
2
4
 
3
5
  module Octofacts
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Octofacts
2
3
  class Manipulators
3
4
  # Delete a fact from a hash.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require_relative "base"
2
3
 
3
4
  module Octofacts
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require_relative "manipulators/replace"
2
3
 
3
4
  # Octofacts::Manipulators - our fact manipulation API.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # Retrieves configuration parameters from:
2
3
  # - input hash
3
4
  # - rspec configuration
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Octofacts
2
3
  module Util
3
4
  class Keys
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Octofacts
2
3
  VERSION = File.read(File.expand_path("../../.version", File.dirname(__FILE__))).strip
3
4
  end
data/lib/octofacts.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require "octofacts/constructors/from_file"
2
3
  require "octofacts/constructors/from_index"
3
4
  require "octofacts/manipulators"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octofacts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub, Inc.
@@ -10,10 +10,12 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-10-09 00:00:00.000000000 Z
13
+ date: 2024-08-14 00:00:00.000000000 Z
14
14
  dependencies: []
15
- description: |
16
- Octofacts provides fact fixtures built from recently-updated Puppet facts to rspec-puppet tests.
15
+ description: 'Octofacts provides fact fixtures built from recently-updated Puppet
16
+ facts to rspec-puppet tests.
17
+
18
+ '
17
19
  email: opensource+octofacts@github.com
18
20
  executables: []
19
21
  extensions: []
@@ -46,15 +48,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
46
48
  requirements:
47
49
  - - ">="
48
50
  - !ruby/object:Gem::Version
49
- version: 2.1.0
51
+ version: 2.7.0
50
52
  required_rubygems_version: !ruby/object:Gem::Requirement
51
53
  requirements:
52
54
  - - ">="
53
55
  - !ruby/object:Gem::Version
54
56
  version: '0'
55
57
  requirements: []
56
- rubyforge_project:
57
- rubygems_version: 2.2.5
58
+ rubygems_version: 3.4.19
58
59
  signing_key:
59
60
  specification_version: 4
60
61
  summary: Run your rspec-puppet tests against fake hosts that present almost real facts