scout 5.7.3.pre.2 → 5.7.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. data/CHANGELOG.markdown +4 -0
  2. data/lib/scout/version.rb +1 -1
  3. data/vendor/json_pure/.gitignore +12 -0
  4. data/vendor/json_pure/.travis.yml +20 -0
  5. data/vendor/json_pure/CHANGES +282 -0
  6. data/vendor/json_pure/COPYING +58 -0
  7. data/vendor/json_pure/COPYING-json-jruby +57 -0
  8. data/vendor/json_pure/GPL +340 -0
  9. data/vendor/json_pure/Gemfile +11 -0
  10. data/vendor/json_pure/README-json-jruby.markdown +33 -0
  11. data/vendor/json_pure/README.rdoc +358 -0
  12. data/vendor/json_pure/Rakefile +412 -0
  13. data/vendor/json_pure/TODO +1 -0
  14. data/vendor/json_pure/VERSION +1 -0
  15. data/vendor/json_pure/data/example.json +1 -0
  16. data/vendor/json_pure/data/index.html +38 -0
  17. data/vendor/json_pure/data/prototype.js +4184 -0
  18. data/vendor/json_pure/diagrams/.keep +0 -0
  19. data/vendor/json_pure/ext/json/ext/fbuffer/fbuffer.h +181 -0
  20. data/vendor/json_pure/ext/json/ext/generator/depend +1 -0
  21. data/vendor/json_pure/ext/json/ext/generator/extconf.rb +14 -0
  22. data/vendor/json_pure/ext/json/ext/generator/generator.c +1435 -0
  23. data/vendor/json_pure/ext/json/ext/generator/generator.h +148 -0
  24. data/vendor/json_pure/ext/json/ext/parser/depend +1 -0
  25. data/vendor/json_pure/ext/json/ext/parser/extconf.rb +13 -0
  26. data/vendor/json_pure/ext/json/ext/parser/parser.c +2204 -0
  27. data/vendor/json_pure/ext/json/ext/parser/parser.h +77 -0
  28. data/vendor/json_pure/ext/json/ext/parser/parser.rl +927 -0
  29. data/vendor/json_pure/install.rb +23 -0
  30. data/vendor/json_pure/java/src/json/ext/ByteListTranscoder.java +167 -0
  31. data/vendor/json_pure/java/src/json/ext/Generator.java +444 -0
  32. data/vendor/json_pure/java/src/json/ext/GeneratorMethods.java +232 -0
  33. data/vendor/json_pure/java/src/json/ext/GeneratorService.java +43 -0
  34. data/vendor/json_pure/java/src/json/ext/GeneratorState.java +543 -0
  35. data/vendor/json_pure/java/src/json/ext/OptionsReader.java +114 -0
  36. data/vendor/json_pure/java/src/json/ext/Parser.java +2644 -0
  37. data/vendor/json_pure/java/src/json/ext/Parser.rl +968 -0
  38. data/vendor/json_pure/java/src/json/ext/ParserService.java +35 -0
  39. data/vendor/json_pure/java/src/json/ext/RuntimeInfo.java +121 -0
  40. data/vendor/json_pure/java/src/json/ext/StringDecoder.java +167 -0
  41. data/vendor/json_pure/java/src/json/ext/StringEncoder.java +106 -0
  42. data/vendor/json_pure/java/src/json/ext/Utils.java +89 -0
  43. data/vendor/json_pure/json-java.gemspec +23 -0
  44. data/vendor/json_pure/json.gemspec +37 -0
  45. data/vendor/json_pure/json_pure.gemspec +39 -0
  46. data/vendor/json_pure/lib/json.rb +62 -0
  47. data/vendor/json_pure/lib/json/add/bigdecimal.rb +28 -0
  48. data/vendor/json_pure/lib/json/add/complex.rb +22 -0
  49. data/vendor/json_pure/lib/json/add/core.rb +11 -0
  50. data/vendor/json_pure/lib/json/add/date.rb +34 -0
  51. data/vendor/json_pure/lib/json/add/date_time.rb +50 -0
  52. data/vendor/json_pure/lib/json/add/exception.rb +31 -0
  53. data/vendor/json_pure/lib/json/add/ostruct.rb +31 -0
  54. data/vendor/json_pure/lib/json/add/range.rb +29 -0
  55. data/vendor/json_pure/lib/json/add/rational.rb +22 -0
  56. data/vendor/json_pure/lib/json/add/regexp.rb +30 -0
  57. data/vendor/json_pure/lib/json/add/struct.rb +30 -0
  58. data/vendor/json_pure/lib/json/add/symbol.rb +25 -0
  59. data/vendor/json_pure/lib/json/add/time.rb +38 -0
  60. data/vendor/json_pure/lib/json/common.rb +487 -0
  61. data/vendor/json_pure/lib/json/ext.rb +21 -0
  62. data/vendor/json_pure/lib/json/ext/.keep +0 -0
  63. data/vendor/json_pure/lib/json/generic_object.rb +70 -0
  64. data/vendor/json_pure/lib/json/pure.rb +21 -0
  65. data/vendor/json_pure/lib/json/pure/generator.rb +522 -0
  66. data/vendor/json_pure/lib/json/pure/parser.rb +359 -0
  67. data/vendor/json_pure/lib/json/version.rb +8 -0
  68. data/vendor/json_pure/tests/fixtures/fail1.json +1 -0
  69. data/vendor/json_pure/tests/fixtures/fail10.json +1 -0
  70. data/vendor/json_pure/tests/fixtures/fail11.json +1 -0
  71. data/vendor/json_pure/tests/fixtures/fail12.json +1 -0
  72. data/vendor/json_pure/tests/fixtures/fail13.json +1 -0
  73. data/vendor/json_pure/tests/fixtures/fail14.json +1 -0
  74. data/vendor/json_pure/tests/fixtures/fail18.json +1 -0
  75. data/vendor/json_pure/tests/fixtures/fail19.json +1 -0
  76. data/vendor/json_pure/tests/fixtures/fail2.json +1 -0
  77. data/vendor/json_pure/tests/fixtures/fail20.json +1 -0
  78. data/vendor/json_pure/tests/fixtures/fail21.json +1 -0
  79. data/vendor/json_pure/tests/fixtures/fail22.json +1 -0
  80. data/vendor/json_pure/tests/fixtures/fail23.json +1 -0
  81. data/vendor/json_pure/tests/fixtures/fail24.json +1 -0
  82. data/vendor/json_pure/tests/fixtures/fail25.json +1 -0
  83. data/vendor/json_pure/tests/fixtures/fail27.json +2 -0
  84. data/vendor/json_pure/tests/fixtures/fail28.json +2 -0
  85. data/vendor/json_pure/tests/fixtures/fail3.json +1 -0
  86. data/vendor/json_pure/tests/fixtures/fail4.json +1 -0
  87. data/vendor/json_pure/tests/fixtures/fail5.json +1 -0
  88. data/vendor/json_pure/tests/fixtures/fail6.json +1 -0
  89. data/vendor/json_pure/tests/fixtures/fail7.json +1 -0
  90. data/vendor/json_pure/tests/fixtures/fail8.json +1 -0
  91. data/vendor/json_pure/tests/fixtures/fail9.json +1 -0
  92. data/vendor/json_pure/tests/fixtures/pass1.json +56 -0
  93. data/vendor/json_pure/tests/fixtures/pass15.json +1 -0
  94. data/vendor/json_pure/tests/fixtures/pass16.json +1 -0
  95. data/vendor/json_pure/tests/fixtures/pass17.json +1 -0
  96. data/vendor/json_pure/tests/fixtures/pass2.json +1 -0
  97. data/vendor/json_pure/tests/fixtures/pass26.json +1 -0
  98. data/vendor/json_pure/tests/fixtures/pass3.json +6 -0
  99. data/vendor/json_pure/tests/setup_variant.rb +11 -0
  100. data/vendor/json_pure/tests/test_json.rb +545 -0
  101. data/vendor/json_pure/tests/test_json_addition.rb +196 -0
  102. data/vendor/json_pure/tests/test_json_encoding.rb +65 -0
  103. data/vendor/json_pure/tests/test_json_fixtures.rb +35 -0
  104. data/vendor/json_pure/tests/test_json_generate.rb +322 -0
  105. data/vendor/json_pure/tests/test_json_generic_object.rb +75 -0
  106. data/vendor/json_pure/tests/test_json_string_matching.rb +39 -0
  107. data/vendor/json_pure/tests/test_json_unicode.rb +72 -0
  108. data/vendor/json_pure/tools/fuzz.rb +139 -0
  109. data/vendor/json_pure/tools/server.rb +62 -0
  110. metadata +111 -4
@@ -0,0 +1,412 @@
1
+ begin
2
+ require 'rubygems/package_task'
3
+ rescue LoadError
4
+ end
5
+
6
+ require 'rbconfig'
7
+ include\
8
+ begin
9
+ RbConfig
10
+ rescue NameError
11
+ Config
12
+ end
13
+
14
+ require 'rake/clean'
15
+ CLOBBER.include 'doc', 'Gemfile.lock'
16
+ CLEAN.include FileList['diagrams/*.*'], 'doc', 'coverage', 'tmp',
17
+ FileList["ext/**/{Makefile,mkmf.log}"], 'build', 'dist', FileList['**/*.rbc'],
18
+ FileList["{ext,lib}/**/*.{so,bundle,#{CONFIG['DLEXT']},o,obj,pdb,lib,manifest,exp,def,jar,class,dSYM}"],
19
+ FileList['java/src/**/*.class']
20
+
21
+ require 'rake/testtask'
22
+ class UndocumentedTestTask < Rake::TestTask
23
+ def desc(*) end
24
+ end
25
+
26
+ def skip_sdoc(src)
27
+ src.gsub(/^.*sdoc.*/) { |s| s + ' if RUBY_VERSION > "1.8.6"' }
28
+ end
29
+
30
+ MAKE = ENV['MAKE'] || %w[gmake make].find { |c| system(c, '-v') }
31
+ BUNDLE = ENV['BUNDLE'] || %w[bundle].find { |c| system(c, '-v') }
32
+ PKG_NAME = 'json'
33
+ PKG_TITLE = 'JSON Implementation for Ruby'
34
+ PKG_VERSION = File.read('VERSION').chomp
35
+ PKG_FILES = FileList[`git ls-files`.split(/\n/)]
36
+
37
+ EXT_ROOT_DIR = 'ext/json/ext'
38
+ EXT_PARSER_DIR = "#{EXT_ROOT_DIR}/parser"
39
+ EXT_PARSER_DL = "#{EXT_PARSER_DIR}/parser.#{CONFIG['DLEXT']}"
40
+ RAGEL_PATH = "#{EXT_PARSER_DIR}/parser.rl"
41
+ EXT_PARSER_SRC = "#{EXT_PARSER_DIR}/parser.c"
42
+ EXT_GENERATOR_DIR = "#{EXT_ROOT_DIR}/generator"
43
+ EXT_GENERATOR_DL = "#{EXT_GENERATOR_DIR}/generator.#{CONFIG['DLEXT']}"
44
+ EXT_GENERATOR_SRC = "#{EXT_GENERATOR_DIR}/generator.c"
45
+
46
+ JAVA_DIR = "java/src/json/ext"
47
+ JAVA_RAGEL_PATH = "#{JAVA_DIR}/Parser.rl"
48
+ JAVA_PARSER_SRC = "#{JAVA_DIR}/Parser.java"
49
+ JAVA_SOURCES = FileList["#{JAVA_DIR}/*.java"]
50
+ JAVA_CLASSES = []
51
+ JRUBY_PARSER_JAR = File.expand_path("lib/json/ext/parser.jar")
52
+ JRUBY_GENERATOR_JAR = File.expand_path("lib/json/ext/generator.jar")
53
+
54
+ RAGEL_CODEGEN = %w[rlcodegen rlgen-cd ragel].find { |c| system(c, '-v') }
55
+ RAGEL_DOTGEN = %w[rlgen-dot rlgen-cd ragel].find { |c| system(c, '-v') }
56
+
57
+ desc "Installing library (pure)"
58
+ task :install_pure => :version do
59
+ ruby 'install.rb'
60
+ end
61
+
62
+ task :install_ext_really do
63
+ sitearchdir = CONFIG["sitearchdir"]
64
+ cd 'ext' do
65
+ for file in Dir["json/ext/*.#{CONFIG['DLEXT']}"]
66
+ d = File.join(sitearchdir, file)
67
+ mkdir_p File.dirname(d)
68
+ install(file, d)
69
+ end
70
+ warn " *** Installed EXT ruby library."
71
+ end
72
+ end
73
+
74
+ desc "Installing library (extension)"
75
+ task :install_ext => [ :compile, :install_pure, :install_ext_really ]
76
+
77
+ desc "Installing library (extension)"
78
+ task :install => :install_ext
79
+
80
+ if defined?(Gem) and defined?(Gem::PackageTask)
81
+ spec_pure = Gem::Specification.new do |s|
82
+ s.name = 'json_pure'
83
+ s.version = PKG_VERSION
84
+ s.summary = PKG_TITLE
85
+ s.description = "This is a JSON implementation in pure Ruby."
86
+
87
+ s.files = PKG_FILES
88
+
89
+ s.require_path = 'lib'
90
+ s.add_development_dependency 'permutation'
91
+ s.add_development_dependency 'sdoc', '~>0.3.16'
92
+ s.add_development_dependency 'rake', '~>0.9.2'
93
+
94
+ s.extra_rdoc_files << 'README.rdoc'
95
+ s.rdoc_options <<
96
+ '--title' << 'JSON implemention for ruby' << '--main' << 'README.rdoc'
97
+ s.test_files.concat Dir['./tests/test_*.rb']
98
+
99
+ s.author = "Florian Frank"
100
+ s.email = "flori@ping.de"
101
+ s.homepage = "http://flori.github.com/#{PKG_NAME}"
102
+ s.license = 'Ruby'
103
+ end
104
+
105
+ desc 'Creates a json_pure.gemspec file'
106
+ task :gemspec_pure => :version do
107
+ File.open('json_pure.gemspec', 'w') do |gemspec|
108
+ gemspec.write skip_sdoc(spec_pure.to_ruby)
109
+ end
110
+ end
111
+
112
+ Gem::PackageTask.new(spec_pure) do |pkg|
113
+ pkg.need_tar = true
114
+ pkg.package_files = PKG_FILES
115
+ end
116
+
117
+ spec_ext = Gem::Specification.new do |s|
118
+ s.name = 'json'
119
+ s.version = PKG_VERSION
120
+ s.summary = PKG_TITLE
121
+ s.description = "This is a JSON implementation as a Ruby extension in C."
122
+
123
+ s.files = PKG_FILES
124
+
125
+ s.extensions = FileList['ext/**/extconf.rb']
126
+
127
+ s.require_path = 'lib'
128
+ s.add_development_dependency 'permutation'
129
+ s.add_development_dependency 'sdoc', '~>0.3.16'
130
+
131
+ s.extra_rdoc_files << 'README.rdoc'
132
+ s.rdoc_options <<
133
+ '--title' << 'JSON implemention for Ruby' << '--main' << 'README.rdoc'
134
+ s.test_files.concat Dir['./tests/test_*.rb']
135
+
136
+ s.author = "Florian Frank"
137
+ s.email = "flori@ping.de"
138
+ s.homepage = "http://flori.github.com/#{PKG_NAME}"
139
+ s.license = 'Ruby'
140
+ end
141
+
142
+ desc 'Creates a json.gemspec file'
143
+ task :gemspec_ext => :version do
144
+ File.open('json.gemspec', 'w') do |gemspec|
145
+ gemspec.write skip_sdoc(spec_ext.to_ruby)
146
+ end
147
+ end
148
+
149
+ Gem::PackageTask.new(spec_ext) do |pkg|
150
+ pkg.need_tar = true
151
+ pkg.package_files = PKG_FILES
152
+ end
153
+
154
+
155
+ desc 'Create all gemspec files'
156
+ task :gemspec => [ :gemspec_pure, :gemspec_ext ]
157
+ end
158
+
159
+ desc m = "Writing version information for #{PKG_VERSION}"
160
+ task :version do
161
+ puts m
162
+ File.open(File.join('lib', 'json', 'version.rb'), 'w') do |v|
163
+ v.puts <<EOT
164
+ module JSON
165
+ # JSON version
166
+ VERSION = '#{PKG_VERSION}'
167
+ VERSION_ARRAY = VERSION.split(/\\./).map { |x| x.to_i } # :nodoc:
168
+ VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
169
+ VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
170
+ VERSION_BUILD = VERSION_ARRAY[2] # :nodoc:
171
+ end
172
+ EOT
173
+ end
174
+ end
175
+
176
+ desc "Testing library (pure ruby)"
177
+ task :test_pure => [ :clean, :do_test_pure ]
178
+
179
+ UndocumentedTestTask.new do |t|
180
+ t.name = 'do_test_pure'
181
+ t.libs << 'lib'
182
+ t.test_files = FileList['tests/test_*.rb']
183
+ t.verbose = true
184
+ t.options = '-v'
185
+ end
186
+
187
+ desc "Testing library (pure ruby and extension)"
188
+ task :test do
189
+ sh "env JSON=pure #{BUNDLE} exec rake test_pure" or exit 1
190
+ sh "env JSON=ext #{BUNDLE} exec rake test_ext" or exit 1
191
+ end
192
+
193
+ namespace :gems do
194
+ desc 'Install all development gems'
195
+ task :install do
196
+ sh "#{BUNDLE}"
197
+ end
198
+ end
199
+
200
+ if defined?(RUBY_ENGINE) and RUBY_ENGINE == 'jruby'
201
+ if ENV.key?('JAVA_HOME')
202
+ warn " *** JAVA_HOME was set to #{ENV['JAVA_HOME'].inspect}"
203
+ elsif File.directory?(local_java = '/usr/local/java/jdk') ||
204
+ File.directory?(local_java = '/usr/lib/jvm/java-6-openjdk')
205
+ then
206
+ ENV['JAVA_HOME'] = local_java
207
+ end
208
+ if ENV['JAVA_HOME']
209
+ warn " *** JAVA_HOME is set to #{ENV['JAVA_HOME'].inspect}"
210
+ ENV['PATH'] = ENV['PATH'].split(/:/).unshift(java_path = "#{ENV['JAVA_HOME']}/bin") * ':'
211
+ warn " *** java binaries are assumed to be in #{java_path.inspect}"
212
+ else
213
+ warn " *** JAVA_HOME was not set or could not be guessed!"
214
+ exit 1
215
+ end
216
+
217
+ file JAVA_PARSER_SRC => JAVA_RAGEL_PATH do
218
+ cd JAVA_DIR do
219
+ if RAGEL_CODEGEN == 'ragel'
220
+ sh "ragel Parser.rl -J -o Parser.java"
221
+ else
222
+ sh "ragel -x Parser.rl | #{RAGEL_CODEGEN} -J"
223
+ end
224
+ end
225
+ end
226
+
227
+ desc "Generate parser for java with ragel"
228
+ task :ragel => JAVA_PARSER_SRC
229
+
230
+ desc "Delete the ragel generated Java source"
231
+ task :ragel_clean do
232
+ rm_rf JAVA_PARSER_SRC
233
+ end
234
+
235
+ JRUBY_JAR = File.join(CONFIG["libdir"], "jruby.jar")
236
+ if File.exist?(JRUBY_JAR)
237
+ JAVA_SOURCES.each do |src|
238
+ classpath = (Dir['java/lib/*.jar'] << 'java/src' << JRUBY_JAR) * ':'
239
+ obj = src.sub(/\.java\Z/, '.class')
240
+ file obj => src do
241
+ sh 'javac', '-classpath', classpath, '-source', '1.5', '-target', '1.5', src
242
+ end
243
+ JAVA_CLASSES << obj
244
+ end
245
+ else
246
+ warn "WARNING: Cannot find jruby in path => Cannot build jruby extension!"
247
+ end
248
+
249
+ desc "Compiling jruby extension"
250
+ task :compile => JAVA_CLASSES
251
+
252
+ desc "Package the jruby gem"
253
+ task :jruby_gem => :create_jar do
254
+ sh 'gem build json-java.gemspec'
255
+ mkdir_p 'pkg'
256
+ mv "json-#{PKG_VERSION}-java.gem", 'pkg'
257
+ end
258
+
259
+ desc "Testing library (jruby)"
260
+ task :test_ext => [ :create_jar, :do_test_ext ]
261
+
262
+ UndocumentedTestTask.new do |t|
263
+ t.name = 'do_test_ext'
264
+ t.libs << 'lib'
265
+ t.test_files = FileList['tests/test_*.rb']
266
+ t.verbose = true
267
+ t.options = '-v'
268
+ end
269
+
270
+ file JRUBY_PARSER_JAR => :compile do
271
+ cd 'java/src' do
272
+ parser_classes = FileList[
273
+ "json/ext/ByteListTranscoder*.class",
274
+ "json/ext/OptionsReader*.class",
275
+ "json/ext/Parser*.class",
276
+ "json/ext/RuntimeInfo*.class",
277
+ "json/ext/StringDecoder*.class",
278
+ "json/ext/Utils*.class"
279
+ ]
280
+ sh 'jar', 'cf', File.basename(JRUBY_PARSER_JAR), *parser_classes
281
+ mv File.basename(JRUBY_PARSER_JAR), File.dirname(JRUBY_PARSER_JAR)
282
+ end
283
+ end
284
+
285
+ desc "Create parser jar"
286
+ task :create_parser_jar => JRUBY_PARSER_JAR
287
+
288
+ file JRUBY_GENERATOR_JAR => :compile do
289
+ cd 'java/src' do
290
+ generator_classes = FileList[
291
+ "json/ext/ByteListTranscoder*.class",
292
+ "json/ext/OptionsReader*.class",
293
+ "json/ext/Generator*.class",
294
+ "json/ext/RuntimeInfo*.class",
295
+ "json/ext/StringEncoder*.class",
296
+ "json/ext/Utils*.class"
297
+ ]
298
+ sh 'jar', 'cf', File.basename(JRUBY_GENERATOR_JAR), *generator_classes
299
+ mv File.basename(JRUBY_GENERATOR_JAR), File.dirname(JRUBY_GENERATOR_JAR)
300
+ end
301
+ end
302
+
303
+ desc "Create generator jar"
304
+ task :create_generator_jar => JRUBY_GENERATOR_JAR
305
+
306
+ desc "Create parser and generator jars"
307
+ task :create_jar => [ :create_parser_jar, :create_generator_jar ]
308
+
309
+ desc "Build all gems and archives for a new release of the jruby extension."
310
+ task :build => [ :clean, :version, :jruby_gem ]
311
+
312
+ task :release => :build
313
+ else
314
+ desc "Compiling extension"
315
+ task :compile => [ EXT_PARSER_DL, EXT_GENERATOR_DL ]
316
+
317
+ file EXT_PARSER_DL => EXT_PARSER_SRC do
318
+ cd EXT_PARSER_DIR do
319
+ ruby 'extconf.rb'
320
+ sh MAKE
321
+ end
322
+ cp "#{EXT_PARSER_DIR}/parser.#{CONFIG['DLEXT']}", EXT_ROOT_DIR
323
+ end
324
+
325
+ file EXT_GENERATOR_DL => EXT_GENERATOR_SRC do
326
+ cd EXT_GENERATOR_DIR do
327
+ ruby 'extconf.rb'
328
+ sh MAKE
329
+ end
330
+ cp "#{EXT_GENERATOR_DIR}/generator.#{CONFIG['DLEXT']}", EXT_ROOT_DIR
331
+ end
332
+
333
+ desc "Testing library (extension)"
334
+ task :test_ext => [ :compile, :do_test_ext ]
335
+
336
+ UndocumentedTestTask.new do |t|
337
+ t.name = 'do_test_ext'
338
+ t.libs << 'ext' << 'lib'
339
+ t.test_files = FileList['tests/test_*.rb']
340
+ t.verbose = true
341
+ t.options = '-v'
342
+ end
343
+
344
+ desc "Create RDOC documentation"
345
+ task :doc => [ :version, EXT_PARSER_SRC ] do
346
+ sh "sdoc -o doc -t '#{PKG_TITLE}' -m README.rdoc README.rdoc lib/json.rb #{FileList['lib/json/**/*.rb']} #{EXT_PARSER_SRC} #{EXT_GENERATOR_SRC}"
347
+ end
348
+
349
+ desc "Generate parser with ragel"
350
+ task :ragel => EXT_PARSER_SRC
351
+
352
+ desc "Delete the ragel generated C source"
353
+ task :ragel_clean do
354
+ rm_rf EXT_PARSER_SRC
355
+ end
356
+
357
+ desc "Update the tags file"
358
+ task :tags do
359
+ system 'ctags', *Dir['**/*.{rb,c,h,java}']
360
+ end
361
+
362
+ file EXT_PARSER_SRC => RAGEL_PATH do
363
+ cd EXT_PARSER_DIR do
364
+ if RAGEL_CODEGEN == 'ragel'
365
+ sh "ragel parser.rl -G2 -o parser.c"
366
+ else
367
+ sh "ragel -x parser.rl | #{RAGEL_CODEGEN} -G2"
368
+ end
369
+ src = File.read("parser.c").gsub(/[ \t]+$/, '')
370
+ File.open("parser.c", "w") {|f| f.print src}
371
+ end
372
+ end
373
+
374
+ desc "Generate diagrams of ragel parser (ps)"
375
+ task :ragel_dot_ps do
376
+ root = 'diagrams'
377
+ specs = []
378
+ File.new(RAGEL_PATH).grep(/^\s*machine\s*(\S+);\s*$/) { specs << $1 }
379
+ for s in specs
380
+ if RAGEL_DOTGEN == 'ragel'
381
+ sh "ragel #{RAGEL_PATH} -S#{s} -p -V | dot -Tps -o#{root}/#{s}.ps"
382
+ else
383
+ sh "ragel -x #{RAGEL_PATH} -S#{s} | #{RAGEL_DOTGEN} -p|dot -Tps -o#{root}/#{s}.ps"
384
+ end
385
+ end
386
+ end
387
+
388
+ desc "Generate diagrams of ragel parser (png)"
389
+ task :ragel_dot_png do
390
+ root = 'diagrams'
391
+ specs = []
392
+ File.new(RAGEL_PATH).grep(/^\s*machine\s*(\S+);\s*$/) { specs << $1 }
393
+ for s in specs
394
+ if RAGEL_DOTGEN == 'ragel'
395
+ sh "ragel #{RAGEL_PATH} -S#{s} -p -V | dot -Tpng -o#{root}/#{s}.png"
396
+ else
397
+ sh "ragel -x #{RAGEL_PATH} -S#{s} | #{RAGEL_DOTGEN} -p|dot -Tpng -o#{root}/#{s}.png"
398
+ end
399
+ end
400
+ end
401
+
402
+ desc "Generate diagrams of ragel parser"
403
+ task :ragel_dot => [ :ragel_dot_png, :ragel_dot_ps ]
404
+
405
+ desc "Build all gems and archives for a new release of json and json_pure."
406
+ task :build => [ :clean, :gemspec, :package ]
407
+
408
+ task :release => :build
409
+ end
410
+
411
+ desc "Compile in the the source directory"
412
+ task :default => [ :clean, :gemspec, :test ]
@@ -0,0 +1 @@
1
+
@@ -0,0 +1 @@
1
+ 1.8.0
@@ -0,0 +1 @@
1
+ {"a":2,"b":3.141,"TIME":"2007-03-14T11:52:40","c":"c","d":[1,"b",3.14],"COUNT":666,"e":{"foo":"bar"},"foo":"B\u00e4r","g":"\u677e\u672c\u884c\u5f18","h":1000.0,"bar":"\u00a9 \u2260 \u20ac!","i":0.001,"j":"\ud840\udc01"}
@@ -0,0 +1,38 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
4
+ <head>
5
+ <title>Javascript Example</title>
6
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
7
+ <script src="prototype.js" type="text/javascript"></script>
8
+ </head>
9
+
10
+ <body>
11
+ <h1>Fetching object from server</h1>
12
+ <div id="list">
13
+ Wait...<br/>
14
+ <noscript><p>Switch on Javascript!</p></noscript>
15
+ </div>
16
+ <script type="text/javascript">
17
+ <!--
18
+ function pollJSON() {
19
+ new Ajax.Request('/json',
20
+ {
21
+ method: 'get',
22
+ onSuccess: function(transport) {
23
+ var response = transport.responseText || "no response text";
24
+ response = eval("(" + response + ")");
25
+ var text = "";
26
+ for (var k in response) {
27
+ text = text + "<b>" + k + "</b>: " + response[k] + "<br/>"
28
+ }
29
+ $("list").update(text);
30
+ },
31
+ onFailure: function() { alert('Something went wrong...') }
32
+ });
33
+ }
34
+ new PeriodicalExecuter(pollJSON, 1);
35
+ -->
36
+ </script>
37
+ </body>
38
+ </html>