ita2 0.1.2 → 0.1.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.
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "rubygems"
4
+ require "ita2"
5
+
6
+ def usage
7
+ puts "ITA2 -- International Telegraphy Alphabet No.2"
8
+ puts "Usage: ita2 some text [--punchcode|--hexcodes]"
9
+ puts "--punchcode = shows the text as an ASCII graphic"
10
+ puts "--hexcodes = shows the text as ita2 codes in hexadecimal"
11
+ end
12
+
13
+ unless ARGV.size == 2
14
+ usage
15
+ exit
16
+ end
17
+
18
+ text = ARGV[0]
19
+ mode = ARGV[1].downcase
20
+
21
+ if mode == "--hexcodes"
22
+ puts text.to_ita2.map{|char| char.to_s(16).rjust(2, '0')}.join(' ')
23
+ elsif mode == "--punchcode"
24
+ puts text.to_punchcode
25
+ else
26
+ usage
27
+ end
File without changes
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ita2
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 29
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 1
8
- - 2
9
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
10
11
  platform: ruby
11
12
  authors:
12
13
  - !binary |
@@ -16,21 +17,22 @@ autorequire:
16
17
  bindir: bin
17
18
  cert_chain: []
18
19
 
19
- date: 2010-03-30 00:00:00 +02:00
20
+ date: 2010-07-25 00:00:00 +02:00
20
21
  default_executable:
21
22
  dependencies: []
22
23
 
23
24
  description: Converts strings to ITA2 codes or to a punchcode ASCII graphic in 5-bit ITA2
24
25
  email: darkoem@gmail.com
25
- executables: []
26
-
26
+ executables:
27
+ - ita2
27
28
  extensions: []
28
29
 
29
30
  extra_rdoc_files: []
30
31
 
31
32
  files:
32
33
  - lib/ita2.rb
33
- - test/ita2_test.rb
34
+ - test/test_ita2.rb
35
+ - bin/ita2
34
36
  has_rdoc: true
35
37
  homepage: http://darkno.de
36
38
  licenses: []
@@ -41,23 +43,27 @@ rdoc_options: []
41
43
  require_paths:
42
44
  - lib
43
45
  required_ruby_version: !ruby/object:Gem::Requirement
46
+ none: false
44
47
  requirements:
45
48
  - - ">="
46
49
  - !ruby/object:Gem::Version
50
+ hash: 3
47
51
  segments:
48
52
  - 0
49
53
  version: "0"
50
54
  required_rubygems_version: !ruby/object:Gem::Requirement
55
+ none: false
51
56
  requirements:
52
57
  - - ">="
53
58
  - !ruby/object:Gem::Version
59
+ hash: 3
54
60
  segments:
55
61
  - 0
56
62
  version: "0"
57
63
  requirements: []
58
64
 
59
65
  rubyforge_project:
60
- rubygems_version: 1.3.6
66
+ rubygems_version: 1.3.7
61
67
  signing_key:
62
68
  specification_version: 3
63
69
  summary: International Telegraphy Alphabet No.2 for Ruby