masu 0.1.0 → 0.2.0

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
  SHA256:
3
- metadata.gz: acedcbb5dd65566741365c87e0c23ce6521cfbad5e057671856f7cb35722738f
4
- data.tar.gz: b79244c8b90a92f9e4aca3b3014b1cff20af821efd91f53fa0f5a0951ab67388
3
+ metadata.gz: 5208c0ef9bd168d83d06f7ff4a34986ec6dce20929bc9f009120bf4a2af8ecc4
4
+ data.tar.gz: 52d19fa010b55d8ee2863e62adbec3b10ba12e4d829e256a47352e2bf4fe4180
5
5
  SHA512:
6
- metadata.gz: e967bc3ef683802743850c78e7fd91f040103afe02a318803c393d195c7f0eafcc91865bf7205065f93a0aa64831c4b7aaf1c3f0afc2c85acb6428a3375cbe75
7
- data.tar.gz: be083af47722e0749d00e442efe5a6da93369cc4b2b9688fc309b48be82a3651b305a62daf6c14d649ac5732842200e828792043f1c62c44b1095a9441d676f9
6
+ metadata.gz: af1af30b482ffc89dacb98a28d2cb2a3ef863a5a42418fbb49945709e8bc1b08fa585f5652161d1ece0cc588b16f2e0a3a71b26608da363219ffb3694a6824b5
7
+ data.tar.gz: 8f814c27657b9dec8cfc14116b4edeeed0ffaa76dc0621de19db5871f1eb0d9fdde20f81e05c357b21260eb30f1dfe52ed3e50225e3659d16965897f83db3ecf
data/.coveralls.yml ADDED
@@ -0,0 +1 @@
1
+ service_name: travis-pro
data/CHANGELOG.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # Change Log
2
2
 
3
+ ## [v0.1.0](https://github.com/akinov/masu/tree/v0.1.0) (2019-09-15)
3
4
 
4
5
 
5
6
  \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
data/Gemfile CHANGED
@@ -2,3 +2,5 @@ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in masu.gemspec
4
4
  gemspec
5
+
6
+ gem 'coveralls', require: false
data/Gemfile.lock CHANGED
@@ -6,7 +6,15 @@ PATH
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
+ coveralls (0.8.23)
10
+ json (>= 1.8, < 3)
11
+ simplecov (~> 0.16.1)
12
+ term-ansicolor (~> 1.3)
13
+ thor (>= 0.19.4, < 2.0)
14
+ tins (~> 1.6)
9
15
  diff-lcs (1.3)
16
+ docile (1.3.2)
17
+ json (2.2.0)
10
18
  rake (10.5.0)
11
19
  rspec (3.8.0)
12
20
  rspec-core (~> 3.8.0)
@@ -21,12 +29,22 @@ GEM
21
29
  diff-lcs (>= 1.2.0, < 2.0)
22
30
  rspec-support (~> 3.8.0)
23
31
  rspec-support (3.8.2)
32
+ simplecov (0.16.1)
33
+ docile (~> 1.1)
34
+ json (>= 1.8, < 3)
35
+ simplecov-html (~> 0.10.0)
36
+ simplecov-html (0.10.2)
37
+ term-ansicolor (1.7.1)
38
+ tins (~> 1.0)
39
+ thor (0.20.3)
40
+ tins (1.21.1)
24
41
 
25
42
  PLATFORMS
26
43
  ruby
27
44
 
28
45
  DEPENDENCIES
29
46
  bundler (~> 2.0)
47
+ coveralls
30
48
  masu!
31
49
  rake (~> 10.0)
32
50
  rspec (~> 3.0)
data/README.md CHANGED
@@ -1,8 +1,12 @@
1
+ [![Gem Version](https://badge.fury.io/rb/masu.svg)](https://rubygems.org/gems/ketsuban)
2
+ [![Coverage Status](https://coveralls.io/repos/github/akinov/masu/badge.svg?branch=master)](https://coveralls.io/github/akinov/masu?branch=master)
3
+
4
+
1
5
  # Masu
2
6
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/masu`. To experiment with that code, run `bin/console` for an interactive prompt.
7
+ Enclose text in a frame!
4
8
 
5
- TODO: Delete this and the text above, and describe your gem
9
+ Provide a great Masu for your string.
6
10
 
7
11
  ## Installation
8
12
 
@@ -22,6 +26,8 @@ Or install it yourself as:
22
26
 
23
27
  ## Usage
24
28
 
29
+ ### Default usage
30
+
25
31
  ```ruby
26
32
 
27
33
  irb:001:0> 'hoge'.to_masu
@@ -35,6 +41,16 @@ irb:002:0> puts 'hoge'.to_masu
35
41
 
36
42
  ```
37
43
 
44
+ ### Additional Masu type
45
+
46
+ ```ruby
47
+ irb:001:0> puts '突然の死'.to_masu :totsuzen
48
+ _人人人人_
49
+ > 突然の死 <
50
+  ̄Y^Y^Y^Y ̄
51
+ => nil
52
+ ```
53
+
38
54
  ## Development
39
55
 
40
56
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
data/lib/masu/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Masu
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
data/lib/masu.rb CHANGED
@@ -3,13 +3,33 @@ require 'masu/version'
3
3
  module Masu
4
4
  class Error < StandardError; end
5
5
 
6
- def to_masu
6
+ def to_masu(type = :default)
7
+ method_name = "to_masu_#{type}"
8
+
9
+ unless self.class.private_method_defined? method_name
10
+ raise ArgumentError.new, "Undefined Masu type #{type}."
11
+ end
12
+
13
+ send method_name
14
+ end
15
+
16
+ private
17
+
18
+ def to_masu_default
7
19
  <<~EOS
8
20
  ┌#{'-' * length}┐
9
21
  │#{self}│
10
22
  └#{'-' * length}┘
11
23
  EOS
12
24
  end
25
+
26
+ def to_masu_totsuzen
27
+ <<~EOS
28
+ _#{'人' * length}_
29
+ > #{self} <
30
+  ̄#{('Y^' * length).delete_suffix('^')} ̄
31
+ EOS
32
+ end
13
33
  end
14
34
 
15
35
  class String
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: masu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - akinov
@@ -59,6 +59,7 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
+ - ".coveralls.yml"
62
63
  - ".gitignore"
63
64
  - ".rspec"
64
65
  - ".travis.yml"