~siegfriedehret/coder-avec-crystal-pour-ne-pas-perdre-la-boule

39d7b8d728917ebfa9879ee0ad79b4566fd7402b — Siegfried EHRET 2 years ago f34b003 part-06-after
🎉 add a dependency

tagzytout: part-06-after
3 files changed, 12 insertions(+), 4 deletions(-)

A shard.lock
M shard.yml
M src/commands/add.cr
A shard.lock => shard.lock +6 -0
@@ 0,0 1,6 @@
version: 2.0
shards:
  emoji:
    git: https://github.com/veelenga/emoji.cr.git
    version: 0.4.0+git.commit.94c9047f6e8adc8db07494644be0cc104336de3c


M shard.yml => shard.yml +4 -1
@@ 4,7 4,10 @@ version: 0.1.0
authors:
  - Siegfried Ehret <siegfried@ehret.me>

# TODO 1: Add dependency
dependencies:
  emoji:
    github: veelenga/emoji.cr
    branch: master

targets:
  myapp:

M src/commands/add.cr => src/commands/add.cr +2 -3
@@ 1,4 1,4 @@
# TODO 3: require the dependency
require "emoji"
require "../structs/*"

module Myapp


@@ 8,8 8,7 @@ module Myapp
        if !name.nil? && !email.nil?
          add(name, email)
        else
          # TODO 3: Use the dependency
          puts "I need a name and an email!"
          puts Emoji.emojize(":warning: I need a name and an email!")
        end
      end