maths 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +22 -0
- data/bin/maths +16 -2
- data/lib/maths/version.rb +1 -1
- data/lib/maths.rb +1 -0
- data/maths.gemspec +1 -0
- metadata +19 -2
data/README.md
CHANGED
@@ -74,6 +74,28 @@ maths> exit
|
|
74
74
|
|
75
75
|
Variables persist in maths between runs of the command, so feel free to exit and reopen maths all you want - those variables will stick around between executions.
|
76
76
|
|
77
|
+
If you'd like to list all defined variables, use the `vars` command:
|
78
|
+
|
79
|
+
```
|
80
|
+
maths> vars
|
81
|
+
|
82
|
+
Defined Variables:
|
83
|
+
s: 10
|
84
|
+
$: 12345
|
85
|
+
z: 25
|
86
|
+
y: 25
|
87
|
+
x: 0.4
|
88
|
+
```
|
89
|
+
|
90
|
+
You can also copy your last result to your system clipboard with the `copy` command:
|
91
|
+
|
92
|
+
```
|
93
|
+
maths> 5 + 5
|
94
|
+
= 10
|
95
|
+
maths> copy
|
96
|
+
Copied 10 to your system clipboard.
|
97
|
+
```
|
98
|
+
|
77
99
|
## Tell Us More, Bob
|
78
100
|
|
79
101
|
Maths can do all sorts of great math!
|
data/bin/maths
CHANGED
@@ -18,9 +18,23 @@ end
|
|
18
18
|
|
19
19
|
prompt = "maths> "
|
20
20
|
while command = Readline.readline(prompt, true)
|
21
|
-
|
21
|
+
command.strip!
|
22
22
|
|
23
|
-
if
|
23
|
+
if /exit/i =~ command
|
24
|
+
break
|
25
|
+
elsif /copy/i =~ command
|
26
|
+
begin
|
27
|
+
if Clipboard.implementation
|
28
|
+
Clipboard.copy(Maths::Formatter.format(Maths::Brain.lookup("$")))
|
29
|
+
puts "Copied #{Clipboard.paste} to your system clipboard."
|
30
|
+
puts
|
31
|
+
end
|
32
|
+
rescue
|
33
|
+
puts "Sorry, but clipboard support isn't enabled on your system."
|
34
|
+
puts
|
35
|
+
end
|
36
|
+
|
37
|
+
elsif command == "vars" || command == "variables"
|
24
38
|
puts
|
25
39
|
puts "Defined Variables:"
|
26
40
|
Maths::Brain.read.each do |key, value|
|
data/lib/maths/version.rb
CHANGED
data/lib/maths.rb
CHANGED
data/maths.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maths
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json_pure
|
@@ -27,6 +27,22 @@ dependencies:
|
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: 1.7.6
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: clipboard
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 1.0.1
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.0.1
|
30
46
|
description: Your friendly neighborhood console calculator
|
31
47
|
email:
|
32
48
|
- alan@commondream.net
|
@@ -75,3 +91,4 @@ signing_key:
|
|
75
91
|
specification_version: 3
|
76
92
|
summary: Your friendly neighborhood console calculator
|
77
93
|
test_files: []
|
94
|
+
has_rdoc:
|