Gemnigma 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c972d271fb7395b7d645684a4e95991456479375
4
- data.tar.gz: 85a3ca12bd9117a3d328386e7b0988ccca761b6e
3
+ metadata.gz: dd31aaaf48c91657512deb00700f6435c680d87a
4
+ data.tar.gz: 9df381f318e73258d2617d7ed684d018d325c1ac
5
5
  SHA512:
6
- metadata.gz: 7cfa961d91ed50852aadcc41edb87009787dc5190a4f5249505b4e9a77e031dc7209543e025ef04032e3c33de9d006a39c03dab3d02ed5b97ef8600b58525f68
7
- data.tar.gz: d9728b6ff7bb168039d03489a441463c1e8f032674d6f7c618dcf7ad1e57883b877ba5850223b5adcfdf8d11b436758c70589f31c4614f4d809b263f9774c21f
6
+ metadata.gz: 0552c09a0ac8f54c738c650001e7bb33b3731ab249ecbf7309c1bb41bffa4e5e8c073a2013be30d4a5add7f01952b18544be7efaee1c34504beaf61a712c4256
7
+ data.tar.gz: 5be571b7ebf670e0f82a45890d2105226107f1b1d555b2d64039423bc74a69030c4e33030a6ffa0771a06384377f9e73d62034bccb029c61abc73b4297cf020f
@@ -4,9 +4,13 @@ module Gemnigma
4
4
  class Crack
5
5
  include ValidateFileArg
6
6
 
7
+ def initialize
8
+ @messages = Messages.new
9
+ end
10
+
7
11
  def get_cmd_args
8
12
  if ARGV.length < 4
9
- Messages.new.few_args
13
+ @messages.few_args
10
14
  return
11
15
  end
12
16
 
@@ -18,7 +22,7 @@ module Gemnigma
18
22
  end
19
23
 
20
24
  if ARGV.length > 4
21
- Messages.new.too_much_args
25
+ @messages.too_much_args
22
26
  return
23
27
  end
24
28
  end
@@ -31,7 +35,7 @@ module Gemnigma
31
35
 
32
36
  def brute_force_key_map(input, date)
33
37
  unless true_date?(date)
34
- Messages.new.wrong_date(date)
38
+ @messages.wrong_date(date)
35
39
  return
36
40
  end
37
41
 
@@ -180,7 +184,7 @@ module Gemnigma
180
184
  end
181
185
  end
182
186
  @cracked_key = possible_key_combination.join
183
- Messages.new.success_message(@output_file, @secret_key, @date_gen)
187
+ @messages.success_message(@output_file, @secret_key, @date_gen)
184
188
  end
185
189
 
186
190
  def crack_file(input, output)
@@ -4,9 +4,13 @@ module Gemnigma
4
4
  class Decrypt < RotatorDecrypt
5
5
  include ValidateFileArg
6
6
 
7
+ def initialize
8
+ @messages = Messages.new
9
+ end
10
+
7
11
  def get_cmd_args
8
12
  if ARGV.length < 5
9
- Messages.new.few_args
13
+ @messages.few_args
10
14
  return
11
15
  end
12
16
 
@@ -19,7 +23,7 @@ module Gemnigma
19
23
  end
20
24
 
21
25
  if ARGV.length > 5
22
- Messages.new.too_much_args
26
+ @messages.too_much_args
23
27
  return
24
28
  end
25
29
 
@@ -58,7 +62,7 @@ module Gemnigma
58
62
 
59
63
  encrypted_file.close
60
64
  decrypted_file.close
61
- Messages.new.success_message(@output_file, @secret_key, @date_gen)
65
+ @messages.success_message(@output_file, @secret_key, @date_gen)
62
66
  end
63
67
  end
64
68
  end
@@ -4,9 +4,13 @@ module Gemnigma
4
4
  class Encrypt < RotatorEncrypt
5
5
  include ValidateFileArg
6
6
 
7
+ def initialize
8
+ @message = Messages.new
9
+ end
10
+
7
11
  def get_cmd_args
8
12
  if ARGV.length < 3
9
- Messages.new.few_args
13
+ @message.few_args
10
14
  return
11
15
  end
12
16
 
@@ -17,7 +21,7 @@ module Gemnigma
17
21
  end
18
22
 
19
23
  if ARGV.length > 3
20
- Messages.new.too_much_args
24
+ @message.too_much_args
21
25
  return
22
26
  end
23
27
 
@@ -39,7 +43,7 @@ module Gemnigma
39
43
 
40
44
  file_input.close
41
45
  encrypted_file.close
42
- Messages.new.success_message(@output_file, @secret_key, @date_gen)
46
+ @message.success_message(@output_file, @secret_key, @date_gen)
43
47
  end
44
48
  end
45
49
  end
@@ -1,3 +1,3 @@
1
1
  module Gemnigma
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -9,8 +9,8 @@ describe Gemnigma do
9
9
  expect(Gemnigma.constants.include? :VERSION).to be true
10
10
  end
11
11
 
12
- it "should have a version number 0.0.1" do
13
- expect(Gemnigma::VERSION).to eql("0.0.1")
12
+ it "should have a version number 0.0.3" do
13
+ expect(Gemnigma::VERSION).to eql("0.0.3")
14
14
  end
15
15
 
16
16
  it "should have access to the char_map module" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Gemnigma
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chinedu