puppetdb_query 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +10 -7
- data/Gemfile +3 -1
- data/README.md +2 -0
- data/lib/puppetdb_query/parser.rb +4 -3
- data/lib/puppetdb_query/version.rb +1 -1
- data/puppetdb_query.gemspec +1 -2
- data/scripts/deploy_gem.sh +87 -0
- data/spec/puppetdb_query/parser_spec.rb +5 -0
- metadata +4 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3301979985af2a5c8e3e52c9aebe6204d91a2bd3
|
4
|
+
data.tar.gz: 2a3155d079b92856bb7f9ff0b0a8045c9d973e25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22aa0dcca610efafe04080ed11683f4d03fe038c2be0d80dca89b93d8c39deb22ce186c2b8cbf0b4da653c73304bf11153bca56761b0e105f33c24ee45b3f43e
|
7
|
+
data.tar.gz: 791c167a17715cc0de051ce33c5a05bf8d603a3b6ad70c01a7584c24a4d318ad2be4678db8e2191a26dd310639cea4eb3371cb0bf253f07a087b0b87905f74f8
|
data/.travis.yml
CHANGED
@@ -1,19 +1,22 @@
|
|
1
1
|
sudo: false
|
2
2
|
language: ruby
|
3
3
|
cache: bundler
|
4
|
+
before_install: gem install bundler
|
5
|
+
install: bundle install --jobs=3 --retry=3
|
4
6
|
rvm:
|
5
7
|
- 1.9.3
|
6
8
|
- 2.0.0
|
7
|
-
- 2.1.
|
8
|
-
- 2.2.
|
9
|
-
- 2.3.
|
9
|
+
- 2.1.10
|
10
|
+
- 2.2.6
|
11
|
+
- 2.3.3
|
12
|
+
- 2.4.0
|
13
|
+
- ruby-head
|
14
|
+
- jruby-9.1.5.0
|
10
15
|
- jruby-19mode
|
11
16
|
- jruby-head
|
12
|
-
- rbx
|
13
|
-
- rbx-19mode
|
14
17
|
matrix:
|
15
18
|
fast_finish: true
|
16
19
|
allow_failures:
|
17
20
|
- rvm: jruby-head
|
18
|
-
- rvm:
|
19
|
-
|
21
|
+
- rvm: ruby-head
|
22
|
+
|
data/Gemfile
CHANGED
@@ -4,8 +4,10 @@ gemspec
|
|
4
4
|
|
5
5
|
# only for local testing but not needed for spec tests
|
6
6
|
group :test do
|
7
|
+
gem 'rake', '~>11'
|
7
8
|
gem 'mongo', '>=2.2.0' # if you want to work with a mongodb
|
8
9
|
gem 'ruby-puppetdb', '=2.2.0' if RUBY_VERSION !~ /^1\./
|
9
10
|
gem 'puppet', '=3.8.7' if RUBY_VERSION !~ /^1\./
|
10
|
-
gem
|
11
|
+
gem 'rubocop', '=0.39.0' if RUBY_VERSION =~ /^1\./
|
12
|
+
gem 'rubocop' if RUBY_VERSION !~ /^1\./
|
11
13
|
end
|
data/README.md
CHANGED
@@ -88,6 +88,8 @@ After checking out the repo, run `bundle install` to install dependencies.
|
|
88
88
|
|
89
89
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
90
90
|
|
91
|
+
Travis results under (https://travis-ci.org/m-31/puppetdb_query)
|
92
|
+
|
91
93
|
## Contributing
|
92
94
|
|
93
95
|
1. Fork it ( https://github.com/m-31/puppetdb_query/fork )
|
@@ -30,6 +30,7 @@ module PuppetDBQuery
|
|
30
30
|
OR.symbol => OR,
|
31
31
|
NOT.symbol => NOT,
|
32
32
|
EQUAL.symbol => EQUAL,
|
33
|
+
:is => EQUAL,
|
33
34
|
NOT_EQUAL.symbol => NOT_EQUAL,
|
34
35
|
MATCH.symbol => MATCH,
|
35
36
|
IN.symbol => IN,
|
@@ -108,7 +109,7 @@ module PuppetDBQuery
|
|
108
109
|
term = args
|
109
110
|
else
|
110
111
|
error("no operator #{get_operator} expected here") if get_operator
|
111
|
-
if Tokenizer::LANGUAGE_STRINGS.include?(token) && ![:true, :false].include?(token)
|
112
|
+
if Tokenizer::LANGUAGE_STRINGS.include?(token) && ![:true, :false, :null].include?(token)
|
112
113
|
error("that was not expected here: '#{Tokenizer.symbol_to_string(token)}'")
|
113
114
|
end
|
114
115
|
token = read_token
|
@@ -121,7 +122,7 @@ module PuppetDBQuery
|
|
121
122
|
# rubocop:enable Metrics/PerceivedComplexity,Metrics/AbcSize,Metrics/CyclomaticComplexity
|
122
123
|
# rubocop:enable Metrics/MethodLength
|
123
124
|
|
124
|
-
# rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity
|
125
|
+
# rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/BlockLength
|
125
126
|
# rubocop:disable Metrics/MethodLength,Metrics/PerceivedComplexity
|
126
127
|
def add_next_infix_terms(priority, first)
|
127
128
|
old_operator = nil
|
@@ -169,7 +170,7 @@ module PuppetDBQuery
|
|
169
170
|
old_operator = operator
|
170
171
|
end
|
171
172
|
end
|
172
|
-
# rubocop:enable Metrics/AbcSize,Metrics/CyclomaticComplexity
|
173
|
+
# rubocop:enable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/BlockLength
|
173
174
|
# rubocop:enable Metrics/MethodLength,Metrics/PerceivedComplexity
|
174
175
|
|
175
176
|
# rubocop:disable Style/AccessorMethodName
|
data/puppetdb_query.gemspec
CHANGED
@@ -17,11 +17,10 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.bindir = "exe"
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
+
spec.required_ruby_version = '>= 1.9.3'
|
20
21
|
spec.require_paths = ["lib"]
|
21
22
|
spec.post_install_message = " Sitting quietly, doing nothing, spring comes, and grass grows by itself."
|
22
23
|
|
23
|
-
spec.add_development_dependency "rake"
|
24
24
|
spec.add_development_dependency "rspec"
|
25
|
-
spec.add_development_dependency "rubocop" #, "0.43.0" # matches with .rubocop.yml
|
26
25
|
spec.add_development_dependency "easy_diff"
|
27
26
|
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
# release puppetdb_query gem to rubygems
|
4
|
+
|
5
|
+
# exit on any error
|
6
|
+
set -e
|
7
|
+
|
8
|
+
#############################################################################
|
9
|
+
## defaults
|
10
|
+
|
11
|
+
readonly progname=$(basename $0)
|
12
|
+
readonly script_dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
13
|
+
readonly main_dir=$( cd "${script_dir}" && cd .. && pwd )
|
14
|
+
readonly application=puppetdb_query
|
15
|
+
readonly module=PuppetDBQuery
|
16
|
+
|
17
|
+
#############################################################################
|
18
|
+
## functions
|
19
|
+
|
20
|
+
## write green message with time stamp to stdout
|
21
|
+
function puts () {
|
22
|
+
echo -e "\033[0;32m"$(date +"%Y-%m-%d %T") $*"\033[0m"
|
23
|
+
}
|
24
|
+
|
25
|
+
## bump version, must be in main git directory
|
26
|
+
function bump_version () {
|
27
|
+
puts "bump ${application} gem version"
|
28
|
+
|
29
|
+
old_version=$( ruby -I lib/${application} -e "require 'version'; puts Gem::Version.new(${module}::VERSION)" )
|
30
|
+
puts "gem version currently:" ${old_version}
|
31
|
+
|
32
|
+
new_version=$( ruby -I lib/${application} -e "require 'version'; puts Gem::Version.new(${module}::VERSION + '.1').bump" )
|
33
|
+
puts "we will change it into:" ${new_version}
|
34
|
+
|
35
|
+
cat lib/${application}/version.rb | sed "s/$old_version/$new_version/" > lib/${application}/version.rb.new
|
36
|
+
mv lib/${application}/version.rb.new lib/${application}/version.rb
|
37
|
+
}
|
38
|
+
|
39
|
+
## commit and push version, must be in main git directory
|
40
|
+
function commit_and_push_version () {
|
41
|
+
puts "commit and push ${application} gem version"
|
42
|
+
git add lib/${application}/version.rb
|
43
|
+
git commit -m "m31's version bumper"
|
44
|
+
git push
|
45
|
+
}
|
46
|
+
|
47
|
+
#############################################################################
|
48
|
+
## main processsing
|
49
|
+
|
50
|
+
cd ${main_dir}
|
51
|
+
|
52
|
+
puts "trying to release ${application} gem to rubygems"
|
53
|
+
puts
|
54
|
+
|
55
|
+
puts "updating git repository"
|
56
|
+
git pull -r
|
57
|
+
|
58
|
+
puts "build new Gemfile.lock with bundle install"
|
59
|
+
rm Gemfile.lock
|
60
|
+
bundle install
|
61
|
+
|
62
|
+
puts "check and test"
|
63
|
+
bundle exec rake spec
|
64
|
+
|
65
|
+
bump_version
|
66
|
+
commit_and_push_version
|
67
|
+
|
68
|
+
puts "build gem"
|
69
|
+
result=$( gem build ${application}.gemspec )
|
70
|
+
puts " ${result}"
|
71
|
+
|
72
|
+
# get gem file name
|
73
|
+
set +e
|
74
|
+
gem_file=$( echo $result | grep -o "${application}-[.0-9]*\.gem$" )
|
75
|
+
set -e
|
76
|
+
puts " gem file:" $gem_file
|
77
|
+
|
78
|
+
## check if group was specified
|
79
|
+
if [ -z "${gem_file}" ]; then
|
80
|
+
echo "generated gem file not found" >&2
|
81
|
+
exit 1
|
82
|
+
fi
|
83
|
+
|
84
|
+
puts "push gem to rubygems"
|
85
|
+
gem push ${gem_file} --host https://rubygems.org
|
86
|
+
|
87
|
+
echo -e "\033[0;34mThe lioness has rejoined her cub, and all is right in the jungle...\033[0m"
|
@@ -30,6 +30,11 @@ describe PuppetDBQuery::Parser do
|
|
30
30
|
))
|
31
31
|
]
|
32
32
|
],
|
33
|
+
[ 'type in [jenkins, mongo, tomcat]',
|
34
|
+
[PuppetDBQuery::Term.new(PuppetDBQuery::Parser::IN)
|
35
|
+
.add(:type, [:jenkins, :mongo, :tomcat])
|
36
|
+
]
|
37
|
+
],
|
33
38
|
].freeze
|
34
39
|
|
35
40
|
CORRECT_PARSER_DATA.each do |q, a|
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppetdb_query
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Meyling
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: rake
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: rspec
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -38,20 +24,6 @@ dependencies:
|
|
38
24
|
- - ">="
|
39
25
|
- !ruby/object:Gem::Version
|
40
26
|
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rubocop
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
27
|
- !ruby/object:Gem::Dependency
|
56
28
|
name: easy_diff
|
57
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -93,6 +65,7 @@ files:
|
|
93
65
|
- lib/puppetdb_query/updater.rb
|
94
66
|
- lib/puppetdb_query/version.rb
|
95
67
|
- puppetdb_query.gemspec
|
68
|
+
- scripts/deploy_gem.sh
|
96
69
|
- spec/puppetdb_query/parser_spec.rb
|
97
70
|
- spec/puppetdb_query/to_mongo_spec.rb
|
98
71
|
- spec/puppetdb_query/tokenizer_spec.rb
|
@@ -111,7 +84,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
111
84
|
requirements:
|
112
85
|
- - ">="
|
113
86
|
- !ruby/object:Gem::Version
|
114
|
-
version:
|
87
|
+
version: 1.9.3
|
115
88
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
89
|
requirements:
|
117
90
|
- - ">="
|