sdl4r 0.9.9 → 0.9.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. data/CHANGELOG +70 -1
  2. data/LICENSE +499 -497
  3. data/Rakefile +38 -28
  4. data/TODO +194 -45
  5. data/doc/classes/SDL4R/AbbreviationTimezoneProxy.html +151 -0
  6. data/doc/classes/SDL4R/ConstantTimezone.html +129 -0
  7. data/doc/classes/SDL4R/Element.html +148 -0
  8. data/doc/classes/SDL4R/Reader.html +683 -0
  9. data/doc/classes/SDL4R/RelativeTimezone.html +187 -0
  10. data/doc/classes/SDL4R/SdlBinary.html +188 -0
  11. data/doc/classes/SDL4R/SdlParseError.html +110 -0
  12. data/doc/classes/SDL4R/SdlTimeSpan.html +651 -0
  13. data/doc/classes/SDL4R/Serializer.html +557 -0
  14. data/doc/classes/SDL4R/Serializer/Ref.html +138 -0
  15. data/doc/classes/SDL4R/TZAbbreviationDB/Record.html +117 -0
  16. data/doc/classes/SDL4R/Tag.html +1274 -0
  17. data/doc/classes/SDL4R/Token.html +131 -0
  18. data/doc/created.rid +1 -0
  19. data/doc/files/CHANGELOG.html +290 -0
  20. data/doc/files/LICENSE.html +53 -0
  21. data/doc/files/README.html +405 -0
  22. data/doc/files/lib/sdl4r/abbreviation_timezone_proxy_rb.html +63 -0
  23. data/doc/files/lib/sdl4r/constant_timezone_rb.html +54 -0
  24. data/doc/files/lib/sdl4r/element_rb.html +54 -0
  25. data/doc/files/lib/sdl4r/reader_rb.html +68 -0
  26. data/doc/files/lib/sdl4r/relative_timezone_rb.html +62 -0
  27. data/doc/files/lib/sdl4r/sdl4r_rb.html +66 -0
  28. data/doc/files/lib/sdl4r/sdl4r_tzinfo_rb.html +64 -0
  29. data/doc/files/lib/sdl4r/sdl4r_version_rb.html +54 -0
  30. data/doc/files/lib/sdl4r/sdl_binary_rb.html +54 -0
  31. data/doc/files/lib/sdl4r/sdl_parse_error_rb.html +54 -0
  32. data/doc/files/lib/sdl4r/sdl_time_span_rb.html +54 -0
  33. data/doc/files/lib/sdl4r/serializer_rb.html +62 -0
  34. data/doc/files/lib/sdl4r/tag_rb.html +66 -0
  35. data/doc/files/lib/sdl4r/token_rb.html +54 -0
  36. data/doc/files/lib/sdl4r/tokenizer_rb.html +64 -0
  37. data/doc/files/lib/sdl4r/tz_abbreviation_db_rb.html +67 -0
  38. data/doc/files/lib/sdl4r_rb.html +54 -0
  39. data/doc/files/lib/sdl4r_tzinfo_rb.html +54 -0
  40. data/doc/fr_class_index.html +23 -0
  41. data/doc/fr_file_index.html +40 -0
  42. data/doc/fr_method_index.html +4711 -0
  43. data/doc/index.html +15 -0
  44. data/doc/rdoc-style.css +328 -0
  45. data/lib/sdl4r.rb +3 -1
  46. data/lib/sdl4r/abbreviation_timezone_proxy.rb +38 -0
  47. data/lib/sdl4r/constant_timezone.rb +58 -0
  48. data/{test/sdl4r/sdl_test.rb → lib/sdl4r/element.rb} +19 -14
  49. data/lib/sdl4r/reader.rb +772 -0
  50. data/lib/sdl4r/relative_timezone.rb +156 -0
  51. data/lib/sdl4r/sdl4r.rb +187 -45
  52. data/lib/sdl4r/sdl4r_tzinfo.rb +75 -0
  53. data/lib/sdl4r/sdl4r_version.rb +24 -0
  54. data/lib/sdl4r/sdl_parse_error.rb +1 -1
  55. data/lib/sdl4r/sdl_time_span.rb +5 -1
  56. data/lib/sdl4r/serializer.rb +473 -60
  57. data/lib/sdl4r/tag.rb +126 -51
  58. data/lib/sdl4r/token.rb +49 -0
  59. data/lib/sdl4r/tokenizer.rb +431 -0
  60. data/lib/sdl4r/tz_abbreviation_db.rb +266 -0
  61. data/read_jprof.html +16934 -0
  62. data/read_jprof_pull.html +14451 -0
  63. data/read_prof.html +4983 -0
  64. data/read_prof_pull.html +4896 -0
  65. data/test/sdl4r/parser_test.rb +577 -503
  66. data/test/sdl4r/read_jprof.rb +58 -0
  67. data/test/sdl4r/read_prof.rb +70 -0
  68. data/test/sdl4r/reader_test.rb +173 -0
  69. data/test/sdl4r/relative_timezone_test.rb +102 -0
  70. data/test/sdl4r/sdl4r_test.rb +611 -528
  71. data/test/sdl4r/sdl4r_tzinfo_test.rb +108 -0
  72. data/test/sdl4r/sdl_test_case.rb +60 -0
  73. data/test/sdl4r/serializer_test.rb +448 -11
  74. data/test/sdl4r/tag_test.rb +84 -5
  75. data/test/sdl4r/tokenizer_test.rb +128 -0
  76. metadata +69 -11
  77. data/lib/sdl4r/parser.rb +0 -648
  78. data/lib/sdl4r/parser/reader.rb +0 -184
  79. data/lib/sdl4r/parser/time_span_with_zone.rb +0 -57
  80. data/lib/sdl4r/parser/token.rb +0 -138
  81. data/lib/sdl4r/parser/tokenizer.rb +0 -507
data/Rakefile CHANGED
@@ -5,6 +5,9 @@ require 'rake/gempackagetask'
5
5
  require 'rake/packagetask'
6
6
  require 'rubygems'
7
7
 
8
+ lib_dir = File.expand_path('lib')
9
+ test_dir = File.expand_path('test')
10
+
8
11
  # Use Hanna as the documentation template if installated,
9
12
  # otherwise generate with the default RDoc generator.
10
13
  if USING_HANNA = Gem.required_location("hanna", "hanna/rdoctask.rb")
@@ -17,7 +20,10 @@ spec = Gem::Specification.new do |s|
17
20
  s.platform = Gem::Platform::RUBY
18
21
  s.summary = "Simple Declarative Language for Ruby library"
19
22
  s.name = 'sdl4r'
20
- s.version = '0.9.9'
23
+
24
+ require File.dirname(__FILE__) + "/lib/sdl4r/sdl4r_version.rb"
25
+ s.version = SDL4R::VERSION
26
+
21
27
  s.requirements << 'none'
22
28
  s.require_path = 'lib'
23
29
  s.authors = ['Philippe Vosges', 'Daniel Leuck']
@@ -26,13 +32,13 @@ spec = Gem::Specification.new do |s|
26
32
  s.homepage = 'http://sdl4r.rubyforge.org/'
27
33
  s.files = FileList['lib/sdl4r.rb', 'lib/sdl4r/**/*.rb', 'bin/*', '[A-Z]*', 'test/**/*', 'doc/**/*'].to_a
28
34
  s.test_files = FileList[ 'test/**/*test.rb' ].to_a
29
- s.description = <<EOF
30
- The Simple Declarative Language provides an easy way to describe lists, maps,
31
- and trees of typed data in a compact, easy to read representation.
32
- For property files, configuration files, logs, and simple serialization
33
- requirements, SDL provides a compelling alternative to XML and Properties
34
- files.
35
- EOF
35
+ s.description = <<-EOF
36
+ The Simple Declarative Language provides an easy way to describe lists, maps,
37
+ and trees of typed data in a compact, easy to read representation.
38
+ For property files, configuration files, logs, and simple serialization
39
+ requirements, SDL provides a compelling alternative to XML and Properties
40
+ files.
41
+ EOF
36
42
  end
37
43
 
38
44
  Rake::GemPackageTask.new(spec) do |pkg|
@@ -40,26 +46,8 @@ Rake::GemPackageTask.new(spec) do |pkg|
40
46
  pkg.need_tar = true
41
47
  end
42
48
 
43
- # FIXME The package task tries to package twice and it shouldn't:
44
- # - once with the provided command (i.e. 7zip if zip is not available)
45
- # - once with "zip" disregarding the configuration (that attempt fails if you do not have the
46
- # "zip" command)
47
- #Rake::PackageTask.new(spec.name, spec.version) do |p|
48
- # p.need_zip = true
49
- # p.need_tar = false
50
- # p.need_tar_gz = false
51
- # p.need_tar_bz2 = false
52
- #
53
- # # If "zip" is not available, we try 7-zip.
54
- #puts "========================================================"
55
- # system("zip")
56
- # p.zip_command = "7z a -tzip" if $?.exitstatus == 127
57
- # system("tar")
58
- # p.tar_command = "7z a -ttar" if $?.exitstatus == 127
59
- #end
60
-
61
49
  Rake::RDocTask.new do |rd|
62
- files = ['README', 'LICENSE', 'CHANGELOG', 'lib/**/*.rb', 'doc/**/*.rdoc', 'test/**/*.rb']
50
+ files = ['README', 'LICENSE', 'CHANGELOG', 'lib/**/*.rb', 'doc/**/*.rdoc']
63
51
  rd.main = 'README'
64
52
  rd.rdoc_files.include(files)
65
53
  rd.rdoc_files.exclude("lib/scratchpad.rb")
@@ -70,9 +58,20 @@ Rake::RDocTask.new do |rd|
70
58
  rd.options << '--inline-source'
71
59
  end
72
60
 
61
+ if Gem.required_location("yard", "yard.rb")
62
+ require 'yard'
63
+ YARD::Rake::YardocTask.new do |t|
64
+ files = FileList.new('README', 'LICENSE', 'CHANGELOG', 'lib/**/*.rb', 'doc/**/*.rdoc')
65
+ files.exclude("lib/scratchpad.rb")
66
+ t.files = files.to_ary
67
+ end
68
+ end
69
+
73
70
  Rake::TestTask.new do |t|
74
71
  t.test_files = FileList['test/**/*test.rb']
75
72
  t.verbose = true
73
+ t.libs = [lib_dir, test_dir]
74
+ t.warning = true
76
75
  end
77
76
 
78
77
  # Generates the SDL4R site with Nanoc.
@@ -82,4 +81,15 @@ nanoc_compile = task :nanoc_compile do
82
81
  system("nanoc", "compile")
83
82
  }
84
83
  end
85
- nanoc_compile.comment = "Builds the site with Nanoc"
84
+ nanoc_compile.comment = "Builds the site with Nanoc"
85
+
86
+ if Gem.required_location("ruby-prof", "ruby-prof/task.rb")
87
+ require 'ruby-prof/task'
88
+
89
+ RubyProf::ProfileTask.new do |t|
90
+ t.test_files = FileList['test/**/*_prof.rb']
91
+ t.output_dir = "."
92
+ t.printer = :graph_html
93
+ t.min_percent = 1
94
+ end
95
+ end
data/TODO CHANGED
@@ -9,13 +9,10 @@
9
9
  [x] "null" value test
10
10
  [x] Comment tests
11
11
  [x] Bad syntax tests
12
- [ ] Test write (unit tests)
13
- [x] Dates
14
- [ ] Numbers
15
12
  [A] Use YARD in order to generate documentation ?
16
13
  ==> alternatively, I tried to generate some RDoc templates but none worked in Rake...
17
- [ ] BUG: the line number is too high by 1 (the column is correct).
18
- [/] Fix the differences between test_basic_types.sdl and what is generated from the parsed structure
14
+ [x] BUG: the line number is too high by 1 (the column is correct).
15
+ [x] Fix the differences between test_basic_types.sdl and what is generated from the parsed structure
19
16
  [x] chars
20
17
  [x] longs
21
18
  [x] doubles
@@ -26,30 +23,28 @@
26
23
  [x] times
27
24
  [x] negative times
28
25
  [x] datetimes
29
- [/] zone codes
26
+ [x] zone codes
30
27
  ==> Time only works in UTC, which means that the original zone code is lost.
31
28
  ==> DateTime doesn't give the zone code but only the offset.
32
- [ ] Use TzTime? Use a custom object that knows whether a time zone was specified?
29
+ [A] Use TzTime? Use a custom object that knows whether a time zone was specified?
33
30
  ==> http://tztime.rubyforge.org/
34
31
  ==> along with TzInfo: http://tzinfo.rubyforge.org/
35
- [ ] See how Ruby floats relate to Java floats and doubles.
36
- [ ] Add tests for the SDL class
37
- [ ] Allow unicode characters in identifiers.
38
- [ ] FUTURE: It might be useful to allow people to replace the standard types by their own. This
32
+ ==> We could provide a sdl4r/tztime.rb, which would change the behavior of SDL4R so that
33
+ it uses TzTimes and TzInfos.
34
+ [x] Add tests for the SDL class
35
+ [x] Allow unicode characters in identifiers.
36
+ [x] FUTURE: It might be useful to allow people to replace the standard types by their own. This
39
37
  could be useful for dates or numbers, for instance.
40
- [ ] FUTURE: Consider being able to read text files that are not UTF-8(?)
41
- [ ] BUG: the report on the line no in errors is off by 1 (at least in some cases)
42
- [ ] Tag.hash: the implementation is not very efficient.
38
+ ==> possible for times, not for dates or numbers
39
+ [A] FUTURE: Consider being able to read text files that are not UTF-8(?)
40
+ ==> The burden is on the IO object, the regexp take care of the rest (a priori).
41
+ [x] BUG: the report on the line no in errors is off by 1 (at least in some cases)
42
+ [A] Tag.hash: the implementation is not very efficient.
43
43
  ==> Difficult to make better and still simple
44
44
  ==> Maybe possible when it's frozen.
45
- [ ] FUTURE: xpath, ypath ==> sdlpath(?)
46
- [ ] FUTURE: evenemential parsing(?)
47
- [ ] FUTURE: add a way to insert a tag after or before another or at some index(?)
48
- [ ] FUTURE: allow some way of generating YAML(?)
49
- [ ] FUTURE: allow to turn a YAML structure into a SDL one(?)
50
- [ ] BUG: "rake package" tries to archive the contents twice: once with the command that I configure
51
- in Rakefile, once with a zip command that can't work on my machine (zip is not installed). Why?
52
- At least, the first archive is created and seems correct.
45
+ [x] FUTURE: evenemential parsing(?)
46
+ ==> via the pull parser
47
+ [x] FUTURE: pull parser(?)
53
48
  [A] FUTURE: Would we need a "write" method in SDL4R?
54
49
  ==> Na, there's already Tag.write(), I guess.
55
50
  [N] Never call a class "Test" => it can easily conflict with the "Test" module of Test::Unit and
@@ -63,28 +58,20 @@
63
58
  ==> Minor change: we return nil for the methods were nothing was really returned explicitely
64
59
  (for the time being).
65
60
  [x] If there is any success, maybe create/recreate the Rubyforge site for the support.
66
- [ ] Should we allow to create a Tag without a name (== "content") for anonymous Tags?
61
+ [x] Should we allow to create a Tag without a name (== "content") for anonymous Tags?
62
+ ==> It seems natural.
67
63
  [x] Add latest doc access to RubyForge:
68
64
  ==> Rake task?
69
65
 
70
- [ ] ONWAIT: Implement the [] operator in order to access attributes:
71
- ["attr"] <=> attribute("attr")
72
- ["ns:attr"] <=> attribute("ns", "attr") (should we allow this?)
73
- ["ns", "attr"] <=> attribute("ns", "attr")
74
- Should we allow attribute("ns:attr")?
75
- ==> Mmmm, but it could also mean "get child with that name". Let's wait.
76
66
  [x] IDEA: marshaller? easy object <=> SDL read/write?
77
67
  SEE SPECS @ Ikayzo: http://www.ikayzo.org/confluence/display/SDL/Draft+-+Serialization+with+SDL
78
- [ ] Check the coverage and make the tests better.
79
- ==> Might be better to use some other tool than
80
- [ ] IDEA: add an option to the XML export allowing to write anonymous nodes as XML tag content?
81
- [ ] IDEA: add an option to the XML export allowing to export without formatting?
68
+ [A] IDEA: add an option to the XML export allowing to write anonymous nodes as XML tag content?
69
+ [A] IDEA: add an option to the XML export allowing to export without formatting?
70
+ ==> If you want to generate fancy XML, there are libraries to do it and it's not that difficult
71
+ from SDL.
82
72
  [x] BUG: line continuation is not handled properly (skipping chars etc).
83
- [ ] BUG: the rake task 'gen_rubyforge' doesn't work under 1.9 (only 1.8.7)
73
+ [A] BUG: the rake task 'gen_rubyforge' doesn't work under 1.9 (only 1.8.7)
84
74
  ==> when Hanna is not installed the CHANGELOG HTML file must have a different name.
85
- [ ] Look into performances, compared to YAML or XML parsers
86
- [ ] Future: SDL + ERB to have dynamic config templates
87
- see http://github.com/binarylogic/settingslogic
88
75
  [x] Future: object dump/load as YAML does
89
76
  SEE SPECS @ Ikayzo: http://www.ikayzo.org/confluence/display/SDL/Draft+-+Serialization+with+SDL
90
77
  - add to_sdl(4r) to Object
@@ -110,9 +97,8 @@
110
97
  }
111
98
  - use Class.allocate() to have a blank object on deserialization.
112
99
 
113
- [ ] Have to_string implement options
100
+ [v] Have to_string implement options ==> builder
114
101
  [x] Put the docs online
115
- [ ] Document Rakefile and dependencies
116
102
  [x] BUG: in Ruby 1.9.2
117
103
  <internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- test/sdl4r/../../lib
118
104
  /sdl4r/tag (LoadError)
@@ -133,17 +119,15 @@
133
119
  ==> We link to the RDoc for the time being.
134
120
  ====================================================================================================
135
121
  [x] Add a line about the support of of 1.9 in README (1.9.1 and 1.9.2)
136
- [ ] Get the version from some common (Rakefile?) place in Nanoc
137
- [ ] Add a modification date to site pages?
138
122
  [x] Clean up the Rakefile and see whether that Rubyforge upload task is necessary.
139
123
  ==> Easier to upload the site manually: I removed the code.
140
- [ ] Future (not necessarily for Ruby): SDL parser ==> SAX
141
- [ ] Optimization: cache strings in order not to duplicate them (especially tag names?)
124
+ [A] Optimization: cache strings in order not to duplicate them (especially tag names?)
125
+ ==> can be done outside of SDL4R if necessary
142
126
  [x] Add a constant for "content".
143
127
  ==> ANONYMOUS_TAG_NAME
144
128
  ==> Also added ROOT_TAG_NAME
145
129
  [x] Fixed missing Parser.parse_error() error.
146
- [ ] BUG: this is parsed
130
+ [x] BUG: this is parsed
147
131
  vegetable {
148
132
  }
149
133
  while this is not
@@ -151,9 +135,174 @@
151
135
 
152
136
  ==> It seems this is not supported by the Java parser. Is it invalid/valid syntax?
153
137
  ==> It will be in the next version of SDL.
138
+ ==> Supported by the latest pull parser in the Ruby version
154
139
  [x] BUG: '$' is a valid identifier character and it is not accepted.
155
140
  ====================================================================================================
156
141
  [x] Check that if you write 2 values, a date and a timespan, you get both normally when you load.
157
142
  ==> Considered as a bug in the language spec by Dan.
158
143
  [x] BUG: negative years seem not to be supported in dates (somehow mistaken for integers: -4712/01/01)
159
- [ ] Allow Symbols as attribute/child names
144
+ [x] Allow Symbols as attribute/child names
145
+ [x] Tag#new
146
+ [x] Tag#new_child
147
+ [x] Tag#set_attribute
148
+ [x] Tests for Tag#<<
149
+ [A] Allow
150
+ Tag.new('myTag') << { 'tool' => { 'name' => 'hammer', 'price' => 19.99 } }
151
+ in order to create hierarchies of Tags easily.
152
+ ==> It's cool but is it really useful?
153
+ ==> people could use deserialization to do the same
154
+ [x] Warning: sdl4r/tag.rb:600: warning: shadowing outer local variable - namespace
155
+ ==> Verify fix
156
+ [x] Warning: sdl4r/parser/tokenizer.rb:489: warning: character class has duplicated range: /[\w_$-\.]/
157
+ ==> Verify fix
158
+ [x] BUG: Seems that the Java version doesn't support time zones stated as "+01:00" for instance. Only 3 letters codes?
159
+ ==> Should be "-GMT+01:00"
160
+ [x] BUG: timezones should support only:
161
+ 1. -JST (a zone code alone)
162
+ 2. -GMT+02:30 (custom zone offset based on GMT and not any other code - well, maybe UTC -)
163
+ ==> We also support -JST+00:30 because it is not so complicated.
164
+ [N] NOTE: Date.Format.ZONES seems to be the richest reference of zones in the standard API
165
+ [x] Deserialization: custom object class support
166
+ [x] Deserialization: custom value types (not SDL)
167
+ ==> Could be done by redefining Serializer#set_serializable_property() for instance.
168
+ ==> will also be possible in #from_sdl(), I guess
169
+ [x] Deserialization: idiom detection
170
+ ==> Vectors, matrices
171
+ [x] Deserialization: anonymous tags
172
+ [x] Serialization/Deserialization: attribute/instance variable access priority rules
173
+ ==> 1. property accessor if both accessors defined
174
+ 2. direct variable access otherwise
175
+ [x] Test
176
+ [x] Serialization: Hash rather than OpenStruct as default
177
+ [x] Serialization: omit nil attributes option
178
+ [x] Serialization/Deserialization: object references, object cycles
179
+ [x] Spec and Impl of Serialization: handling of arrays, collections, etc
180
+ [x] Specification
181
+ [x] Serialization implementation
182
+ [x] Deserialization implementation
183
+ [x] Detect when there are several child tags with the same name and create corresponding array
184
+ [x] Test deserialization of root tag as a Hash
185
+ [x] Serialization & Deserialization of Hashes
186
+ [x] Serialization Implementation
187
+ [x] Deserialization Implementation
188
+ [x] Deserialization: test values
189
+ [x] Serializer: make a better idiom for new_collection_tag()
190
+ ==> Replace by get_collection_item_name() ?
191
+ ==> Fix the method signatures and visibilities
192
+ [x] Deserialization: test object property priorities
193
+ [x] Test that a lonely anonymous tag gives a simple value and not an array in the results
194
+ [x] Test that we generate a child tag with values if property value is an array of SDL values
195
+ [x] Implement from_sdl(), to_sdl()
196
+ ==> may need new accessors and better interface in Serializer
197
+ ==> to_sdl(serializer)
198
+ [x] SDL4R dump()/load()
199
+ [x] Serialization: test nil values for properties or inside arrays, matrices, etc
200
+ [A] Memory optimization: use a map of the strings for SDL identifiers in Parser
201
+ ==> With the new Reader nothing prevents from implementing it outside of SDL4R.
202
+ [A] Memory optimization: the profiling test under JRuby takes a LOT of memory
203
+ ==> It seems ok now.
204
+ [x] Option for the namespace in the serialization.
205
+ [A] Option to disable Unicode identifiers? ==> not so important
206
+ [x] Use ruby-prof
207
+ ==> Lot of time spent in the reader
208
+ ==> Lot of time spent wherever there are lots of tests (IFs or CASEs)
209
+ [x] Use jruby-prof
210
+ [x] Profile Ruby script (==> read_jprof.rb)
211
+ [N] Test with JRuby in mode -Djruby.compat.version=RUBY1_9
212
+ [N] Be clear about the difference between /.../ and /.../u
213
+ ==> /.../u regexps will refuse to work with not-UTF8 strings as far as I know.
214
+ ==> /.../ regexps might or might not be UTF8 compatible depending on the context (Ruby
215
+ implementation, global options, etc).
216
+ [x] Do not generate the doc for the tests.
217
+ [x] Consider using Yardoc (http://yardoc.org/) in order to generate the documentation.
218
+ [x] BUG: Parser.get_time_zone_offset() should take the year and the month in order to calculate
219
+ the offset (when there is a zone code) because there can be saving day saving time depending on
220
+ the year.
221
+ ==> The code should be correct but I can't find a way to calculate the DST offset for a zone and
222
+ a date. Providing this date and zone to DateTime.strptime() doesn't work (the DST factor is
223
+ ignored). TO FIX LATER in Parser.get_time_zone_offset().
224
+ [x] IDEA: pull parser
225
+ ==> Ruby 1.9: 19% faster
226
+ ==> JRuby (--1.8): 43% faster
227
+ [x] BUG: SDL4R#format() seems to return a US-ASCII string for DateTimes (because of strftime()?)
228
+ [x] Test SDL4R#format() with Time instances.
229
+ [x] BUG: Under Ruby187, we have the following kind of warnings:
230
+ E:/dev/sdl/sdl4r/lib/sdl4r/serializer.rb:463: warning: instance variable @food not initialized
231
+ when calling instance_variable_get() on an object. The warning is completely unnecessary.
232
+ ==> We now check the variable exists beforehand with instance_variable_defined?()
233
+ [x] Use TZInfo for timezones
234
+ [A] Wrap TimezonePeriod to avoid accessing unpublished elements of TZInfo.
235
+ ==> too much work + can be broken easily
236
+ [x] Declare TZInfo in the dependencies of the gem
237
+ [x] Test the TZINfo refactor under JRuby 1.8/1.9 and Ruby 1.9
238
+ [x] BUG: Parser error when running tests under "JRuby --1.9"
239
+ ==> Look into it even if the support of 1.9 in JRuby is not complete
240
+ ==> JRuby --1.9 doesn't support encodings specifications right now
241
+ [A] Use TZTime optionaly
242
+ [A] Use TZTime::LocalTime::Builder.get_time_zone() instead of the basic TZInfo::Timezone.get().
243
+ ==> Hmmm: it seems TZTime never passed v0.1.0, which doesn't work in 1.9.2.
244
+ [x] A date should be created with seconds and milliseconds separate + the TZInfo
245
+ (and not the offset)
246
+ [x] Add a method or an option to create Time instead of DateTime so that switching is easy
247
+ [x] 4 tests: DateTime, Time, DateTime + TZInfo, Time + TZInfo
248
+ [x] BUG in Netbeans: the chosen Ruby runtime of the project doesn't determine what library files
249
+ are open on navigation (when you change the runtime from 1.8 to 1.9 for instance).
250
+ ==> Reported
251
+ [x] TZAbbreviationDB doesn't work in 1.8.7 ==> CSV.open/CSV.foreach (not the same arguments in the
252
+ two versions).
253
+ [x] Make all the test cases include SdlTestCase and put the Netbeans work-around there, uncommented.
254
+ [x] Make tests with Nokogiri in order to understand the order of the events and the availability of
255
+ the info (e.g. attributes) on different points.
256
+ ==> It seems Nokogiri doesn't emit all the nodes for which there are constants:
257
+ TYPE_ELEMENT
258
+ TYPE_END_ELEMENT
259
+ TYPE_SIGNIFICANT_WHITESPACE
260
+ TYPE_TEXT
261
+ Therefore, no attributes, no document, no simple whitespace, etc. We can these are used
262
+ only internally.
263
+ [x] Make Reader more like the one in Nokogiri (i.e. interface).
264
+ [x] Fix parse error test for the pull parser
265
+ [x] ditch the old parser.
266
+ [x] Go deep in what forces me to have path algebra in require commands in source files.
267
+ ==> path start at the dirs of the load path: they are not relative to the current file.
268
+ ==> Fixed
269
+ ===================================================================== 26-dec-2010
270
+ [ ] Use RVM (http://rvm.beginrescueend.com/) in order to handle tests in the different environments.
271
+ ==> Not unless I'm using Linux.
272
+ [ ] Make a builder => extract features from Tag to a Builder. ?
273
+ In Nokogiri, a builder is a way to create a DOM structure, it seems.
274
+ ==> Might rather need an Emitter to convert to text.
275
+ [ ] Get the version from some common (Rakefile?) place in Nanoc
276
+ ==> Version is now declared in sdl4r.sdl4r_version.
277
+ [ ] Add a modification date to site pages?
278
+ [ ] Base the deserializer on the Reader rather than the DOM structure.
279
+ [ ] If the emitter allows it, base the serializer on it rather than on the DOM structure.
280
+ [ ] Rakefile Tasks for profiling : --debug -I"E:/dev/sdl/sdl4r/lib" -I"E:/dev/sdl/sdl4r/test"
281
+ [ ] Parser unit tests for numbers
282
+ [ ] See how Ruby floats relate to Java floats and doubles.
283
+ [ ] FUTURE: xpath, ypath ==> spath(?)
284
+ [ ] FUTURE: add a way to insert a tag after or before another or at some index(?)
285
+ [ ] FUTURE: allow some way of generating YAML(?)
286
+ [ ] FUTURE: allow to turn a YAML structure into a SDL one(?)
287
+ [ ] BUG: "rake package" tries to archive the contents twice: once with the command that I configure
288
+ in Rakefile, once with a zip command that can't work on my machine (zip is not installed). Why?
289
+ At least, the first archive is created and seems correct.
290
+ [ ] ONWAIT: Implement the [] operator in order to access attributes:
291
+ ["attr"] <=> attribute("attr")
292
+ ["ns:attr"] <=> attribute("ns", "attr") (should we allow this?)
293
+ ["ns", "attr"] <=> attribute("ns", "attr")
294
+ Should we allow attribute("ns:attr")?
295
+ ==> Mmmm, but it could also mean "get child with that name". Let's wait.
296
+ [ ] Check the coverage and make the tests better.
297
+ [x] Look into performances, compared to YAML or XML parsers
298
+ ==> All efficient parsers in the Ruby world seem to be implemented in C.
299
+ ==> Compared to Nokogiri, it is nearly 20 times slower.
300
+ [ ] Future: SDL + ERB to have dynamic config templates
301
+ see http://github.com/binarylogic/settingslogic
302
+ [ ] Document Rakefile and dependencies
303
+ [ ] Future (not necessarily for Ruby): SDL parser ==> SAX
304
+ [ ] Serialization: option to choose between attribute or child tag generation for instance variables
305
+ [x] reader_test: more tests of the interface
306
+ [x] Move Reader/etc to directory sdl4r?
307
+ [ ] Deliver v0.9.10 or v1.0
308
+ [ ] Update the README to include the use of Reader, TZInfo and Time
@@ -0,0 +1,151 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
+ <html lang='en'>
3
+ <head>
4
+ <title>: SDL4R::AbbreviationTimezoneProxy [RDoc: Simple Declarative Language for Ruby]</title>
5
+ <meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
6
+ <link href='../../rdoc-style.css' media='screen' rel='stylesheet' type='text/css'>
7
+ <script type='text/javascript'>
8
+ //<![CDATA[
9
+ function popupCode(url) {
10
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
11
+ }
12
+
13
+ function toggleCode(id) {
14
+ var code = document.getElementById(id)
15
+
16
+ code.style.display = code.style.display != 'block' ? 'block' : 'none'
17
+ return true
18
+ }
19
+
20
+ // Make codeblocks hidden by default
21
+ document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
22
+ //]]>
23
+ </script>
24
+ </head>
25
+ <body class='page'>
26
+ <div class='class' id='wrapper'>
27
+ <div class='header'>
28
+ <h1 class='name'>
29
+ <span class='type'>Class</span>
30
+ SDL4R::AbbreviationTimezoneProxy
31
+ </h1>
32
+ <ol class='paths'>
33
+ <li>
34
+ <a href="../../files/lib/sdl4r/abbreviation_timezone_proxy_rb.html">lib/sdl4r/abbreviation_timezone_proxy.rb</a>
35
+ </li>
36
+ </ol>
37
+ <div class='parent'>
38
+ Parent:
39
+ <strong>TZInfo::Timezone</strong>
40
+ </div>
41
+ </div>
42
+ <div id='content'>
43
+ <div id='text'>
44
+ <div id='method-list'>
45
+ <h2>Methods</h2>
46
+ <h3>public class</h3>
47
+ <ol>
48
+ <li><a href="#M000001">new</a></li>
49
+ </ol>
50
+ <h3>public instance</h3>
51
+ <ol>
52
+ <li><a href="#M000002">_initialize</a></li>
53
+ <li><a href="#M000003">actual_timezone</a></li>
54
+ <li><a href="#M000004">identifier</a></li>
55
+ <li><a href="#M000005">period_for_utc</a></li>
56
+ <li><a href="#M000006">periods_for_local</a></li>
57
+ </ol>
58
+ </div>
59
+ <div id='section'>
60
+ <div id='methods'>
61
+ <h2>Public class methods</h2>
62
+ <div class='method public-class' id='method-M000001'>
63
+ <a name='M000001'></a>
64
+ <div class='synopsis'>
65
+ <span class='name'>new</span>
66
+ <span class='arguments'>(identifier, consider_modern_abbreviations)</span>
67
+ </div>
68
+ <div class='source'>
69
+ <a class='source-toggle' href='#' onclick="toggleCode('M000001-source'); return false">
70
+ [show source]
71
+ </a>
72
+ <pre id='M000001-source'> <span class="ruby-comment cmt"># File lib/sdl4r/abbreviation_timezone_proxy.rb, line 7</span>&#x000A; 7: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">identifier</span>, <span class="ruby-identifier">consider_modern_abbreviations</span>)&#x000A; 8: <span class="ruby-identifier">o</span> = <span class="ruby-keyword kw">super</span>()&#x000A; 9: <span class="ruby-identifier">o</span>.<span class="ruby-identifier">_initialize</span>(<span class="ruby-identifier">identifier</span>, <span class="ruby-identifier">consider_modern_abbreviations</span>)&#x000A;10: <span class="ruby-identifier">o</span>&#x000A;11: <span class="ruby-keyword kw">end</span></pre>
73
+ </div>
74
+ </div>
75
+ <h2>Public instance methods</h2>
76
+ <div class='method public-instance' id='method-M000002'>
77
+ <a name='M000002'></a>
78
+ <div class='synopsis'>
79
+ <span class='name'>_initialize</span>
80
+ <span class='arguments'>(identifier, consider_modern_abbreviations)</span>
81
+ </div>
82
+ <div class='source'>
83
+ <a class='source-toggle' href='#' onclick="toggleCode('M000002-source'); return false">
84
+ [show source]
85
+ </a>
86
+ <pre id='M000002-source'> <span class="ruby-comment cmt"># File lib/sdl4r/abbreviation_timezone_proxy.rb, line 13</span>&#x000A;13: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_initialize</span>(<span class="ruby-identifier">identifier</span>, <span class="ruby-identifier">consider_modern_abbreviations</span>)&#x000A;14: <span class="ruby-ivar">@identifier</span> = <span class="ruby-identifier">identifier</span>&#x000A;15: <span class="ruby-ivar">@consider_modern_abbreviations</span> = <span class="ruby-identifier">consider_modern_abbreviations</span>&#x000A;16: <span class="ruby-ivar">@actual_timezone</span> = <span class="ruby-keyword kw">nil</span>&#x000A;17: <span class="ruby-keyword kw">end</span></pre>
87
+ </div>
88
+ </div>
89
+ <div class='method public-instance' id='method-M000003'>
90
+ <a name='M000003'></a>
91
+ <div class='synopsis'>
92
+ <span class='name'>actual_timezone</span>
93
+ <span class='arguments'>()</span>
94
+ </div>
95
+ <div class='source'>
96
+ <a class='source-toggle' href='#' onclick="toggleCode('M000003-source'); return false">
97
+ [show source]
98
+ </a>
99
+ <pre id='M000003-source'> <span class="ruby-comment cmt"># File lib/sdl4r/abbreviation_timezone_proxy.rb, line 19</span>&#x000A;19: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">actual_timezone</span>&#x000A;20: <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@actual_timezone</span>&#x000A;21: <span class="ruby-ivar">@actual_timezone</span> = <span class="ruby-identifier">get_timezone</span>(<span class="ruby-identifier">identifier</span>, <span class="ruby-identifier">consider_modern_abbreviations</span>)&#x000A;22: <span class="ruby-keyword kw">end</span>&#x000A;23: <span class="ruby-ivar">@actual_timezone</span>&#x000A;24: <span class="ruby-keyword kw">end</span></pre>
100
+ </div>
101
+ </div>
102
+ <div class='method public-instance' id='method-M000004'>
103
+ <a name='M000004'></a>
104
+ <div class='synopsis'>
105
+ <span class='name'>identifier</span>
106
+ <span class='arguments'>()</span>
107
+ </div>
108
+ <div class='source'>
109
+ <a class='source-toggle' href='#' onclick="toggleCode('M000004-source'); return false">
110
+ [show source]
111
+ </a>
112
+ <pre id='M000004-source'> <span class="ruby-comment cmt"># File lib/sdl4r/abbreviation_timezone_proxy.rb, line 26</span>&#x000A;26: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">identifier</span>&#x000A;27: <span class="ruby-ivar">@identifier</span>&#x000A;28: <span class="ruby-keyword kw">end</span></pre>
113
+ </div>
114
+ </div>
115
+ <div class='method public-instance' id='method-M000005'>
116
+ <a name='M000005'></a>
117
+ <div class='synopsis'>
118
+ <span class='name'>period_for_utc</span>
119
+ <span class='arguments'>(utc)</span>
120
+ </div>
121
+ <div class='source'>
122
+ <a class='source-toggle' href='#' onclick="toggleCode('M000005-source'); return false">
123
+ [show source]
124
+ </a>
125
+ <pre id='M000005-source'> <span class="ruby-comment cmt"># File lib/sdl4r/abbreviation_timezone_proxy.rb, line 30</span>&#x000A;30: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">period_for_utc</span>(<span class="ruby-identifier">utc</span>)&#x000A;31: <span class="ruby-identifier">actual_timezone</span>.<span class="ruby-identifier">period_for_utc</span>(<span class="ruby-identifier">utc</span>)&#x000A;32: <span class="ruby-keyword kw">end</span></pre>
126
+ </div>
127
+ </div>
128
+ <div class='method public-instance' id='method-M000006'>
129
+ <a name='M000006'></a>
130
+ <div class='synopsis'>
131
+ <span class='name'>periods_for_local</span>
132
+ <span class='arguments'>(local)</span>
133
+ </div>
134
+ <div class='source'>
135
+ <a class='source-toggle' href='#' onclick="toggleCode('M000006-source'); return false">
136
+ [show source]
137
+ </a>
138
+ <pre id='M000006-source'> <span class="ruby-comment cmt"># File lib/sdl4r/abbreviation_timezone_proxy.rb, line 34</span>&#x000A;34: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">periods_for_local</span>(<span class="ruby-identifier">local</span>)&#x000A;35: <span class="ruby-identifier">actual_timezone</span>.<span class="ruby-identifier">periods_for_local</span>(<span class="ruby-identifier">local</span>)&#x000A;36: <span class="ruby-keyword kw">end</span></pre>
139
+ </div>
140
+ </div>
141
+ </div>
142
+ </div>
143
+ </div>
144
+ </div>
145
+ <div id='footer-push'></div>
146
+ </div>
147
+ <div id='footer'>
148
+ <a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
149
+ </div>
150
+ </body>
151
+ </html>