yogi 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +41 -0
- data/Rakefile +2 -0
- data/bin/activate +7 -0
- data/bin/console +14 -0
- data/bin/fixme +6 -0
- data/bin/setup +8 -0
- data/lib/tasks/yogi.rake +16 -0
- data/lib/yogi/version.rb +3 -0
- data/lib/yogi.rb +75 -0
- data/yogi.gemspec +34 -0
- metadata +88 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 898639754515305fa31de10d5b4dae3c5bf9880a
|
4
|
+
data.tar.gz: ac980aeaf3032a2a3ca255c29e8a65d4241f1e9a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 04e6fa973902044cf123ece46294605fe78dcec6d1d095ecc138a05693c69085bab0363402325cef857dc7c58799189b8df0c76b7cf8f21f670f6c5ae9cb4b3f
|
7
|
+
data.tar.gz: d61e5b61a018e7836961d14f167472ac00961844c90113d768d50a4e0d9353d9233fe26d61e0292805f9499ec2f700dfd73a0dd45c71d975b357bb1f19ae81b3
|
data/.gitignore
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, and in the interest of
|
4
|
+
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
+
contribute through reporting issues, posting feature requests, updating
|
6
|
+
documentation, submitting pull requests or patches, and other activities.
|
7
|
+
|
8
|
+
We are committed to making participation in this project a harassment-free
|
9
|
+
experience for everyone, regardless of level of experience, gender, gender
|
10
|
+
identity and expression, sexual orientation, disability, personal appearance,
|
11
|
+
body size, race, ethnicity, age, religion, or nationality.
|
12
|
+
|
13
|
+
Examples of unacceptable behavior by participants include:
|
14
|
+
|
15
|
+
* The use of sexualized language or imagery
|
16
|
+
* Personal attacks
|
17
|
+
* Trolling or insulting/derogatory comments
|
18
|
+
* Public or private harassment
|
19
|
+
* Publishing other's private information, such as physical or electronic
|
20
|
+
addresses, without explicit permission
|
21
|
+
* Other unethical or unprofessional conduct
|
22
|
+
|
23
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
24
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
25
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
26
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
27
|
+
threatening, offensive, or harmful.
|
28
|
+
|
29
|
+
By adopting this Code of Conduct, project maintainers commit themselves to
|
30
|
+
fairly and consistently applying these principles to every aspect of managing
|
31
|
+
this project. Project maintainers who do not follow or enforce the Code of
|
32
|
+
Conduct may be permanently removed from the project team.
|
33
|
+
|
34
|
+
This code of conduct applies both within project spaces and in public spaces
|
35
|
+
when an individual is representing the project or its community.
|
36
|
+
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
38
|
+
reported by contacting a project maintainer at Langnickel.thomas@gmail.com. All
|
39
|
+
complaints will be reviewed and investigated and will result in a response that
|
40
|
+
is deemed necessary and appropriate to the circumstances. Maintainers are
|
41
|
+
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
+
incident.
|
43
|
+
|
44
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
+
version 1.3.0, available at
|
46
|
+
[http://contributor-covenant.org/version/1/3/0/][version]
|
47
|
+
|
48
|
+
[homepage]: http://contributor-covenant.org
|
49
|
+
[version]: http://contributor-covenant.org/version/1/3/0/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Thomas Langnickel
|
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
|
13
|
+
all 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
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# Yogi
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/yogi`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'yogi'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install yogi
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/yogi. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
|
+
|
37
|
+
|
38
|
+
## License
|
39
|
+
|
40
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
|
+
|
data/Rakefile
ADDED
data/bin/activate
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "yogi"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/fixme
ADDED
data/bin/setup
ADDED
data/lib/tasks/yogi.rake
ADDED
data/lib/yogi/version.rb
ADDED
data/lib/yogi.rb
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
require "yogi/version"
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
file_names = []
|
5
|
+
file_names = Dir.glob("app/**/*.rb") + Dir.glob("app/**/*.js") + Dir.glob("app/**/*.css") + Dir.glob("app/**/*.scss") + Dir.glob("app/**/*.erb") + Dir.glob("app/**/*.html")
|
6
|
+
file_sample = file_names.sample(5)
|
7
|
+
|
8
|
+
module Yogi
|
9
|
+
class ErrorInside
|
10
|
+
def backup
|
11
|
+
# creating backup directory
|
12
|
+
FileUtils.mkdir_p 'backupFiles' unless File.exists?('backupFiles')
|
13
|
+
puts "created folder backupFiles"
|
14
|
+
|
15
|
+
#copy backup to backup folder
|
16
|
+
FileUtils.cp_r "./app", "backupFiles/"
|
17
|
+
puts "copied files to backupFiles #{file_names}"
|
18
|
+
|
19
|
+
# #rename files in backupFiles folder
|
20
|
+
# backup_file_path = "./backupFiles/"
|
21
|
+
# Dir.foreach('./backupFiles') do |item|
|
22
|
+
# next if item == '.' or item == '..'
|
23
|
+
# File.rename(backup_file_path+item, backup_file_path+item +".bak")
|
24
|
+
# end
|
25
|
+
# end
|
26
|
+
end
|
27
|
+
|
28
|
+
def yogify
|
29
|
+
file_sample.each do |file_name|
|
30
|
+
text = File.read(file_name)
|
31
|
+
|
32
|
+
#counting ocurences of the original chars before changes
|
33
|
+
# counted_comma = text.count(",") #counts ocurences in the file
|
34
|
+
# counted_semicolon = text.count(";") #counts ocurences in the file
|
35
|
+
# counted_1 = text.count("1") #counts ocurences in the file
|
36
|
+
# counted_3 = text.count("3") #counts ocurences in the file
|
37
|
+
# counted_5 = text.count("5") #counts ocurences in the file
|
38
|
+
# counted_px = text.count("px") #counts ocurences in the file
|
39
|
+
# puts "commas : #{counted_comma}"
|
40
|
+
# puts "semikolons : #{counted_semicolon}"
|
41
|
+
# puts "1 : #{counted_1}"
|
42
|
+
# puts "3 : #{counted_3}"
|
43
|
+
# puts "5 : #{counted_5}"
|
44
|
+
# puts "px : #{counted_px}"
|
45
|
+
|
46
|
+
# To merely print the contents of the file, use:
|
47
|
+
new_contents1 = text.gsub(";"){rand(2).zero? ? ";" : ","}
|
48
|
+
new_contents2 = new_contents1.gsub(","){rand(2).zero? ? "," : ";"}
|
49
|
+
new_contents3 = new_contents2.gsub("1"){rand(2).zero? ? "1" : "l"}
|
50
|
+
new_contents4 = new_contents3.gsub("3"){rand(2).zero? ? "3" : "E"}
|
51
|
+
new_contents5 = new_contents4.gsub("5"){rand(2).zero? ? "5" : "S"}
|
52
|
+
new_contents6 = new_contents5.gsub("px"){rand(2).zero? ? "px" : "xp"}
|
53
|
+
# puts new_contents6
|
54
|
+
|
55
|
+
# To write changes to the file, use:
|
56
|
+
File.open(file_name, "w") {|file| file.puts new_contents6 }
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
class ErrorOut
|
62
|
+
def undo
|
63
|
+
#undo changes originaly made.
|
64
|
+
Dir.foreach('backupFiles') do |item|
|
65
|
+
next if item == '.' or item == '..'
|
66
|
+
FileUtils.cp_r "backupFiles/"+ item, "./"
|
67
|
+
# puts item
|
68
|
+
# FileUtils.cp_r file_names, "backupFiles/"
|
69
|
+
end
|
70
|
+
#removes folder backupFiles
|
71
|
+
Dir.rmdir('backupFiles')
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
data/yogi.gemspec
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'yogi/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "yogi"
|
8
|
+
spec.version = Yogi::VERSION
|
9
|
+
spec.authors = ["Thomas Langnickel"]
|
10
|
+
spec.email = ["Langnickel.thomas@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{practice debugging skills}
|
13
|
+
spec.description = %q{The Master of Syntax Error brings you... this exercise}
|
14
|
+
spec.homepage = "http://github.io/Yogibeer2001/Yogify"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
|
+
# if spec.respond_to?(:metadata)
|
20
|
+
# spec.metadata['allowed_push_host'] = "https://rubygems.org"
|
21
|
+
# else
|
22
|
+
# raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
23
|
+
# end
|
24
|
+
|
25
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
26
|
+
# spec.bindir = "exe"
|
27
|
+
spec.executables = ["activate" , "fixme"]
|
28
|
+
#spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
29
|
+
spec.require_paths = ["lib"]
|
30
|
+
|
31
|
+
spec.add_development_dependency "bundler", "~> 1.12"
|
32
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
33
|
+
# spec.add_dependency "fileutils"
|
34
|
+
end
|
metadata
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: yogi
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Thomas Langnickel
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-07-20 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.12'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.12'
|
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
|
+
description: The Master of Syntax Error brings you... this exercise
|
42
|
+
email:
|
43
|
+
- Langnickel.thomas@gmail.com
|
44
|
+
executables:
|
45
|
+
- activate
|
46
|
+
- fixme
|
47
|
+
extensions: []
|
48
|
+
extra_rdoc_files: []
|
49
|
+
files:
|
50
|
+
- ".gitignore"
|
51
|
+
- CODE_OF_CONDUCT.md
|
52
|
+
- Gemfile
|
53
|
+
- LICENSE.txt
|
54
|
+
- README.md
|
55
|
+
- Rakefile
|
56
|
+
- bin/activate
|
57
|
+
- bin/console
|
58
|
+
- bin/fixme
|
59
|
+
- bin/setup
|
60
|
+
- lib/tasks/yogi.rake
|
61
|
+
- lib/yogi.rb
|
62
|
+
- lib/yogi/version.rb
|
63
|
+
- yogi.gemspec
|
64
|
+
homepage: http://github.io/Yogibeer2001/Yogify
|
65
|
+
licenses:
|
66
|
+
- MIT
|
67
|
+
metadata: {}
|
68
|
+
post_install_message:
|
69
|
+
rdoc_options: []
|
70
|
+
require_paths:
|
71
|
+
- lib
|
72
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
requirements: []
|
83
|
+
rubyforge_project:
|
84
|
+
rubygems_version: 2.4.8
|
85
|
+
signing_key:
|
86
|
+
specification_version: 4
|
87
|
+
summary: practice debugging skills
|
88
|
+
test_files: []
|