ruby-puppetdb 1.0.0.pre2

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.
Files changed (40) hide show
  1. data/.gitignore +3 -0
  2. data/COPYING +202 -0
  3. data/Modulefile +7 -0
  4. data/README.md +233 -0
  5. data/Rakefile +24 -0
  6. data/bin/find-nodes +56 -0
  7. data/examples/nova_functions.pp +16 -0
  8. data/examples/query_node_examples.pp +12 -0
  9. data/examples/query_resource_examples.pp +48 -0
  10. data/lib/puppet/application/query.rb +22 -0
  11. data/lib/puppet/face/query.rb +60 -0
  12. data/lib/puppet/parser/functions/pdbfactquery.rb +31 -0
  13. data/lib/puppet/parser/functions/pdbnodequery.rb +38 -0
  14. data/lib/puppet/parser/functions/pdbnodequery_all.rb +40 -0
  15. data/lib/puppet/parser/functions/pdbquery.rb +41 -0
  16. data/lib/puppet/parser/functions/pdbresourcequery.rb +39 -0
  17. data/lib/puppet/parser/functions/pdbresourcequery_all.rb +37 -0
  18. data/lib/puppet/parser/functions/pdbstatusquery.rb +31 -0
  19. data/lib/puppet/parser/functions/query_facts.rb +27 -0
  20. data/lib/puppet/parser/functions/query_nodes.rb +27 -0
  21. data/lib/puppetdb.rb +2 -0
  22. data/lib/puppetdb/astnode.rb +86 -0
  23. data/lib/puppetdb/connection.rb +62 -0
  24. data/lib/puppetdb/grammar.y +57 -0
  25. data/lib/puppetdb/lexer.l +28 -0
  26. data/lib/puppetdb/lexer.rb +135 -0
  27. data/lib/puppetdb/parser.rb +368 -0
  28. data/lib/puppetdb/util.rb +18 -0
  29. data/ruby-puppetdb.gemspec +16 -0
  30. data/spec/spec_helper.rb +4 -0
  31. data/spec/unit/puppet/parser/functions/pdbfactquery_spec.rb +19 -0
  32. data/spec/unit/puppet/parser/functions/pdbnodequery_all_spec.rb +19 -0
  33. data/spec/unit/puppet/parser/functions/pdbnodequery_spec.rb +19 -0
  34. data/spec/unit/puppet/parser/functions/pdbquery_spec.rb +19 -0
  35. data/spec/unit/puppet/parser/functions/pdbresourcequery_all_spec.rb +19 -0
  36. data/spec/unit/puppet/parser/functions/pdbresourcequery_spec.rb +19 -0
  37. data/spec/unit/puppet/parser/functions/pdbstatusquery_spec.rb +19 -0
  38. data/spec/unit/puppet/parser/functions/query_facts_spec.rb +11 -0
  39. data/spec/unit/puppet/parser/functions/query_nodes_spec.rb +11 -0
  40. metadata +118 -0
@@ -0,0 +1,19 @@
1
+ #! /usr/bin/env ruby -S rspec
2
+
3
+ require 'spec_helper'
4
+
5
+ describe "the pdbnodequery function" do
6
+ let(:scope) { PuppetlabsSpec::PuppetInternals.scope }
7
+
8
+ it "should exist" do
9
+ Puppet::Parser::Functions.function("pdbnodequery").should == "function_pdbnodequery"
10
+ end
11
+
12
+ it "should raise a ParseError if there is less than 1 arguments" do
13
+ lambda { scope.function_pdbnodequery([]) }.should( raise_error(Puppet::ParseError))
14
+ end
15
+
16
+ it "should raise a ParseError if there are more than 2 arguments" do
17
+ lambda { scope.function_pdbnodequery([1, 2, 3]) }.should( raise_error(Puppet::ParseError))
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ #! /usr/bin/env ruby -S rspec
2
+
3
+ require 'spec_helper'
4
+
5
+ describe "the pdbquery function" do
6
+ let(:scope) { PuppetlabsSpec::PuppetInternals.scope }
7
+
8
+ it "should exist" do
9
+ Puppet::Parser::Functions.function("pdbquery").should == "function_pdbquery"
10
+ end
11
+
12
+ it "should raise a ParseError if there is less than 1 arguments" do
13
+ lambda { scope.function_pdbquery([]) }.should( raise_error(Puppet::ParseError))
14
+ end
15
+
16
+ it "should raise a ParseError if there are more than 2 arguments" do
17
+ lambda { scope.function_pdbquery([1, 2, 3]) }.should( raise_error(Puppet::ParseError))
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ #! /usr/bin/env ruby -S rspec
2
+
3
+ require 'spec_helper'
4
+
5
+ describe "the pdbresourcequery_all function" do
6
+ let(:scope) { PuppetlabsSpec::PuppetInternals.scope }
7
+
8
+ it "should exist" do
9
+ Puppet::Parser::Functions.function("pdbresourcequery_all").should == "function_pdbresourcequery_all"
10
+ end
11
+
12
+ it "should raise a ParseError if there is less than 1 arguments" do
13
+ lambda { scope.function_pdbresourcequery_all([]) }.should( raise_error(Puppet::ParseError))
14
+ end
15
+
16
+ it "should raise a ParseError if there are more than 2 arguments" do
17
+ lambda { scope.function_pdbresourcequery_all([1, 2, 3]) }.should( raise_error(Puppet::ParseError))
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ #! /usr/bin/env ruby -S rspec
2
+
3
+ require 'spec_helper'
4
+
5
+ describe "the pdbresourcequery function" do
6
+ let(:scope) { PuppetlabsSpec::PuppetInternals.scope }
7
+
8
+ it "should exist" do
9
+ Puppet::Parser::Functions.function("pdbresourcequery").should == "function_pdbresourcequery"
10
+ end
11
+
12
+ it "should raise a ParseError if there is less than 1 arguments" do
13
+ lambda { scope.function_pdbresourcequery([]) }.should( raise_error(Puppet::ParseError))
14
+ end
15
+
16
+ it "should raise a ParseError if there are more than 2 arguments" do
17
+ lambda { scope.function_pdbresourcequery([1, 2, 3]) }.should( raise_error(Puppet::ParseError))
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ #! /usr/bin/env ruby -S rspec
2
+
3
+ require 'spec_helper'
4
+
5
+ describe "the pdbstatusquery function" do
6
+ let(:scope) { PuppetlabsSpec::PuppetInternals.scope }
7
+
8
+ it "should exist" do
9
+ Puppet::Parser::Functions.function("pdbstatusquery").should == "function_pdbstatusquery"
10
+ end
11
+
12
+ it "should raise a ParseError if there is less than 1 arguments" do
13
+ lambda { scope.function_pdbstatusquery([]) }.should( raise_error(Puppet::ParseError))
14
+ end
15
+
16
+ it "should raise a ParseError if there are more than 2 arguments" do
17
+ lambda { scope.function_pdbstatusquery([1, 2, 3]) }.should( raise_error(Puppet::ParseError))
18
+ end
19
+ end
@@ -0,0 +1,11 @@
1
+ #! /usr/bin/env ruby -S rspec
2
+
3
+ require 'spec_helper'
4
+
5
+ describe "the query_facts function" do
6
+ let(:scope) { PuppetlabsSpec::PuppetInternals.scope }
7
+
8
+ it "should exist" do
9
+ Puppet::Parser::Functions.function("query_facts").should == "function_query_facts"
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ #! /usr/bin/env ruby -S rspec
2
+
3
+ require 'spec_helper'
4
+
5
+ describe "the query_nodes function" do
6
+ let(:scope) { PuppetlabsSpec::PuppetInternals.scope }
7
+
8
+ it "should exist" do
9
+ Puppet::Parser::Functions.function("query_nodes").should == "function_query_nodes"
10
+ end
11
+ end
metadata ADDED
@@ -0,0 +1,118 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruby-puppetdb
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: true
5
+ segments:
6
+ - 1
7
+ - 0
8
+ - 0
9
+ - pre2
10
+ version: 1.0.0.pre2
11
+ platform: ruby
12
+ authors:
13
+ - Dan Bode
14
+ - "Erik Dal\xC3\xA9n"
15
+ autorequire:
16
+ bindir: bin
17
+ cert_chain: []
18
+
19
+ date: 2013-04-04 00:00:00 +02:00
20
+ default_executable:
21
+ dependencies: []
22
+
23
+ description: A higher level query language for PuppetDB.
24
+ email:
25
+ - dan@puppetlabs.com
26
+ - erik.gustav.dalen@gmail.com
27
+ executables:
28
+ - find-nodes
29
+ extensions: []
30
+
31
+ extra_rdoc_files: []
32
+
33
+ files:
34
+ - .gitignore
35
+ - COPYING
36
+ - Modulefile
37
+ - README.md
38
+ - Rakefile
39
+ - bin/find-nodes
40
+ - examples/nova_functions.pp
41
+ - examples/query_node_examples.pp
42
+ - examples/query_resource_examples.pp
43
+ - lib/puppet/application/query.rb
44
+ - lib/puppet/face/query.rb
45
+ - lib/puppet/parser/functions/pdbfactquery.rb
46
+ - lib/puppet/parser/functions/pdbnodequery.rb
47
+ - lib/puppet/parser/functions/pdbnodequery_all.rb
48
+ - lib/puppet/parser/functions/pdbquery.rb
49
+ - lib/puppet/parser/functions/pdbresourcequery.rb
50
+ - lib/puppet/parser/functions/pdbresourcequery_all.rb
51
+ - lib/puppet/parser/functions/pdbstatusquery.rb
52
+ - lib/puppet/parser/functions/query_facts.rb
53
+ - lib/puppet/parser/functions/query_nodes.rb
54
+ - lib/puppetdb.rb
55
+ - lib/puppetdb/astnode.rb
56
+ - lib/puppetdb/connection.rb
57
+ - lib/puppetdb/grammar.y
58
+ - lib/puppetdb/lexer.l
59
+ - lib/puppetdb/lexer.rb
60
+ - lib/puppetdb/parser.rb
61
+ - lib/puppetdb/util.rb
62
+ - ruby-puppetdb.gemspec
63
+ - spec/spec_helper.rb
64
+ - spec/unit/puppet/parser/functions/pdbfactquery_spec.rb
65
+ - spec/unit/puppet/parser/functions/pdbnodequery_all_spec.rb
66
+ - spec/unit/puppet/parser/functions/pdbnodequery_spec.rb
67
+ - spec/unit/puppet/parser/functions/pdbquery_spec.rb
68
+ - spec/unit/puppet/parser/functions/pdbresourcequery_all_spec.rb
69
+ - spec/unit/puppet/parser/functions/pdbresourcequery_spec.rb
70
+ - spec/unit/puppet/parser/functions/pdbstatusquery_spec.rb
71
+ - spec/unit/puppet/parser/functions/query_facts_spec.rb
72
+ - spec/unit/puppet/parser/functions/query_nodes_spec.rb
73
+ has_rdoc: true
74
+ homepage: https://github.com/dalen/puppet-puppetdbquery
75
+ licenses: []
76
+
77
+ post_install_message:
78
+ rdoc_options: []
79
+
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ segments:
87
+ - 0
88
+ version: "0"
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">"
92
+ - !ruby/object:Gem::Version
93
+ segments:
94
+ - 1
95
+ - 3
96
+ - 1
97
+ version: 1.3.1
98
+ requirements: []
99
+
100
+ rubyforge_project:
101
+ rubygems_version: 1.3.6
102
+ signing_key:
103
+ specification_version: 3
104
+ summary: Query functions for PuppetDB
105
+ test_files:
106
+ - examples/nova_functions.pp
107
+ - examples/query_node_examples.pp
108
+ - examples/query_resource_examples.pp
109
+ - spec/spec_helper.rb
110
+ - spec/unit/puppet/parser/functions/pdbfactquery_spec.rb
111
+ - spec/unit/puppet/parser/functions/pdbnodequery_all_spec.rb
112
+ - spec/unit/puppet/parser/functions/pdbnodequery_spec.rb
113
+ - spec/unit/puppet/parser/functions/pdbquery_spec.rb
114
+ - spec/unit/puppet/parser/functions/pdbresourcequery_all_spec.rb
115
+ - spec/unit/puppet/parser/functions/pdbresourcequery_spec.rb
116
+ - spec/unit/puppet/parser/functions/pdbstatusquery_spec.rb
117
+ - spec/unit/puppet/parser/functions/query_facts_spec.rb
118
+ - spec/unit/puppet/parser/functions/query_nodes_spec.rb