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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c3b483dc010017e7810a509f7713c7f21e52037a6c426ebba407cf04765db493
4
- data.tar.gz: d54a12cd59c28d9fe0d17e6ba8ae549221a0b3b4032557004607a3081b921bd2
3
+ metadata.gz: '0909c959538fce8cf1b5810478578af52183321c60545dd1af6777184d931a5a'
4
+ data.tar.gz: aab7532d52faa7a752db8198fd07f67ed829fb725a3ed330d117f1551e070939
5
5
  SHA512:
6
- metadata.gz: 06b6ebd4c8a02415ab093c0b0845408b9df7c2e41aa30dbd55831d87523d353a90b78174ac9fae18b34a7e53b2e5759488a918c560a3ca21a97422eb26356fbc
7
- data.tar.gz: fa51228cb40ec0154b8f1e6d69d163979a1c053e6b7a3959689e7a9ccc910b739a0e1a722545aff99a9d3c99f0fb0ad84bc30656074e684e3f6adf50ed98d626
6
+ metadata.gz: 449ad849b35989acbc6f810bee2b6ac9179d514c1c65cc51dd754148f57de70c22ea2aeafe57dedf1649d9ee0c1077d6b1f76657020e76ec47d4b28e922930e1
7
+ data.tar.gz: cb855e91c6dff22697a9ab24466c59dc63f8e22bb4a445d58047947c4d9d63403c792f901e49da87b82dd678cc60ba9d766a5597a5063583d965d6d2482e175c
@@ -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
- # Build a user profile
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 user.satisfied
23
+ until satisfied
25
24
  # this method asks the user if he is happy currently ?
26
25
  strategy_orchestrator.strategize
27
- user.enquire_satisfaction
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
- module MotherDucker
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 what we could ! maybe take a nap ? or look at memes?"
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
- TEXT_ARRAY.each do |sentence|
27
+ text_array.each do |sentence|
41
28
  sleep_with_dots(3)
42
29
  puts sentence
43
- speech_sentence = sentence.split.reject { |word| emoji_array.include?(word.chomp) }
44
-
45
- # %x(say "#{speech_sentence}")
30
+ %x(say "#{sentence}")
46
31
  end
47
32
 
48
- puts "Hope that was helpful"
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 message.match(/undefined method/)
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.2
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
@@ -1,9 +0,0 @@
1
- sketch.txt
2
- /.bundle/
3
- /.yardoc
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- pkg/
8
- /spec/reports/
9
- /tmp/
@@ -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
@@ -1,2 +0,0 @@
1
- require "bundler/gem_tasks"
2
- task :default => :install
@@ -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
@@ -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