greenenvy 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/lib/greenenvy/name_checker.rb +10 -2
- data/lib/greenenvy/version.rb +1 -1
- metadata +2 -3
- data/Gemfile.lock +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c44d7ffe342cc58db10ea5d8a2ade17f2607bec6ef51362e08979ec1ca86e64b
|
4
|
+
data.tar.gz: 9ea1723669d2111ac53c01ae68729451f32b0a898b4801abe547ef6aa9e1a01a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7773d0521273e17a293b0869b74ac8976e896bb54a95a76ac3aba987e8310222bbd589de5092b51c518cf0eec617415279c57b6c2c7150628f6db7df0c6e719
|
7
|
+
data.tar.gz: da063579e5110454fc0d8cffe812396a67b90929e989794eab879b65d1af8a9fa72d869d79acf8f721f5e16b8246314fdeab339250f8ce0e35486b58be36715a
|
data/.gitignore
CHANGED
@@ -17,6 +17,8 @@ module Greenenvy
|
|
17
17
|
:inspect,
|
18
18
|
].freeze
|
19
19
|
|
20
|
+
REGEXP = %r{\A[A-Za-z]+\w+\z}.freeze
|
21
|
+
|
20
22
|
def valid?(name)
|
21
23
|
name = name.to_s
|
22
24
|
!reserved_method?(name) && valid_pattern?(name)
|
@@ -28,8 +30,14 @@ module Greenenvy
|
|
28
30
|
BASIC_OBJECT_METHODS.include?(name)
|
29
31
|
end
|
30
32
|
|
31
|
-
|
32
|
-
|
33
|
+
if String.instance_methods.include?(:match?)
|
34
|
+
def valid_pattern?(name)
|
35
|
+
REGEXP.match?(name)
|
36
|
+
end
|
37
|
+
else
|
38
|
+
def valid_pattern?(name)
|
39
|
+
name =~ REGEXP ? true : false
|
40
|
+
end
|
33
41
|
end
|
34
42
|
end
|
35
43
|
end
|
data/lib/greenenvy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: greenenvy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Gibralter
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -64,7 +64,6 @@ files:
|
|
64
64
|
- ".travis.yml"
|
65
65
|
- CODE_OF_CONDUCT.md
|
66
66
|
- Gemfile
|
67
|
-
- Gemfile.lock
|
68
67
|
- LICENSE
|
69
68
|
- LICENSE.txt
|
70
69
|
- README.md
|
data/Gemfile.lock
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
greenenvy (0.1.0)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: https://rubygems.org/
|
8
|
-
specs:
|
9
|
-
minitest (5.11.3)
|
10
|
-
rake (10.5.0)
|
11
|
-
|
12
|
-
PLATFORMS
|
13
|
-
ruby
|
14
|
-
|
15
|
-
DEPENDENCIES
|
16
|
-
bundler (~> 1.16)
|
17
|
-
greenenvy!
|
18
|
-
minitest (~> 5.0)
|
19
|
-
rake (~> 10.0)
|
20
|
-
|
21
|
-
BUNDLED WITH
|
22
|
-
1.16.1
|