johnson 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +4 -0
- data/Manifest.txt +0 -4
- data/Rakefile +59 -16
- data/ext/spidermonkey/extconf.rb +5 -2
- data/lib/johnson/version.rb +1 -1
- data/test/helper.rb +0 -4
- metadata +6 -21
- data/docs/MINGW32.mk +0 -124
- data/docs/cross-compile.txt +0 -38
- data/lib/tasks/parsing.rake +0 -37
- data/lib/tasks/vendor.rake +0 -20
data/CHANGELOG.rdoc
CHANGED
data/Manifest.txt
CHANGED
@@ -4,8 +4,6 @@ Manifest.txt
|
|
4
4
|
README.rdoc
|
5
5
|
Rakefile
|
6
6
|
bin/johnson
|
7
|
-
docs/MINGW32.mk
|
8
|
-
docs/cross-compile.txt
|
9
7
|
ext/spidermonkey/context.c
|
10
8
|
ext/spidermonkey/context.h
|
11
9
|
ext/spidermonkey/conversions.c
|
@@ -64,8 +62,6 @@ lib/johnson/visitors/enumerating_visitor.rb
|
|
64
62
|
lib/johnson/visitors/sexp_visitor.rb
|
65
63
|
lib/johnson/visitors/visitor.rb
|
66
64
|
lib/rails/init.rb
|
67
|
-
lib/tasks/parsing.rake
|
68
|
-
lib/tasks/vendor.rake
|
69
65
|
test/helper.rb
|
70
66
|
test/johnson/browser_test.rb
|
71
67
|
test/johnson/conversions/array_test.rb
|
data/Rakefile
CHANGED
@@ -1,10 +1,14 @@
|
|
1
1
|
require "rubygems"
|
2
|
+
|
3
|
+
gem "hoe", ">= 2.3"
|
2
4
|
require "hoe"
|
5
|
+
|
6
|
+
gem "rake-compiler", ">= 0.6.0"
|
3
7
|
require "rake/extensiontask"
|
4
8
|
|
5
|
-
Hoe.plugin :debugging, :git
|
9
|
+
Hoe.plugin :debugging, :doofus, :git
|
6
10
|
|
7
|
-
|
11
|
+
Hoe.spec "johnson" do
|
8
12
|
developer "John Barnette", "jbarnette@rubyforge.org"
|
9
13
|
developer "Aaron Patterson", "aaron.patterson@gmail.com"
|
10
14
|
developer "Yehuda Katz", "wycats@gmail.com"
|
@@ -15,26 +19,65 @@ HOE = Hoe.spec "johnson" do
|
|
15
19
|
self.readme_file = "README.rdoc"
|
16
20
|
self.test_globs = %w(test/**/*_test.rb)
|
17
21
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
clean_globs << "ext/**/*.{o,so,bundle,a,log}"
|
22
|
+
self.spec_extras = { :extensions => %w(ext/spidermonkey/extconf.rb) }
|
23
|
+
|
24
|
+
extra_dev_deps << ["rake-compiler", ">= 0.6.0"]
|
22
25
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
26
|
+
clean_globs << "ext/**/Makefile"
|
27
|
+
clean_globs << "ext/**/*.{o,so,bundle,a,log}"
|
28
|
+
clean_globs << "ext/spidermonkey/immutable_node.c"
|
29
|
+
clean_globs << "lib/johnson/spidermonkey.bundle"
|
30
|
+
clean_globs << "tmp"
|
31
|
+
clean_globs << "vendor/spidermonkey/**/*.OBJ"
|
32
|
+
|
33
|
+
Rake::ExtensionTask.new "spidermonkey", spec do |ext|
|
34
|
+
ext.lib_dir = "lib/johnson"
|
35
|
+
end
|
27
36
|
end
|
28
37
|
|
29
|
-
|
30
|
-
|
38
|
+
task :clean do
|
39
|
+
Dir.chdir "vendor/spidermonkey" do
|
40
|
+
sh "make clean -f Makefile.ref" unless Dir["**/libjs.a"].empty?
|
41
|
+
end
|
31
42
|
end
|
32
43
|
|
33
44
|
task :test => :compile
|
34
45
|
|
35
|
-
|
46
|
+
require "erb"
|
47
|
+
|
48
|
+
GENERATED_NODE = "ext/spidermonkey/immutable_node.c"
|
49
|
+
|
50
|
+
task :package => GENERATED_NODE
|
51
|
+
task :check_manifest => GENERATED_NODE
|
36
52
|
|
37
|
-
|
38
|
-
|
53
|
+
def jsops
|
54
|
+
ops = []
|
55
|
+
File.open("vendor/spidermonkey/jsopcode.tbl", "rb") { |f|
|
56
|
+
f.each_line do |line|
|
57
|
+
if line =~ /^OPDEF\((\w+),/
|
58
|
+
ops << $1
|
59
|
+
end
|
60
|
+
end
|
61
|
+
}
|
62
|
+
ops
|
63
|
+
end
|
64
|
+
|
65
|
+
def tokens
|
66
|
+
toks = []
|
67
|
+
File.open("vendor/spidermonkey/jsscan.h", "rb") { |f|
|
68
|
+
f.each_line do |line|
|
69
|
+
line.scan(/TOK_\w+/).each do |token|
|
70
|
+
next if token == "TOK_ERROR"
|
71
|
+
toks << token
|
72
|
+
end
|
73
|
+
end
|
74
|
+
}
|
75
|
+
toks.uniq
|
76
|
+
end
|
77
|
+
|
78
|
+
file GENERATED_NODE => "ext/spidermonkey/immutable_node.c.erb" do |t|
|
79
|
+
template = ERB.new(File.open(t.prerequisites.first, "rb") { |x| x.read })
|
80
|
+
File.open(GENERATED_NODE, "wb") { |f| f.write template.result(binding) }
|
81
|
+
end
|
39
82
|
|
40
|
-
|
83
|
+
file "ext/spidermonkey/extconf.rb" => GENERATED_NODE
|
data/ext/spidermonkey/extconf.rb
CHANGED
@@ -18,9 +18,12 @@ $CFLAGS << cflags.collect { |f| " -#{f}" }.join(" ")
|
|
18
18
|
spidermonkey_dir = File.expand_path File.dirname(__FILE__) +
|
19
19
|
"/../../vendor/spidermonkey"
|
20
20
|
|
21
|
+
Dir.chdir spidermonkey_dir do
|
22
|
+
system "make -f Makefile.ref" if Dir["**/libjs.a"].empty?
|
23
|
+
end
|
24
|
+
|
21
25
|
libjs = Dir[spidermonkey_dir + "/**/libjs.a"].first
|
22
|
-
|
23
|
-
$LOCAL_LIBS<< libjs
|
26
|
+
$LOCAL_LIBS << libjs
|
24
27
|
|
25
28
|
dir_config "johnson/spidermonkey"
|
26
29
|
|
data/lib/johnson/version.rb
CHANGED
data/test/helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: johnson
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Barnette
|
@@ -12,19 +12,9 @@ autorequire:
|
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
14
|
|
15
|
-
date: 2009-
|
15
|
+
date: 2009-07-29 00:00:00 -07:00
|
16
16
|
default_executable:
|
17
17
|
dependencies:
|
18
|
-
- !ruby/object:Gem::Dependency
|
19
|
-
name: rake
|
20
|
-
type: :runtime
|
21
|
-
version_requirement:
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: "0"
|
27
|
-
version:
|
28
18
|
- !ruby/object:Gem::Dependency
|
29
19
|
name: rake-compiler
|
30
20
|
type: :development
|
@@ -33,7 +23,7 @@ dependencies:
|
|
33
23
|
requirements:
|
34
24
|
- - ">="
|
35
25
|
- !ruby/object:Gem::Version
|
36
|
-
version:
|
26
|
+
version: 0.6.0
|
37
27
|
version:
|
38
28
|
- !ruby/object:Gem::Dependency
|
39
29
|
name: hoe
|
@@ -43,7 +33,7 @@ dependencies:
|
|
43
33
|
requirements:
|
44
34
|
- - ">="
|
45
35
|
- !ruby/object:Gem::Version
|
46
|
-
version: 2.3.
|
36
|
+
version: 2.3.2
|
47
37
|
version:
|
48
38
|
description: |-
|
49
39
|
Johnson wraps JavaScript in a loving Ruby embrace. It embeds the
|
@@ -56,10 +46,9 @@ email:
|
|
56
46
|
executables:
|
57
47
|
- johnson
|
58
48
|
extensions:
|
59
|
-
-
|
49
|
+
- ext/spidermonkey/extconf.rb
|
60
50
|
extra_rdoc_files:
|
61
51
|
- Manifest.txt
|
62
|
-
- docs/cross-compile.txt
|
63
52
|
- CHANGELOG.rdoc
|
64
53
|
- README.rdoc
|
65
54
|
files:
|
@@ -69,8 +58,6 @@ files:
|
|
69
58
|
- README.rdoc
|
70
59
|
- Rakefile
|
71
60
|
- bin/johnson
|
72
|
-
- docs/MINGW32.mk
|
73
|
-
- docs/cross-compile.txt
|
74
61
|
- ext/spidermonkey/context.c
|
75
62
|
- ext/spidermonkey/context.h
|
76
63
|
- ext/spidermonkey/conversions.c
|
@@ -129,8 +116,6 @@ files:
|
|
129
116
|
- lib/johnson/visitors/sexp_visitor.rb
|
130
117
|
- lib/johnson/visitors/visitor.rb
|
131
118
|
- lib/rails/init.rb
|
132
|
-
- lib/tasks/parsing.rake
|
133
|
-
- lib/tasks/vendor.rake
|
134
119
|
- test/helper.rb
|
135
120
|
- test/johnson/browser_test.rb
|
136
121
|
- test/johnson/conversions/array_test.rb
|
@@ -456,7 +441,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
456
441
|
requirements: []
|
457
442
|
|
458
443
|
rubyforge_project: johnson
|
459
|
-
rubygems_version: 1.3.
|
444
|
+
rubygems_version: 1.3.5
|
460
445
|
signing_key:
|
461
446
|
specification_version: 3
|
462
447
|
summary: Johnson wraps JavaScript in a loving Ruby embrace
|
data/docs/MINGW32.mk
DELETED
@@ -1,124 +0,0 @@
|
|
1
|
-
# -*- Mode: makefile -*-
|
2
|
-
#
|
3
|
-
#
|
4
|
-
# Based on patch submitted to mozilla.dev.tech.js-engine by 'Andy':
|
5
|
-
# http://groups.google.com/group/mozilla.dev.tech.js-engine/browse_thread/thread/16972946bf7df82e
|
6
|
-
#
|
7
|
-
#
|
8
|
-
# ***** BEGIN LICENSE BLOCK *****
|
9
|
-
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
10
|
-
#
|
11
|
-
# The contents of this file are subject to the Mozilla Public License Version
|
12
|
-
# 1.1 (the "License"); you may not use this file except in compliance with
|
13
|
-
# the License. You may obtain a copy of the License at
|
14
|
-
# http://www.mozilla.org/MPL/
|
15
|
-
#
|
16
|
-
# Software distributed under the License is distributed on an "AS IS" basis,
|
17
|
-
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
18
|
-
# for the specific language governing rights and limitations under the
|
19
|
-
# License.
|
20
|
-
#
|
21
|
-
# The Original Code is Mozilla Communicator client code, released
|
22
|
-
# March 31, 1998.
|
23
|
-
#
|
24
|
-
# The Initial Developer of the Original Code is
|
25
|
-
# Netscape Communications Corporation.
|
26
|
-
# Portions created by the Initial Developer are Copyright (C) 1998
|
27
|
-
# the Initial Developer. All Rights Reserved.
|
28
|
-
#
|
29
|
-
# Contributor(s):
|
30
|
-
#
|
31
|
-
# Alternatively, the contents of this file may be used under the terms of
|
32
|
-
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
33
|
-
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
34
|
-
# in which case the provisions of the GPL or the LGPL are applicable instead
|
35
|
-
# of those above. If you wish to allow use of your version of this file only
|
36
|
-
# under the terms of either the GPL or the LGPL, and not to allow others to
|
37
|
-
# use your version of this file under the terms of the MPL, indicate your
|
38
|
-
# decision by deleting the provisions above and replace them with the notice
|
39
|
-
# and other provisions required by the GPL or the LGPL. If you do not delete
|
40
|
-
# the provisions above, a recipient may use your version of this file under
|
41
|
-
# the terms of any one of the MPL, the GPL or the LGPL.
|
42
|
-
#
|
43
|
-
# ***** END LICENSE BLOCK *****
|
44
|
-
|
45
|
-
#
|
46
|
-
# Config for all versions of Mingw (copy and modified from Linux)
|
47
|
-
#
|
48
|
-
|
49
|
-
AR = i586-mingw32msvc-ar
|
50
|
-
CC = i586-mingw32msvc-gcc
|
51
|
-
LD = i586-mingw32msvc-ld
|
52
|
-
CCC = i586-mingw32msvc-g++
|
53
|
-
|
54
|
-
CFLAGS += -Wall -Wno-format
|
55
|
-
#OS_CFLAGS = -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DHAVE_LOCALTIME_R -DEXPORT_JS_API
|
56
|
-
OS_CFLAGS = -D_X86_=1 -DXP_WIN -DXP_WIN32 -DWIN32 -D_WINDOWS -D_WIN32 $(WIN_CFLAGS) -DEXPORT_JS_API
|
57
|
-
JSDLL_CFLAGS = -DEXPORT_JS_API # not work, dunno why?
|
58
|
-
SO_SUFFIX = dll
|
59
|
-
# libgcc.a:__divdi3 kernel32:DebugBreak,GetSystemTimeAsFileTime
|
60
|
-
# winmm:timeBeginPeriod,timeEndPeriod
|
61
|
-
WINLIBS = -lmsvcrt -lm -lkernel32 -lwinmm /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/libgcc.a
|
62
|
-
#LDFLAGS += $(WINLIBS) # dont work. rewrite by Makefile.ref
|
63
|
-
OTHER_LIBS += $(WINLIBS)
|
64
|
-
|
65
|
-
RANLIB = echo
|
66
|
-
MKSHLIB = $(LD) -shared $(XMKSHLIBOPTS)
|
67
|
-
|
68
|
-
# These don't work :(
|
69
|
-
LIBRARY = $(OBJDIR)/js32.lib
|
70
|
-
SHARED_LIBRARY = $(OBJDIR)/js32.dll
|
71
|
-
PROGRAM = $(OBJDIR)/js.exe
|
72
|
-
|
73
|
-
#.c.o:
|
74
|
-
# $(CC) -c -MD $*.d $(CFLAGS) $<
|
75
|
-
|
76
|
-
CPU_ARCH = $(shell uname -m)
|
77
|
-
# don't filter in x86-64 architecture
|
78
|
-
ifneq (x86_64,$(CPU_ARCH))
|
79
|
-
ifeq (86,$(findstring 86,$(CPU_ARCH)))
|
80
|
-
CPU_ARCH = x86
|
81
|
-
OS_CFLAGS+= -DX86_LINUX
|
82
|
-
|
83
|
-
ifeq (gcc, $(CC))
|
84
|
-
# if using gcc on x86, check version for opt bug
|
85
|
-
# (http://bugzilla.mozilla.org/show_bug.cgi?id=24892)
|
86
|
-
GCC_VERSION := $(shell gcc -v 2>&1 | grep version | awk '{ print $$3 }')
|
87
|
-
GCC_LIST:=$(sort 2.91.66 $(GCC_VERSION) )
|
88
|
-
|
89
|
-
ifeq (2.91.66, $(firstword $(GCC_LIST)))
|
90
|
-
CFLAGS+= -DGCC_OPT_BUG
|
91
|
-
endif
|
92
|
-
endif
|
93
|
-
endif
|
94
|
-
endif
|
95
|
-
|
96
|
-
GFX_ARCH = x
|
97
|
-
|
98
|
-
OS_LIBS = -lm -lc
|
99
|
-
|
100
|
-
ASFLAGS += -x assembler-with-cpp
|
101
|
-
|
102
|
-
|
103
|
-
ifeq ($(CPU_ARCH),alpha)
|
104
|
-
|
105
|
-
# Ask the C compiler on alpha linux to let us work with denormalized
|
106
|
-
# double values, which are required by the ECMA spec.
|
107
|
-
|
108
|
-
OS_CFLAGS += -mieee
|
109
|
-
endif
|
110
|
-
|
111
|
-
# Use the editline library to provide line-editing support.
|
112
|
-
#JS_EDITLINE = 1 // not support by Mingw
|
113
|
-
|
114
|
-
ifeq ($(CPU_ARCH),x86_64)
|
115
|
-
# Use VA_COPY() standard macro on x86-64
|
116
|
-
# FIXME: better use it everywhere
|
117
|
-
OS_CFLAGS += -DHAVE_VA_COPY
|
118
|
-
endif
|
119
|
-
|
120
|
-
ifeq ($(CPU_ARCH),x86_64)
|
121
|
-
# We need PIC code for shared libraries
|
122
|
-
# FIXME: better patch rules.mk & fdlibm/Makefile*
|
123
|
-
OS_CFLAGS += -DPIC -fPIC
|
124
|
-
endif
|
data/docs/cross-compile.txt
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
|
2
|
-
CROSS-COMPILING FOR WINDOWS
|
3
|
-
|
4
|
-
Based on http://eigenclass.org/hiki.rb?cross+compiling+rcovrt
|
5
|
-
|
6
|
-
|
7
|
-
*) Install the MinGW cross-compiler
|
8
|
-
|
9
|
-
Debian: apt-get install mingw32 mingw32-binutils mingw32-runtime
|
10
|
-
|
11
|
-
*) Download & extract a ruby distribution archive
|
12
|
-
|
13
|
-
*) Double the backslashes in the ALT_SEPARATOR definition in Makefile.in
|
14
|
-
|
15
|
-
*) Build & install it:
|
16
|
-
|
17
|
-
env ac_cv_func_getpgrp_void=no \
|
18
|
-
ac_cv_func_setpgrp_void=yes \
|
19
|
-
rb_cv_negative_time_t=no \
|
20
|
-
ac_cv_func_memcmp_working=yes \
|
21
|
-
rb_cv_binary_elf=no \
|
22
|
-
./configure \
|
23
|
-
--host=i586-mingw32msvc \
|
24
|
-
--target=i386-mingw32 \
|
25
|
-
--build=i686-linux \
|
26
|
-
--prefix=~/ruby-mingw32
|
27
|
-
|
28
|
-
make ruby
|
29
|
-
|
30
|
-
make install
|
31
|
-
|
32
|
-
*) Build the extension (rake will build spidermonkey for you)
|
33
|
-
|
34
|
-
# Remove any native binaries that are already built
|
35
|
-
rake clean
|
36
|
-
|
37
|
-
rake build CROSS=MINGW32 CROSSLIB=~/ruby-mingw32/lib/ruby/1.8/i386-mingw32
|
38
|
-
|
data/lib/tasks/parsing.rake
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
require "erb"
|
2
|
-
|
3
|
-
GENERATED_NODE = "ext/spidermonkey/immutable_node.c"
|
4
|
-
HOE.clean_globs << GENERATED_NODE
|
5
|
-
task :check_manifest => GENERATED_NODE
|
6
|
-
|
7
|
-
def jsops
|
8
|
-
ops = []
|
9
|
-
File.open("vendor/spidermonkey/jsopcode.tbl", "rb") { |f|
|
10
|
-
f.each_line do |line|
|
11
|
-
if line =~ /^OPDEF\((\w+),/
|
12
|
-
ops << $1
|
13
|
-
end
|
14
|
-
end
|
15
|
-
}
|
16
|
-
ops
|
17
|
-
end
|
18
|
-
|
19
|
-
def tokens
|
20
|
-
toks = []
|
21
|
-
File.open("vendor/spidermonkey/jsscan.h", "rb") { |f|
|
22
|
-
f.each_line do |line|
|
23
|
-
line.scan(/TOK_\w+/).each do |token|
|
24
|
-
next if token == "TOK_ERROR"
|
25
|
-
toks << token
|
26
|
-
end
|
27
|
-
end
|
28
|
-
}
|
29
|
-
toks.uniq
|
30
|
-
end
|
31
|
-
|
32
|
-
file GENERATED_NODE => "ext/spidermonkey/immutable_node.c.erb" do |t|
|
33
|
-
template = ERB.new(File.open(t.prerequisites.first, "rb") { |x| x.read })
|
34
|
-
File.open(GENERATED_NODE, "wb") { |f| f.write template.result(binding) }
|
35
|
-
end
|
36
|
-
|
37
|
-
file "ext/spidermonkey/extconf.rb" => GENERATED_NODE
|
data/lib/tasks/vendor.rake
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
namespace :vendor do
|
2
|
-
namespace :spidermonkey do
|
3
|
-
desc "Clean the vendored SpiderMonkey."
|
4
|
-
task :clean do
|
5
|
-
Dir.chdir "vendor/spidermonkey" do
|
6
|
-
sh "make clean -f Makefile.ref" unless Dir["**/libjs.a"].empty?
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
desc "Compile the vendored SpiderMonkey."
|
11
|
-
task :compile do
|
12
|
-
Dir.chdir "vendor/spidermonkey" do
|
13
|
-
sh "make -f Makefile.ref" if Dir["**/libjs.a"].empty?
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
task :clean => "vendor:spidermonkey:clean"
|
20
|
-
file "ext/spidermonkey/extconf.rb" => "vendor:spidermonkey:compile"
|