webidl 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ interface Foo {
2
+ creator Foo (boolean foo);
3
+ setter void (DOMString key, DOMString value);
4
+ getter DOMString (DOMString key);
5
+ stringifier DOMString ();
6
+ deleter void ();
7
+ };
@@ -89,4 +89,29 @@ RUBY
89
89
  actual = generate(fixture("module_with_implements_statement.idl"))
90
90
  actual.should == expected
91
91
  end
92
+
93
+ it "generates code for no-name setters, getters, creators, stringifier and deleters" do
94
+ expected = <<-RUBY
95
+ module Foo
96
+ def initialize(foo)
97
+ raise(NotImplementedError)
98
+ end
99
+ def []=(key, value)
100
+ raise(NotImplementedError)
101
+ end
102
+ def [](key)
103
+ raise(NotImplementedError)
104
+ end
105
+ def to_s
106
+ raise(NotImplementedError)
107
+ end
108
+ def delete!
109
+ raise(NotImplementedError)
110
+ end
111
+ end
112
+ RUBY
113
+
114
+ actual = generate(fixture("interface_with_specials.idl"))
115
+ actual.should == expected.strip
116
+ end
92
117
  end
data/spec/spec_helper.rb CHANGED
@@ -7,11 +7,10 @@ require 'spec'
7
7
  require 'spec/autorun'
8
8
  require "pp"
9
9
 
10
- require "ruby-debug"
11
-
12
- Debugger.start
13
- Debugger.settings[:autoeval] = true
14
- Debugger.settings[:autolist] = 1
10
+ # require "ruby-debug"
11
+ # Debugger.start
12
+ # Debugger.settings[:autoeval] = true
13
+ # Debugger.settings[:autolist] = 1
15
14
 
16
15
  module ParseHelper
17
16
  def parse(input)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webidl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jari Bakken
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-08 00:00:00 +01:00
12
+ date: 2009-11-21 00:00:00 +01:00
13
13
  default_executable: webidl2ruby
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -102,6 +102,7 @@ files:
102
102
  - lib/webidl/parse_tree/stringifier_attribute_or_operation.rb
103
103
  - lib/webidl/parse_tree/typedef.rb
104
104
  - lib/webidl/parser/debug_helper.rb
105
+ - lib/webidl/parser/idl.rb
105
106
  - lib/webidl/parser/idl.treetop
106
107
  - spec/ast_spec.rb
107
108
  - spec/fixtures/empty_interface.idl
@@ -111,6 +112,7 @@ files:
111
112
  - spec/fixtures/interface_with_attribute.idl
112
113
  - spec/fixtures/interface_with_inheritance.idl
113
114
  - spec/fixtures/interface_with_members.idl
115
+ - spec/fixtures/interface_with_specials.idl
114
116
  - spec/fixtures/interface_with_stringifiers.idl
115
117
  - spec/fixtures/module_with_exception.idl
116
118
  - spec/fixtures/module_with_implements_statement.idl