aaaa_aaaa 0.0.1 → 0.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2f5a25f18b08d633e3e851281af6de0540c8a5c7
4
- data.tar.gz: b20bc3214de49352a6aa8d87bad65852425bed59
3
+ metadata.gz: 62b1d38308f52d72dad9cddd75ddced11f7730ab
4
+ data.tar.gz: b846b4a622282b6a4d403d46b77b4f71375ba12b
5
5
  SHA512:
6
- metadata.gz: e37861a12695f01806b6b1100c0b61622290c55b38939b0ce894fc3b80b1bcf21e41aef75a89b1fb156cc6846afacb66fd59d51513400ff178ea44ab360c4733
7
- data.tar.gz: 9f1f527ef58946925b3901c91c45251e35cc879b093f509c19f5b75467467031f7e62e6fd4aebb95e6f9fdc78db0454228f9ffdca1b332fc006335b1b1f56c20
6
+ metadata.gz: b7d9372f905dc7ed9b3bd2e7318c99aac5ac75a1c28cc4dae8aa269963565b1ecdf2357046533626ca7d16e340cb6222cccd6f16050966c1330d2c58dbb1762f
7
+ data.tar.gz: 5b8832d12e05430859fd642765422eab703387e7d5e4c210f41a89823ff097720f0b6d2948d500385e3391cfb6896e8b1fdfcaf533ca8d24f697108b415192ef
@@ -2,13 +2,17 @@
2
2
  require "aaaa_aaaa/version"
3
3
 
4
4
  module AaaaAaaa
5
+
6
+ class NotUseAaaaAaaaError < StandardError; end
7
+
5
8
  class Text
6
- def initialize(str, step=nil, prefix="")
9
+ def initialize(str, step=nil, prefix="", production: false)
7
10
  @value = ""
8
11
 
9
12
  @str = str
10
13
  @step = step
11
14
  @prefix = prefix
15
+ @production = production
12
16
  if @step
13
17
  @nextstep = step
14
18
  end
@@ -43,7 +47,6 @@ module AaaaAaaa
43
47
  end
44
48
 
45
49
  def *(mul)
46
-
47
50
  if @step
48
51
  @iter = mul / @step
49
52
  @iter.times do |x|
@@ -57,7 +60,11 @@ module AaaaAaaa
57
60
  end
58
61
 
59
62
  def to_s
60
- @value
63
+ if @production
64
+ raise NotUseAaaaAaaaError, "set procution mode. you must remove AaaaAaaa."
65
+ else
66
+ @value
67
+ end
61
68
  end
62
69
  end
63
70
  end
@@ -1,3 +1,3 @@
1
1
  module AaaaAaaa
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -44,5 +44,15 @@ describe AaaaAaaa do
44
44
  expect((AaaaAaaa::Text.new("あ", step=10, prefix="名前") * 20).to_s)
45
45
  .to eq("名前" + ("あ" * 6) + "10" + "名前" + ("あ" * 6) + "20")
46
46
  end
47
+
48
+ it 'production mode is raise error' do
49
+ raise_error = false
50
+ begin
51
+ (AaaaAaaa::Text.new("あ", production: true) * 20).to_s
52
+ rescue AaaaAaaa::NotUseAaaaAaaaError
53
+ raise_error = true
54
+ end
55
+ expect(raise_error).to be true
56
+ end
47
57
  end
48
58
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aaaa_aaaa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - esehara shigeo