rubyserif 0.1 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/Makefile CHANGED
@@ -1,8 +1,8 @@
1
- GEM_FILE=js-0.1.gem
2
- SPEC_FILE=javascript.gemspec
1
+ GEM_FILE=rubyserif-0.1.gem
2
+ SPEC_FILE=rubyserif.gemspec
3
+
3
4
 
4
5
  all: gem
5
- @gem install $(GEM_FILE)
6
6
 
7
7
  gem:
8
8
  @gem build $(SPEC_FILE)
@@ -10,5 +10,8 @@ gem:
10
10
  install:
11
11
  @gem install $(GEM_FILE)
12
12
 
13
+ install1-9-1:
14
+ @gem1.9.1 install $(GEM_FILE)
15
+
13
16
  test: gem
14
17
  @ruby test/test.rb
data/README.md CHANGED
@@ -6,9 +6,13 @@ _swarley's poor excuse for JavaScript like features_
6
6
  Create JSON objects and functions with the JavaScript module.
7
7
 
8
8
  > Module JavaScript
9
+ >
9
10
  > |
11
+ >
10
12
  > - class Object
13
+ >
11
14
  > |
15
+ >
12
16
  > - class Function
13
17
 
14
18
  I may add more. Who knows?
data/test/test.rb CHANGED
@@ -1,30 +1,45 @@
1
- require_relative '../javascript.gem'
2
- puts "Creating object JavaScript::Object.new({ :foo => 'bar', :hello => 'world' }, [ :hello ] "
1
+ begin
2
+ require 'rubyserif'
3
+ rescue Exception
4
+ puts 'Gem not installed'
5
+ load File.expand_path(File.dirname(__FILE__)).split('/')[0..-2].join('/') + '/lib/js.rb'
6
+ end
7
+
8
+ print "Creating object JavaScript::Object.new({ :foo => 'bar', :hello => 'world' }, [ :hello ]...\t"
3
9
  obj = JavaScript::Object.new({ :foo => 'bar', :hello => 'world' }, [ :hello ])
4
- puts "Setting obj.foo to 'car'"
10
+ puts "\e[32mSuccess\e[0m"
11
+
12
+ print "Setting obj.foo to 'car'...\t"
5
13
  obj.foo = 'car'
6
- (obj.foo == 'car') ? puts 'Success' : puts "Failed to set obj.foo to 'car'"
7
- puts "Creating new element cat"
14
+ puts (obj.foo == 'car') ? "\e[32mSuccess\e[0m" : "\e[31mFailed\e[0m"
15
+
16
+ print "Creating new element cat...\t"
8
17
  obj.cat = true
9
- (obj.cat) ? puts "Success" : puts "Cat element not created"
10
- puts "Attempting to write constant 'hello'"
18
+ puts (obj.cat) ? "\e[32mSuccess\e[0m" : "\e[31mFailed\e[0m"
19
+
20
+ print "Attempting to write constant 'hello'...\t"
11
21
  begin
12
22
  obj.hello = 'fail'
13
- puts 'Constant not write protected'
23
+ puts "\e[31mFailed\e[0m"
14
24
  rescue
15
- puts 'Success'
25
+ puts "\e[32mSuccess\e[0m"
16
26
  end
17
27
 
18
- puts "Attempting to read elements"
19
- (obj/:elements) ? puts "Success" : puts "Failed"
28
+ print "Attempting to read elements...\t"
29
+ puts (obj/:elements) ? "\e[32mSuccess\e[0m" : "\e[31mFailed\e[0m"
20
30
 
21
- puts "Testing JavaScript::Function"
31
+ print "Testing JavaScript::Function...\t"
22
32
  function = JavaScript::Function.new { true }
23
33
  if function.class == Proc
24
- puts 'Success'
34
+ puts "\e[32mSuccess\e[0m"
35
+ else
36
+ puts "\e[31mFailed\e[0m"
25
37
  end
26
- puts "Testing successful use of JavaScript::Function#[]"
38
+
39
+ print "Testing successful use of JavaScript::Function#[]...\t"
27
40
  if (function[].class == TrueClass)
28
- puts 'Success'
41
+ puts "\e[32mSuccess\e[0m"
42
+ else
43
+ puts "\e[31mFailed\e[0m"
29
44
  end
30
45
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyserif
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -52,7 +52,7 @@ files:
52
52
  - doc/test/test_rb.html
53
53
  - doc/created.rid
54
54
  - doc/index.html
55
- - lib/js.rb
55
+ - lib/rubyserif.rb
56
56
  - Makefile
57
57
  - test/test.rb
58
58
  - README.md
File without changes