wielder_of_anor 0.1.4 → 0.2.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 +4 -4
- data/README.md +9 -9
- data/bin/wielder_of_anor +2 -0
- data/lib/wielder_of_anor.rb +26 -0
- data/lib/wielder_of_anor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e81b84a6c048c63ce41ab46da269c437a9f445e
|
4
|
+
data.tar.gz: c20ed30930612574987a785d152bba685f77b0df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5d78de14210e53eb2dd42995f1da520a227a67a3e51f25a5d432492dfa808bb1ca0346809ef8bdea6df52944b8c7e35d74365bcdea7bbf9127239c9ab063070
|
7
|
+
data.tar.gz: 054d920d3f19e9930f8cfa818c3be97f8849f26940c49f098d549d50efd1db2b912bd8109595c8fa65a9da3de91f4c0ff7d2d857a7d2a53221265e40851f1d8a
|
data/README.md
CHANGED
@@ -33,17 +33,15 @@ Ahem. Sorry.
|
|
33
33
|
So. If you need to prevent anything in your code from making it past your dev
|
34
34
|
environment and need a reliable way to do this, use Wielder of Anor.
|
35
35
|
|
36
|
-
##
|
37
|
-
|
38
|
-
and
|
36
|
+
## Installation
|
37
|
+
Installation is simple! Just run a `gem install wielder_of_anor`, then run
|
38
|
+
`wielder_of_anor` and follow the instructions. You're now good to go!
|
39
39
|
|
40
40
|
## Use/What It Does
|
41
41
|
To use Wielder of Anor, just run it *from within the code directory you want to
|
42
|
-
run the forbidden words checks against* (this is important).
|
43
|
-
|
44
|
-
|
45
|
-
have personally made an alias for doing this. Feel free to do that or type the
|
46
|
-
full path each time as you desire. You can pass in a couple of arguments here.
|
42
|
+
run the forbidden words checks against* (this is important). From your code
|
43
|
+
directory, just type `wielder_of_anor` followed by your arguments. You can pass
|
44
|
+
in a couple of arguments here.
|
47
45
|
|
48
46
|
The first argument can be:
|
49
47
|
|
@@ -55,6 +53,8 @@ The first argument can be:
|
|
55
53
|
* 'config' - This will re-run the configuration process. IF YOU SET ANY OF YOUR
|
56
54
|
FILE LOCATIONS TO POINT TO PREVIOUSLY EXISTING FILES, THOSE FILES *WILL* BE
|
57
55
|
OVERWRITTEN.
|
56
|
+
* 'words' - This will spit out all of the forbidden words that you currently
|
57
|
+
are checking for.
|
58
58
|
|
59
59
|
There is currently only one option for the second argument:
|
60
60
|
|
@@ -79,7 +79,7 @@ every one it finds.
|
|
79
79
|
If it found none (or if you've skipped the search and are forcing a commit), you
|
80
80
|
are good to go and can tell the app to then run the git commit command, if
|
81
81
|
you've opted to allow it to do so. At this point, Wielder of Anor will run a
|
82
|
-
`git commit -m
|
82
|
+
`git commit -m` followed by your commit message (your first argument when
|
83
83
|
running the app). Once it prints out "COMMITTED.", execution will end. Don't
|
84
84
|
forget to run your git push!
|
85
85
|
|
data/bin/wielder_of_anor
CHANGED
data/lib/wielder_of_anor.rb
CHANGED
@@ -222,6 +222,32 @@ module WielderOfAnor
|
|
222
222
|
forbidden_words_file.close
|
223
223
|
end
|
224
224
|
|
225
|
+
def add_forbidden_word(word)
|
226
|
+
set_app_directory
|
227
|
+
config = YAML.load_file("#{@app_directory}/lib/config.yaml")
|
228
|
+
forbidden_words_file = File.open(config['forbidden_words_file_location'], 'a')
|
229
|
+
get_forbidden_words(config['forbidden_words_file_location'])
|
230
|
+
|
231
|
+
if word.nil?
|
232
|
+
lines_pretty_print Rainbow('Please submit your word as a second parameter.').red
|
233
|
+
|
234
|
+
abort
|
235
|
+
end
|
236
|
+
|
237
|
+
if @forbidden_words.include?(word)
|
238
|
+
lines_pretty_print Rainbow("''#{word}'' is already a forbidden word!").red
|
239
|
+
|
240
|
+
abort
|
241
|
+
end
|
242
|
+
|
243
|
+
forbidden_words_file.puts word
|
244
|
+
forbidden_words_file.close
|
245
|
+
|
246
|
+
lines_pretty_print 'Added!'
|
247
|
+
|
248
|
+
abort
|
249
|
+
end
|
250
|
+
|
225
251
|
def wielder_of_anor
|
226
252
|
found_forbidden = false
|
227
253
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wielder_of_anor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Sellek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rainbow
|