cvnotes 0.0.1
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 +7 -0
- data/Rakefile +0 -0
- data/bin/cvnotes +59 -0
- data/cvnotes.gemspec +21 -0
- data/test/cvnotes_test.rb +6 -0
- metadata +51 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2b9d5bfb4100b7f31ebc3b7c7d081544fdeee060
|
4
|
+
data.tar.gz: 889ccffe191f2da5abe5ce6c7d03e29173bc465d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: aa335976dc16870a882e7c0af90fe206c7af0a49414e43b099f54c90158ea6206ded0e1fbe622b5ca12431d469e328ae7d3b2bd2f135722bb9e8b9f35425118b
|
7
|
+
data.tar.gz: f3a2a9a26082f08da6289d98637d8e1858ad7b9f672e5539917c6a8bd707228f498e3106fb951db285261438c0e465cf8c15e38ed07f7411665b13bf7cbd77a1
|
data/Rakefile
ADDED
File without changes
|
data/bin/cvnotes
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
#!/home/abdulsattar/.rbenv/shims/ruby
|
2
|
+
class NoteManger
|
3
|
+
FILE_NAME = 'note-manger.txt'
|
4
|
+
def initialize
|
5
|
+
@hash = {}
|
6
|
+
read
|
7
|
+
end
|
8
|
+
|
9
|
+
def add(key, value)
|
10
|
+
@hash[key] = value
|
11
|
+
write
|
12
|
+
end
|
13
|
+
|
14
|
+
def show(key)
|
15
|
+
@hash[key]
|
16
|
+
end
|
17
|
+
|
18
|
+
def list
|
19
|
+
@hash.map{|k,v| k + '=' + v}.join("\n")
|
20
|
+
end
|
21
|
+
|
22
|
+
def delete(key)
|
23
|
+
v = @hash.delete(key)
|
24
|
+
write
|
25
|
+
v
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
def read
|
30
|
+
return unless File.exists?(FILE_NAME)
|
31
|
+
File.open(FILE_NAME,'r') do |f|
|
32
|
+
f.each_line do|line|
|
33
|
+
k,v = line.split('=')
|
34
|
+
@hash[k] = v
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def write
|
40
|
+
File.open(FILE_NAME,'w') do |f|
|
41
|
+
@hash.each do |k,v|
|
42
|
+
f.puts "#{k}=#{v}"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
|
49
|
+
n = NoteManger.new
|
50
|
+
case ARGV.first
|
51
|
+
when '-s'
|
52
|
+
puts n.show(ARGV[1])
|
53
|
+
when '-l'
|
54
|
+
puts n.list
|
55
|
+
when '-d'
|
56
|
+
puts n.delete(ARGV[1])
|
57
|
+
else
|
58
|
+
n.add(ARGV[0],ARGV[1])
|
59
|
+
end
|
data/cvnotes.gemspec
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "cvnotes/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "cvnotes"
|
7
|
+
s.version = VERSION
|
8
|
+
s.authors = ["Abdulsattar"]
|
9
|
+
s.email = ["asattar.md@gmail.com"]
|
10
|
+
s.homepage = ""
|
11
|
+
s.summary = "Simple notes app"
|
12
|
+
s.description = "Simple notes app"
|
13
|
+
|
14
|
+
s.rubyforge_project = "cvnotes"
|
15
|
+
|
16
|
+
s.files = `ls`.split("\n")
|
17
|
+
s.test_files = `ls test/*`.split("\n")
|
18
|
+
s.executables = `ls bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
s.license = 'MIT'
|
21
|
+
end
|
metadata
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cvnotes
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Abdulsattar
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-12-19 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Simple notes app
|
14
|
+
email:
|
15
|
+
- asattar.md@gmail.com
|
16
|
+
executables:
|
17
|
+
- cvnotes
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- cvnotes.gemspec
|
22
|
+
- Rakefile
|
23
|
+
- test/cvnotes_test.rb
|
24
|
+
- bin/cvnotes
|
25
|
+
homepage: ''
|
26
|
+
licenses:
|
27
|
+
- MIT
|
28
|
+
metadata: {}
|
29
|
+
post_install_message:
|
30
|
+
rdoc_options: []
|
31
|
+
require_paths:
|
32
|
+
- lib
|
33
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - '>='
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
requirements: []
|
44
|
+
rubyforge_project: cvnotes
|
45
|
+
rubygems_version: 2.0.2
|
46
|
+
signing_key:
|
47
|
+
specification_version: 4
|
48
|
+
summary: Simple notes app
|
49
|
+
test_files:
|
50
|
+
- test/cvnotes_test.rb
|
51
|
+
has_rdoc:
|