octofacts 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 61e9a30a1976cdb0fb35f94e0d7a9c6447923719
4
- data.tar.gz: 7db84b41abcd552aedc84346159cd3f67be8d68f
2
+ SHA256:
3
+ metadata.gz: f0b8fc30fafad10604fd311c01a40ef6ea05d68a97d6342a42d2bb2232d72dd8
4
+ data.tar.gz: 04e8868b91adad87c9fe2619bcc7159db518cf69fe3b96e194c9909fb6b9aa51
5
5
  SHA512:
6
- metadata.gz: 559197f0fd9d352eb28bd862e3f87f1fb4acf95d25aed162f4f8f7815c87592a99997a5a595829ac95d76f24d2fabddbef8f551f7eff14a75ff453547e00a5a6
7
- data.tar.gz: 4fc2845a2297be4ebc7225ad0145f186fffb69545f3e98c64d741ade9a807e514d4e881c3556e0d16a612f76c876a878a74ab58d116a79588d0c7864399a0d39
6
+ metadata.gz: e64d9d5ad104119ec098ad882929d9e0906baf1a66a236f03f570b4340c3081498197eeaadc19be65562103f083b7bfaebeac1a02d49b638294106250fd3300b
7
+ data.tar.gz: f9fde2bda3bec8cf9e8f7db0df8f08cdb26a9e63e05465308d0918fe7e8b676ea827872b085be046396c8e3d1e54931d9f24bdb94a363e83b03379ef5e9fb8ca
data/.version CHANGED
@@ -1 +1 @@
1
- 0.5.0
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.0
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-06 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