config_templates 0.0.3 → 0.0.4

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: fc8b11d7ca7acb11e83e9287eec0bc0cf8cf8b16
4
- data.tar.gz: d37ad35203202dfcb1661fdc2335662dece16d0d
3
+ metadata.gz: d752207f0865213d7b12f3ba1eb62f4aecce85f0
4
+ data.tar.gz: c11f18272a97dda4448a9f4d17d11bec99c092f1
5
5
  SHA512:
6
- metadata.gz: ad630cea888a5a254ed4d77344617c985b5f2664e68e610c4cf52b2ff6647db5860469ab9c7c053241b6cf2147fd217c785fb80f92925419ae40fb3eb8a01f33
7
- data.tar.gz: b1023f9a1b8c27706138eff79eafe328b8e2012e98f4bf51c0dc3c430374074b6f458cbd8e8679f35705425e9e5d4394ed269333dd377aa2a2def3ed849c1a55
6
+ metadata.gz: 4a67cecc7b557d6eaee4ec4ec8d0f8e05063add3737c7704b559cefb100de4dc764b0ddf5f61be842ce1953e323448ac109dd98533eed4ecd4263eb66e953de5
7
+ data.tar.gz: 224d4ab9679466750e581474729b5473ffd0b84c18ddb23ff1324b819684557a0edae86e08f054773d1b14bbc7c741d16849623eeb95a0313400be911adf1f77
@@ -1,12 +1,20 @@
1
1
  module ConfigTemplates::Criteria
2
2
  class Name
3
- def initialize(pattern, override = true)
3
+ def initialize(pattern, straight = true)
4
4
  @pattern = pattern
5
- @override = override
5
+ @straight = straight
6
6
  end
7
7
 
8
- def matches?(target)
9
- @pattern.match?(target) && @override
8
+ def matches?(expression)
9
+ @pattern.match?(cast expression) && @straight
10
+ end
11
+
12
+ def cast(expression)
13
+ if expression.is_a?(::String) || expression.is_a?(::Regexp)
14
+ expression
15
+ else
16
+ expression.to_s
17
+ end
10
18
  end
11
19
  end
12
20
  end
@@ -1,3 +1,3 @@
1
1
  module ConfigTemplates
2
- VERSION = '0.0.3'.freeze
2
+ VERSION = '0.0.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: config_templates
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - g.ivanov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-29 00:00:00.000000000 Z
11
+ date: 2018-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler