rpxem 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +26 -12
- data/lib/rpxem/interpreter.rb +2 -2
- data/lib/rpxem/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -10,15 +10,21 @@ enables you to create programs in 0-byte files.
|
|
10
10
|
|
11
11
|
Add this line to your application's Gemfile:
|
12
12
|
|
13
|
-
|
13
|
+
```ruby
|
14
|
+
gem 'rpxem'
|
15
|
+
```
|
14
16
|
|
15
17
|
And then execute:
|
16
18
|
|
17
|
-
|
19
|
+
```bash
|
20
|
+
$ bundle
|
21
|
+
```
|
18
22
|
|
19
23
|
Or install it yourself as:
|
20
24
|
|
21
|
-
|
25
|
+
```bash
|
26
|
+
$ gem install rpxem
|
27
|
+
```
|
22
28
|
|
23
29
|
## Usage
|
24
30
|
|
@@ -26,26 +32,34 @@ Or install it yourself as:
|
|
26
32
|
|
27
33
|
Require `RPxem`:
|
28
34
|
|
29
|
-
|
35
|
+
```ruby
|
36
|
+
require 'rpxem'
|
37
|
+
```
|
30
38
|
|
31
39
|
Open and execute your Pxem **file**:
|
32
40
|
|
33
|
-
|
34
|
-
|
41
|
+
```ruby
|
42
|
+
path_to_pxem_file = '~/Hello, world!.pxe'
|
43
|
+
RPxem.open(path_to_pxem_file) #=> Hello, world!
|
44
|
+
```
|
35
45
|
|
36
46
|
Execute your Pxem **code**:
|
37
47
|
|
38
|
-
|
39
|
-
|
40
|
-
|
48
|
+
```ruby
|
49
|
+
file_name = 'world!.fHello,.pxe'
|
50
|
+
file_cont = ' Pxem '
|
51
|
+
RPxem.run(file_name, file_cont) #=> Hello, Pxem world!
|
52
|
+
```
|
41
53
|
|
42
54
|
### Using from CLI
|
43
55
|
|
44
56
|
This program also runs as a command-line Pxem interpreter called `rpxem`:
|
45
57
|
|
46
|
-
|
47
|
-
|
48
|
-
|
58
|
+
```bash
|
59
|
+
$ touch "Hello, world!.pxe"
|
60
|
+
$ rpxem "Hello, world!.pxe"
|
61
|
+
Hello, world!
|
62
|
+
```
|
49
63
|
|
50
64
|
## Contributing
|
51
65
|
|
data/lib/rpxem/interpreter.rb
CHANGED
@@ -168,7 +168,7 @@ module RPxem
|
|
168
168
|
count += 1
|
169
169
|
elsif ('a' == @filename[@cursor+1].chr.downcase)
|
170
170
|
count -= 1
|
171
|
-
|
171
|
+
end
|
172
172
|
end
|
173
173
|
end
|
174
174
|
@cursor += 1
|
@@ -184,7 +184,7 @@ module RPxem
|
|
184
184
|
count += 1
|
185
185
|
elsif ('a' == @filename[@cursor+1].chr.downcase)
|
186
186
|
count -= 1
|
187
|
-
|
187
|
+
end
|
188
188
|
end
|
189
189
|
@cursor -= 1
|
190
190
|
end
|
data/lib/rpxem/version.rb
CHANGED