kita 0.5.6 → 0.5.7
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 +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/kita.gemspec +6 -2
- data/lib/kita.rb +13 -19
- data/lib/kita/hiragana.rb +1 -0
- data/lib/kita/katakana.rb +1 -0
- data/lib/kita/question.rb +23 -0
- data/lib/kita/version.rb +1 -1
- data/snap/snapcraft.yaml +3 -27
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b9ab67c3c2be81e1c63d0e5bba5ce903f27c5228b0dd6fe6b4051a032fa5371
|
4
|
+
data.tar.gz: 32021b813755a63059f0d4cb1464b636b374a6a758094bd86d448ba81c5f88dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d22c59c1e32b34cab29475370dd7bac3d12a486be5d6c404008647d5c27a2374ce07a1caa7ac027c0512969034427e5019f9df4229e809c42b9841e32ff3f3ba
|
7
|
+
data.tar.gz: b39f7cce3e1d969f72603c1e3aeb2edc1b0d440f4effa7fc16706d6d6b0d61c76dc5aa9ddfb585a4b3122b1bf3416e2ea09cd86b5d48128e610bb152a93165e8
|
data/CHANGELOG.md
CHANGED
@@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
9
9
|
|
10
10
|
### Changed
|
11
11
|
|
12
|
+
## 2020-05-27
|
13
|
+
### Changed
|
14
|
+
- Selecting an incorrect answer for a Katakana question, shows the correct Katakana, rather than
|
15
|
+
just repeating the Hiragana
|
16
|
+
|
12
17
|
## 2020-05-25
|
13
18
|
### Changed
|
14
19
|
- Improved sounds, neither へ nor は are pronounced in their particle form (e and wa).
|
data/Gemfile.lock
CHANGED
data/kita.gemspec
CHANGED
@@ -10,9 +10,13 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.license = 'GPLv3+'
|
11
11
|
|
12
12
|
spec.summary = 'A Japanese kana learning tool.'
|
13
|
-
spec.description =
|
13
|
+
spec.description = <<-DESC
|
14
|
+
A simple GTK3 app to help Japanese language learners with Hiragana and Katakana. It introduces
|
15
|
+
users to the sounds of the kana and teaches basic recognition of both writing systems.
|
16
|
+
DESC
|
17
|
+
|
14
18
|
spec.homepage = 'https://www.danbishop.org'
|
15
|
-
spec.required_ruby_version = Gem::Requirement.new('>= 2.
|
19
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 2.5.0')
|
16
20
|
|
17
21
|
spec.metadata['homepage_uri'] = spec.homepage
|
18
22
|
spec.metadata['source_code_uri'] = 'https://github.com/danbishop/kita'
|
data/lib/kita.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require 'gtk3'
|
3
4
|
require_relative 'kita/audio'
|
4
5
|
require_relative 'kita/config'
|
5
|
-
require_relative 'kita/
|
6
|
-
require_relative 'kita/katakana'
|
6
|
+
require_relative 'kita/question'
|
7
7
|
require_relative 'kita/version'
|
8
8
|
|
9
9
|
module Kita
|
@@ -14,11 +14,8 @@ module Kita
|
|
14
14
|
builder_file = "#{File.expand_path(File.dirname(__dir__))}/ui/builder.ui"
|
15
15
|
# Construct a Gtk::Builder instance and load our UI description
|
16
16
|
@builder = Gtk::Builder.new(file: builder_file)
|
17
|
-
# Initiate
|
18
|
-
@
|
19
|
-
# Initiate Katakana class
|
20
|
-
@katakana = Katakana.new
|
21
|
-
@types = [@hiragana]
|
17
|
+
# Initiate Question class
|
18
|
+
@question = Question.new
|
22
19
|
@button_signals = {}
|
23
20
|
@sound = Audio.new
|
24
21
|
new_question
|
@@ -81,19 +78,13 @@ module Kita
|
|
81
78
|
end
|
82
79
|
|
83
80
|
def toggle_katakana
|
84
|
-
|
85
|
-
@
|
86
|
-
@types << @hiragana if @hiragana_switch.active?
|
87
|
-
@types << @katakana if @katakana_switch.active?
|
88
|
-
(@hiragana_switch.set_active(true) && @types = [@hiragana]) if @types.empty?
|
81
|
+
Settings.katakana = !Settings.katakana
|
82
|
+
(@hiragana_switch.set_active(true) && Settings.hiragana = true) if !Settings.katakana && !Settings.hiragana
|
89
83
|
end
|
90
84
|
|
91
85
|
def toggle_hiragana
|
92
|
-
|
93
|
-
@
|
94
|
-
@types << @hiragana if @hiragana_switch.active?
|
95
|
-
@types << @katakana if @katakana_switch.active?
|
96
|
-
(@katakana_switch.set_active(true) && @types = [@katakana]) if @types.empty?
|
86
|
+
Settings.hiragana = !Settings.hiragana
|
87
|
+
(@katakana_switch.set_active(true) && Settings.katakana = true) if !Settings.katakana && !Settings.hiragana
|
97
88
|
end
|
98
89
|
|
99
90
|
def toggle_sound
|
@@ -111,7 +102,7 @@ module Kita
|
|
111
102
|
|
112
103
|
def new_question
|
113
104
|
reset_buttons
|
114
|
-
question = @
|
105
|
+
question = @question.new_question
|
115
106
|
question_label = @builder.get_object('question')
|
116
107
|
question_label.set_markup("<span font='72'>#{question[:question]}</span>")
|
117
108
|
buttons = %w[a b c d]
|
@@ -144,7 +135,10 @@ module Kita
|
|
144
135
|
def wrong_button_click(button)
|
145
136
|
button.set_sensitive(false)
|
146
137
|
label = button.child
|
147
|
-
|
138
|
+
correction = @question.type == 'hiragana' ? button.label.hiragana : button.label.katakana
|
139
|
+
label.set_markup(
|
140
|
+
"<span color='#d40000'>#{button.label} #{correction}</span>"
|
141
|
+
)
|
148
142
|
end
|
149
143
|
|
150
144
|
def reset_buttons
|
data/lib/kita/hiragana.rb
CHANGED
data/lib/kita/katakana.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'hiragana'
|
4
|
+
require_relative 'katakana'
|
5
|
+
|
6
|
+
# Question Class
|
7
|
+
class Question
|
8
|
+
attr_accessor :type
|
9
|
+
|
10
|
+
def initialize
|
11
|
+
@hiragana = Hiragana.new
|
12
|
+
@katakana = Katakana.new
|
13
|
+
end
|
14
|
+
|
15
|
+
def new_question
|
16
|
+
question_types = []
|
17
|
+
question_types.push @hiragana if Settings.hiragana
|
18
|
+
question_types.push @katakana if Settings.katakana
|
19
|
+
question = question_types.sample.question
|
20
|
+
@type = question[:type]
|
21
|
+
question
|
22
|
+
end
|
23
|
+
end
|
data/lib/kita/version.rb
CHANGED
data/snap/snapcraft.yaml
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
name: kita
|
2
|
-
version: '0.5.
|
2
|
+
version: '0.5.6'
|
3
3
|
summary: Japanese learning tool
|
4
4
|
description: |
|
5
5
|
A simple tool to help Japanese language learners.
|
@@ -15,43 +15,19 @@ parts:
|
|
15
15
|
plugin: ruby
|
16
16
|
gems:
|
17
17
|
- kita
|
18
|
-
ruby-version: 2.7.
|
18
|
+
ruby-version: 2.7.1
|
19
19
|
stage-packages:
|
20
|
-
- gobject-introspection
|
21
|
-
- gir1.2-atk-1.0
|
22
|
-
- gir1.2-atspi-2.0
|
23
|
-
- gir1.2-freedesktop
|
24
|
-
- gir1.2-gdkpixbuf-2.0
|
25
|
-
- gir1.2-glib-2.0
|
26
|
-
- gir1.2-gtk-3.0
|
27
|
-
- gir1.2-pango-1.0
|
28
|
-
- libcanberra-gtk3-0
|
29
20
|
- libgstreamer1.0-0
|
30
|
-
-
|
21
|
+
- gstreamer1.0-plugins-base
|
31
22
|
- libgirepository-1.0-1
|
32
23
|
- gir1.2-gstreamer-1.0
|
33
|
-
- gstreamer1.0-plugins-base
|
34
|
-
# Just trying these to see if it makes sound work
|
35
|
-
- libpulse0
|
36
|
-
- libpulse-mainloop-glib0
|
37
|
-
- libslang2
|
38
|
-
- libgpm2
|
39
|
-
- libasound2
|
40
24
|
|
41
25
|
apps:
|
42
26
|
kita:
|
43
27
|
command: bin/kita
|
44
28
|
extensions: [gnome-3-28]
|
45
|
-
environment:
|
46
|
-
LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio
|
47
29
|
plugs:
|
48
|
-
- desktop
|
49
|
-
- desktop-legacy
|
50
|
-
- gsettings
|
51
|
-
- wayland
|
52
|
-
- x11
|
53
30
|
- audio-playback
|
54
|
-
- home
|
55
31
|
slots:
|
56
32
|
- dbus-daemon
|
57
33
|
common-id: uk.danbishop.kita
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kita
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Bishop
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: config
|
@@ -94,7 +94,9 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '3.4'
|
97
|
-
description:
|
97
|
+
description: |2
|
98
|
+
A simple GTK3 app to help Japanese language learners with Hiragana and Katakana. It introduces
|
99
|
+
users to the sounds of the kana and teaches basic recognition of both writing systems.
|
98
100
|
email:
|
99
101
|
- d@nbishop.uk
|
100
102
|
executables:
|
@@ -118,6 +120,7 @@ files:
|
|
118
120
|
- lib/kita/config.rb
|
119
121
|
- lib/kita/hiragana.rb
|
120
122
|
- lib/kita/katakana.rb
|
123
|
+
- lib/kita/question.rb
|
121
124
|
- lib/kita/version.rb
|
122
125
|
- snap/gui/kita.desktop
|
123
126
|
- snap/gui/kita.svg
|
@@ -283,7 +286,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
283
286
|
requirements:
|
284
287
|
- - ">="
|
285
288
|
- !ruby/object:Gem::Version
|
286
|
-
version: 2.
|
289
|
+
version: 2.5.0
|
287
290
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
288
291
|
requirements:
|
289
292
|
- - ">="
|