semantic_puppet 1.0.1 → 1.0.2

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
2
  SHA1:
3
- metadata.gz: f3b8c9749c1289e2571d5252ea6bd1a464545d9f
4
- data.tar.gz: c73441801b17011eb978062596b86216bcb224f1
3
+ metadata.gz: cc232fb3f2d16e77531d2a52282d78b6e2c020c0
4
+ data.tar.gz: 2692a3f0c579ea9ddc068ea79a973d8765b3c407
5
5
  SHA512:
6
- metadata.gz: 5bf4ca513a1edde4040868602fb1ff4b92d849681547cfb11a8e7f274c1b169ff61eec066fcfd1c5ba9b9178fd6c3cfa91b508bf126706163ea73ccd6836bc95
7
- data.tar.gz: 72d5a7cf4727fc5d84adff17884d433de4ee0d985bcccd4cab1170a33346d3bea81ed69df5f7c9b8f75161acc5ed812bf259db1ef915e82626b2649b6f4a97f8
6
+ metadata.gz: 913af8f7fa2657363468237d267f2f4de79246f285273a2aaf328038f1f2ff11488001c8bee281ad989ded8401227c878c422963ed208aa14a178084e904cd7a
7
+ data.tar.gz: e32a58891d6b026a47dce06b5cd9eec259c3706cf4b30a3ba34345e4ec887df2e04041929c3df8dbc34607b32396fdafee0388350b3adc9fa82147399818ec68
@@ -1,14 +1,29 @@
1
1
  ---
2
2
  language: ruby
3
+
3
4
  cache: bundler
5
+
6
+ before_install:
7
+ - bundle -v
8
+ - rm Gemfile.lock || true
9
+ - gem update --system
10
+ - gem update bundler
11
+ - gem --version
12
+ - bundle -v
13
+
4
14
  script: "bundle exec rspec --color --format documentation spec/unit"
15
+
5
16
  notifications:
6
17
  email: false
18
+
7
19
  sudo: false
20
+
8
21
  rvm:
9
- - "2.3.1"
22
+ - "2.4.1"
10
23
  - "2.1.9"
24
+ - "2.0.0"
11
25
  - "1.9.3"
12
26
  - "jruby-19mode"
27
+
13
28
  jdk:
14
29
  - oraclejdk8
@@ -2,8 +2,14 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
+ ## 1.0.2 - 2018-03-13
6
+ - Removed i18n/gettext configuration and string externalization. After further consideration we have decided that
7
+ as a library, semantic_puppet should not be attempting to configure global localization state and the localization
8
+ of error messages etc. is the responsibility of the consuming application.
9
+ - Added Appveyor CI configuration
10
+
5
11
  ## 1.0.1 - 2017-07-01
6
- - Fix bug causing pre-release identifiers being considered invalid when they contained letters but started with a zero
12
+ - Fix bug causing pre-release identifiers being considered invalid when they contained letters but started with a zero
7
13
 
8
14
  ## 1.0.0 - 2017-04-05
9
15
  - Complete rewrite of the VersionRange to make it compatible with Node Semver
data/README.md CHANGED
@@ -12,10 +12,6 @@ Versions and Version Ranges and to query and resolve module dependencies.
12
12
 
13
13
  For sparse, but accurate documentation, please see the docs directory.
14
14
 
15
- Note that this is a 0 release version, and things can change. Expect that the
16
- version and version range code to stay relatively stable, but the module
17
- dependency code is expected to change.
18
-
19
15
  This library is used by a number of Puppet Labs projects, including
20
16
  [Puppet](https://github.com/puppetlabs/puppet) and
21
17
  [r10k](https://github.com/puppetlabs/r10k).
@@ -23,9 +19,8 @@ This library is used by a number of Puppet Labs projects, including
23
19
  Requirements
24
20
  ------------
25
21
 
26
- Semantic_puppet will work on several ruby versions, including 1.9.3, 2.0.0, and
27
- 2.1.0. Ruby 1.8.7 is immediately deprecated as it is in
28
- [r10k](https://github.com/puppetlabs/r10k).
22
+ Semantic_puppet will work on several ruby versions, including 1.9.3,
23
+ 2.0.0, 2.1.9 and 2.4.1. Please see the exact matrix in `.travis.yml`.
29
24
 
30
25
  No gem/library requirements.
31
26
 
@@ -48,40 +43,22 @@ install it out of a git repository:
48
43
  Usage
49
44
  -----
50
45
 
51
- SemanticPuppet is intended to be used as a library.
46
+ SemanticPuppet is intended to be used as a library.
52
47
 
53
48
  ### Version Range Operator Support
54
49
 
55
- SemanticPuppet will support the same version range operators as those used when
56
- publishing modules to [Puppet Forge](https://forge.puppetlabs.com) which is
57
- documented at
58
- [Publishing Modules on the Puppet Forge](https://docs.puppetlabs.com/puppet/latest/reference/modules_publishing.html#dependencies-in-metadatajson).
59
-
60
- ### i18n
61
-
62
- When adding new error or log messages please follow the instructions for
63
- [writing translatable code](https://github.com/puppetlabs/gettext-setup-gem#writing-translatable-code).
64
-
65
- The SemanticPuppet gem will default to outputing all error messages in English, but you may set the locale
66
- using the `FastGettext.set_locale` method. If translations do not exist for the language you request then the gem will
67
- default to English. The `set_locale` method will return the locale, as a string, that FastGettext will now
68
- use to report PuppetForge errors.
69
-
70
- ``` ruby
71
- # Assuming the German translations exist, this will set the reporting language
72
- # to German
73
-
74
- locale = FastGettext.set_locale "de_DE"
75
-
76
- # If it successfully finds Germany's locale, locale will be "de_DE"
77
- # If it fails to find any German locale, locale will be "en"
78
- ```
50
+ SemanticPuppet will support the same version range operators as those
51
+ used when publishing modules to [Puppet
52
+ Forge](https://forge.puppetlabs.com) which is documented at [Publishing
53
+ Modules on the Puppet
54
+ Forge](https://docs.puppetlabs.com/puppet/latest/reference/modules_publishing.html#dependencies-in-metadatajson).
79
55
 
80
56
  Contributors
81
57
  ------------
82
58
 
83
- Pieter van de Bruggen wrote the library originally, with additions by Alex
84
- Dreyer, Jesse Scott and Anderson Mills.
59
+ Pieter van de Bruggen wrote the library originally. See
60
+ [https://github.com/puppetlabs/semantic_puppet/graphs/contributors](https://github.com/puppetlabs/semantic_puppet/graphs/contributors)
61
+ for a list of contributors.
85
62
 
86
63
  ## Maintenance
87
64
 
@@ -90,4 +67,5 @@ Maintainers:
90
67
  * Jesse Scott, jesse@puppet.com
91
68
  * Anderson Mills, anderson@puppet.com
92
69
 
93
- Tickets: File at https://tickets.puppet.com/browse/FORGE
70
+ Tickets: File at
71
+ [https://tickets.puppet.com/browse/FORGE](https://tickets.puppet.com/browse/FORGE)
data/Rakefile CHANGED
@@ -56,12 +56,3 @@ begin
56
56
  rescue LoadError
57
57
  warn "[Warning]: Could not load `bundler/gem_tasks`."
58
58
  end
59
-
60
- # Gettext tasks
61
- begin
62
- spec = Gem::Specification.find_by_name 'gettext-setup'
63
- load "#{spec.gem_dir}/lib/tasks/gettext.rake"
64
- GettextSetup.initialize(File.absolute_path('locales', File.dirname(__FILE__)))
65
- rescue LoadError
66
- warn "[Warning]: Could not load gettext tasks."
67
- end
@@ -0,0 +1,18 @@
1
+ version: 1.0.1.{build}
2
+ clone_depth: 10
3
+ environment:
4
+ matrix:
5
+ - RUBY_VERSION: 193
6
+ - RUBY_VERSION: 23-x64
7
+ - RUBY_VERSION: 21-x64
8
+ matrix:
9
+ fast_finish: true
10
+ install:
11
+ - set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
12
+ - bundle install --jobs 4 --retry 2
13
+ build: off
14
+ test_script:
15
+ - ruby -v
16
+ - gem -v
17
+ - bundle -v
18
+ - bundle exec rspec --format documentation --color spec/unit
@@ -1,8 +1,4 @@
1
- require 'gettext-setup'
2
-
3
1
  module SemanticPuppet
4
- GettextSetup.initialize(File.absolute_path('../locales', File.dirname(__FILE__)))
5
-
6
2
  autoload :Version, 'semantic_puppet/version'
7
3
  autoload :VersionRange, 'semantic_puppet/version_range'
8
4
  autoload :Dependency, 'semantic_puppet/dependency'
@@ -1,3 +1,3 @@
1
1
  module SemanticPuppet
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
  end
@@ -15,7 +15,7 @@ module SemanticPuppet
15
15
  def self.parse(ver)
16
16
  match, major, minor, patch, prerelease, build = *ver.match(REGEX_FULL_RX)
17
17
 
18
- raise ValidationFailure, _("Unable to parse '%{version}' as a semantic version identifier") % {version: ver} unless match
18
+ raise ValidationFailure, "Unable to parse '#{ver}' as a semantic version identifier" unless match
19
19
 
20
20
  new(major.to_i, minor.to_i, patch.to_i, parse_prerelease(prerelease), parse_build(build)).freeze
21
21
  end
@@ -42,7 +42,7 @@ module SemanticPuppet
42
42
  return nil unless prerelease
43
43
  prerelease.split('.').map do |x|
44
44
  if x =~ /^\d+$/
45
- raise ValidationFailure, _('Numeric pre-release identifiers MUST NOT contain leading zeroes') if x.length > 1 && x.start_with?('0')
45
+ raise ValidationFailure, 'Numeric pre-release identifiers MUST NOT contain leading zeroes' if x.length > 1 && x.start_with?('0')
46
46
  x.to_i
47
47
  else
48
48
  x
@@ -74,7 +74,7 @@ module SemanticPuppet
74
74
  # Split on whitespace
75
75
  simples = range.split(RANGE_SPLIT).map do |simple|
76
76
  match_data = SIMPLE_EXPR.match(simple)
77
- raise ArgumentError, _("Unparsable version range: \"%{range}\"") % { range: range_string } unless match_data
77
+ raise ArgumentError, "Unparsable version range: \"#{range_string}\"" unless match_data
78
78
  operand = match_data[2]
79
79
 
80
80
  # Case based on operator
@@ -104,7 +104,7 @@ module SemanticPuppet
104
104
 
105
105
  def self.parse_partial(expr)
106
106
  match_data = PARTIAL_EXPR.match(expr)
107
- raise ArgumentError, _("Unparsable version range: \"%{expr}\"") % { expr: expr } unless match_data
107
+ raise ArgumentError, "Unparsable version range: \"#{expr}\"" unless match_data
108
108
  match_data
109
109
  end
110
110
  private_class_method :parse_partial
@@ -332,7 +332,7 @@ module SemanticPuppet
332
332
  # @return [VersionRange] the common subset
333
333
  # @api public
334
334
  def intersection(other)
335
- raise ArgumentError, _("value must be a %{type}") % { :type => self.class.name } unless other.is_a?(VersionRange)
335
+ raise ArgumentError, "value must be a #{self.class.name}" unless other.is_a?(VersionRange)
336
336
  result = @ranges.map { |range| other.ranges.map { |o_range| range.intersection(o_range) } }.flatten
337
337
  result.compact!
338
338
  result.uniq!
@@ -22,8 +22,6 @@ spec = Gem::Specification.new do |s|
22
22
  # Dependencies
23
23
  s.required_ruby_version = '>= 1.9.3'
24
24
 
25
- s.add_dependency "gettext-setup", ">= 0.3"
26
-
27
25
  s.add_development_dependency "json", "~> 1.8.3" if RUBY_VERSION < '2.0'
28
26
  s.add_development_dependency "rake"
29
27
  s.add_development_dependency "rspec"
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semantic_puppet
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet Labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-01 00:00:00.000000000 Z
11
+ date: 2018-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: gettext-setup
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0.3'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0.3'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: rake
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -125,6 +111,7 @@ files:
125
111
  - LICENSE
126
112
  - README.md
127
113
  - Rakefile
114
+ - appveyor.yml
128
115
  - lib/semantic_puppet.rb
129
116
  - lib/semantic_puppet/dependency.rb
130
117
  - lib/semantic_puppet/dependency/graph.rb
@@ -135,7 +122,6 @@ files:
135
122
  - lib/semantic_puppet/gem_version.rb
136
123
  - lib/semantic_puppet/version.rb
137
124
  - lib/semantic_puppet/version_range.rb
138
- - locales/config.yaml
139
125
  - semantic_puppet.gemspec
140
126
  - spec/spec_helper.rb
141
127
  - spec/unit/semantic_puppet/dependency/graph_node_spec.rb
@@ -166,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
152
  version: '0'
167
153
  requirements: []
168
154
  rubyforge_project:
169
- rubygems_version: 2.6.10
155
+ rubygems_version: 2.6.8
170
156
  signing_key:
171
157
  specification_version: 4
172
158
  summary: Useful tools for working with Semantic Versions.
@@ -1,21 +0,0 @@
1
- ---
2
- # This is the project-specific configuration file for setting up
3
- # fast_gettext for your project.
4
- gettext:
5
- # This is used for the name of the .pot and .po files; they will be
6
- # called <project_name>.pot?
7
- project_name: 'semantic_puppet'
8
- # This is used in comments in the .pot and .po files to indicate what
9
- # project the files belong to and should bea little more desctiptive than
10
- # <project_name>
11
- package_name: Semantic Puppet Gem
12
- # The locale that the default messages in the .pot file are in
13
- default_locale: en
14
- # The email used for sending bug reports.
15
- bugs_address: docs@puppetlabs.com
16
- # The holder of the copyright.
17
- copyright_holder: Puppet, Inc.
18
- # Patterns for +Dir.glob+ used to find all files that might contain
19
- # translatable content, relative to the project root directory
20
- source_files:
21
- - 'lib/**/*.rb'