motherducker 1.0.2 → 1.1.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/lib/mother_ducker.rb +8 -5
- data/lib/mother_ducker/constants.rb +9 -0
- data/lib/mother_ducker/strategy_orchestrator.rb +32 -23
- metadata +2 -9
- data/.gitignore +0 -9
- data/GEM_CHEATSHEET.md +0 -52
- data/Gemfile +0 -1
- data/README +0 -1
- data/Rakefile +0 -2
- data/lib/mother_ducker/user.rb +0 -23
- data/mother_ducker.gemspec +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0909c959538fce8cf1b5810478578af52183321c60545dd1af6777184d931a5a'
|
4
|
+
data.tar.gz: aab7532d52faa7a752db8198fd07f67ed829fb725a3ed330d117f1551e070939
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 449ad849b35989acbc6f810bee2b6ac9179d514c1c65cc51dd754148f57de70c22ea2aeafe57dedf1649d9ee0c1077d6b1f76657020e76ec47d4b28e922930e1
|
7
|
+
data.tar.gz: cb855e91c6dff22697a9ab24466c59dc63f8e22bb4a445d58047947c4d9d63403c792f901e49da87b82dd678cc60ba9d766a5597a5063583d965d6d2482e175c
|
data/lib/mother_ducker.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# entrypoint
|
2
|
+
require_relative "mother_ducker/constants"
|
2
3
|
require_relative "mother_ducker/strategy_orchestrator"
|
3
|
-
require_relative "mother_ducker/user"
|
4
4
|
|
5
5
|
# TODO: change name of this class
|
6
6
|
# class in module in charge of running the code
|
@@ -8,8 +8,7 @@ module MotherDucker
|
|
8
8
|
class Starter
|
9
9
|
def self.launch
|
10
10
|
# hackish but who's checking ?
|
11
|
-
|
12
|
-
user = User.new
|
11
|
+
satisfied = false
|
13
12
|
# initiate a strategy class, passing it the user instance
|
14
13
|
strategy_orchestrator = StrategyCoordinator.new
|
15
14
|
|
@@ -21,10 +20,14 @@ module MotherDucker
|
|
21
20
|
puts "Ok ! Let's work through that"
|
22
21
|
|
23
22
|
# call Strategy.strategize while user.satisfied == false
|
24
|
-
until
|
23
|
+
until satisfied
|
25
24
|
# this method asks the user if he is happy currently ?
|
26
25
|
strategy_orchestrator.strategize
|
27
|
-
|
26
|
+
puts ""
|
27
|
+
puts "are you feeling better ? [ y | n ]"
|
28
|
+
|
29
|
+
input = gets.chomp.downcase
|
30
|
+
satisfied = true if (input == "y" || input == "yes")
|
28
31
|
end
|
29
32
|
# it will pick and execute a strategy from the set
|
30
33
|
|
@@ -0,0 +1,9 @@
|
|
1
|
+
module MotherDucker
|
2
|
+
MEDITATION_TEXT = [ "Get comfortable",
|
3
|
+
"Relax your body by releasing any areas of tension",
|
4
|
+
"You're at a hackathon... You've been coding for hours...",
|
5
|
+
"Forget about bugs... Forget about method errors...",
|
6
|
+
"Close your eyes...",
|
7
|
+
"Now follow the animation on the screen.. breathe in when it expands, out when it contracts"
|
8
|
+
]
|
9
|
+
end
|
@@ -1,21 +1,7 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require "yaml"
|
3
2
|
|
3
|
+
module MotherDucker
|
4
4
|
class StrategyCoordinator
|
5
|
-
TEXT_ARRAY = [ "Get comfortable",
|
6
|
-
"Relax your body by releasing any areas of tension",
|
7
|
-
"You're at a hackathon... You've been coding for hours...",
|
8
|
-
"Forget about bugs... Forget about method errors...",
|
9
|
-
"Close your eyes...",
|
10
|
-
"Breathe in deeply , drawing air fully into your lungs....",
|
11
|
-
"And release the air...",
|
12
|
-
"Breathe in again, slowly....",
|
13
|
-
"Out.....🌬",
|
14
|
-
"In.....",
|
15
|
-
"Become more and more relaxed with each breath...",
|
16
|
-
"Out..... 😤😤😤",
|
17
|
-
"🌈 🌈 🌈 🌈 🌈 🌈 🌈 🌈 🌈 🌈 🌈 🌈 🌈 🌈 🌈 🌈 🌈 🌈 🌈 🌈 🌈 🌈 🌈"
|
18
|
-
]
|
19
5
|
|
20
6
|
def initialize
|
21
7
|
@meditation_used = false
|
@@ -28,24 +14,24 @@ module MotherDucker
|
|
28
14
|
elsif !(@debugging_used)
|
29
15
|
debug
|
30
16
|
else
|
31
|
-
puts "we did
|
17
|
+
puts "we did all we could ! maybe take a nap ? or look at memes?"
|
32
18
|
end
|
33
19
|
end
|
34
20
|
|
35
21
|
def meditate
|
36
22
|
emoji_array = ["🌬", "😤", "🌈"]
|
23
|
+
text_array = MotherDucker::MEDITATION_TEXT
|
37
24
|
|
38
25
|
puts "I think some meditation would be useful. Let me guide you through it"
|
39
26
|
|
40
|
-
|
27
|
+
text_array.each do |sentence|
|
41
28
|
sleep_with_dots(3)
|
42
29
|
puts sentence
|
43
|
-
|
44
|
-
|
45
|
-
# %x(say "#{speech_sentence}")
|
30
|
+
%x(say "#{sentence}")
|
46
31
|
end
|
47
32
|
|
48
|
-
|
33
|
+
animation_with_a_great_final_frame
|
34
|
+
puts "Thanks. I hope that helped you relax"
|
49
35
|
|
50
36
|
@meditation_used = true
|
51
37
|
end
|
@@ -61,7 +47,7 @@ module MotherDucker
|
|
61
47
|
end
|
62
48
|
|
63
49
|
def parse_error(error)
|
64
|
-
if
|
50
|
+
if error.match(/undefined method/)
|
65
51
|
line = /\:\d+\:/.match(message)[0].gsub(":", "")
|
66
52
|
file_name = /\#\<\w+\:/.match(message)[0].gsub("#<", "").gsub(":", "")
|
67
53
|
puts "\n"
|
@@ -92,5 +78,28 @@ module MotherDucker
|
|
92
78
|
end
|
93
79
|
puts ""
|
94
80
|
end
|
81
|
+
|
82
|
+
def animation_with_a_great_final_frame
|
83
|
+
arr = (0..90).to_a
|
84
|
+
arr.delete_at(0)
|
85
|
+
arr.delete_at(0)
|
86
|
+
arr.delete_at(6)
|
87
|
+
arr.delete_at(9)
|
88
|
+
arr.delete_at(24)
|
89
|
+
arr.delete_at(49)
|
90
|
+
arr.delete_at(72)
|
91
|
+
arr.delete_at(83)
|
92
|
+
arr.delete_at(82)
|
93
|
+
2.times do
|
94
|
+
for i in arr
|
95
|
+
puts "\033[2J"
|
96
|
+
File.foreach("db/ascii_animations/ascii_meditation/#{i}.txt") do |f|
|
97
|
+
puts f
|
98
|
+
end
|
99
|
+
sleep(0.1)
|
100
|
+
i += 1
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
95
104
|
end
|
96
105
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motherducker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Korelsky
|
@@ -45,17 +45,10 @@ executables:
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
-
- ".gitignore"
|
49
|
-
- GEM_CHEATSHEET.md
|
50
|
-
- Gemfile
|
51
|
-
- README
|
52
|
-
- Rakefile
|
53
48
|
- bin/motherducker
|
54
49
|
- lib/mother_ducker.rb
|
50
|
+
- lib/mother_ducker/constants.rb
|
55
51
|
- lib/mother_ducker/strategy_orchestrator.rb
|
56
|
-
- lib/mother_ducker/user.rb
|
57
|
-
- mother_ducker.gemspec
|
58
|
-
- sketch.txt
|
59
52
|
homepage:
|
60
53
|
licenses:
|
61
54
|
- MIT
|
data/.gitignore
DELETED
data/GEM_CHEATSHEET.md
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
# Instructions for gem pushing
|
2
|
-
|
3
|
-
- code goes in lib/
|
4
|
-
- mother_ducker.gemspec # metainfo for gem
|
5
|
-
|
6
|
-
# cheatsheet
|
7
|
-
|
8
|
-
- with rake
|
9
|
-
|
10
|
-
- build and install for testing
|
11
|
-
```
|
12
|
-
$ rake install
|
13
|
-
```
|
14
|
-
|
15
|
-
- release to the wider world
|
16
|
-
|
17
|
-
```
|
18
|
-
$ rake release
|
19
|
-
```
|
20
|
-
|
21
|
-
- check if gem is published
|
22
|
-
|
23
|
-
```
|
24
|
-
$ gem list -r motherducker
|
25
|
-
```
|
26
|
-
|
27
|
-
- if version tag is not updated
|
28
|
-
|
29
|
-
```
|
30
|
-
$ gem yank motherducker -v VERSION
|
31
|
-
```
|
32
|
-
|
33
|
-
## outdated
|
34
|
-
- manually
|
35
|
-
|
36
|
-
building the gem
|
37
|
-
```
|
38
|
-
$ gem build mother_ducker.gemspec
|
39
|
-
```
|
40
|
-
|
41
|
-
pushing the gem
|
42
|
-
```
|
43
|
-
$ gem push {file_created_from_build}.gem
|
44
|
-
```
|
45
|
-
|
46
|
-
# notes
|
47
|
-
|
48
|
-
- version can be hardcoded into the gemspec, will need to be bumped up as we go
|
49
|
-
|
50
|
-
|
51
|
-
[guide](https://guides.rubygems.org/make-your-own-gem/)
|
52
|
-
[another, better guide](http://robdodson.me/how-to-write-a-command-line-ruby-gem/)
|
data/Gemfile
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
source 'https://rubygems.org'
|
data/README
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
# The motherducker
|
data/Rakefile
DELETED
data/lib/mother_ducker/user.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
module MotherDucker
|
2
|
-
|
3
|
-
class User
|
4
|
-
attr_accessor :satisfied
|
5
|
-
|
6
|
-
def initialize
|
7
|
-
# set our user attributes in here
|
8
|
-
@satisified = false
|
9
|
-
end
|
10
|
-
|
11
|
-
# def build_profile
|
12
|
-
# puts "Code me ! User#build_profile! I will build the user profile"
|
13
|
-
# end
|
14
|
-
|
15
|
-
def enquire_satisfaction
|
16
|
-
puts "Are you feeling better ? [ y | n ]"
|
17
|
-
input = gets.chomp.downcase
|
18
|
-
|
19
|
-
@satisfied = true if (input == "y" || input == "yes")
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
23
|
-
end
|
data/mother_ducker.gemspec
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
Gem::Specification.new do |gem|
|
2
|
-
gem.name = 'motherducker'
|
3
|
-
gem.summary = "some random summary for now"
|
4
|
-
|
5
|
-
gem.version = "1.0.2"
|
6
|
-
gem.files = `git ls-files`.split($\)
|
7
|
-
gem.executables = ["motherducker"]
|
8
|
-
|
9
|
-
gem.author = ['Victor Korelsky']
|
10
|
-
gem.licenses = ['MIT']
|
11
|
-
|
12
|
-
gem.add_development_dependency "bundler", "~> 1.16"
|
13
|
-
gem.add_development_dependency "rake", "~> 10.0"
|
14
|
-
end
|