reserved_words 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8779f3810afc26182435a4cde93072fce62f60a7
4
+ data.tar.gz: 0944d1f7ecf3bdaf418324edd8d63980ae1e9036
5
+ SHA512:
6
+ metadata.gz: f2e253ccf2dfc486d357674ecd0193b326161ea9efbcf9f28c5b5884cc98abf42d3bea405727f77dec2fcf29b3154e7f02c0b04d91e9bc8ebb34b756889c178e
7
+ data.tar.gz: 41c32f19815e654ef37cc939eff05d754cc264c5c2ca7d2eda7d1bde9c52cfd016b393940793d8492b1ad67fbe0171dccb027d50e775de9cc3a56fce284b0834
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.rubocop.yml ADDED
@@ -0,0 +1,36 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ AllCops:
4
+ Exclude:
5
+ - vendor/**/*
6
+ - db/**/*
7
+ - bin/**
8
+ RunRailsCops: true
9
+
10
+ BlockComments:
11
+ Enabled: false
12
+
13
+ Documentation:
14
+ Enabled: false
15
+
16
+ LineLength:
17
+ Enabled: false
18
+
19
+ MethodLength:
20
+ Enabled: false
21
+
22
+ PercentLiteralDelimiters:
23
+ PreferredDelimiters:
24
+ '%': '{}'
25
+
26
+ SignalException:
27
+ Enabled: false
28
+
29
+ UnusedBlockArgument:
30
+ Enabled: false
31
+
32
+ AssignmentInCondition:
33
+ Enabled: false
34
+
35
+ NumericLiterals:
36
+ MinDigits: 10
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,3 @@
1
+ # Offense count: 10
2
+ Metrics/AbcSize:
3
+ Max: 59
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.2.2
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ ruby '2.2.2'
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in reserved_words.gemspec
6
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Bit Journey, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
data/README.md ADDED
@@ -0,0 +1,59 @@
1
+ # ReservedWords
2
+
3
+ Reserve words for your system
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'reserved_words'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install reserved_words
20
+
21
+ ## Usage
22
+
23
+ List default words
24
+
25
+ ```ruby
26
+ [1] pry(main)> ReservedWords.list
27
+ => ["admin", "api", "image", "rss", "www"]
28
+ ```
29
+
30
+ Add your own word
31
+
32
+ ```ruby
33
+ [1] pry(main)> ReservedWords.add('blog')
34
+ => ["admin", "api", "blog", "image", "rss", "www"]
35
+ ```
36
+
37
+ Remove word
38
+
39
+ ```ruby
40
+ [1] pry(main)> ReservedWords.remove('rss')
41
+ => ["admin", "api", "image", "www"]
42
+ ```
43
+
44
+ Restore default words
45
+
46
+ ```ruby
47
+ [1] pry(main)> ReservedWords.clear!
48
+ => ["admin", "api", "image", "rss", "www"]
49
+ ```
50
+
51
+ If you are using Rails, `config/initializers/reserved_words.rb` is a good place to create your own reserved words
52
+
53
+ ## Contributing
54
+
55
+ 1. Fork it ( https://github.com/[my-github-username]/reserved_words/fork )
56
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
57
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
58
+ 4. Push to the branch (`git push origin my-new-feature`)
59
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,5 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+ task default: :spec
data/circle.yml ADDED
@@ -0,0 +1,9 @@
1
+ machine:
2
+ timezone:
3
+ Asia/Tokyo
4
+ ruby:
5
+ version: 2.2.2
6
+
7
+ test:
8
+ override:
9
+ - bundle exec rubocop
@@ -0,0 +1,23 @@
1
+ require 'reserved_words/version'
2
+
3
+ module ReservedWords
4
+ DEFAULT_WORDS = %w(admin api image rss www)
5
+
6
+ @reserved_words = DEFAULT_WORDS.dup
7
+
8
+ def self.list
9
+ @reserved_words
10
+ end
11
+
12
+ def self.add(word)
13
+ @reserved_words.tap { |reserved_words| reserved_words << word }.sort!
14
+ end
15
+
16
+ def self.remove(word)
17
+ @reserved_words.tap { |reserved_words| reserved_words.delete(word) }.sort!
18
+ end
19
+
20
+ def self.clear!
21
+ @reserved_words = DEFAULT_WORDS.dup
22
+ end
23
+ end
@@ -0,0 +1,3 @@
1
+ module ReservedWords
2
+ VERSION = '0.1.0'
3
+ end
@@ -0,0 +1,23 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require 'reserved_words/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'reserved_words'
7
+ spec.version = ReservedWords::VERSION
8
+ spec.authors = ['Masahiro Ihara']
9
+ spec.email = ['ihara2525@gmail.com']
10
+
11
+ spec.summary = 'Simple library to keep reserved words'
12
+ spec.description = 'Simple library to keep reserved words'
13
+ spec.homepage = 'https://github.com/ihara2525/reserved_words'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.require_paths = ['lib']
18
+
19
+ spec.add_development_dependency 'bundler', '~> 1.9'
20
+ spec.add_development_dependency 'rake', '~> 10.0'
21
+ spec.add_development_dependency 'rspec', '~> 3.2'
22
+ spec.add_development_dependency 'rubocop', '~> 0.31.0'
23
+ end
metadata ADDED
@@ -0,0 +1,113 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: reserved_words
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Masahiro Ihara
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-05-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.9'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.9'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.2'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.2'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.31.0
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.31.0
69
+ description: Simple library to keep reserved words
70
+ email:
71
+ - ihara2525@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - ".rspec"
78
+ - ".rubocop.yml"
79
+ - ".rubocop_todo.yml"
80
+ - ".ruby-version"
81
+ - Gemfile
82
+ - LICENSE
83
+ - README.md
84
+ - Rakefile
85
+ - circle.yml
86
+ - lib/reserved_words.rb
87
+ - lib/reserved_words/version.rb
88
+ - reserved_words.gemspec
89
+ homepage: https://github.com/ihara2525/reserved_words
90
+ licenses:
91
+ - MIT
92
+ metadata: {}
93
+ post_install_message:
94
+ rdoc_options: []
95
+ require_paths:
96
+ - lib
97
+ required_ruby_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ requirements: []
108
+ rubyforge_project:
109
+ rubygems_version: 2.4.5
110
+ signing_key:
111
+ specification_version: 4
112
+ summary: Simple library to keep reserved words
113
+ test_files: []