synchronized_model 0.2.0 → 0.2.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8c3ec9f9dc2eb693b021aab24c83cc09f56c2d14
4
- data.tar.gz: e0961b8b0502b22d7e51366ea88e33a49ee88003
3
+ metadata.gz: 8e0650e391a34a311c43ce5d5a893cca5d733159
4
+ data.tar.gz: 49166070dc06eb3930132c21836c1b093d3a495f
5
5
  SHA512:
6
- metadata.gz: 2f7cae4eb06d29592f42927a96ffb8f5837be86c647b61f919c4fa65ed969cdeba8351eba9fbb2758f227f917307dd2d17f9d7d919e28b099b3374528aa43b9d
7
- data.tar.gz: b3439a0ddd1de47112f4cb041628ba0c0e151d916ee7eb4354a2bc0f264521bda95cc2ffad4cbe8f911694947efcf7a5ff3925812703ace4138f2b868e209917
6
+ metadata.gz: '0581c14dd604efc3a653840b200efa747965d7f90bdcee20e4d6909836cceea03c14d6a9a2553da93ea920ed7abe0eea934d60ab10af7b43a86e45af095032a1'
7
+ data.tar.gz: abb286e78958d3454a0eab030da9e77cff0b1213640538d197e9970a9cfda87ac05403e164e4684c46c7b961a237acff7563500e05bad216e06b47592c1f1552
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- synchronized_model (0.2.0)
4
+ synchronized_model (0.2.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -3,7 +3,9 @@ module SynchronizedModel
3
3
  module Support
4
4
  # Taken from ActiveSupport:Inflector.underscore
5
5
  def underscore(camel_cased_word)
6
- return camel_cased_word unless /[A-Z-]|::/.match?(camel_cased_word)
6
+ unless matches(/[A-Z-]|::/, camel_cased_word)
7
+ return camel_cased_word
8
+ end
7
9
  word = camel_cased_word.to_s.gsub('::', '/')
8
10
  word.gsub!(/([A-Z\d]+)([A-Z][a-z])/, '\1_\2')
9
11
  word.gsub!(/([a-z\d])([A-Z])/, '\1_\2')
@@ -11,5 +13,17 @@ module SynchronizedModel
11
13
  word.downcase!
12
14
  word
13
15
  end
16
+
17
+ private
18
+
19
+ # `match?` was added in Ruby 2.4 this allows us to be backwards
20
+ # compatible with older Ruby versions
21
+ def matches(regexp, word)
22
+ if regexp.respond_to?(:match?)
23
+ regexp.match?(word)
24
+ else
25
+ regexp.match(word)
26
+ end
27
+ end
14
28
  end
15
29
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SynchronizedModel
4
- VERSION = '0.2.0'
4
+ VERSION = '0.2.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: synchronized_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Cranston
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-22 00:00:00.000000000 Z
11
+ date: 2018-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler