Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
twitch
live-coding-fr
Commits
4901bf13
Commit
4901bf13
authored
Jul 19, 2020
by
Colin DAMON
Browse files
Switch to autonomous kata
parent
36585115
Changes
30
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
4901bf13
######################
# Created by https://www.toptal.com/developers/gitignore/api/eclipse,intellij,visualstudiocode,java,maven
# Project Specific
# Edit at https://www.toptal.com/developers/gitignore?templates=eclipse,intellij,visualstudiocode,java,maven
######################
/src/main/webapp/content/css/main.css
### Eclipse ###
/target/classes/static/**
/src/test/javascript/coverage/
######################
# Node
######################
/node/
node_tmp/
node_modules/
npm-debug.log.*
/.awcache/*
/.cache-loader/*
######################
# SASS
######################
.sass-cache/
######################
# Eclipse
######################
*.pydevproject
.project
.metadata
.metadata
bin/
tmp/
tmp/
tmp/**/*
*.tmp
*.tmp
*.bak
*.bak
*.swp
*.swp
*~.nib
*~.nib
local.properties
local.properties
.classpath
.settings/
.settings/
.loadpath
.loadpath
.factorypath
.recommenders
/src/main/resources/rebel.xml
# External tool builders
# External tool builders
.externalToolBuilders/
**
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
# Locally stored "Eclipse launch configurations"
*.launch
*.launch
# CDT-specific
# PyDev specific (Python IDE for Eclipse)
*.pydevproject
# CDT-specific (C/C++ Development Tooling)
.cproject
.cproject
# PDT-specific
# CDT- autotools
.autotools
# Java annotation processor (APT)
.factorypath
# PDT-specific (PHP Development Tools)
.buildpath
.buildpath
######################
# sbteclipse plugin
# Intellij
.target
######################
.idea/
# Tern plugin
*.iml
.tern-project
# TeXlipse plugin
.texlipse
# STS (Spring Tool Suite)
.springBeans
# Code Recommenders
.recommenders/
# Annotation Processing
.apt_generated/
# Scala IDE specific (Scala & Java development for Eclipse)
.cache-main
.scala_dependencies
.worksheet
### Eclipse Patch ###
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath
# Annotation Processing
.apt_generated
.sts4-cache/
### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
*.iws
*.ipr
*.ids
# IntelliJ
*.orig
classes/
out/
out/
######################
# mpeltonen/sbt-idea plugin
# Visual Studio Code
.idea_modules/
######################
.vscode/
######################
# JIRA plugin
# Maven
atlassian-ide-plugin.xml
######################
/log/
/target/
######################
# Cursive Clojure plugin
# Gradle
.idea/replstate.xml
######################
.gradle/
# Crashlytics plugin (for Android Studio and IntelliJ)
/build/
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
######################
# Editor-based Rest Client
# Package Files
.idea/httpRequests
######################
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
### Intellij Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr
# Sonarlint plugin
.idea/sonarlint
### Java ###
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.jar
*.war
*.war
*.nar
*.ear
*.ear
*.db
*.zip
*.tar.gz
######################
*.rar
# Windows
######################
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
# Windows image file caches
hs_err_pid*
Thumbs.db
### Maven ###
# Folder config file
target/
Desktop.ini
pom.xml.tag
pom.xml.releaseBackup
######################
pom.xml.versionsBackup
# Mac OSX
pom.xml.next
######################
release.properties
.DS_Store
dependency-reduced-pom.xml
.svn
buildNumber.properties
.mvn/timing.properties
# Thumbnails
.mvn/wrapper/maven-wrapper.jar
._*
### VisualStudioCode ###
# Files that might appear on external disk
.vscode/*
.Spotlight-V100
!.vscode/settings.json
.Trashes
!.vscode/tasks.json
!.vscode/launch.json
######################
!.vscode/extensions.json
# Directories
######################
### VisualStudioCode Patch ###
/bin/
# Ignore all local history of files
/deploy/
.history
######################
# End of https://www.toptal.com/developers/gitignore/api/eclipse,intellij,visualstudiocode,java,maven
# Logs
######################
*.log*
######################
# Others
######################
*.class
*.*~
*~
.merge_file*
######################
# Gradle Wrapper
######################
!gradle/wrapper/gradle-wrapper.jar
######################
# Maven Wrapper
######################
!.mvn/wrapper/maven-wrapper.jar
######################
# ESLint
######################
.eslintcache
nohup.out
.gitlab-ci.yml
View file @
4901bf13
image
:
maven:latest
stages
:
-
build
variables
:
include
:
MAVEN_CLI_OPTS
:
'
-s
.m2/settings.xml
--batch-mode'
-
local
:
"
/.gitlab-common-ci.yml"
-
local
:
"
/wordWrap/.gitlab-ci.yml"
cache
:
-
local
:
"
/romanNumerals/.gitlab-ci.yml"
paths
:
-
.maven/
before_script
:
-
export MAVEN_USER_HOME=`pwd`/.maven
maven-compile
:
stage
:
build
script
:
-
./mvnw $MAVEN_CLI_OPTS compile -Dmaven.repo.local=$MAVEN_USER_HOME
artifacts
:
paths
:
-
target/classes/
-
target/generated-sources/
expire_in
:
1 day
maven-test
:
stage
:
test
script
:
./mvnw $MAVEN_CLI_OPTS verify -Dmaven.repo.local=$MAVEN_USER_HOME
artifacts
:
reports
:
junit
:
target/test-results/**/TEST-*.xml
dependency_scanning
:
target/dependency-check-report.xml
paths
:
-
target/test-results
-
target/jacoco
-
target/dependency-check-report.xml
-
target/dependency-check-report.html
expire_in
:
1 day
.gitlab-common-ci.yml
0 → 100644
View file @
4901bf13
variables
:
MAVEN_OPTS
:
"
-Dhttps.protocols=TLSv1.2
-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN
-Dorg.slf4j.simpleLogger.showDateTime=true
-Djava.awt.headless=true"
MAVEN_CLI_OPTS
:
"
--batch-mode
--errors
--fail-at-end
--show-version
-DinstallAtEnd=true
-DdeployAtEnd=true"
cache
:
paths
:
-
.m2/repository
.java
:
image
:
maven:3.6.3-jdk-14
tags
:
docker
coverage
:
'
/Total.*?([0-9]{1,3})%/'
.m2/settings.xml
deleted
100644 → 0
View file @
36585115
<?xml version="1.0" encoding="UTF-8"?>
<settings
xmlns=
"http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"
>
<pluginGroups/>
<proxies/>
<servers/>
<mirrors/>
<profiles/>
</settings>
.mvn/wrapper/MavenWrapperDownloader.java
deleted
100644 → 0
View file @
36585115
/*
* Copyright 2007-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
java.net.*
;
import
java.io.*
;
import
java.nio.channels.*
;
import
java.util.Properties
;
public
class
MavenWrapperDownloader
{
private
static
final
String
WRAPPER_VERSION
=
"0.5.6"
;
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private
static
final
String
DEFAULT_DOWNLOAD_URL
=
"https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+
WRAPPER_VERSION
+
"/maven-wrapper-"
+
WRAPPER_VERSION
+
".jar"
;
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private
static
final
String
MAVEN_WRAPPER_PROPERTIES_PATH
=
".mvn/wrapper/maven-wrapper.properties"
;
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private
static
final
String
MAVEN_WRAPPER_JAR_PATH
=
".mvn/wrapper/maven-wrapper.jar"
;
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private
static
final
String
PROPERTY_NAME_WRAPPER_URL
=
"wrapperUrl"
;
public
static
void
main
(
String
args
[])
{
System
.
out
.
println
(
"- Downloader started"
);
File
baseDirectory
=
new
File
(
args
[
0
]);
System
.
out
.
println
(
"- Using base directory: "
+
baseDirectory
.
getAbsolutePath
());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File
mavenWrapperPropertyFile
=
new
File
(
baseDirectory
,
MAVEN_WRAPPER_PROPERTIES_PATH
);
String
url
=
DEFAULT_DOWNLOAD_URL
;
if
(
mavenWrapperPropertyFile
.
exists
())
{
FileInputStream
mavenWrapperPropertyFileInputStream
=
null
;
try
{
mavenWrapperPropertyFileInputStream
=
new
FileInputStream
(
mavenWrapperPropertyFile
);
Properties
mavenWrapperProperties
=
new
Properties
();
mavenWrapperProperties
.
load
(
mavenWrapperPropertyFileInputStream
);
url
=
mavenWrapperProperties
.
getProperty
(
PROPERTY_NAME_WRAPPER_URL
,
url
);
}
catch
(
IOException
e
)
{
System
.
out
.
println
(
"- ERROR loading '"
+
MAVEN_WRAPPER_PROPERTIES_PATH
+
"'"
);
}
finally
{
try
{
if
(
mavenWrapperPropertyFileInputStream
!=
null
)
{
mavenWrapperPropertyFileInputStream
.
close
();
}
}
catch
(
IOException
e
)
{
// Ignore ...
}
}
}
System
.
out
.
println
(
"- Downloading from: "
+
url
);
File
outputFile
=
new
File
(
baseDirectory
.
getAbsolutePath
(),
MAVEN_WRAPPER_JAR_PATH
);
if
(!
outputFile
.
getParentFile
().
exists
())
{
if
(!
outputFile
.
getParentFile
().
mkdirs
())
{
System
.
out
.
println
(
"- ERROR creating output directory '"
+
outputFile
.
getParentFile
().
getAbsolutePath
()
+
"'"
);
}
}
System
.
out
.
println
(
"- Downloading to: "
+
outputFile
.
getAbsolutePath
());
try
{
downloadFileFromURL
(
url
,
outputFile
);
System
.
out
.
println
(
"Done"
);
System
.
exit
(
0
);
}
catch
(
Throwable
e
)
{
System
.
out
.
println
(
"- Error downloading"
);
e
.
printStackTrace
();
System
.
exit
(
1
);
}
}
private
static
void
downloadFileFromURL
(
String
urlString
,
File
destination
)
throws
Exception
{
if
(
System
.
getenv
(
"MVNW_USERNAME"
)
!=
null
&&
System
.
getenv
(
"MVNW_PASSWORD"
)
!=
null
)
{
String
username
=
System
.
getenv
(
"MVNW_USERNAME"
);
char
[]
password
=
System
.
getenv
(
"MVNW_PASSWORD"
).
toCharArray
();
Authenticator
.
setDefault
(
new
Authenticator
()
{
@Override
protected
PasswordAuthentication
getPasswordAuthentication
()
{
return
new
PasswordAuthentication
(
username
,
password
);
}
});
}
URL
website
=
new
URL
(
urlString
);
ReadableByteChannel
rbc
;
rbc
=
Channels
.
newChannel
(
website
.
openStream
());
FileOutputStream
fos
=
new
FileOutputStream
(
destination
);
fos
.
getChannel
().
transferFrom
(
rbc
,
0
,
Long
.
MAX_VALUE
);
fos
.
close
();
rbc
.
close
();
}
}
.mvn/wrapper/maven-wrapper.jar
deleted
100644 → 0
View file @
36585115
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
.mvn/wrapper/maven-wrapper.properties
deleted
100644 → 0
View file @
36585115
distributionUrl
=
https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl
=
https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
README.md
View file @
4901bf13
...
@@ -17,7 +17,7 @@ Ce dépôt Git a pour but de partager les différents ateliers pouvant être ré
...
@@ -17,7 +17,7 @@ Ce dépôt Git a pour but de partager les différents ateliers pouvant être ré
## Kata Live Coding
## Kata Live Coding
*
**Wrapper**
: Proposé par Colin DAMON le 09/07/2020
*
**Wrapper**
: Proposé par Colin DAMON le 09/07/2020
*
lien:
[
Lancement de la chaîne
](
https://www.youtube.com/watch?v=bokPlp6o02g
)
*
lien:
[
Lancement de la chaîne
](
https://www.youtube.com/watch?v=bokPlp6o02g
)
*
Go To:
[
Wrapper
](
/
kata/wrapper
)
*
Go To:
[
Wrapper
](
/
wordWrap
)
*
**Roman Numerals**
: Proposé par Colin DAMON et Julie le 15/07/2020
*
**Roman Numerals**
: Proposé par Colin DAMON et Julie le 15/07/2020
*
lien:
[
Roman Numerals avec Julie et Colin
](
https://www.twitch.tv/videos/680494502
)
(
lien
twitch en attendant upload YT)
*
lien:
[
Roman Numerals avec Julie et Colin
](
https://www.twitch.tv/videos/680494502
)
(
lien
twitch en attendant upload YT)
*
Go To:
[
Roman Numerals
](
/
kata/
romanNumerals
)
*
Go To:
[
Roman Numerals
](
/romanNumerals
)
kata/romanNumerals/pom.xml
deleted
100644 → 0
View file @
36585115
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
fr.ippon.live-coding
</groupId>
<artifactId>
parent
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<relativePath>
../../
</relativePath>
</parent>
<groupId>
fr.ippon.kata
</groupId>
<artifactId>
romanNumerals
</artifactId>
<name>
Roman Numerals Kata
</name>
<developers>
<developer>
<email>
cdamon@ippon.tech
</email>
<name>
Colin DAMON
</name>
</developer>
<developer>
<email></email>
<name>
Julie
</name>
</developer>
</developers>
<dependencies>
<dependency>
<groupId>
org.assertj
</groupId>
<artifactId>
assertj-core
</artifactId>
</dependency>
<dependency>
<groupId>
org.junit.jupiter
</groupId>
<artifactId>
junit-jupiter-api
</artifactId>
</dependency>
<dependency>
<groupId>
org.junit.jupiter
</groupId>
<artifactId>
junit-jupiter-engine
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
kata/romanNumerals/src/main/java/fr/ippon/kata/roman/Numerals.java
deleted
100644 → 0
View file @
36585115
package
fr.ippon.kata.roman
;
import
java.util.NavigableMap
;
import
java.util.TreeMap
;
public
class
Numerals
{
private
static
final
NavigableMap
<
Integer
,
Roman
>
CONVERSIONS
=
buildConversions
();
public
static
String
toRoman
(
int
arabic
)
{
// TODO : Use Stream.iterable to avoid stackoverflow on recursion
if
(
arabic
<=
0
)
{
return
""
;
}
Integer
highestKnownConversion
=
CONVERSIONS
.
floorKey
(
arabic
);
String
highestKnownRepresentation
=
CONVERSIONS
.
get
(
highestKnownConversion
)
.
getRepresentation
();
return
highestKnownRepresentation
+
toRoman
(
arabic
-
highestKnownConversion
);
}
private
static
NavigableMap
<
Integer
,
Roman
>
buildConversions
()
{
NavigableMap
<
Integer
,
Roman
>
conversions
=
new
TreeMap
<>();
conversions
.
put
(
1
,
Roman
.
ONE
);
conversions
.
put
(
4
,
Roman
.
FOUR
);
conversions
.
put
(
5
,
Roman
.
FIVE
);
conversions
.
put
(
9
,
Roman
.
NINE
);
conversions
.
put
(
10
,
Roman
.
TEN
);
return
conversions
;
}
}
kata/romanNumerals/src/test/java/fr/ippon/kata/roman/NumeralsTest.java
deleted
100644 → 0
View file @
36585115
package
fr.ippon.kata.roman
;
import
org.junit.jupiter.api.Test
;
import
static
fr
.
ippon
.
kata
.
roman
.
Numerals
.
toRoman
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.*;
class
NumeralsTest
{
@Test
void
shouldConvertZeroToEmptyString
()
{
assertThat
(
toRoman
(
0
)).
isEmpty
();
}
@Test
void
shouldConvertOneToI
()
{
assertThat
(
toRoman
(
1
)).
isEqualTo
(
"I"
);
}
@Test
void
shouldConvertThreeToIII
()
{
assertThat
(
toRoman
(
3
)).
isEqualTo
(
"III"
);
}
@Test