From d11af060b342b4518e3e3cebdba5e24c1a537622 Mon Sep 17 00:00:00 2001 From: yoshiyuki-tsuchida Date: Mon, 23 Oct 2017 05:12:00 +0900 Subject: [PATCH 01/18] java first commit --- java/MoneyTest.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 java/MoneyTest.java diff --git a/java/MoneyTest.java b/java/MoneyTest.java new file mode 100644 index 0000000..0b0b67c --- /dev/null +++ b/java/MoneyTest.java @@ -0,0 +1,19 @@ +package money; + +import org.junit.jupiter.api.Test; + +import jdk.internal.jline.internal.TestAccessible; + +import static org.junit.jupiter.api.Assertions.*; + +/** + * MoneyTest + */ +public class MoneyTest { + @Test + public void testMultiplication() { + Dollar five = new Dollar(5); + five.times(2); + assertEquals(10, five.amount); + } +} \ No newline at end of file From 4665a11aa975da7d125418a3b2c3399c71f0f198 Mon Sep 17 00:00:00 2001 From: yoshiyuki-tsuchida Date: Thu, 2 Nov 2017 08:59:13 +0900 Subject: [PATCH 02/18] =?UTF-8?q?crystal=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + chapter01/.editorconfig | 7 +++++++ chapter01/.gitignore | 4 ++++ chapter01/.travis.yml | 1 + chapter01/LICENSE | 21 +++++++++++++++++++++ chapter01/README.md | 27 +++++++++++++++++++++++++++ chapter01/shard.yml | 13 +++++++++++++ chapter01/spec/chapter01_spec.cr | 9 +++++++++ chapter01/spec/spec_helper.cr | 2 ++ chapter01/src/chapter01.cr | 5 +++++ chapter01/src/chapter01/version.cr | 3 +++ java/MoneyTest.java | 19 ------------------- 12 files changed, 93 insertions(+), 19 deletions(-) create mode 100644 .gitignore create mode 100644 chapter01/.editorconfig create mode 100644 chapter01/.gitignore create mode 100644 chapter01/.travis.yml create mode 100644 chapter01/LICENSE create mode 100644 chapter01/README.md create mode 100644 chapter01/shard.yml create mode 100644 chapter01/spec/chapter01_spec.cr create mode 100644 chapter01/spec/spec_helper.cr create mode 100644 chapter01/src/chapter01.cr create mode 100644 chapter01/src/chapter01/version.cr delete mode 100644 java/MoneyTest.java diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e10e727 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.metadata/ diff --git a/chapter01/.editorconfig b/chapter01/.editorconfig new file mode 100644 index 0000000..8f0c87a --- /dev/null +++ b/chapter01/.editorconfig @@ -0,0 +1,7 @@ +[*.cr] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true diff --git a/chapter01/.gitignore b/chapter01/.gitignore new file mode 100644 index 0000000..0397cf7 --- /dev/null +++ b/chapter01/.gitignore @@ -0,0 +1,4 @@ +/doc/ +/lib/ +/bin/ +/.shards/ diff --git a/chapter01/.travis.yml b/chapter01/.travis.yml new file mode 100644 index 0000000..ffc7b6a --- /dev/null +++ b/chapter01/.travis.yml @@ -0,0 +1 @@ +language: crystal diff --git a/chapter01/LICENSE b/chapter01/LICENSE new file mode 100644 index 0000000..2fea624 --- /dev/null +++ b/chapter01/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017 yoshiyuki-tsuchida + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/chapter01/README.md b/chapter01/README.md new file mode 100644 index 0000000..781749e --- /dev/null +++ b/chapter01/README.md @@ -0,0 +1,27 @@ +# chapter01 + +TODO: Write a description here + +## Installation + +TODO: Write installation instructions here + +## Usage + +TODO: Write usage instructions here + +## Development + +TODO: Write development instructions here + +## Contributing + +1. Fork it ( https://github.com/[your-github-name]/chapter01/fork ) +2. Create your feature branch (git checkout -b my-new-feature) +3. Commit your changes (git commit -am 'Add some feature') +4. Push to the branch (git push origin my-new-feature) +5. Create a new Pull Request + +## Contributors + +- [[your-github-name]](https://github.com/[your-github-name]) yoshiyuki-tsuchida - creator, maintainer diff --git a/chapter01/shard.yml b/chapter01/shard.yml new file mode 100644 index 0000000..70f6cba --- /dev/null +++ b/chapter01/shard.yml @@ -0,0 +1,13 @@ +name: chapter01 +version: 0.1.0 + +authors: + - yoshiyuki-tsuchida + +targets: + chapter01: + main: src/chapter01.cr + +crystal: 0.23.1 + +license: MIT diff --git a/chapter01/spec/chapter01_spec.cr b/chapter01/spec/chapter01_spec.cr new file mode 100644 index 0000000..aeff196 --- /dev/null +++ b/chapter01/spec/chapter01_spec.cr @@ -0,0 +1,9 @@ +require "./spec_helper" + +describe Chapter01 do + # TODO: Write tests + + it "works" do + false.should eq(true) + end +end diff --git a/chapter01/spec/spec_helper.cr b/chapter01/spec/spec_helper.cr new file mode 100644 index 0000000..8f43b78 --- /dev/null +++ b/chapter01/spec/spec_helper.cr @@ -0,0 +1,2 @@ +require "spec" +require "../src/chapter01" diff --git a/chapter01/src/chapter01.cr b/chapter01/src/chapter01.cr new file mode 100644 index 0000000..f15a4fa --- /dev/null +++ b/chapter01/src/chapter01.cr @@ -0,0 +1,5 @@ +require "./chapter01/*" + +module Chapter01 + # TODO Put your code here +end diff --git a/chapter01/src/chapter01/version.cr b/chapter01/src/chapter01/version.cr new file mode 100644 index 0000000..05fe0ed --- /dev/null +++ b/chapter01/src/chapter01/version.cr @@ -0,0 +1,3 @@ +module Chapter01 + VERSION = "0.1.0" +end diff --git a/java/MoneyTest.java b/java/MoneyTest.java deleted file mode 100644 index 0b0b67c..0000000 --- a/java/MoneyTest.java +++ /dev/null @@ -1,19 +0,0 @@ -package money; - -import org.junit.jupiter.api.Test; - -import jdk.internal.jline.internal.TestAccessible; - -import static org.junit.jupiter.api.Assertions.*; - -/** - * MoneyTest - */ -public class MoneyTest { - @Test - public void testMultiplication() { - Dollar five = new Dollar(5); - five.times(2); - assertEquals(10, five.amount); - } -} \ No newline at end of file From 94fa53b00ac390754787512e42f9cdec5154ab37 Mon Sep 17 00:00:00 2001 From: yoshiyuki-tsuchida Date: Thu, 2 Nov 2017 13:25:22 +0900 Subject: [PATCH 03/18] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=82=92?= =?UTF-8?q?=E5=9B=9E=E3=81=9B=E3=82=8B=E3=81=A8=E3=81=93=E3=82=8D=E3=81=BE?= =?UTF-8?q?=E3=81=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 - chapter01/.gitignore | 1 + chapter01/.vscode/tasks.json | 30 ++++++++++++++++++++++++++ chapter01/spec/chapter01/money_spec.cr | 9 ++++++++ chapter01/src/chapter01/money.cr | 2 ++ 5 files changed, 42 insertions(+), 1 deletion(-) delete mode 100644 .gitignore create mode 100644 chapter01/.vscode/tasks.json create mode 100644 chapter01/spec/chapter01/money_spec.cr create mode 100644 chapter01/src/chapter01/money.cr diff --git a/.gitignore b/.gitignore deleted file mode 100644 index e10e727..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/.metadata/ diff --git a/chapter01/.gitignore b/chapter01/.gitignore index 0397cf7..dabb3a1 100644 --- a/chapter01/.gitignore +++ b/chapter01/.gitignore @@ -2,3 +2,4 @@ /lib/ /bin/ /.shards/ +!/.vscode/ \ No newline at end of file diff --git a/chapter01/.vscode/tasks.json b/chapter01/.vscode/tasks.json new file mode 100644 index 0000000..b46f9a3 --- /dev/null +++ b/chapter01/.vscode/tasks.json @@ -0,0 +1,30 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "taskName": "Crystal spec all", + "type": "shell", + "command": "sh -c 'cd ${workspaceRoot} && crystal spec'", + "group": { + "kind": "test", + "isDefault": true + }, + "presentation": { + "reveal": "always", + "panel": "new" + } + }, + { + "taskName": "Crystal spec current", + "type": "shell", + "command": "sh -c 'cd ${workspaceRoot} && crystal spec ${relativeFile}:${lineNumber}'", + "group": "test", + "presentation": { + "reveal": "always", + "panel": "new" + } + } + ] +} \ No newline at end of file diff --git a/chapter01/spec/chapter01/money_spec.cr b/chapter01/spec/chapter01/money_spec.cr new file mode 100644 index 0000000..daefa4f --- /dev/null +++ b/chapter01/spec/chapter01/money_spec.cr @@ -0,0 +1,9 @@ +require "../spec_helper" + +describe Chapter01 do + describe Money do + it "works" do + false.should eq(true) + end + end +end diff --git a/chapter01/src/chapter01/money.cr b/chapter01/src/chapter01/money.cr new file mode 100644 index 0000000..497cd19 --- /dev/null +++ b/chapter01/src/chapter01/money.cr @@ -0,0 +1,2 @@ +module Chapter01 +end From 3c80386e2ef18d7fe751eb1c63f7c0236c34736d Mon Sep 17 00:00:00 2001 From: yoshiyuki-tsuchida Date: Thu, 2 Nov 2017 18:04:28 +0900 Subject: [PATCH 04/18] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E3=81=AA=E3=83=86?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chapter01/spec/chapter01_spec.cr | 5 ----- 1 file changed, 5 deletions(-) diff --git a/chapter01/spec/chapter01_spec.cr b/chapter01/spec/chapter01_spec.cr index aeff196..72ddce5 100644 --- a/chapter01/spec/chapter01_spec.cr +++ b/chapter01/spec/chapter01_spec.cr @@ -1,9 +1,4 @@ require "./spec_helper" describe Chapter01 do - # TODO: Write tests - - it "works" do - false.should eq(true) - end end From 945a9f1fcc191585f9272611bbf67f8c319053f1 Mon Sep 17 00:00:00 2001 From: yoshiyuki-tsuchida Date: Thu, 2 Nov 2017 18:05:34 +0900 Subject: [PATCH 05/18] =?UTF-8?q?Money=20module=E3=81=AE=E3=83=86=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chapter01/spec/chapter01/money_spec.cr | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/chapter01/spec/chapter01/money_spec.cr b/chapter01/spec/chapter01/money_spec.cr index daefa4f..de428ce 100644 --- a/chapter01/spec/chapter01/money_spec.cr +++ b/chapter01/spec/chapter01/money_spec.cr @@ -1,9 +1,11 @@ require "../spec_helper" -describe Chapter01 do - describe Money do - it "works" do - false.should eq(true) +describe Chapter01::Money do + describe "multiplication" do + it "$5 * 2 = 10 になること" do + five = Dollar.new(5) + five.times(2) + five.amount.should eq 10 end end end From 4fbf6ad32ecc306a87abd932b5df25900155963d Mon Sep 17 00:00:00 2001 From: yoshiyuki-tsuchida Date: Thu, 2 Nov 2017 18:29:34 +0900 Subject: [PATCH 06/18] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E3=81=AAmodule?= =?UTF-8?q?=E3=82=92=E5=89=8A=E9=99=A4=E3=81=97=E3=81=A6=E7=B6=BA=E9=BA=97?= =?UTF-8?q?=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chapter01/spec/chapter01_spec.cr | 4 ---- chapter01/spec/{chapter01 => }/money_spec.cr | 4 ++-- chapter01/spec/spec_helper.cr | 2 +- chapter01/src/chapter01.cr | 5 ----- chapter01/src/chapter01/money.cr | 2 -- chapter01/src/chapter01/version.cr | 3 --- chapter01/src/money.cr | 4 ++++ chapter01/src/money/dollar.cr | 4 ++++ 8 files changed, 11 insertions(+), 17 deletions(-) delete mode 100644 chapter01/spec/chapter01_spec.cr rename chapter01/spec/{chapter01 => }/money_spec.cr (75%) delete mode 100644 chapter01/src/chapter01.cr delete mode 100644 chapter01/src/chapter01/money.cr delete mode 100644 chapter01/src/chapter01/version.cr create mode 100644 chapter01/src/money.cr create mode 100644 chapter01/src/money/dollar.cr diff --git a/chapter01/spec/chapter01_spec.cr b/chapter01/spec/chapter01_spec.cr deleted file mode 100644 index 72ddce5..0000000 --- a/chapter01/spec/chapter01_spec.cr +++ /dev/null @@ -1,4 +0,0 @@ -require "./spec_helper" - -describe Chapter01 do -end diff --git a/chapter01/spec/chapter01/money_spec.cr b/chapter01/spec/money_spec.cr similarity index 75% rename from chapter01/spec/chapter01/money_spec.cr rename to chapter01/spec/money_spec.cr index de428ce..f66f755 100644 --- a/chapter01/spec/chapter01/money_spec.cr +++ b/chapter01/spec/money_spec.cr @@ -1,6 +1,6 @@ -require "../spec_helper" +require "./spec_helper" -describe Chapter01::Money do +describe Money do describe "multiplication" do it "$5 * 2 = 10 になること" do five = Dollar.new(5) diff --git a/chapter01/spec/spec_helper.cr b/chapter01/spec/spec_helper.cr index 8f43b78..a9a3f1b 100644 --- a/chapter01/spec/spec_helper.cr +++ b/chapter01/spec/spec_helper.cr @@ -1,2 +1,2 @@ require "spec" -require "../src/chapter01" +require "../src/money" diff --git a/chapter01/src/chapter01.cr b/chapter01/src/chapter01.cr deleted file mode 100644 index f15a4fa..0000000 --- a/chapter01/src/chapter01.cr +++ /dev/null @@ -1,5 +0,0 @@ -require "./chapter01/*" - -module Chapter01 - # TODO Put your code here -end diff --git a/chapter01/src/chapter01/money.cr b/chapter01/src/chapter01/money.cr deleted file mode 100644 index 497cd19..0000000 --- a/chapter01/src/chapter01/money.cr +++ /dev/null @@ -1,2 +0,0 @@ -module Chapter01 -end diff --git a/chapter01/src/chapter01/version.cr b/chapter01/src/chapter01/version.cr deleted file mode 100644 index 05fe0ed..0000000 --- a/chapter01/src/chapter01/version.cr +++ /dev/null @@ -1,3 +0,0 @@ -module Chapter01 - VERSION = "0.1.0" -end diff --git a/chapter01/src/money.cr b/chapter01/src/money.cr new file mode 100644 index 0000000..0f22eed --- /dev/null +++ b/chapter01/src/money.cr @@ -0,0 +1,4 @@ +require "./money/*" + +module Money +end diff --git a/chapter01/src/money/dollar.cr b/chapter01/src/money/dollar.cr new file mode 100644 index 0000000..d8e8484 --- /dev/null +++ b/chapter01/src/money/dollar.cr @@ -0,0 +1,4 @@ +module Money + class Dollar + end +end From 5441c16d8c412bbfd0b937f9880a766ac1d8ea63 Mon Sep 17 00:00:00 2001 From: yoshiyuki-tsuchida Date: Thu, 2 Nov 2017 18:31:12 +0900 Subject: [PATCH 07/18] =?UTF-8?q?Dollar=E3=82=AF=E3=83=A9=E3=82=B9?= =?UTF-8?q?=E3=81=8C=E3=81=BF=E3=81=A4=E3=81=8B=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E3=81=AA=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chapter01/spec/money_spec.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter01/spec/money_spec.cr b/chapter01/spec/money_spec.cr index f66f755..13bae56 100644 --- a/chapter01/spec/money_spec.cr +++ b/chapter01/spec/money_spec.cr @@ -3,7 +3,7 @@ require "./spec_helper" describe Money do describe "multiplication" do it "$5 * 2 = 10 になること" do - five = Dollar.new(5) + five = Money::Dollar.new(5) five.times(2) five.amount.should eq 10 end From f133c2338fedeab30cd8420978e1789fdf46776f Mon Sep 17 00:00:00 2001 From: yoshiyuki-tsuchida Date: Thu, 2 Nov 2017 18:32:39 +0900 Subject: [PATCH 08/18] =?UTF-8?q?initialize=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chapter01/src/money/dollar.cr | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chapter01/src/money/dollar.cr b/chapter01/src/money/dollar.cr index d8e8484..3ea2d3b 100644 --- a/chapter01/src/money/dollar.cr +++ b/chapter01/src/money/dollar.cr @@ -1,4 +1,6 @@ module Money class Dollar + def initialize(amount) + end end end From 858e929147460540fe6546220cbcc3caed0c7e92 Mon Sep 17 00:00:00 2001 From: yoshiyuki-tsuchida Date: Thu, 2 Nov 2017 18:34:46 +0900 Subject: [PATCH 09/18] =?UTF-8?q?times=E3=83=A1=E3=82=BD=E3=83=83=E3=83=89?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chapter01/src/money/dollar.cr | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chapter01/src/money/dollar.cr b/chapter01/src/money/dollar.cr index 3ea2d3b..8bb1802 100644 --- a/chapter01/src/money/dollar.cr +++ b/chapter01/src/money/dollar.cr @@ -2,5 +2,8 @@ module Money class Dollar def initialize(amount) end + + def times(multiplier) + end end end From fae6ba5a5b5910b37d6ec3788cee37e04cc16d8a Mon Sep 17 00:00:00 2001 From: yoshiyuki-tsuchida Date: Thu, 2 Nov 2017 18:36:21 +0900 Subject: [PATCH 10/18] =?UTF-8?q?amount=E3=83=97=E3=83=AD=E3=83=91?= =?UTF-8?q?=E3=83=86=E3=82=A3=E3=81=AE=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chapter01/src/money/dollar.cr | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chapter01/src/money/dollar.cr b/chapter01/src/money/dollar.cr index 8bb1802..1e287a3 100644 --- a/chapter01/src/money/dollar.cr +++ b/chapter01/src/money/dollar.cr @@ -1,6 +1,8 @@ module Money class Dollar - def initialize(amount) + property amount + + def initialize(@amount) end def times(multiplier) From 2b18d081f113a2dc1274845251ae4066f943e800 Mon Sep 17 00:00:00 2001 From: yoshiyuki-tsuchida Date: Thu, 2 Nov 2017 18:38:44 +0900 Subject: [PATCH 11/18] =?UTF-8?q?=E5=9E=8B=E3=82=92=E8=BF=BD=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chapter01/src/money/dollar.cr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chapter01/src/money/dollar.cr b/chapter01/src/money/dollar.cr index 1e287a3..8c5a10d 100644 --- a/chapter01/src/money/dollar.cr +++ b/chapter01/src/money/dollar.cr @@ -1,11 +1,11 @@ module Money class Dollar - property amount + property amount : Int32 - def initialize(@amount) + def initialize(@amount : Int32) end - def times(multiplier) + def times(multiplier : Int32) end end end From 5865622514e9ce1caf1780c12f4192ae6fdded42 Mon Sep 17 00:00:00 2001 From: yoshiyuki-tsuchida Date: Thu, 2 Nov 2017 21:58:31 +0900 Subject: [PATCH 12/18] =?UTF-8?q?Green=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chapter01/src/money/dollar.cr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chapter01/src/money/dollar.cr b/chapter01/src/money/dollar.cr index 8c5a10d..cae3d77 100644 --- a/chapter01/src/money/dollar.cr +++ b/chapter01/src/money/dollar.cr @@ -1,8 +1,8 @@ module Money class Dollar - property amount : Int32 + property amount : Int32 = 10 - def initialize(@amount : Int32) + def initialize(amount : Int32) end def times(multiplier : Int32) From 6da5b0abb5cdb26abe7d4da3c81a41390d5796c5 Mon Sep 17 00:00:00 2001 From: yoshiyuki-tsuchida Date: Thu, 2 Nov 2017 22:24:22 +0900 Subject: [PATCH 13/18] =?UTF-8?q?amount=E3=81=AE=E9=87=8D=E8=A4=87?= =?UTF-8?q?=E6=8E=92=E9=99=A4=E3=82=92=E5=A7=8B=E3=82=81=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chapter01/src/money/dollar.cr | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chapter01/src/money/dollar.cr b/chapter01/src/money/dollar.cr index cae3d77..04ff0c6 100644 --- a/chapter01/src/money/dollar.cr +++ b/chapter01/src/money/dollar.cr @@ -1,11 +1,12 @@ module Money class Dollar - property amount : Int32 = 10 + property amount : Int32 - def initialize(amount : Int32) + def initialize(@amount : Int32) end def times(multiplier : Int32) + @amount = 5 * 2 end end end From daa24a3b533ca4f949b7f4cebf2df201a1b92132 Mon Sep 17 00:00:00 2001 From: at-grandpa Date: Thu, 2 Nov 2017 23:12:16 +0900 Subject: [PATCH 14/18] =?UTF-8?q?'5'=E3=81=ABinitialize=E3=81=A7=E4=BB=A3?= =?UTF-8?q?=E5=85=A5=E3=81=97=E3=81=9F@amount=E3=82=92=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chapter01/src/money/dollar.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter01/src/money/dollar.cr b/chapter01/src/money/dollar.cr index 04ff0c6..fcd5499 100644 --- a/chapter01/src/money/dollar.cr +++ b/chapter01/src/money/dollar.cr @@ -6,7 +6,7 @@ module Money end def times(multiplier : Int32) - @amount = 5 * 2 + @amount = @amount * 2 end end end From 1da5e467d9a455bf0397e9c2ac0b6a6d6084a93c Mon Sep 17 00:00:00 2001 From: at-grandpa Date: Thu, 2 Nov 2017 23:14:53 +0900 Subject: [PATCH 15/18] =?UTF-8?q?'2'=E3=81=8C=E9=87=8D=E8=A4=87=E3=81=97?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=81=A7=E3=80=81multiplie?= =?UTF-8?q?r=E3=81=AB=E5=A4=89=E3=81=88=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chapter01/src/money/dollar.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter01/src/money/dollar.cr b/chapter01/src/money/dollar.cr index fcd5499..e5fab06 100644 --- a/chapter01/src/money/dollar.cr +++ b/chapter01/src/money/dollar.cr @@ -6,7 +6,7 @@ module Money end def times(multiplier : Int32) - @amount = @amount * 2 + @amount = @amount * multiplier end end end From e7585e8ee79affe67fe7487973972c935f116f4e Mon Sep 17 00:00:00 2001 From: at-grandpa Date: Thu, 2 Nov 2017 23:17:50 +0900 Subject: [PATCH 16/18] =?UTF-8?q?@amount=E3=81=AE=E9=87=8D=E8=A4=87?= =?UTF-8?q?=E6=8E=92=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chapter01/src/money/dollar.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter01/src/money/dollar.cr b/chapter01/src/money/dollar.cr index e5fab06..1f5b95a 100644 --- a/chapter01/src/money/dollar.cr +++ b/chapter01/src/money/dollar.cr @@ -6,7 +6,7 @@ module Money end def times(multiplier : Int32) - @amount = @amount * multiplier + @amount *= multiplier end end end From c02e985b23645c8c174e8bfcb6a424e81f980107 Mon Sep 17 00:00:00 2001 From: at-grandpa Date: Thu, 2 Nov 2017 23:34:14 +0900 Subject: [PATCH 17/18] =?UTF-8?q?=E3=83=87=E3=82=A3=E3=83=AC=E3=82=AF?= =?UTF-8?q?=E3=83=88=E3=83=AA=E5=90=8D=E3=81=AA=E3=81=A9=E3=81=AE=E6=95=B4?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- {chapter01 => part01}/.editorconfig | 0 {chapter01 => part01}/.gitignore | 0 {chapter01 => part01}/.travis.yml | 0 {chapter01 => part01}/.vscode/tasks.json | 0 {chapter01 => part01}/LICENSE | 0 {chapter01 => part01}/README.md | 0 {chapter01 => part01}/shard.yml | 0 {chapter01 => part01}/spec/money_spec.cr | 0 {chapter01 => part01}/spec/spec_helper.cr | 0 {chapter01 => part01}/src/money.cr | 0 {chapter01 => part01}/src/money/dollar.cr | 0 11 files changed, 0 insertions(+), 0 deletions(-) rename {chapter01 => part01}/.editorconfig (100%) rename {chapter01 => part01}/.gitignore (100%) rename {chapter01 => part01}/.travis.yml (100%) rename {chapter01 => part01}/.vscode/tasks.json (100%) rename {chapter01 => part01}/LICENSE (100%) rename {chapter01 => part01}/README.md (100%) rename {chapter01 => part01}/shard.yml (100%) rename {chapter01 => part01}/spec/money_spec.cr (100%) rename {chapter01 => part01}/spec/spec_helper.cr (100%) rename {chapter01 => part01}/src/money.cr (100%) rename {chapter01 => part01}/src/money/dollar.cr (100%) diff --git a/chapter01/.editorconfig b/part01/.editorconfig similarity index 100% rename from chapter01/.editorconfig rename to part01/.editorconfig diff --git a/chapter01/.gitignore b/part01/.gitignore similarity index 100% rename from chapter01/.gitignore rename to part01/.gitignore diff --git a/chapter01/.travis.yml b/part01/.travis.yml similarity index 100% rename from chapter01/.travis.yml rename to part01/.travis.yml diff --git a/chapter01/.vscode/tasks.json b/part01/.vscode/tasks.json similarity index 100% rename from chapter01/.vscode/tasks.json rename to part01/.vscode/tasks.json diff --git a/chapter01/LICENSE b/part01/LICENSE similarity index 100% rename from chapter01/LICENSE rename to part01/LICENSE diff --git a/chapter01/README.md b/part01/README.md similarity index 100% rename from chapter01/README.md rename to part01/README.md diff --git a/chapter01/shard.yml b/part01/shard.yml similarity index 100% rename from chapter01/shard.yml rename to part01/shard.yml diff --git a/chapter01/spec/money_spec.cr b/part01/spec/money_spec.cr similarity index 100% rename from chapter01/spec/money_spec.cr rename to part01/spec/money_spec.cr diff --git a/chapter01/spec/spec_helper.cr b/part01/spec/spec_helper.cr similarity index 100% rename from chapter01/spec/spec_helper.cr rename to part01/spec/spec_helper.cr diff --git a/chapter01/src/money.cr b/part01/src/money.cr similarity index 100% rename from chapter01/src/money.cr rename to part01/src/money.cr diff --git a/chapter01/src/money/dollar.cr b/part01/src/money/dollar.cr similarity index 100% rename from chapter01/src/money/dollar.cr rename to part01/src/money/dollar.cr From ae91085c3b57d22639119bdb0728cdcb82195550 Mon Sep 17 00:00:00 2001 From: at-grandpa Date: Thu, 2 Nov 2017 23:34:29 +0900 Subject: [PATCH 18/18] fix --- part01/LICENSE | 2 +- part01/README.md | 28 +--------------------------- part01/shard.yml | 8 ++++---- 3 files changed, 6 insertions(+), 32 deletions(-) diff --git a/part01/LICENSE b/part01/LICENSE index 2fea624..b163f5d 100644 --- a/part01/LICENSE +++ b/part01/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2017 yoshiyuki-tsuchida +Copyright (c) 2017 at-grandpa Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/part01/README.md b/part01/README.md index 781749e..72fcbf6 100644 --- a/part01/README.md +++ b/part01/README.md @@ -1,27 +1 @@ -# chapter01 - -TODO: Write a description here - -## Installation - -TODO: Write installation instructions here - -## Usage - -TODO: Write usage instructions here - -## Development - -TODO: Write development instructions here - -## Contributing - -1. Fork it ( https://github.com/[your-github-name]/chapter01/fork ) -2. Create your feature branch (git checkout -b my-new-feature) -3. Commit your changes (git commit -am 'Add some feature') -4. Push to the branch (git push origin my-new-feature) -5. Create a new Pull Request - -## Contributors - -- [[your-github-name]](https://github.com/[your-github-name]) yoshiyuki-tsuchida - creator, maintainer +# 第01章 仮実装 \ No newline at end of file diff --git a/part01/shard.yml b/part01/shard.yml index 70f6cba..8b17150 100644 --- a/part01/shard.yml +++ b/part01/shard.yml @@ -1,12 +1,12 @@ -name: chapter01 +name: part01 version: 0.1.0 authors: - - yoshiyuki-tsuchida + - at-grandpa targets: - chapter01: - main: src/chapter01.cr + part01: + main: src/money.cr crystal: 0.23.1