te_reo_maori 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +23 -3
- data/ChangeLog +1 -0
- data/Dockerfile +10 -0
- data/exe/te_reo_maori +15 -0
- data/lib/te_reo_maori/tau.rb +56 -35
- data/lib/te_reo_maori/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9c4d305f849d2fb625c6d34cf88e0bf45ef333ae788ab8ae68fb997208582e8
|
4
|
+
data.tar.gz: 8d9ebc46de387bf2423bd5442e9645de57f0e07ca4ea25606c36a57135157c6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89addf2f4b6d484bc4fb1d2def719d61019de90846a1a929b42cefff1f40a80a1d317bf3430b6dcbf3a822e3a3a5a0242916425fce225cf2ce4717b46260207f
|
7
|
+
data.tar.gz: 336ff0c1fbaf7b977e8ad8e35dfbccf70e8f9eb09c63dd45646d3d2a9858df88c0343d6527d79cd92404e1e2eddb77fb7a1ba650d6d10ac08e6b50979051790f
|
data/.gitlab-ci.yml
CHANGED
@@ -1,8 +1,28 @@
|
|
1
1
|
image: ruby:2.6
|
2
2
|
|
3
|
-
before_script:
|
4
|
-
- bundle install
|
5
|
-
|
6
3
|
test:
|
4
|
+
before_script:
|
5
|
+
- bundle install
|
7
6
|
script:
|
8
7
|
- rake
|
8
|
+
|
9
|
+
include:
|
10
|
+
- template: Code-Quality.gitlab-ci.yml
|
11
|
+
|
12
|
+
docker_build:
|
13
|
+
variables:
|
14
|
+
# Use TLS https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#tls-enabled
|
15
|
+
DOCKER_HOST: tcp://docker:2376
|
16
|
+
DOCKER_TLS_CERTDIR: "/certs"
|
17
|
+
stage: deploy # Part of a later stage
|
18
|
+
services:
|
19
|
+
- docker:19.03.5-dind
|
20
|
+
image: docker:19.03.5
|
21
|
+
script:
|
22
|
+
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
23
|
+
- docker pull --quiet $CI_REGISTRY_IMAGE:latest || true
|
24
|
+
- docker build -t $CI_REGISTRY_IMAGE:latest .
|
25
|
+
- docker push $CI_REGISTRY_IMAGE:latest
|
26
|
+
only:
|
27
|
+
- master
|
28
|
+
needs: ["test"]
|
data/ChangeLog
CHANGED
data/Dockerfile
ADDED
data/exe/te_reo_maori
CHANGED
@@ -5,4 +5,19 @@ require 'irb'
|
|
5
5
|
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
6
6
|
require 'te_reo_maori'
|
7
7
|
|
8
|
+
def putanga
|
9
|
+
exit
|
10
|
+
end
|
11
|
+
|
12
|
+
extend Tau # Make numbers available
|
13
|
+
|
14
|
+
puts 'Nau mai haere mai. Welcome to this application for learning and interacting with Maori.'
|
15
|
+
puts 'Type "putanga" to exit'
|
16
|
+
puts 'Try and perform +, -, * (times), / (divide) with Maori'
|
17
|
+
puts 'The numbers are: '
|
18
|
+
Tau.rarangi.each do |tau, whakamaoritanga|
|
19
|
+
puts "#{tau}: #{whakamaoritanga}"
|
20
|
+
end
|
21
|
+
puts 'Example of bigger numbers. 12: (tekau ma rua). Add 23 + 33: (rua tekau ma toru) + (toru tekau ma toru) '
|
22
|
+
|
8
23
|
IRB.start(__FILE__)
|
data/lib/te_reo_maori/tau.rb
CHANGED
@@ -1,49 +1,70 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
# Number in Maori
|
4
|
+
module Tau
|
5
|
+
# List numbers
|
6
|
+
def self.rarangi
|
7
|
+
{
|
8
|
+
1 => 'tahi', 2 => 'rua', 3 => 'toru', 4 => 'wha', 5 => 'rima', 6 => 'ono', 7 => 'waru',
|
9
|
+
8 => 'iwa', 10 => 'tekau'
|
10
|
+
}
|
11
|
+
end
|
5
12
|
|
6
|
-
def
|
7
|
-
|
8
|
-
end
|
13
|
+
def digit(tau, second_digit)
|
14
|
+
return tau if second_digit.nil?
|
9
15
|
|
10
|
-
|
11
|
-
|
12
|
-
end
|
16
|
+
((tau - 1) * 10) + second_digit
|
17
|
+
end
|
13
18
|
|
14
|
-
|
15
|
-
|
16
|
-
|
19
|
+
# 1
|
20
|
+
def tahi
|
21
|
+
1
|
22
|
+
end
|
17
23
|
|
18
|
-
|
19
|
-
|
20
|
-
|
24
|
+
# 2
|
25
|
+
def rua(second_digit = nil)
|
26
|
+
digit(2, second_digit)
|
27
|
+
end
|
21
28
|
|
22
|
-
|
23
|
-
|
24
|
-
|
29
|
+
# 3
|
30
|
+
def toru(second_digit = nil)
|
31
|
+
digit(3, second_digit)
|
32
|
+
end
|
25
33
|
|
26
|
-
|
27
|
-
|
28
|
-
|
34
|
+
# 4
|
35
|
+
def wha(second_digit = nil)
|
36
|
+
digit(4, second_digit)
|
37
|
+
end
|
29
38
|
|
30
|
-
|
31
|
-
|
32
|
-
|
39
|
+
# 5
|
40
|
+
def rima(second_digit = nil)
|
41
|
+
digit(5, second_digit)
|
42
|
+
end
|
33
43
|
|
34
|
-
|
35
|
-
|
36
|
-
|
44
|
+
# 6
|
45
|
+
def ono(second_digit = nil)
|
46
|
+
digit(6, second_digit)
|
47
|
+
end
|
37
48
|
|
38
|
-
def
|
39
|
-
|
40
|
-
end
|
49
|
+
def whitu(second_digit = nil)
|
50
|
+
digit(7, second_digit)
|
51
|
+
end
|
41
52
|
|
42
|
-
def
|
43
|
-
|
44
|
-
end
|
53
|
+
def waru(second_digit = nil)
|
54
|
+
digit(8, second_digit)
|
55
|
+
end
|
56
|
+
|
57
|
+
def iwa(second_digit = nil)
|
58
|
+
digit(9, second_digit)
|
59
|
+
end
|
60
|
+
|
61
|
+
# 10. Used to add groups of 10
|
62
|
+
def tekau(extra_digit = nil)
|
63
|
+
extra_digit ? 10 + extra_digit : 10
|
64
|
+
end
|
45
65
|
|
46
|
-
# Add extra digit
|
47
|
-
def ma(extra_digit)
|
48
|
-
|
66
|
+
# Add extra digit
|
67
|
+
def ma(extra_digit)
|
68
|
+
extra_digit
|
69
|
+
end
|
49
70
|
end
|
data/lib/te_reo_maori/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: te_reo_maori
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Garratt
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Tool to aid one to learn Maori and enable one to program in Maori.
|
14
14
|
email:
|
@@ -23,6 +23,7 @@ files:
|
|
23
23
|
- ".rspec"
|
24
24
|
- CODE_OF_CONDUCT.md
|
25
25
|
- ChangeLog
|
26
|
+
- Dockerfile
|
26
27
|
- Gemfile
|
27
28
|
- LICENSE.txt
|
28
29
|
- README.md
|