f0cus 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.
Files changed (5) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +0 -0
  3. data/bin/f +5 -0
  4. data/lib/f0cus.rb +29 -0
  5. metadata +45 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 0d2353c9aa56abb3d7549773a2eea14f77137e5316a70673686bbb5e0710b074
4
+ data.tar.gz: e2d96215d37ed8d66fc247b7415a124b199f0d310224af4654ee5e9f625653c8
5
+ SHA512:
6
+ metadata.gz: a7722395bc0ff93c947aaedbf208f748097777eac6ec2e87e53847f5124983e780600bc959c63ad04fbc1d8af5f014607fc2be9bd471d02e3bb0ea778674a817
7
+ data.tar.gz: 83dd80be26d114053cf2e5a6878b98f4f22312e38e4e7224870b8d7f446945ca1ad2af2afe11478bc26f2cafd306b6b8f83c469f52abfaa8a070dfc96df3ff65
data/README.md ADDED
File without changes
data/bin/f ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.expand_path(File.dirname(__FILE__) + '/../lib/f0cus.rb')
4
+
5
+ F0cus.run(ARGV)
data/lib/f0cus.rb ADDED
@@ -0,0 +1,29 @@
1
+ require 'fileutils'
2
+
3
+ class F0cus
4
+ FILE = File.join(Dir.home, '.f0cus')
5
+
6
+ def self.run(args)
7
+ subcommand = args.shift
8
+
9
+ case subcommand
10
+ when 'push'
11
+ str = args.shift
12
+ File.open(FILE, 'a') { |file| file.write("#{str}\n") }
13
+ puts str
14
+ exit
15
+ when 'pop'
16
+ lines = File.readlines(FILE)
17
+ lines.pop
18
+ File.open(FILE, 'w') do |f|
19
+ lines.each do |line|
20
+ f.write(line)
21
+ end
22
+ end
23
+ puts lines.last
24
+ else
25
+ FileUtils.touch(FILE)
26
+ puts File.readlines(FILE).last
27
+ end
28
+ end
29
+ end
metadata ADDED
@@ -0,0 +1,45 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: f0cus
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Matt Manning
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-02-18 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Stay focused
14
+ email: matt.manning@gmail.com
15
+ executables:
16
+ - f
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - README.md
21
+ - bin/f
22
+ - lib/f0cus.rb
23
+ homepage: https://github.com/mattmanning/f0cus
24
+ licenses: []
25
+ metadata: {}
26
+ post_install_message:
27
+ rdoc_options: []
28
+ require_paths:
29
+ - lib
30
+ required_ruby_version: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ required_rubygems_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ requirements: []
41
+ rubygems_version: 3.0.6
42
+ signing_key:
43
+ specification_version: 4
44
+ summary: Stay focused
45
+ test_files: []