memit 0.0.0
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 +7 -0
- data/bin/memit +4 -0
- data/data/prepositions.csv +69 -0
- data/lib/memit.rb +19 -0
- data/lib/memit/cli.rb +45 -0
- data/lib/memit/config.rb +15 -0
- data/lib/memit/config_repository.rb +31 -0
- data/lib/memit/question_provider.rb +19 -0
- metadata +51 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5bf7e43a76d3d4fe5f66cf8c398821ce1c317094
|
4
|
+
data.tar.gz: 02558772132b696925592d33c8e2913ddb529542
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0737cc903a81ddee84b75da60003852467cc6fc1516defa61088686576d553bbb90abef2f01ee9c8da789300052c7b3e71619bc683c6df66f1a6c88ab49eb023
|
7
|
+
data.tar.gz: 9f258c15de3aaf308603cba86bd3fcfd16fdf9c327adb17a60389654b53d8ff11d263e09f3b49d056971e3d6c3b919d0c94424e5151c90648f4cea87f5ec2a9e
|
data/bin/memit
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
advantage _ (korzyść, zaleta, przewaga z);of
|
2
|
+
disadvantage _ (wada, niekorzyść z);of
|
3
|
+
suspicion _ (podejrzenie o);of
|
4
|
+
photograph _ (zdjęcie czegoś);of
|
5
|
+
picture _ (obraz czegoś);of
|
6
|
+
map _ (mapa czegoś);of
|
7
|
+
cause _ (przyczyna czegoś);of
|
8
|
+
intention _ (zamiar);of
|
9
|
+
disapproval _ (dezaprobata wobec);of
|
10
|
+
gratitude _ (wdzięczność za);for
|
11
|
+
cheque _ (czek na);for
|
12
|
+
demand _ (popyt na);for
|
13
|
+
excuse _ (wymówka za);for
|
14
|
+
punishment _ (kara za);for
|
15
|
+
reason _ (przyczyna czegoś);for
|
16
|
+
vocation _ (powołanie do czegoś);for
|
17
|
+
weakness _ (słabość do);for
|
18
|
+
application _ (podanie o);for
|
19
|
+
responsibility _ (odpowiedzialność za);for
|
20
|
+
respect _ (szacunek dla);for
|
21
|
+
admiration _ (podziw dla);for
|
22
|
+
room _ (miejsce dla / na);for
|
23
|
+
sympathy _ (współczucie dla);for
|
24
|
+
recipe _ (przepis na);for
|
25
|
+
answer _ (odpowiedź na);to
|
26
|
+
solution _ (rozwiązanie czegoś);to
|
27
|
+
invitation _ (zaproszenie na);to
|
28
|
+
damage _ (zniszczenie czegoś);to
|
29
|
+
addiction _ (uzależnienie od);to
|
30
|
+
attitude _ (nastawienie wobec);to
|
31
|
+
attention _ (zwracać uwagę na);to
|
32
|
+
reply _ (odpowiedź na);to
|
33
|
+
chance _ (szansa na);to
|
34
|
+
response _ (odpowiedź na);to
|
35
|
+
access _ (dostęp do);to
|
36
|
+
threat _ (zagrożenie dla);to
|
37
|
+
increase _ (wzrost czegoś);in
|
38
|
+
rise _ (wzrost czegoś);in
|
39
|
+
decrease _ (spadek, zniżka czegoś);in
|
40
|
+
fall _ (spadek, zniżka czegoś);in
|
41
|
+
belief _ (wiara w);in
|
42
|
+
interest _ (zainteresowanie czymś);in
|
43
|
+
investment _ (inwestycja w);in
|
44
|
+
pride _ (być dumnym z);in
|
45
|
+
trust _ (zaufanie do);in
|
46
|
+
experience _ (doświadczenie w);in
|
47
|
+
dependence _ (zależność od);on
|
48
|
+
reliance _ (wiara, zaufanie do);on
|
49
|
+
comment _ (komentarz o);on
|
50
|
+
tax _ (podatek od);on
|
51
|
+
influence _ (wpływ na);on
|
52
|
+
ban _ (zakaz czegoś);on
|
53
|
+
effect _ (wpływ na);on
|
54
|
+
encounter _ (spotkanie z);with
|
55
|
+
quarrel _ (kłótnia z);with
|
56
|
+
contact _ (kontakt z);with
|
57
|
+
link _ (styczność z);with
|
58
|
+
relationship _ (związek z drugą osobą);with
|
59
|
+
connection _ (połączenie, więź z);with
|
60
|
+
difference _ (różnica pomiędzy);between
|
61
|
+
disagreement _ (niezgoda pomiędzy);between
|
62
|
+
relationship _ (stosunek, powiązanie pomiędzy);between
|
63
|
+
contact _ (kontakt pomiędzy);between
|
64
|
+
connection _ (połączenie pomiędzy);between
|
65
|
+
control _ (kontrola, władza nad);over
|
66
|
+
dispute _ (kłótnia, spór o);over
|
67
|
+
skill _ (umiejętność, zdolność);at
|
68
|
+
attempt _ (próba zrobienia czegoś);at
|
69
|
+
ability _ (umiejętność, zdolność);at
|
data/lib/memit.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
require 'json'
|
3
|
+
require 'thor'
|
4
|
+
require 'csv'
|
5
|
+
|
6
|
+
require_relative './memit/cli'
|
7
|
+
require_relative './memit/config'
|
8
|
+
require_relative './memit/config_repository'
|
9
|
+
require_relative './memit/question_provider'
|
10
|
+
|
11
|
+
module Memit
|
12
|
+
def self.root_path
|
13
|
+
@root_path ||= Pathname.new(__dir__).parent
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.config_path
|
17
|
+
@config_path ||= Pathname.new(File.expand_path('~/.memit'))
|
18
|
+
end
|
19
|
+
end
|
data/lib/memit/cli.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
require_relative '../memit'
|
2
|
+
|
3
|
+
module Memit
|
4
|
+
class CLI < Thor
|
5
|
+
desc 'askme', 'Asks a single question'
|
6
|
+
def askme
|
7
|
+
c = config_repository.load
|
8
|
+
qp = Memit::QuestionProvider.new(c.data_path)
|
9
|
+
q, a = qp.random_question
|
10
|
+
|
11
|
+
puts q
|
12
|
+
if STDIN.gets.chomp == a
|
13
|
+
puts 'Correct!'
|
14
|
+
else
|
15
|
+
puts "Wrong! Should be '#{a}'."
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
desc 'setdata', 'Sets data'
|
20
|
+
def setdata(path)
|
21
|
+
unless File.exist?(path)
|
22
|
+
puts 'Data file does not exist.'
|
23
|
+
return
|
24
|
+
end
|
25
|
+
|
26
|
+
c = config_repository.load
|
27
|
+
|
28
|
+
c.data_path = path
|
29
|
+
config_repository.save(c)
|
30
|
+
end
|
31
|
+
|
32
|
+
desc 'whichdata', 'Prints'
|
33
|
+
def whichdata
|
34
|
+
c = config_repository.load
|
35
|
+
|
36
|
+
puts c.data_path
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def config_repository
|
42
|
+
@config_repository ||= Memit::ConfigRepository.new(Memit.config_path)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
data/lib/memit/config.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
require_relative '../memit'
|
2
|
+
|
3
|
+
module Memit
|
4
|
+
class ConfigRepository
|
5
|
+
class UnparsableConfigFileError < StandardError
|
6
|
+
end
|
7
|
+
|
8
|
+
def initialize(config_path)
|
9
|
+
@config_path = config_path
|
10
|
+
end
|
11
|
+
|
12
|
+
def save(config)
|
13
|
+
File.open(@config_path, 'w') do |f|
|
14
|
+
h = {data_path: config.data_path}
|
15
|
+
f.write(h.to_json)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def load
|
20
|
+
if File.exist?(@config_path)
|
21
|
+
h = JSON.parse(File.read(@config_path))
|
22
|
+
Memit::Config.new(h['data_path'])
|
23
|
+
else
|
24
|
+
Memit::Config.default
|
25
|
+
end
|
26
|
+
|
27
|
+
rescue JSON::ParserError
|
28
|
+
raise UnparsableConfigFileError
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require_relative '../memit'
|
2
|
+
|
3
|
+
module Memit
|
4
|
+
class QuestionProvider
|
5
|
+
def initialize(data_path)
|
6
|
+
@data_path = data_path
|
7
|
+
end
|
8
|
+
|
9
|
+
def random_question
|
10
|
+
data.sample
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def data
|
16
|
+
@data ||= CSV.read(@data_path, col_sep: ';', row_sep: "\n", encoding: 'utf-8')
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
metadata
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: memit
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Piotr Leniec
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-06-11 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description:
|
14
|
+
email: leniec.piotr@gmail.com
|
15
|
+
executables:
|
16
|
+
- memit
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- bin/memit
|
21
|
+
- data/prepositions.csv
|
22
|
+
- lib/memit.rb
|
23
|
+
- lib/memit/cli.rb
|
24
|
+
- lib/memit/config.rb
|
25
|
+
- lib/memit/config_repository.rb
|
26
|
+
- lib/memit/question_provider.rb
|
27
|
+
homepage:
|
28
|
+
licenses:
|
29
|
+
- MIT
|
30
|
+
metadata: {}
|
31
|
+
post_install_message:
|
32
|
+
rdoc_options: []
|
33
|
+
require_paths:
|
34
|
+
- lib
|
35
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
45
|
+
requirements: []
|
46
|
+
rubyforge_project:
|
47
|
+
rubygems_version: 2.5.1
|
48
|
+
signing_key:
|
49
|
+
specification_version: 4
|
50
|
+
summary: Do you have to memorize something? Memit can help you!
|
51
|
+
test_files: []
|