Skip to content

Commit

Permalink
Gemfile: Add version to the gemfile generation
Browse files Browse the repository at this point in the history
Set GemRequirement of puppet-lint to 2.1.1 and add version
to the gemfile generation.
  • Loading branch information
yash-nisar committed Mar 28, 2017
1 parent 63d31e1 commit e0e1d05
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
15 changes: 12 additions & 3 deletions .ci/Gemfile.jinja2
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
source 'https://rubygems.org'
ruby '2.2.2'

{% for gem in gems %}gem "{{gem.name + '"' if gem.required == '' else gem.name + '", require: false'}}
{% endfor %}
{% for gem in gems %}
{%- if gem.version != '' and gem.required != '' %}
gem "{{ gem.name + '", "' + gem.version + '", require: false' }}
{%- elif gem.version == '' and gem.required == '' %}
gem "{{ gem.name + '"' }}
{%- elif gem.version != '' and gem.required == '' %}
gem "{{ gem.name + '", "' + gem.version + '"' }}
{%- else %}
gem "{{ gem.name + '", require: false' }}
{%- endif %}
{%- endfor %}
{{ '' }}
5 changes: 3 additions & 2 deletions .ci/generate_bear_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,9 @@ def write_gem_requirements(requirements):

for requirement in requirements:
gem_dependencies.append(
{'name' : requirement.package,
'required' : requirement.require})
{'name': requirement.package,
'version': requirement.version,
'required': requirement.require})

gemfile_string = template.render(
gems=gem_dependencies
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ source 'https://rubygems.org'
ruby '2.2.2'

gem "csvlint"
gem "puppet-lint"
gem "puppet-lint", "2.1.1"
gem "reek"
gem "rubocop"
gem "scss_lint", require: false
Expand Down
2 changes: 1 addition & 1 deletion bears/configfiles/PuppetLintBear.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class PuppetLintBear:
'''

LANGUAGES = {'Puppet'}
REQUIREMENTS = {GemRequirement('puppet-lint', '2')}
REQUIREMENTS = {GemRequirement('puppet-lint', '2.1.1')}
AUTHORS = {'The coala developers'}
AUTHORS_EMAILS = {'[email protected]'}
LICENSE = 'AGPL-3.0'
Expand Down

0 comments on commit e0e1d05

Please sign in to comment.