s_calc 0.1.4 → 0.1.5
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 +4 -4
- data/README.md +4 -1
- data/lib/calc/calc.rb +4 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2300d4c867d9123b59ab6558928efe93915f5bbddb008e717b092aeecd2f628b
|
4
|
+
data.tar.gz: e0007120fdb41d3d95b63b191a5670c2b9830a41eb6eae0c34ea53dc8d136718
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb871839999560ae6ccbb102ac551925c87b06f7165ab0cef1e932af4d3fb466d5d6dde90d6111061ed599fe2f8c432c08dd92ec48434ae64db1a5b518ec300b
|
7
|
+
data.tar.gz: f5026ec9bd05688768db0b76bec58eb5dda60cadda9d447757f421d6347048609b163bf4809d2c6534580bbf541f898da70ce2016a8c9b9ed64f005c41e52d7a
|
data/README.md
CHANGED
@@ -113,6 +113,8 @@ You can use Calc as a library in your Ruby program.
|
|
113
113
|
- Create an instance of the class `Calc`. Let the instance name be 'c'.
|
114
114
|
- Call `c.run(s)` where `s` is a string of an expression. Then it returns the value of the expression.
|
115
115
|
For example, `c.run("1+2")` returns 3.0.
|
116
|
+
- The instance method `parse` on the class `Calc` is an alias of `run`.
|
117
|
+
So, you can use `parse` instead of `run`.
|
116
118
|
|
117
119
|
The following is a sample code.
|
118
120
|
|
@@ -235,7 +237,8 @@ CalcをライブラリとしてRubyプログラムの中で使うことができ
|
|
235
237
|
- まず、'calc'をrequireする
|
236
238
|
- `Calc`クラスのインスタンスを生成する。仮にその名前を`c`とする
|
237
239
|
- 数式を表す文字列を`s`とすると、`c.run(s)`はその数式を計算した値を返す
|
238
|
-
例えば、`c.run("1+2")`は3.0
|
240
|
+
例えば、`c.run("1+2")`は3.0を返す
|
241
|
+
- インスタンス・メソッド`run`のエイリアス`parse`を代わりに使うことができる
|
239
242
|
|
240
243
|
以下に簡単なサンプルコードを示します。
|
241
244
|
|
data/lib/calc/calc.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: s_calc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toshio Sekiya
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: CUI Scientific calculator
|
14
14
|
email: lxboyjp@gmail.com
|
@@ -41,7 +41,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '0'
|
43
43
|
requirements: []
|
44
|
-
rubygems_version: 3.4.
|
44
|
+
rubygems_version: 3.4.21
|
45
45
|
signing_key:
|
46
46
|
specification_version: 4
|
47
47
|
summary: Scientific Calculator
|