basefile 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6c2b83e69dd9593be72bb021d3c4e9a9f2e750d20f2fb285451931991b68002e
4
- data.tar.gz: 105e1a964735e59fb32e533971cb36340480dfaef624b82fbad7faa1593d41c3
3
+ metadata.gz: a744ac5dfa008b751a51999c233bf4f8bfdd65147deec2d2a74e010b0312913a
4
+ data.tar.gz: 7eb9460f8e53158030f42d6dae4f59324230de1e81749be1afdf4db5cccbbde7
5
5
  SHA512:
6
- metadata.gz: a56a8f945076249251b7a531479ac273ced7fb39dea9a422e6cad2806049e964df3860dde223550eaff6872f1f4313e72b120c115ab3a0c1f8cdf0ad21503d17
7
- data.tar.gz: 1f8573ff664942de375b29fcec4c3007a8f45b05c6c12312c471d964acfb595e1d1bad92126b07848946ce87076159d71809d7cd285f4b534501bb6ea3e1f42a
6
+ metadata.gz: 78a355107834b5027f8c3a4beb9d1095d466276c16be8859a0465830e0d13744e22f5fd835e6130302dcd8791fd8d84c8f34a809612668a0f0219767e2b3051c
7
+ data.tar.gz: 0c41f6fd28533bce7f05db94cf49f8cafb9784d07c1a3e7484874f9eb059e9184fbf8d3665944091887a41d1d67db2b60cb5c6369d3559da0c07c173d66217c0
@@ -1,13 +1,15 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- basefile (0.1.0)
4
+ basefile (0.2.0)
5
+ slop (~> 4.8.2)
5
6
 
6
7
  GEM
7
8
  remote: https://rubygems.org/
8
9
  specs:
9
10
  minitest (5.14.1)
10
11
  rake (12.3.3)
12
+ slop (4.8.2)
11
13
 
12
14
  PLATFORMS
13
15
  ruby
@@ -6,8 +6,8 @@ Gem::Specification.new do |spec|
6
6
  spec.authors = ["Josh Burns"]
7
7
  spec.email = ["josh@tripwyre.me"]
8
8
 
9
- spec.summary = "Store files as basew64 Text"
10
- spec.description = "Store files as basew64 Text"
9
+ spec.summary = "Store files as base64 text"
10
+ spec.description = "Store files as base64 text"
11
11
  spec.homepage = "https://github.com/tripwyre/basefile"
12
12
  spec.license = "MIT"
13
13
  spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
@@ -23,4 +23,6 @@ Gem::Specification.new do |spec|
23
23
  spec.bindir = "exe"
24
24
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
25
  spec.require_paths = ["lib"]
26
+
27
+ spec.add_runtime_dependency 'slop', '~> 4.8.2'
26
28
  end
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'basefile'
4
+
5
+ opts = Slop.parser do |o|
6
+ o.bool '-e', '--encode', 'Run encoder mode (default)'
7
+ o.bool '-d', '--decode', 'Run decoder mode'
8
+ o.string '-f','--file', 'The file to operate on (input or output dependeing on the mode)', required: true
9
+ o.bool '-v', '--verbose', 'Be loud'
10
+ o.on '--version', 'print the version' do
11
+ puts Basefile::VERSION
12
+ exit
13
+ end
14
+ end
15
+
16
+ if opts.decode?
17
+ opts.encode = false
18
+ # Run decoder
19
+ exit
20
+ elsif opts.encode?
21
+ if opts.verbose?
22
+ puts "Running base64 encoder on #{opts[:file]}"
23
+ end
24
+ enc = Basefile::Exe::Encoder.new(opts[:file])
25
+ enc.call
26
+ exit
27
+ else
28
+ # Throw Error
29
+ end
@@ -0,0 +1,16 @@
1
+ module Basefile
2
+ module Exe
3
+ class Decoder
4
+ def initialize(enc_str, file)
5
+ @enc_str = enc_str
6
+ @file = file
7
+ end
8
+
9
+ def call
10
+ f = ::Basefile::FileHandler.new
11
+ f.fileout = @file
12
+ puts f.decode_file(@enc_str)
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,15 @@
1
+ module Basefile
2
+ module Exe
3
+ class Encoder
4
+ def initialize(file)
5
+ @file = file
6
+ end
7
+
8
+ def call
9
+ f = ::Basefile::FileHandler.new
10
+ f.filein = @file
11
+ puts f.encode_file
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,3 +1,3 @@
1
1
  module Basefile
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: basefile
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Burns
@@ -9,11 +9,26 @@ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
11
  date: 2020-08-24 00:00:00.000000000 Z
12
- dependencies: []
13
- description: Store files as basew64 Text
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: slop
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 4.8.2
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 4.8.2
27
+ description: Store files as base64 text
14
28
  email:
15
29
  - josh@tripwyre.me
16
- executables: []
30
+ executables:
31
+ - basefile
17
32
  extensions: []
18
33
  extra_rdoc_files: []
19
34
  files:
@@ -28,8 +43,11 @@ files:
28
43
  - bin/console
29
44
  - bin/rake
30
45
  - bin/setup
46
+ - exe/basefile
31
47
  - lib/basefile.rb
32
48
  - lib/basefile/base64_shim.rb
49
+ - lib/basefile/exe/decoder.rb
50
+ - lib/basefile/exe/encoder.rb
33
51
  - lib/basefile/file_handler.rb
34
52
  - lib/basefile/version.rb
35
53
  homepage: https://github.com/tripwyre/basefile
@@ -56,5 +74,5 @@ requirements: []
56
74
  rubygems_version: 3.1.2
57
75
  signing_key:
58
76
  specification_version: 4
59
- summary: Store files as basew64 Text
77
+ summary: Store files as base64 text
60
78
  test_files: []