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 +6 -3
- data/README.md +4 -0
- data/test/test.rb +30 -15
- metadata +2 -2
- /data/lib/{js.rb → rubyserif.rb} +0 -0
data/Makefile
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
GEM_FILE=
|
2
|
-
SPEC_FILE=
|
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
data/test/test.rb
CHANGED
@@ -1,30 +1,45 @@
|
|
1
|
-
|
2
|
-
|
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 "
|
10
|
+
puts "\e[32mSuccess\e[0m"
|
11
|
+
|
12
|
+
print "Setting obj.foo to 'car'...\t"
|
5
13
|
obj.foo = 'car'
|
6
|
-
(obj.foo == 'car') ?
|
7
|
-
|
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) ?
|
10
|
-
|
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
|
23
|
+
puts "\e[31mFailed\e[0m"
|
14
24
|
rescue
|
15
|
-
puts
|
25
|
+
puts "\e[32mSuccess\e[0m"
|
16
26
|
end
|
17
27
|
|
18
|
-
|
19
|
-
(obj/:elements) ?
|
28
|
+
print "Attempting to read elements...\t"
|
29
|
+
puts (obj/:elements) ? "\e[32mSuccess\e[0m" : "\e[31mFailed\e[0m"
|
20
30
|
|
21
|
-
|
31
|
+
print "Testing JavaScript::Function...\t"
|
22
32
|
function = JavaScript::Function.new { true }
|
23
33
|
if function.class == Proc
|
24
|
-
puts
|
34
|
+
puts "\e[32mSuccess\e[0m"
|
35
|
+
else
|
36
|
+
puts "\e[31mFailed\e[0m"
|
25
37
|
end
|
26
|
-
|
38
|
+
|
39
|
+
print "Testing successful use of JavaScript::Function#[]...\t"
|
27
40
|
if (function[].class == TrueClass)
|
28
|
-
puts
|
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:
|
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/
|
55
|
+
- lib/rubyserif.rb
|
56
56
|
- Makefile
|
57
57
|
- test/test.rb
|
58
58
|
- README.md
|
/data/lib/{js.rb → rubyserif.rb}
RENAMED
File without changes
|