brag 0.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 +7 -0
- data/bin/brag +4 -0
- data/lib/brag.rb +49 -0
- metadata +46 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 0be399e870168e3a22fdca9558ed518591ae2c1b82af125509c4f404887fdd2c
|
|
4
|
+
data.tar.gz: dc9602a85537d09ec27f78d97548decee6611f76bd039ad93a946bd62552533e
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 648be265ac42bd09b21f7692451275ec7ebeb166835f68821574502a18d4dcb92688aa0010374c8af334fe6f51408239487ed51c0796abe86f1a529ab911f9d0
|
|
7
|
+
data.tar.gz: d381d2f7cc64a2e63ec9da52cc2a97ea636efb6ea4104b84b62f8806e91c8b11ec5e756af69ead0759b14586526fe1ec72efb9979582a074bc01c88677833d45
|
data/bin/brag
ADDED
data/lib/brag.rb
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
class Brag
|
|
4
|
+
DEFAULT_FILE = "#{ENV["HOME"]}/.bragsheet.txt".freeze
|
|
5
|
+
|
|
6
|
+
def self.parse(args)
|
|
7
|
+
if args.empty?
|
|
8
|
+
puts help_page
|
|
9
|
+
elsif args[0] == "sheet"
|
|
10
|
+
read_file(DEFAULT_FILE)
|
|
11
|
+
# print the list
|
|
12
|
+
else
|
|
13
|
+
brag_text = args.join(" ")
|
|
14
|
+
add_to_file(DEFAULT_FILE, brag_text)
|
|
15
|
+
puts "added '#{brag_text}' to your brag sheet"
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def self.add_to_file(file, text)
|
|
20
|
+
open(file, 'a+') do |file|
|
|
21
|
+
file.puts "#{Time.now.strftime("%m-%d-%y %H:%M")} - #{text}"
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def self.read_file(file)
|
|
26
|
+
return puts "no brags yet :(" if no_brags?(file)
|
|
27
|
+
|
|
28
|
+
puts "here's your brags"
|
|
29
|
+
open(file, 'a+').each do |line|
|
|
30
|
+
print "#{line}"
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def self.no_brags?(file)
|
|
35
|
+
# if the file doesn't exist
|
|
36
|
+
# if the file is empty
|
|
37
|
+
!File.exists?(file) || File.zero?(file)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def self.help_page
|
|
41
|
+
"Usage: brag [ACCOMPLISHMENT]
|
|
42
|
+
Keep a list of accomplishments.\n
|
|
43
|
+
Pass in 'sheet' (ie: `brag sheet`)
|
|
44
|
+
to list your accomplishments.\n
|
|
45
|
+
Examples:
|
|
46
|
+
brag finished the mvp
|
|
47
|
+
brag sheet\n"
|
|
48
|
+
end
|
|
49
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: brag
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Colleen McGuckin
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2020-03-10 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: Perfect for keeping track of wins to reference later.
|
|
14
|
+
email: colleenmcguckin@gmail.com
|
|
15
|
+
executables:
|
|
16
|
+
- brag
|
|
17
|
+
extensions: []
|
|
18
|
+
extra_rdoc_files: []
|
|
19
|
+
files:
|
|
20
|
+
- bin/brag
|
|
21
|
+
- lib/brag.rb
|
|
22
|
+
homepage: https://github.com/colleenmcguckin/brag_sheet
|
|
23
|
+
licenses:
|
|
24
|
+
- MIT
|
|
25
|
+
metadata:
|
|
26
|
+
source_code_uri: https://github.com/colleenmcguckin/brag_sheet
|
|
27
|
+
post_install_message:
|
|
28
|
+
rdoc_options: []
|
|
29
|
+
require_paths:
|
|
30
|
+
- lib
|
|
31
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
32
|
+
requirements:
|
|
33
|
+
- - ">="
|
|
34
|
+
- !ruby/object:Gem::Version
|
|
35
|
+
version: '0'
|
|
36
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ">="
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '0'
|
|
41
|
+
requirements: []
|
|
42
|
+
rubygems_version: 3.0.3
|
|
43
|
+
signing_key:
|
|
44
|
+
specification_version: 4
|
|
45
|
+
summary: A simple CLI to record accomplishments.
|
|
46
|
+
test_files: []
|