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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15f1388c18d6a441b6fd21c1ce469812ba9699ae0d077652810a123a3f02d7c2
4
- data.tar.gz: ce16604c09f8dc6cd936af662947675086e41c08ada7588a9f2c4e0aab5a03b8
3
+ metadata.gz: e9c4d305f849d2fb625c6d34cf88e0bf45ef333ae788ab8ae68fb997208582e8
4
+ data.tar.gz: 8d9ebc46de387bf2423bd5442e9645de57f0e07ca4ea25606c36a57135157c6c
5
5
  SHA512:
6
- metadata.gz: d7f8c9574ed5707599ffb943c159d833018678a3bbf83d4efdb6e7411b84eca56585ba9b40a30299b2eb5bb718767e08006ce6dbb693fb2071d88ee2172a0d23
7
- data.tar.gz: 226301514fb751764e133fff9def65574c5eb288218c2da2d353567511ef09776328863c598d21bab2757a8b3310f9d7cea19a241fb9e8d0f1b54fe1bb5223f4
6
+ metadata.gz: 89addf2f4b6d484bc4fb1d2def719d61019de90846a1a929b42cefff1f40a80a1d317bf3430b6dcbf3a822e3a3a5a0242916425fce225cf2ce4717b46260207f
7
+ data.tar.gz: 336ff0c1fbaf7b977e8ad8e35dfbccf70e8f9eb09c63dd45646d3d2a9858df88c0343d6527d79cd92404e1e2eddb77fb7a1ba650d6d10ac08e6b50979051790f
@@ -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
@@ -1 +1,2 @@
1
+ * v 0.1.1 Has docker image. Handle up to 99
1
2
  * v 0.1.0 Handles numbers 1-19
@@ -0,0 +1,10 @@
1
+ FROM ruby:2.6
2
+ MAINTAINER Samuel Garratt
3
+
4
+ RUN mkdir /app
5
+ WORKDIR /app
6
+ COPY . /app
7
+ RUN gem install bundler
8
+ RUN bundle install
9
+
10
+ ENTRYPOINT ["ruby", "exe/te_reo_maori"]
@@ -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__)
@@ -1,49 +1,70 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tau < Integer
4
- end
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 tahi
7
- 1
8
- end
13
+ def digit(tau, second_digit)
14
+ return tau if second_digit.nil?
9
15
 
10
- def rua
11
- 2
12
- end
16
+ ((tau - 1) * 10) + second_digit
17
+ end
13
18
 
14
- def toru
15
- 3
16
- end
19
+ # 1
20
+ def tahi
21
+ 1
22
+ end
17
23
 
18
- def wha
19
- 4
20
- end
24
+ # 2
25
+ def rua(second_digit = nil)
26
+ digit(2, second_digit)
27
+ end
21
28
 
22
- def rima
23
- 5
24
- end
29
+ # 3
30
+ def toru(second_digit = nil)
31
+ digit(3, second_digit)
32
+ end
25
33
 
26
- def ono
27
- 6
28
- end
34
+ # 4
35
+ def wha(second_digit = nil)
36
+ digit(4, second_digit)
37
+ end
29
38
 
30
- def whitu
31
- 7
32
- end
39
+ # 5
40
+ def rima(second_digit = nil)
41
+ digit(5, second_digit)
42
+ end
33
43
 
34
- def waru
35
- 8
36
- end
44
+ # 6
45
+ def ono(second_digit = nil)
46
+ digit(6, second_digit)
47
+ end
37
48
 
38
- def iwa
39
- 9
40
- end
49
+ def whitu(second_digit = nil)
50
+ digit(7, second_digit)
51
+ end
41
52
 
42
- def tekau(extra_digit = nil)
43
- extra_digit ? 10 + extra_digit : 10
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
- extra_digit
66
+ # Add extra digit
67
+ def ma(extra_digit)
68
+ extra_digit
69
+ end
49
70
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TeReoMaori
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
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.0
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-17 00:00:00.000000000 Z
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