cuby 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -14,32 +14,31 @@ A tiny C-like language built on top of Ruby, in less than 20 lines of code.
14
14
 
15
15
  ### Interactive Shell
16
16
 
17
- Cuby comes with an interactive shell called `icb` (just like Ruby's `irb`) which you ran run for the command line.
17
+ Cuby comes with an interactive shell called `icb` (just like Ruby's `irb`) which you can run from the command line.
18
18
 
19
19
  The shell is currently considered to be in an Alpha state, as it doesn't fully work with all the quirks of Cuby.
20
20
 
21
21
  ## Examples
22
22
 
23
- Basic, `example1.cb`:
23
+ Basic, example1.cb:
24
24
 
25
25
  // This is an example of the Cuby Language
26
26
  main {
27
27
  printf "Hello world\n"
28
28
  }
29
29
 
30
- Advanced(ish), `example4.cb`:
30
+ Advanced(ish), example4.cb:
31
31
 
32
32
  // This is another example of the Cuby Language
33
33
  include "cuby/stdio"
34
- plea_for_merci_to {
35
- |name|
34
+ plea_for_merci_to name {
36
35
  shout "Please don't kill me " + name + "!"
37
36
  }
38
37
  main {
39
38
  plea_for_merci_to "Jon"
40
39
  }
41
40
 
42
- `cuby/stdio.rb`:
41
+ cuby/stdio.rb:
43
42
 
44
43
  def shout argument
45
44
  puts argument.upcase
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.1.5
data/bin/icb CHANGED
File without changes
data/cbrun ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+ # This file duplicates the functionality of the default cuby
3
+ # executable, only no gem installation is required for load
4
+ # paths to work.
5
+
6
+ $LOAD_PATH << File.dirname(__FILE__.gsub(/^.\/(.*)$/, "#{ENV["PWD"]}/\\1")) + "/lib"
7
+ require "rubygems"
8
+ require "cuby"
9
+
10
+ # Create and run the application
11
+ app = Cuby.new(ARGV, STDIN)
12
+ app.run
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cuby}
8
- s.version = "0.1.4"
8
+ s.version = "0.1.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jon Vlachoyiannis", "Jim Myhrberg"]
12
- s.date = %q{2009-10-19}
12
+ s.date = %q{2009-10-20}
13
13
  s.description = %q{A tiny C-like language built on top of Ruby, in less than 20 lines of code.}
14
14
  s.email = %q{jon@emotionull.com}
15
15
  s.executables = ["cuby", "icb"]
@@ -25,6 +25,7 @@ Gem::Specification.new do |s|
25
25
  "VERSION",
26
26
  "bin/cuby",
27
27
  "bin/icb",
28
+ "cbrun",
28
29
  "cuby.gemspec",
29
30
  "examples/example1.cb",
30
31
  "examples/example2.cb",
@@ -3,8 +3,7 @@
3
3
 
4
4
  include "cuby/stdio"
5
5
 
6
- plea_for_merci_to {
7
- |name|
6
+ plea_for_merci_to name {
8
7
  shout "Please don't kill me " + name + "!"
9
8
  }
10
9
  main {
@@ -16,7 +16,7 @@ def method_missing(meth, *args, &block)
16
16
  end
17
17
 
18
18
  def preformat_data(data)
19
- data.gsub(/^\s*\/\//,'#')
19
+ data.gsub(/^\s*\/\//,'#').gsub(/^(\s*)([a-zA-Z_]{1}[a-zA-Z0-9_]*)\s+(.+?)\s*\{/, "\\1\\2 { |\\3|")
20
20
  end
21
21
 
22
22
  #FIXME Interactive mode does not work with loop defined
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cuby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Vlachoyiannis
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-10-19 00:00:00 +03:00
13
+ date: 2009-10-20 00:00:00 +03:00
14
14
  default_executable:
15
15
  dependencies: []
16
16
 
@@ -32,6 +32,7 @@ files:
32
32
  - VERSION
33
33
  - bin/cuby
34
34
  - bin/icb
35
+ - cbrun
35
36
  - cuby.gemspec
36
37
  - examples/example1.cb
37
38
  - examples/example2.cb