cw_parser 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
data/cw_parser.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "cw_parser"
8
- s.version = "0.0.2"
8
+ s.version = "0.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["wsugg"]
data/lib/cw_parse_code.rb CHANGED
@@ -3,12 +3,12 @@
3
3
  module CW_Parse_Code
4
4
 
5
5
  def parse_code(code_to_translate)
6
- #puts "code_to_translate: #{code_to_translate}"
6
+ puts "code_to_translate: #{code_to_translate}"
7
7
  code_to_translate_ary = Array.new
8
8
  result_str = ""
9
9
 
10
10
  code_to_translate_ary = code_to_translate.split(' ')
11
- #puts "code to translate array: #{code_to_translate_ary}" #for debugging
11
+ puts "code to translate array: #{code_to_translate_ary}" #for debugging
12
12
  code_to_translate_ary.each{|a| result_str << @morse_code.key(a)}
13
13
  puts "Code:#{code_to_translate_ary} Morse Code:#{result_str}"
14
14
  result_str
data/lib/cw_parser.rb CHANGED
@@ -15,7 +15,7 @@ class CW_Parser
15
15
  attr_reader :morse_code
16
16
  attr_accessor :mode, :sound, :filepath
17
17
 
18
- def initialize(mode=[:text],filepath="",sound="no")
18
+ def initialize(mode=:text,filepath="",sound="no")
19
19
  @mode = mode
20
20
  @filepath = filepath
21
21
  @sound = sound
@@ -26,27 +26,27 @@ class CW_Parser
26
26
  "N" => '-.', "O" => '---', "P" => '.--.', "Q" => '--.-', "R" => '.-.', "S" => '...',
27
27
  "T" => '-', "U" => '..-', "V" => '...-', "W" => '.--', "X" => '-..-', "Y" => '-.--',
28
28
  "Z" => '--..', "1" => '.----', "2" => '..---', "3" => '...--', "4" => '....-', "5" => '.....',
29
- "6" => '-....', "7" => '--...', "8" => '---..', "9" => '----.', "0" => '-----', " " => ' ', "" =>'',
29
+ "6" => '-....', "7" => '--...', "8" => '---..', "9" => '----.', "0" => '-----', " " => ' ',
30
30
  }
31
31
 
32
32
  end
33
33
 
34
34
  def translate_file(path="")
35
35
  if true == File.exist?(path)
36
- puts "path: #{path}"
37
- puts "mode= #{@mode}"
38
- ftranslate = File.read(path)
39
- ftranslate.gsub!(/\n/, " ")
36
+ puts "path: #{path}"
37
+ puts "mode= #{@mode}"
38
+ ftranslate = File.read(path)
39
+ ftranslate.gsub!(/\n/, " ")
40
40
  else
41
- puts "#{path} does not exsist"
41
+ puts "#{path} does not exist"
42
42
  end
43
43
 
44
- if @mode == :text
45
- puts ftranslate.inspect
46
- parse_text(ftranslate)
44
+ if @mode == :text
45
+ puts ftranslate.inspect
46
+ parse_text(ftranslate)
47
47
  else
48
- puts ftranslate.inspect
49
- parse_code(ftranslate)
48
+ puts ftranslate.inspect
49
+ parse_code(ftranslate)
50
50
  end
51
51
  end
52
52
 
data/lib/test.txt CHANGED
@@ -1,2 +1,2 @@
1
1
  THIS IS THE TEXT TO TRANSLATE IN THE TXT FILE
2
- THIS IS THE SECOND LINE TO TRANSLATE
2
+ THIS IS THE SECOND LINE TO TRANSLATE
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cw_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -100,7 +100,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
100
100
  version: '0'
101
101
  segments:
102
102
  - 0
103
- hash: 306435859
103
+ hash: -587768653
104
104
  required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements: