win32ole 1.8.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +8 -0
  3. data/.travis.yml +6 -0
  4. data/Gemfile +7 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +56 -0
  7. data/Rakefile +10 -0
  8. data/bin/console +14 -0
  9. data/bin/setup +8 -0
  10. data/ext/win32ole/depend +12 -0
  11. data/ext/win32ole/extconf.rb +45 -0
  12. data/ext/win32ole/sample/excel1.rb +37 -0
  13. data/ext/win32ole/sample/excel2.rb +31 -0
  14. data/ext/win32ole/sample/excel3.rb +21 -0
  15. data/ext/win32ole/sample/ie.rb +12 -0
  16. data/ext/win32ole/sample/ieconst.rb +33 -0
  17. data/ext/win32ole/sample/ienavi.rb +41 -0
  18. data/ext/win32ole/sample/ienavi2.rb +41 -0
  19. data/ext/win32ole/sample/oledirs.rb +24 -0
  20. data/ext/win32ole/sample/olegen.rb +348 -0
  21. data/ext/win32ole/sample/xml.rb +7307 -0
  22. data/ext/win32ole/win32ole.c +4140 -0
  23. data/ext/win32ole/win32ole.h +155 -0
  24. data/ext/win32ole/win32ole_error.c +84 -0
  25. data/ext/win32ole/win32ole_error.h +9 -0
  26. data/ext/win32ole/win32ole_event.c +1277 -0
  27. data/ext/win32ole/win32ole_event.h +6 -0
  28. data/ext/win32ole/win32ole_method.c +950 -0
  29. data/ext/win32ole/win32ole_method.h +16 -0
  30. data/ext/win32ole/win32ole_param.c +438 -0
  31. data/ext/win32ole/win32ole_param.h +8 -0
  32. data/ext/win32ole/win32ole_record.c +604 -0
  33. data/ext/win32ole/win32ole_record.h +10 -0
  34. data/ext/win32ole/win32ole_type.c +915 -0
  35. data/ext/win32ole/win32ole_type.h +8 -0
  36. data/ext/win32ole/win32ole_typelib.c +844 -0
  37. data/ext/win32ole/win32ole_typelib.h +11 -0
  38. data/ext/win32ole/win32ole_variable.c +380 -0
  39. data/ext/win32ole/win32ole_variable.h +8 -0
  40. data/ext/win32ole/win32ole_variant.c +733 -0
  41. data/ext/win32ole/win32ole_variant.h +9 -0
  42. data/ext/win32ole/win32ole_variant_m.c +149 -0
  43. data/ext/win32ole/win32ole_variant_m.h +7 -0
  44. data/lib/win32ole.rb +33 -0
  45. data/lib/win32ole/property.rb +17 -0
  46. data/win32ole.gemspec +22 -0
  47. metadata +91 -0
@@ -0,0 +1,9 @@
1
+ #ifndef WIN32OLE_VARIANT_H
2
+ #define WIN32OLE_VARIANT_H 1
3
+
4
+ VALUE cWIN32OLE_VARIANT;
5
+ void ole_variant2variant(VALUE val, VARIANT *var);
6
+ void Init_win32ole_variant(void);
7
+
8
+ #endif
9
+
@@ -0,0 +1,149 @@
1
+ #include "win32ole.h"
2
+
3
+ void Init_win32ole_variant_m(void)
4
+ {
5
+ /*
6
+ * Document-module: WIN32OLE::VARIANT
7
+ *
8
+ * The WIN32OLE::VARIANT module includes constants of VARIANT type constants.
9
+ * The constants is used when creating WIN32OLE_VARIANT object.
10
+ *
11
+ * obj = WIN32OLE_VARIANT.new("2e3", WIN32OLE::VARIANT::VT_R4)
12
+ * obj.value # => 2000.0
13
+ *
14
+ */
15
+ mWIN32OLE_VARIANT = rb_define_module_under(cWIN32OLE, "VARIANT");
16
+
17
+ /*
18
+ * represents VT_EMPTY type constant.
19
+ */
20
+ rb_define_const(mWIN32OLE_VARIANT, "VT_EMPTY", RB_INT2FIX(VT_EMPTY));
21
+
22
+ /*
23
+ * represents VT_NULL type constant.
24
+ */
25
+ rb_define_const(mWIN32OLE_VARIANT, "VT_NULL", RB_INT2FIX(VT_NULL));
26
+
27
+ /*
28
+ * represents VT_I2 type constant.
29
+ */
30
+ rb_define_const(mWIN32OLE_VARIANT, "VT_I2", RB_INT2FIX(VT_I2));
31
+
32
+ /*
33
+ * represents VT_I4 type constant.
34
+ */
35
+ rb_define_const(mWIN32OLE_VARIANT, "VT_I4", RB_INT2FIX(VT_I4));
36
+
37
+ /*
38
+ * represents VT_R4 type constant.
39
+ */
40
+ rb_define_const(mWIN32OLE_VARIANT, "VT_R4", RB_INT2FIX(VT_R4));
41
+
42
+ /*
43
+ * represents VT_R8 type constant.
44
+ */
45
+ rb_define_const(mWIN32OLE_VARIANT, "VT_R8", RB_INT2FIX(VT_R8));
46
+
47
+ /*
48
+ * represents VT_CY type constant.
49
+ */
50
+ rb_define_const(mWIN32OLE_VARIANT, "VT_CY", RB_INT2FIX(VT_CY));
51
+
52
+ /*
53
+ * represents VT_DATE type constant.
54
+ */
55
+ rb_define_const(mWIN32OLE_VARIANT, "VT_DATE", RB_INT2FIX(VT_DATE));
56
+
57
+ /*
58
+ * represents VT_BSTR type constant.
59
+ */
60
+ rb_define_const(mWIN32OLE_VARIANT, "VT_BSTR", RB_INT2FIX(VT_BSTR));
61
+
62
+ /*
63
+ * represents VT_USERDEFINED type constant.
64
+ */
65
+ rb_define_const(mWIN32OLE_VARIANT, "VT_USERDEFINED", RB_INT2FIX(VT_USERDEFINED));
66
+
67
+ /*
68
+ * represents VT_PTR type constant.
69
+ */
70
+ rb_define_const(mWIN32OLE_VARIANT, "VT_PTR", RB_INT2FIX(VT_PTR));
71
+
72
+ /*
73
+ * represents VT_DISPATCH type constant.
74
+ */
75
+ rb_define_const(mWIN32OLE_VARIANT, "VT_DISPATCH", RB_INT2FIX(VT_DISPATCH));
76
+
77
+ /*
78
+ * represents VT_ERROR type constant.
79
+ */
80
+ rb_define_const(mWIN32OLE_VARIANT, "VT_ERROR", RB_INT2FIX(VT_ERROR));
81
+
82
+ /*
83
+ * represents VT_BOOL type constant.
84
+ */
85
+ rb_define_const(mWIN32OLE_VARIANT, "VT_BOOL", RB_INT2FIX(VT_BOOL));
86
+
87
+ /*
88
+ * represents VT_VARIANT type constant.
89
+ */
90
+ rb_define_const(mWIN32OLE_VARIANT, "VT_VARIANT", RB_INT2FIX(VT_VARIANT));
91
+
92
+ /*
93
+ * represents VT_UNKNOWN type constant.
94
+ */
95
+ rb_define_const(mWIN32OLE_VARIANT, "VT_UNKNOWN", RB_INT2FIX(VT_UNKNOWN));
96
+
97
+ /*
98
+ * represents VT_I1 type constant.
99
+ */
100
+ rb_define_const(mWIN32OLE_VARIANT, "VT_I1", RB_INT2FIX(VT_I1));
101
+
102
+ /*
103
+ * represents VT_UI1 type constant.
104
+ */
105
+ rb_define_const(mWIN32OLE_VARIANT, "VT_UI1", RB_INT2FIX(VT_UI1));
106
+
107
+ /*
108
+ * represents VT_UI2 type constant.
109
+ */
110
+ rb_define_const(mWIN32OLE_VARIANT, "VT_UI2", RB_INT2FIX(VT_UI2));
111
+
112
+ /*
113
+ * represents VT_UI4 type constant.
114
+ */
115
+ rb_define_const(mWIN32OLE_VARIANT, "VT_UI4", RB_INT2FIX(VT_UI4));
116
+
117
+ #if (_MSC_VER >= 1300) || defined(__CYGWIN__) || defined(__MINGW32__)
118
+ /*
119
+ * represents VT_I8 type constant.
120
+ */
121
+ rb_define_const(mWIN32OLE_VARIANT, "VT_I8", RB_INT2FIX(VT_I8));
122
+
123
+ /*
124
+ * represents VT_UI8 type constant.
125
+ */
126
+ rb_define_const(mWIN32OLE_VARIANT, "VT_UI8", RB_INT2FIX(VT_UI8));
127
+ #endif
128
+
129
+ /*
130
+ * represents VT_INT type constant.
131
+ */
132
+ rb_define_const(mWIN32OLE_VARIANT, "VT_INT", RB_INT2FIX(VT_INT));
133
+
134
+ /*
135
+ * represents VT_UINT type constant.
136
+ */
137
+ rb_define_const(mWIN32OLE_VARIANT, "VT_UINT", RB_INT2FIX(VT_UINT));
138
+
139
+ /*
140
+ * represents VT_ARRAY type constant.
141
+ */
142
+ rb_define_const(mWIN32OLE_VARIANT, "VT_ARRAY", RB_INT2FIX(VT_ARRAY));
143
+
144
+ /*
145
+ * represents VT_BYREF type constant.
146
+ */
147
+ rb_define_const(mWIN32OLE_VARIANT, "VT_BYREF", RB_INT2FIX(VT_BYREF));
148
+
149
+ }
@@ -0,0 +1,7 @@
1
+ #ifndef WIN32OLE_VARIANT_M_H
2
+ #define WIN32OLE_VARIANT_M_H 1
3
+
4
+ VALUE mWIN32OLE_VARIANT;
5
+ void Init_win32ole_variant_m(void);
6
+
7
+ #endif
@@ -0,0 +1,33 @@
1
+ begin
2
+ require 'win32ole.so'
3
+ rescue LoadError
4
+ # do nothing
5
+ end
6
+
7
+ if defined?(WIN32OLE)
8
+ # WIN32OLE
9
+ class WIN32OLE
10
+
11
+ #
12
+ # By overriding Object#methods, WIN32OLE might
13
+ # work well with did_you_mean gem.
14
+ # This is experimental.
15
+ #
16
+ # require 'win32ole'
17
+ # dict = WIN32OLE.new('Scripting.Dictionary')
18
+ # dict.Ade('a', 1)
19
+ # #=> Did you mean? Add
20
+ #
21
+ def methods(*args)
22
+ super + ole_methods_safely.map(&:name).map(&:to_sym)
23
+ end
24
+
25
+ private
26
+
27
+ def ole_methods_safely
28
+ ole_methods
29
+ rescue WIN32OLEQueryInterfaceError
30
+ []
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: false
2
+ # OLEProperty
3
+ # helper class of Property with arguments.
4
+ class OLEProperty
5
+ def initialize(obj, dispid, gettypes, settypes)
6
+ @obj = obj
7
+ @dispid = dispid
8
+ @gettypes = gettypes
9
+ @settypes = settypes
10
+ end
11
+ def [](*args)
12
+ @obj._getproperty(@dispid, args, @gettypes)
13
+ end
14
+ def []=(*args)
15
+ @obj._setproperty(@dispid, args, @settypes)
16
+ end
17
+ end
@@ -0,0 +1,22 @@
1
+ Gem::Specification.new do |spec|
2
+ spec.name = "win32ole"
3
+ spec.version = "1.8.8"
4
+ spec.authors = ["Masaki Suketa"]
5
+ spec.email = ["suke@ruby-lang.org"]
6
+
7
+ spec.summary = %q{Provides an interface for OLE Automation in Ruby}
8
+ spec.description = spec.summary
9
+ spec.homepage = "https://github.com/ruby/win32ole"
10
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
11
+ spec.licenses = ["Ruby", "BSD-2-Clause"]
12
+
13
+ spec.metadata["homepage_uri"] = spec.homepage
14
+ spec.metadata["source_code_uri"] = spec.homepage
15
+
16
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
17
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ end
19
+ spec.bindir = "exe"
20
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
+ spec.require_paths = ["lib"]
22
+ end
metadata ADDED
@@ -0,0 +1,91 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: win32ole
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.8.8
5
+ platform: ruby
6
+ authors:
7
+ - Masaki Suketa
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2020-12-03 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Provides an interface for OLE Automation in Ruby
14
+ email:
15
+ - suke@ruby-lang.org
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".gitignore"
21
+ - ".travis.yml"
22
+ - Gemfile
23
+ - LICENSE.txt
24
+ - README.md
25
+ - Rakefile
26
+ - bin/console
27
+ - bin/setup
28
+ - ext/win32ole/depend
29
+ - ext/win32ole/extconf.rb
30
+ - ext/win32ole/sample/excel1.rb
31
+ - ext/win32ole/sample/excel2.rb
32
+ - ext/win32ole/sample/excel3.rb
33
+ - ext/win32ole/sample/ie.rb
34
+ - ext/win32ole/sample/ieconst.rb
35
+ - ext/win32ole/sample/ienavi.rb
36
+ - ext/win32ole/sample/ienavi2.rb
37
+ - ext/win32ole/sample/oledirs.rb
38
+ - ext/win32ole/sample/olegen.rb
39
+ - ext/win32ole/sample/xml.rb
40
+ - ext/win32ole/win32ole.c
41
+ - ext/win32ole/win32ole.h
42
+ - ext/win32ole/win32ole_error.c
43
+ - ext/win32ole/win32ole_error.h
44
+ - ext/win32ole/win32ole_event.c
45
+ - ext/win32ole/win32ole_event.h
46
+ - ext/win32ole/win32ole_method.c
47
+ - ext/win32ole/win32ole_method.h
48
+ - ext/win32ole/win32ole_param.c
49
+ - ext/win32ole/win32ole_param.h
50
+ - ext/win32ole/win32ole_record.c
51
+ - ext/win32ole/win32ole_record.h
52
+ - ext/win32ole/win32ole_type.c
53
+ - ext/win32ole/win32ole_type.h
54
+ - ext/win32ole/win32ole_typelib.c
55
+ - ext/win32ole/win32ole_typelib.h
56
+ - ext/win32ole/win32ole_variable.c
57
+ - ext/win32ole/win32ole_variable.h
58
+ - ext/win32ole/win32ole_variant.c
59
+ - ext/win32ole/win32ole_variant.h
60
+ - ext/win32ole/win32ole_variant_m.c
61
+ - ext/win32ole/win32ole_variant_m.h
62
+ - lib/win32ole.rb
63
+ - lib/win32ole/property.rb
64
+ - win32ole.gemspec
65
+ homepage: https://github.com/ruby/win32ole
66
+ licenses:
67
+ - Ruby
68
+ - BSD-2-Clause
69
+ metadata:
70
+ homepage_uri: https://github.com/ruby/win32ole
71
+ source_code_uri: https://github.com/ruby/win32ole
72
+ post_install_message:
73
+ rdoc_options: []
74
+ require_paths:
75
+ - lib
76
+ required_ruby_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: 2.3.0
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ requirements: []
87
+ rubygems_version: 3.2.0.rc.2
88
+ signing_key:
89
+ specification_version: 4
90
+ summary: Provides an interface for OLE Automation in Ruby
91
+ test_files: []