keyword 1.0.0
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 +7 -0
- data/lib/keyword.rb +56 -0
- metadata +45 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 30cb45ed96d3ef2c9498533a0251e81803f31ce3
|
4
|
+
data.tar.gz: cc48251ccd063986aa7f6614e12e7625220128b1
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 17ea5ec9688d6d5acc065db21ee16a7d7762f9f347dfd4068d251f4b62abf431035b6717f04683a57cbcbbfdffcbc54897cbba85daa12f83beaf9520809909b4
|
7
|
+
data.tar.gz: b4ca0b61c11163ee6a595f280b82e9d61ecfc4cd4575d2f25aaf9f667e3cb0dfecc9540167a11a3e2f3a832459e36cb17d56f6d197545c90953c2c73bd1f3319
|
data/lib/keyword.rb
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
$KEYWORD_LIST = [
|
2
|
+
"__ENCODING__",
|
3
|
+
"__LINE__",
|
4
|
+
"__FILE__",
|
5
|
+
"BEGIN",
|
6
|
+
"END",
|
7
|
+
"alias",
|
8
|
+
"and",
|
9
|
+
"begin",
|
10
|
+
"break",
|
11
|
+
"case",
|
12
|
+
"class",
|
13
|
+
"def",
|
14
|
+
"defined?",
|
15
|
+
"do",
|
16
|
+
"else",
|
17
|
+
"elsif",
|
18
|
+
"end",
|
19
|
+
"ensure",
|
20
|
+
"false",
|
21
|
+
"for",
|
22
|
+
"if",
|
23
|
+
"in",
|
24
|
+
"module",
|
25
|
+
"next",
|
26
|
+
"nil",
|
27
|
+
"not",
|
28
|
+
"or",
|
29
|
+
"redo",
|
30
|
+
"rescue",
|
31
|
+
"retry",
|
32
|
+
"return",
|
33
|
+
"self",
|
34
|
+
"super",
|
35
|
+
"then",
|
36
|
+
"true",
|
37
|
+
"undef",
|
38
|
+
"unless",
|
39
|
+
"until",
|
40
|
+
"when",
|
41
|
+
"while",
|
42
|
+
"yield"
|
43
|
+
]
|
44
|
+
|
45
|
+
def all_keywords()
|
46
|
+
return $KEYWORD_LIST
|
47
|
+
end
|
48
|
+
def is_keyword?(name)
|
49
|
+
return $KEYWORD_LIST.include?(name)
|
50
|
+
end
|
51
|
+
def not_keyword?(name)
|
52
|
+
return !is_keyword?(name)
|
53
|
+
end
|
54
|
+
|
55
|
+
alias keywords all_keywords
|
56
|
+
alias keyword? is_keyword?
|
metadata
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: keyword
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Anonymous
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-09-26 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: A simple keyword gem for determining if a string is a keyword. It's similar
|
14
|
+
to pythons kwrd module.
|
15
|
+
email:
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- lib/keyword.rb
|
21
|
+
homepage: http://rubygems.org/gems/kwrd
|
22
|
+
licenses:
|
23
|
+
- None
|
24
|
+
metadata: {}
|
25
|
+
post_install_message:
|
26
|
+
rdoc_options: []
|
27
|
+
require_paths:
|
28
|
+
- lib
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ">="
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
requirements: []
|
40
|
+
rubyforge_project:
|
41
|
+
rubygems_version: 2.6.14.1
|
42
|
+
signing_key:
|
43
|
+
specification_version: 4
|
44
|
+
summary: A basic way to search for keywords
|
45
|
+
test_files: []
|