nin 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/nin.rb +59 -0
  3. metadata +44 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: fc5037bc8929225d80c4ffda217726c83a054c9a0c2d7c40d18b95b749248044
4
+ data.tar.gz: 1a85efacd7a65c1df2d3da69faa058a430d898d6c30e7b0c401473a1d6a0cba8
5
+ SHA512:
6
+ metadata.gz: 8cd7d778fd4a06352be726ad2b2dae3b032d76d4c33db113d23f5d8e5f7527aca9e4e552d9f3200655839739064bade40dcfbc7fb0325abae69ebf00e6b846ce
7
+ data.tar.gz: 60196625b942e4034c304aae5ee6856f36dcad94aff28ccb6153baf4beba30095f393fcf1800eb78dfd42da3545c1a62ae7a12fe85787666d25b9af1db3e1cc4
data/lib/nin.rb ADDED
@@ -0,0 +1,59 @@
1
+ module Nin
2
+ class Item
3
+ attr_accessor :body
4
+
5
+ def initialize(desc)
6
+ @desc = desc
7
+ end
8
+
9
+ def to_s
10
+ "#{@desc}"
11
+ end
12
+ end
13
+
14
+ class Todo
15
+ attr_accessor :items
16
+
17
+ def initialize()
18
+ @items = load_items
19
+ end
20
+
21
+ def list
22
+ end
23
+
24
+ def add(todo)
25
+ end
26
+
27
+ def edit(id)
28
+ end
29
+
30
+ def delete(id)
31
+ end
32
+
33
+ private
34
+
35
+ def load_items
36
+ []
37
+ end
38
+ end
39
+ end
40
+
41
+ if __FILE__ == $0
42
+ case ARGV[0]
43
+ when 'l'
44
+ Nin::Todo.new.list
45
+ when 'a'
46
+ Nin::Todo.new.add(ARGV[1])
47
+ when 'e'
48
+ Nin::Todo.new.edit(ARGV[1])
49
+ when 'd'
50
+ Nin::Todo.new.delete(ARGV[1])
51
+ else
52
+ puts "\nUSAGE: nin COMMAND [arguments...]\n\n"
53
+ puts "COMMANDS:"
54
+ puts " l List all todos"
55
+ puts " a desc Add a todo"
56
+ puts " e id Edit a todo"
57
+ puts " d id Remove a todo"
58
+ end
59
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: nin
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Ahmed Saleh
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-12-07 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Under construction
14
+ email: aonemdsaleh@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/nin.rb
20
+ homepage: https://github.com/gems/nin
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.7.6
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: Under construction
44
+ test_files: []