texol 0.1.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ab5f761b940686bfc92106ce4062647faba986f3
4
+ data.tar.gz: 7159bf82d464bb8ea9c60ed2ef04a761b23cfeb1
5
+ SHA512:
6
+ metadata.gz: b3f48932c7fdda844b03d290966af67993b20d35c967be4dbfe00e41709abe8f80ed9fcf4f0acb739f3ea87df662a7e223f96c2ef3894836e925a6ec85c96f52
7
+ data.tar.gz: 70bcb2849f5cc1fd160a5e4966f422cd04245ba65ef6b8aafeaae35fb3931394f0d3a3082497b58d0655dd5d6ecaceae95b8c5319ecb9c59dbb87d216bc3c134
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ Gemfile.lock
10
+ texol-0.1.1.gem
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.4.1
5
+ before_install: gem install bundler -v 1.16.1
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:gitlab) {|repo_name| "https://gitlab.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in texol.gemspec
6
+ gemspec
@@ -0,0 +1 @@
1
+ Wszelkie prawa zastrzeżone dla Jacek Szewczyk
@@ -0,0 +1,46 @@
1
+ # Texol
2
+
3
+ Sposób zapisu 'Texol' polega na pięciu grupach liter po 7 znaków.
4
+ Każda litera należy do ktorejś z grup 't' 'e' 'x' 'o' lub 'l'. Jeśli
5
+ kolejna litera w wyrazie należy do tej samej grupy zapisujemy tylko znak
6
+ różnicy w jakiej grupie jest. W ten sposób ten sam
7
+ znak może oznaczać inną literę.
8
+
9
+ ## Instalacja
10
+
11
+ ystarczy dodać do pliku Gemfile taki napis:
12
+
13
+ ```ruby
14
+ gem 'texol'
15
+ ```
16
+
17
+ I uruchomić:
18
+
19
+ $ bundle
20
+
21
+ Lub zainstalować samodzielnie:
22
+
23
+ $ gem install texol
24
+
25
+ ## Jak używać
26
+
27
+ Wystarczy stworzyć obiekt x = Texol.new . Przy tworzeniu możemy podać różne
28
+ sposoby zapisu znaków dodatkowych. Jako znaki 'unicode', jako znaki
29
+ 'plusminus' i jako znaki na klawiaturze.
30
+
31
+ Zapis 'klawiatura'
32
+ 0=0 1=+1 2=+2 3=+3 4=-1 5=-2 6=-3 7=d0 8=d-1 9=d+1 [=d+2 ]=d+3 {=d-2 }=d-3
33
+
34
+ Najprostrzym sposobem jest podanie pełnego napisu x.napis("treść") i
35
+ otrzymamy wynik gotowy do użycia z odpowiednim fontem.
36
+
37
+ ## Dla ciekawych
38
+
39
+ Instrukcja `rake test` powinna wykonać wszelkie testy obiektu. Można też
40
+ użyć irb interaktywnej konsoli uruchamiając `bin/console`.
41
+
42
+ Jeśli chcesz zainstalować tego gem-a lokalnie, użyj `bundle install --path ./.bundle`.
43
+
44
+ ## Repozytorium
45
+
46
+ Repozytorium https://gitlab.com/x64/texol .
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList["test/**/*_test.rb"]
8
+ end
9
+
10
+ task :default => :test
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "texol"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,73 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: utf-8
3
+
4
+ # Funkcja zamiana() odpowiada na co zamienić literę. Na początku przekazu
5
+ # należy zresetować transmisję.
6
+
7
+ class Texol
8
+
9
+ VERSION = "0.1.1"
10
+
11
+ ZNAKI_DODATKOWE = [ '-3', '-2', '-1', '0', '+1', '+2', '+3',
12
+ 'd-3', 'd-2', 'd-1', 'd0', 'd+1', 'd+2', 'd+3' ]
13
+
14
+ #Inicjując podajemy jak domyślnie określamy dodatkowe litery
15
+ def initialize(jak="plusminus")
16
+ @poprzedni = nil #Tu przechowujemy grupę do jakiej należy poprzedni znak lub nil jeśli nie było poprzedniej grupy
17
+ end
18
+
19
+ def start()
20
+ @poprzedni = nil
21
+ end
22
+
23
+ #d-1 to znak -1 ale z kreską, duża litera
24
+ def znak(znakutf8)
25
+ g = [ 'm', 'j', 'a', 't', 'w', 'u', 'k',
26
+ 'M', 'J', 'A', 'T', 'W', 'U', 'K',
27
+ 's', 'n', 'z', 'e', 'c', 'i', 'h',
28
+ 'S', 'N', 'Z', 'E', 'C', 'I', 'H',
29
+ 'ś', 'v', 'ź', 'x', 'ń', 'ć', 'q',
30
+ 'Ś', 'V', 'Ź', 'X', 'Ń', 'Ć', 'Q',
31
+ 'y', 'b', 'r', 'o', 'd', 'p', 'ł',
32
+ 'Y', 'B', 'R', 'O', 'D', 'P', 'Ł',
33
+ 'ę', 'ó', 'f', 'l', 'ż', 'ą', 'g',
34
+ 'Ę', 'Ó', 'F', 'L', 'Ż', 'Ą', 'G' ]
35
+ s = ( ['t'] * 14 ) + ( ['e'] * 14 ) + ( ['x'] * 14 ) + ( ['o'] * 14 ) + ( ['l'] * 14 )
36
+ d = [ '-3', '-2', '-1', '0', '+1', '+2', '+3',
37
+ 'd-3', 'd-2', 'd-1', 'd0', 'd+1', 'd+2', 'd+3',
38
+ '-3', '-2', '-1', '0', '+1', '+2', '+3',
39
+ 'd-3', 'd-2', 'd-1', 'd0', 'd+1', 'd+2', 'd+3',
40
+ '-3', '-2', '-1', '0', '+1', '+2', '+3',
41
+ 'd-3', 'd-2', 'd-1', 'd0', 'd+1', 'd+2', 'd+3',
42
+ '-3', '-2', '-1', '0', '+1', '+2', '+3',
43
+ 'd-3', 'd-2', 'd-1', 'd0', 'd+1', 'd+2', 'd+3',
44
+ '-3', '-2', '-1', '0', '+1', '+2', '+3',
45
+ 'd-3', 'd-2', 'd-1', 'd0', 'd+1', 'd+2', 'd+3' ]
46
+
47
+ g.each_with_index{|z,i|
48
+ if znakutf8 == z then
49
+ if @poprzedni == s[i] then
50
+ return d[i]
51
+ else
52
+ @poprzedni = s[i]; return znakutf8
53
+ end
54
+ end
55
+ }
56
+
57
+ #inne znaki
58
+ start()
59
+ return znakutf8
60
+ end
61
+
62
+ #zwracamy gotowy napis zamieniony już jak trzeba
63
+ def napis(n)
64
+ self.start()
65
+ n.split(//).map{|e| self.znak(e)}.join
66
+ end
67
+
68
+ def tablica(n)
69
+ self.start()
70
+ n.split(//).map{|e| self.znak(e)}
71
+ end #koniec obiektu Texol
72
+
73
+ end
@@ -0,0 +1,35 @@
1
+ lib = File.expand_path("../lib", __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "texol"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "texol"
7
+ spec.version = Texol::VERSION
8
+ spec.authors = ["Tak"]
9
+ spec.email = ["nerd@linux.pl"]
10
+
11
+ spec.summary = %q{Conscript Texol}
12
+ spec.description = %q{Obiekt do konwersji napisu na texol, przystosowany do odpowiedniego fontu}
13
+ spec.homepage = "https://gitlab.com/x64/texol"
14
+ spec.license = 'Nonstandard'
15
+
16
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
17
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
18
+ if spec.respond_to?(:metadata)
19
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
20
+ else
21
+ raise "RubyGems 2.0 or newer is required to protect against " \
22
+ "public gem pushes."
23
+ end
24
+
25
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
26
+ f.match(%r{^(test|spec|features)/})
27
+ end
28
+ spec.bindir = "exe"
29
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30
+ spec.require_paths = ["lib"]
31
+
32
+ spec.add_development_dependency "bundler", "~> 1.16"
33
+ spec.add_development_dependency "rake", "~> 10.0"
34
+ spec.add_development_dependency "minitest", "~> 5.0"
35
+ end
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: texol
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Tak
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2018-03-10 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.16'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.16'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '5.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '5.0'
55
+ description: Obiekt do konwersji napisu na texol, przystosowany do odpowiedniego fontu
56
+ email:
57
+ - nerd@linux.pl
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - ".travis.yml"
64
+ - Gemfile
65
+ - LICENSE.txt
66
+ - README.md
67
+ - Rakefile
68
+ - bin/console
69
+ - bin/setup
70
+ - lib/texol.rb
71
+ - texol.gemspec
72
+ homepage: https://gitlab.com/x64/texol
73
+ licenses:
74
+ - Nonstandard
75
+ metadata:
76
+ allowed_push_host: https://rubygems.org
77
+ post_install_message:
78
+ rdoc_options: []
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ requirements: []
92
+ rubyforge_project:
93
+ rubygems_version: 2.6.11
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: Conscript Texol
97
+ test_files: []