fjson 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. data/CHANGES +5 -5
  2. data/README +7 -8
  3. data/Rakefile +56 -17
  4. data/TODO +1 -0
  5. data/ext/extensions/array_ext/array_ext.c +118 -0
  6. data/ext/extensions/array_ext/array_ext.h +12 -0
  7. data/ext/extensions/array_ext/extconf.rb +7 -0
  8. data/ext/extensions/false_class_ext/extconf.rb +5 -0
  9. data/ext/extensions/false_class_ext/false_class_ext.c +19 -0
  10. data/ext/extensions/false_class_ext/false_class_ext.h +4 -0
  11. data/ext/extensions/float_ext/extconf.rb +5 -0
  12. data/ext/extensions/float_ext/float_ext.c +19 -0
  13. data/ext/extensions/float_ext/float_ext.h +4 -0
  14. data/ext/extensions/hash_ext/extconf.rb +7 -0
  15. data/ext/extensions/hash_ext/hash_ext.c +128 -0
  16. data/ext/extensions/hash_ext/hash_ext.h +13 -0
  17. data/ext/extensions/integer_ext/extconf.rb +5 -0
  18. data/ext/extensions/integer_ext/integer_ext.c +19 -0
  19. data/ext/extensions/integer_ext/integer_ext.h +4 -0
  20. data/ext/extensions/nil_class_ext/extconf.rb +5 -0
  21. data/ext/extensions/nil_class_ext/nil_class_ext.c +19 -0
  22. data/ext/extensions/nil_class_ext/nil_class_ext.h +4 -0
  23. data/ext/extensions/object_ext/extconf.rb +5 -0
  24. data/ext/extensions/object_ext/object_ext.c +21 -0
  25. data/ext/extensions/object_ext/object_ext.h +4 -0
  26. data/ext/extensions/string_ext/extconf.rb +5 -0
  27. data/ext/extensions/string_ext/string_ext.c +27 -0
  28. data/ext/extensions/string_ext/string_ext.h +4 -0
  29. data/ext/extensions/true_class_ext/extconf.rb +5 -0
  30. data/ext/extensions/true_class_ext/true_class_ext.c +19 -0
  31. data/ext/extensions/true_class_ext/true_class_ext.h +4 -0
  32. data/ext/json_ext/extconf.rb +5 -0
  33. data/ext/json_ext/json_ext.c +180 -0
  34. data/ext/json_ext/json_ext.h +9 -0
  35. data/ext/state_ext/extconf.rb +5 -0
  36. data/ext/state_ext/state_ext.c +169 -0
  37. data/ext/state_ext/state_ext.h +14 -0
  38. data/hash_benchmark.rb +15 -0
  39. data/install.rb +21 -0
  40. data/rake_helper.rb +34 -0
  41. metadata +52 -20
  42. data/VERSION +0 -1
  43. data/lib/extensions/array_ext.so +0 -0
  44. data/lib/extensions/false_class_ext.so +0 -0
  45. data/lib/extensions/float_ext.so +0 -0
  46. data/lib/extensions/hash_ext.so +0 -0
  47. data/lib/extensions/integer_ext.so +0 -0
  48. data/lib/extensions/nil_class_ext.so +0 -0
  49. data/lib/extensions/object_ext.so +0 -0
  50. data/lib/extensions/string_ext.so +0 -0
  51. data/lib/extensions/true_class_ext.so +0 -0
  52. data/lib/json_ext.so +0 -0
  53. data/lib/state_ext.so +0 -0
@@ -0,0 +1,14 @@
1
+ #include "ruby.h"
2
+ #include <string.h>
3
+
4
+ static VALUE initialize(int, VALUE*, VALUE);
5
+ static VALUE state_allocate(VALUE);
6
+ static VALUE from_state(VALUE, VALUE);
7
+ static VALUE hash_value_or_empty_string_default(VALUE, const char*);
8
+ static VALUE seen(VALUE, VALUE);
9
+ static VALUE remember(VALUE, VALUE);
10
+ static VALUE forget(VALUE, VALUE);
11
+
12
+ static VALUE get_indent(VALUE);
13
+ static VALUE set_indent(VALUE, VALUE);
14
+ void rb_json_state_indent(VALUE, VALUE, long);
@@ -0,0 +1,15 @@
1
+ dir = File.dirname(__FILE__)
2
+ require "#{dir}/lib/fjson"
3
+ require 'benchmark'
4
+
5
+ def execute
6
+ 100000.times do
7
+ {
8
+ "foo" => {
9
+ "bar" => "baz"
10
+ }
11
+ }.to_json
12
+ end
13
+ end
14
+
15
+ puts Benchmark.measure {execute}
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rbconfig'
4
+ require 'fileutils'
5
+ include FileUtils::Verbose
6
+
7
+ include Config
8
+
9
+ dest = CONFIG["bindir"]
10
+ cd 'bin' do
11
+ filename = 'edit_json.rb'
12
+ install(filename, dest)
13
+ end
14
+ dest = CONFIG["sitelibdir"]
15
+ cd 'lib' do
16
+ install('json.rb', dest)
17
+ mkdir_p File.join(dest,'json')
18
+ install(File.join('json', 'editor.rb'), File.join(dest,'json'))
19
+ install(File.join('json', 'json.xpm'), File.join(dest,'json'))
20
+ end
21
+ # vim: set et sw=2 ts=2:
@@ -0,0 +1,34 @@
1
+ def setup_extension(dir, extension=nil)
2
+ ext_dir = "ext/#{dir}"
3
+ extension = File.basename(dir) if extension.nil?
4
+ ext_so = "#{ext_dir}/#{extension}.#{Config::CONFIG['DLEXT']}"
5
+
6
+ desc "Builds the #{extension} extension"
7
+ task extension.to_sym => ["#{ext_dir}/Rakefile", ext_so ]
8
+
9
+ file "#{ext_dir}/Rakefile" => ["#{ext_dir}/extconf.rb"] do
10
+ extconf "#{ext_dir}"
11
+ end
12
+
13
+ ext_files = FileList[
14
+ "#{ext_dir}/*.c",
15
+ "#{ext_dir}/*.h",
16
+ "#{ext_dir}/extconf.rb",
17
+ "#{ext_dir}/Rakefile",
18
+ "lib"
19
+ ]
20
+ ext_subdir = File.dirname(dir)
21
+ file ext_so => ext_files do
22
+ rake ext_dir
23
+ end
24
+ end
25
+
26
+ def extconf(dir)
27
+ Dir.chdir(dir) do ruby "extconf.rb" end
28
+ end
29
+
30
+ def rake(rakedir)
31
+ Dir.chdir(rakedir) do
32
+ sh("rake")
33
+ end
34
+ end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: fjson
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.1
7
- date: 2006-10-10 00:00:00 -07:00
6
+ version: 0.0.2
7
+ date: 2006-10-16 00:00:00 -07:00
8
8
  summary: This library is for parsing JSON strings and unparsing ruby data structures. This library is a fork of Florian Frank's JSON library with key parts implemented in C for performance improvements.
9
9
  require_paths:
10
10
  - lib
@@ -31,27 +31,51 @@ authors:
31
31
  files:
32
32
  - Rakefile
33
33
  - GPL
34
- - VERSION
35
34
  - TODO
36
35
  - CHANGES
37
36
  - README
37
+ - rake_helper.rb
38
+ - install.rb
39
+ - hash_benchmark.rb
38
40
  - lib/parser.rb
39
41
  - lib/fjson.rb
40
42
  - lib/extensions/kernel.rb
41
43
  - lib/extensions/class.rb
42
44
  - lib/extensions/string.rb
43
45
  - lib/json/editor.rb
44
- - lib/json_ext.so
45
- - lib/state_ext.so
46
- - lib/extensions/object_ext.so
47
- - lib/extensions/integer_ext.so
48
- - lib/extensions/float_ext.so
49
- - lib/extensions/string_ext.so
50
- - lib/extensions/true_class_ext.so
51
- - lib/extensions/false_class_ext.so
52
- - lib/extensions/nil_class_ext.so
53
- - lib/extensions/array_ext.so
54
- - lib/extensions/hash_ext.so
46
+ - ext/extensions/false_class_ext/false_class_ext.h
47
+ - ext/extensions/hash_ext/hash_ext.h
48
+ - ext/extensions/true_class_ext/true_class_ext.h
49
+ - ext/extensions/float_ext/float_ext.h
50
+ - ext/extensions/object_ext/object_ext.h
51
+ - ext/extensions/string_ext/string_ext.h
52
+ - ext/extensions/nil_class_ext/nil_class_ext.h
53
+ - ext/extensions/integer_ext/integer_ext.h
54
+ - ext/extensions/array_ext/array_ext.h
55
+ - ext/state_ext/state_ext.h
56
+ - ext/json_ext/json_ext.h
57
+ - ext/extensions/false_class_ext/false_class_ext.c
58
+ - ext/extensions/hash_ext/hash_ext.c
59
+ - ext/extensions/true_class_ext/true_class_ext.c
60
+ - ext/extensions/float_ext/float_ext.c
61
+ - ext/extensions/object_ext/object_ext.c
62
+ - ext/extensions/string_ext/string_ext.c
63
+ - ext/extensions/nil_class_ext/nil_class_ext.c
64
+ - ext/extensions/integer_ext/integer_ext.c
65
+ - ext/extensions/array_ext/array_ext.c
66
+ - ext/state_ext/state_ext.c
67
+ - ext/json_ext/json_ext.c
68
+ - ext/extensions/false_class_ext/extconf.rb
69
+ - ext/extensions/hash_ext/extconf.rb
70
+ - ext/extensions/true_class_ext/extconf.rb
71
+ - ext/extensions/float_ext/extconf.rb
72
+ - ext/extensions/object_ext/extconf.rb
73
+ - ext/extensions/string_ext/extconf.rb
74
+ - ext/extensions/nil_class_ext/extconf.rb
75
+ - ext/extensions/integer_ext/extconf.rb
76
+ - ext/extensions/array_ext/extconf.rb
77
+ - ext/state_ext/extconf.rb
78
+ - ext/json_ext/extconf.rb
55
79
  - spec/true_class_spec.rb
56
80
  - spec/float_spec.rb
57
81
  - spec/string_spec.rb
@@ -85,13 +109,21 @@ test_files:
85
109
  - spec/string_with_utf8_values_when_supporting_unicode_json_spec.rb
86
110
  rdoc_options: []
87
111
 
88
- extra_rdoc_files: []
89
-
112
+ extra_rdoc_files:
113
+ - README
90
114
  executables: []
91
115
 
92
- extensions: []
93
-
116
+ extensions:
117
+ - Rakefile
94
118
  requirements: []
95
119
 
96
- dependencies: []
97
-
120
+ dependencies:
121
+ - !ruby/object:Gem::Dependency
122
+ name: mkrf
123
+ version_requirement:
124
+ version_requirements: !ruby/object:Gem::Version::Requirement
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ version: 0.1.2
129
+ version:
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.4.1
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file