rugui 1.6.0 → 2.0.0.beta2
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.
- data/README.rdoc +48 -23
- data/Rakefile +3 -10
- data/bin/rugui +4 -1
- data/lib/rugui/base_view.rb +5 -5
- data/lib/rugui/configuration.rb +1 -29
- data/lib/rugui/entity_registration_support.rb +17 -2
- data/lib/rugui/framework_adapters/GTK.rb +15 -32
- data/lib/rugui/framework_adapters/Qt4.rb +22 -3
- data/lib/rugui/generators/rugui/rugui_generator.rb +3 -9
- data/lib/rugui/generators/rugui/templates/Gemfile.tt +20 -0
- data/lib/rugui/generators/rugui/templates/Rakefile +0 -4
- data/lib/rugui/generators/rugui/templates/app/main.rb +1 -1
- data/lib/rugui/generators/rugui/templates/config/boot.rb +5 -78
- data/lib/rugui/generators/rugui/templates/config/environment.rb.tt +7 -7
- data/lib/rugui/generators/rugui/templates/framework_specific/gtk/app/resources/xml/main_view.xml +43 -0
- data/lib/rugui/generators/rugui/templates/spec/spec_helper.rb +0 -2
- data/lib/rugui/initializer.rb +3 -60
- data/lib/rugui/observable_property_support.rb +5 -1
- data/lib/rugui/property_changed_support.rb +1 -1
- data/lib/rugui/signal_support.rb +2 -2
- data/lib/rugui/tasks/rugui.rb +1 -1
- data/lib/rugui/tasks/runner_application.rake +1 -1
- data/lib/rugui/tasks/spec_application.rake +5 -44
- data/lib/rugui/tasks/spec_framework.rake +3 -25
- data/lib/rugui/version.rb +1 -7
- data/lib/rugui.rb +0 -3
- data/spec/framework/base_controller_spec.rb +7 -14
- data/spec/framework/base_model_spec.rb +1 -3
- data/spec/framework/base_view_helper_spec.rb +1 -3
- data/spec/framework/base_view_spec.rb +2 -5
- data/spec/framework/log_support_spec.rb +2 -2
- data/spec/framework/observable_property_proxy_spec.rb +13 -14
- data/spec/framework/observable_property_support_spec.rb +8 -10
- data/spec/framework/property_observer_spec.rb +20 -22
- data/spec/helpers/controllers.rb +3 -3
- data/spec/helpers/helper_manager.rb +9 -0
- data/spec/helpers/observables.rb +40 -52
- data/spec/helpers/views.rb +15 -15
- data/spec/resource_files/my_other_view.xml +53 -0
- data/spec/resource_files/my_view.xml +53 -0
- data/spec/spec_helper.rb +9 -3
- metadata +98 -84
- data/lib/rugui/gem_builder.rb +0 -21
- data/lib/rugui/gem_dependency.rb +0 -282
- data/lib/rugui/generators/rugui/templates/framework_specific/gtk/app/resources/glade/main_view.glade +0 -33
- data/lib/rugui/generators/rugui/templates/spec/rcov.opts +0 -1
- data/lib/rugui/generators/rugui/templates/spec/spec.opts +0 -4
- data/lib/rugui/generators/rugui/templates/test/test_helper.rb +0 -12
- data/lib/rugui/plugin/loader.rb +0 -77
- data/lib/rugui/tasks/gems_application.rake +0 -71
- data/lib/rugui/tasks/test_application.rake +0 -77
- data/lib/rugui/vendor_gem_source_index.rb +0 -140
- data/spec/rcov.opts +0 -1
- data/spec/spec.opts +0 -5
metadata
CHANGED
@@ -1,15 +1,10 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rugui
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 6
|
9
|
-
- 0
|
10
|
-
version: 1.6.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.0.0.beta2
|
5
|
+
prerelease: 6
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Vicente Mundim
|
14
9
|
- Felipe Mesquita
|
15
10
|
- Claudio Escudero
|
@@ -18,57 +13,89 @@ authors:
|
|
18
13
|
autorequire:
|
19
14
|
bindir: bin
|
20
15
|
cert_chain: []
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
16
|
+
date: 2012-08-31 00:00:00.000000000 Z
|
17
|
+
dependencies:
|
18
|
+
- !ruby/object:Gem::Dependency
|
19
|
+
name: rake
|
20
|
+
requirement: !ruby/object:Gem::Requirement
|
21
|
+
none: false
|
22
|
+
requirements:
|
23
|
+
- - ! '>='
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: 0.9.2.2
|
26
|
+
type: :runtime
|
27
27
|
prerelease: false
|
28
|
-
|
28
|
+
version_requirements: !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
|
-
requirements:
|
31
|
-
- -
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.9.2.2
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: activesupport
|
36
|
+
requirement: !ruby/object:Gem::Requirement
|
37
|
+
none: false
|
38
|
+
requirements:
|
39
|
+
- - ! '>='
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: 3.2.0
|
39
42
|
type: :runtime
|
40
|
-
version_requirements: *id001
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: thor
|
43
43
|
prerelease: false
|
44
|
-
|
44
|
+
version_requirements: !ruby/object:Gem::Requirement
|
45
45
|
none: false
|
46
|
-
requirements:
|
47
|
-
- -
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
46
|
+
requirements:
|
47
|
+
- - ! '>='
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 3.2.0
|
50
|
+
- !ruby/object:Gem::Dependency
|
51
|
+
name: thor
|
52
|
+
requirement: !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ! '>='
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: 0.14.6
|
55
58
|
type: :runtime
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
+
prerelease: false
|
60
|
+
version_requirements: !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: 0.14.6
|
66
|
+
- !ruby/object:Gem::Dependency
|
67
|
+
name: rspec
|
68
|
+
requirement: !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
70
|
+
requirements:
|
71
|
+
- - ! '>='
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: 2.11.0
|
74
|
+
type: :development
|
75
|
+
prerelease: false
|
76
|
+
version_requirements: !ruby/object:Gem::Requirement
|
77
|
+
none: false
|
78
|
+
requirements:
|
79
|
+
- - ! '>='
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: 2.11.0
|
82
|
+
description: ! "\n RuGUI is a framework which aims to help building desktop applications.\n
|
83
|
+
\ RuGUI was mostly inspired by the *Ruby on Rails* framework, taking most of its
|
84
|
+
features from it.\n It provides adapters for GTK and Qt ruby bindings, and you
|
85
|
+
can build other adapters if you wish.\n "
|
86
|
+
email:
|
59
87
|
- vicente.mundim@gmail.com
|
60
88
|
- fmesquitacunha@gmail.com
|
61
89
|
- claudioe@gmail.com
|
62
90
|
- thecatwasnot@gmail.com
|
63
91
|
- sebastien.nicouleaud@gmail.com
|
64
|
-
executables:
|
92
|
+
executables:
|
65
93
|
- rugui
|
66
94
|
extensions: []
|
67
|
-
|
68
|
-
extra_rdoc_files:
|
95
|
+
extra_rdoc_files:
|
69
96
|
- LICENSE
|
70
97
|
- README.rdoc
|
71
|
-
files:
|
98
|
+
files:
|
72
99
|
- bin/rugui
|
73
100
|
- lib/rugui/base_controller.rb
|
74
101
|
- lib/rugui/base_model.rb
|
@@ -82,8 +109,6 @@ files:
|
|
82
109
|
- lib/rugui/framework_adapters/GTK.rb
|
83
110
|
- lib/rugui/framework_adapters/Qt4.rb
|
84
111
|
- lib/rugui/framework_adapters/Rubygame.rb
|
85
|
-
- lib/rugui/gem_builder.rb
|
86
|
-
- lib/rugui/gem_dependency.rb
|
87
112
|
- lib/rugui/generators/rugui/rugui_generator.rb
|
88
113
|
- lib/rugui/generators/rugui/templates/app/controllers/application_controller.rb
|
89
114
|
- lib/rugui/generators/rugui/templates/app/main.rb
|
@@ -97,38 +122,32 @@ files:
|
|
97
122
|
- lib/rugui/generators/rugui/templates/config/environments/production.rb
|
98
123
|
- lib/rugui/generators/rugui/templates/config/environments/test.rb
|
99
124
|
- lib/rugui/generators/rugui/templates/framework_specific/gtk/app/controllers/main_controller.rb
|
100
|
-
- lib/rugui/generators/rugui/templates/framework_specific/gtk/app/resources/glade/main_view.glade
|
101
125
|
- lib/rugui/generators/rugui/templates/framework_specific/gtk/app/resources/styles/main.rc
|
126
|
+
- lib/rugui/generators/rugui/templates/framework_specific/gtk/app/resources/xml/main_view.xml
|
102
127
|
- lib/rugui/generators/rugui/templates/framework_specific/gtk/app/views/main_view.rb
|
103
128
|
- lib/rugui/generators/rugui/templates/framework_specific/qt/app/controllers/main_controller.rb
|
104
129
|
- lib/rugui/generators/rugui/templates/framework_specific/qt/app/resources/ui/main_view.ui
|
105
130
|
- lib/rugui/generators/rugui/templates/framework_specific/qt/app/views/main_view.rb
|
106
131
|
- lib/rugui/generators/rugui/templates/framework_specific/rubygame/app/controllers/main_controller.rb
|
107
132
|
- lib/rugui/generators/rugui/templates/framework_specific/rubygame/app/views/main_view.rb
|
133
|
+
- lib/rugui/generators/rugui/templates/Gemfile.tt
|
108
134
|
- lib/rugui/generators/rugui/templates/Rakefile
|
109
135
|
- lib/rugui/generators/rugui/templates/README
|
110
|
-
- lib/rugui/generators/rugui/templates/spec/rcov.opts
|
111
|
-
- lib/rugui/generators/rugui/templates/spec/spec.opts
|
112
136
|
- lib/rugui/generators/rugui/templates/spec/spec_helper.rb
|
113
|
-
- lib/rugui/generators/rugui/templates/test/test_helper.rb
|
114
137
|
- lib/rugui/generators.rb
|
115
138
|
- lib/rugui/initialize_hooks.rb
|
116
139
|
- lib/rugui/initializer.rb
|
117
140
|
- lib/rugui/log_support.rb
|
118
141
|
- lib/rugui/observable_property_proxy.rb
|
119
142
|
- lib/rugui/observable_property_support.rb
|
120
|
-
- lib/rugui/plugin/loader.rb
|
121
143
|
- lib/rugui/property_changed_support.rb
|
122
144
|
- lib/rugui/property_observer.rb
|
123
145
|
- lib/rugui/signal_support.rb
|
124
|
-
- lib/rugui/tasks/gems_application.rake
|
125
146
|
- lib/rugui/tasks/rugui.rb
|
126
147
|
- lib/rugui/tasks/rugui_framework.rb
|
127
148
|
- lib/rugui/tasks/runner_application.rake
|
128
149
|
- lib/rugui/tasks/spec_application.rake
|
129
150
|
- lib/rugui/tasks/spec_framework.rake
|
130
|
-
- lib/rugui/tasks/test_application.rake
|
131
|
-
- lib/rugui/vendor_gem_source_index.rb
|
132
151
|
- lib/rugui/version.rb
|
133
152
|
- lib/rugui.rb
|
134
153
|
- LICENSE
|
@@ -145,54 +164,48 @@ files:
|
|
145
164
|
- spec/framework/observable_property_support_spec.rb
|
146
165
|
- spec/framework/property_observer_spec.rb
|
147
166
|
- spec/helpers/controllers.rb
|
167
|
+
- spec/helpers/helper_manager.rb
|
148
168
|
- spec/helpers/initialize_hooks_helper.rb
|
149
169
|
- spec/helpers/models.rb
|
150
170
|
- spec/helpers/observables.rb
|
151
171
|
- spec/helpers/view_helpers.rb
|
152
172
|
- spec/helpers/views.rb
|
153
|
-
- spec/rcov.opts
|
154
173
|
- spec/resource_files/my_other_view.glade
|
174
|
+
- spec/resource_files/my_other_view.xml
|
155
175
|
- spec/resource_files/my_view.glade
|
156
|
-
- spec/
|
176
|
+
- spec/resource_files/my_view.xml
|
157
177
|
- spec/spec_helper.rb
|
158
|
-
has_rdoc: true
|
159
178
|
homepage: http://rugui.org
|
160
|
-
licenses:
|
179
|
+
licenses:
|
161
180
|
- GNU LGPL
|
162
181
|
post_install_message:
|
163
|
-
rdoc_options:
|
182
|
+
rdoc_options:
|
164
183
|
- --charset=UTF-8
|
165
184
|
- --main=README.rdoc
|
166
|
-
require_paths:
|
185
|
+
require_paths:
|
167
186
|
- lib
|
168
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
187
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
169
188
|
none: false
|
170
|
-
requirements:
|
171
|
-
- -
|
172
|
-
- !ruby/object:Gem::Version
|
173
|
-
|
174
|
-
segments:
|
189
|
+
requirements:
|
190
|
+
- - ! '>='
|
191
|
+
- !ruby/object:Gem::Version
|
192
|
+
version: '0'
|
193
|
+
segments:
|
175
194
|
- 0
|
176
|
-
|
177
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
195
|
+
hash: 1798710836625666257
|
196
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
178
197
|
none: false
|
179
|
-
requirements:
|
180
|
-
- -
|
181
|
-
- !ruby/object:Gem::Version
|
182
|
-
|
183
|
-
segments:
|
184
|
-
- 1
|
185
|
-
- 3
|
186
|
-
- 5
|
187
|
-
version: 1.3.5
|
198
|
+
requirements:
|
199
|
+
- - ! '>='
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: 1.4.0
|
188
202
|
requirements: []
|
189
|
-
|
190
203
|
rubyforge_project: rugui
|
191
|
-
rubygems_version: 1.
|
204
|
+
rubygems_version: 1.8.24
|
192
205
|
signing_key:
|
193
206
|
specification_version: 3
|
194
207
|
summary: A rails like MVC framework for building desktop applications with GUI frameworks.
|
195
|
-
test_files:
|
208
|
+
test_files:
|
196
209
|
- spec/framework/base_controller_spec.rb
|
197
210
|
- spec/framework/base_model_spec.rb
|
198
211
|
- spec/framework/base_view_helper_spec.rb
|
@@ -202,13 +215,14 @@ test_files:
|
|
202
215
|
- spec/framework/observable_property_support_spec.rb
|
203
216
|
- spec/framework/property_observer_spec.rb
|
204
217
|
- spec/helpers/controllers.rb
|
218
|
+
- spec/helpers/helper_manager.rb
|
205
219
|
- spec/helpers/initialize_hooks_helper.rb
|
206
220
|
- spec/helpers/models.rb
|
207
221
|
- spec/helpers/observables.rb
|
208
222
|
- spec/helpers/view_helpers.rb
|
209
223
|
- spec/helpers/views.rb
|
210
|
-
- spec/rcov.opts
|
211
224
|
- spec/resource_files/my_other_view.glade
|
225
|
+
- spec/resource_files/my_other_view.xml
|
212
226
|
- spec/resource_files/my_view.glade
|
213
|
-
- spec/
|
227
|
+
- spec/resource_files/my_view.xml
|
214
228
|
- spec/spec_helper.rb
|
data/lib/rugui/gem_builder.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'rubygems/installer'
|
3
|
-
|
4
|
-
module RuGUI
|
5
|
-
|
6
|
-
# this class hijacks the functionality of Gem::Installer by overloading its
|
7
|
-
# initializer to only provide the information needed by
|
8
|
-
# Gem::Installer#build_extensions (which happens to be what we have)
|
9
|
-
class GemBuilder < Gem::Installer
|
10
|
-
|
11
|
-
def initialize(spec, gem_dir)
|
12
|
-
@spec = spec
|
13
|
-
@gem_dir = gem_dir
|
14
|
-
end
|
15
|
-
|
16
|
-
# silence the underlying builder
|
17
|
-
def say(message)
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|
21
|
-
end
|
data/lib/rugui/gem_dependency.rb
DELETED
@@ -1,282 +0,0 @@
|
|
1
|
-
require 'rugui/vendor_gem_source_index'
|
2
|
-
|
3
|
-
module Gem
|
4
|
-
def self.source_index=(index)
|
5
|
-
@@source_index = index
|
6
|
-
end
|
7
|
-
end
|
8
|
-
|
9
|
-
module RuGUI
|
10
|
-
class GemDependency < Gem::Dependency
|
11
|
-
attr_accessor :lib, :source, :dep
|
12
|
-
|
13
|
-
def self.unpacked_path
|
14
|
-
@unpacked_path ||= File.join(APPLICATION_ROOT, 'vendor', 'gems')
|
15
|
-
end
|
16
|
-
|
17
|
-
@@framework_gems = {}
|
18
|
-
|
19
|
-
def self.add_frozen_gem_path
|
20
|
-
@@paths_loaded ||= begin
|
21
|
-
source_index = RuGUI::VendorGemSourceIndex.new(Gem.source_index)
|
22
|
-
Gem.clear_paths
|
23
|
-
Gem.source_index = source_index
|
24
|
-
# loaded before us - we can't change them, so mark them
|
25
|
-
Gem.loaded_specs.each do |name, spec|
|
26
|
-
@@framework_gems[name] = spec
|
27
|
-
end
|
28
|
-
true
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
def initialize(name, options = {})
|
33
|
-
require 'rubygems' unless Object.const_defined?(:Gem)
|
34
|
-
|
35
|
-
if options[:requirement]
|
36
|
-
req = options[:requirement]
|
37
|
-
elsif options[:version]
|
38
|
-
req = Gem::Requirement.create(options[:version])
|
39
|
-
else
|
40
|
-
req = Gem::Requirement.default
|
41
|
-
end
|
42
|
-
|
43
|
-
@lib = options[:lib]
|
44
|
-
@source = options[:source]
|
45
|
-
@loaded = @frozen = @load_paths_added = false
|
46
|
-
|
47
|
-
super(name, req)
|
48
|
-
end
|
49
|
-
|
50
|
-
def add_load_paths
|
51
|
-
self.class.add_frozen_gem_path
|
52
|
-
return if @loaded || @load_paths_added
|
53
|
-
if framework_gem?
|
54
|
-
@load_paths_added = @loaded = @frozen = true
|
55
|
-
return
|
56
|
-
end
|
57
|
-
gem self
|
58
|
-
@spec = Gem.loaded_specs[name]
|
59
|
-
@frozen = @spec.loaded_from.include?(self.class.unpacked_path) if @spec
|
60
|
-
@load_paths_added = true
|
61
|
-
rescue Gem::LoadError
|
62
|
-
end
|
63
|
-
|
64
|
-
def dependencies
|
65
|
-
return [] if framework_gem?
|
66
|
-
return [] unless installed?
|
67
|
-
specification.dependencies.reject do |dependency|
|
68
|
-
dependency.type == :development
|
69
|
-
end.map do |dependency|
|
70
|
-
GemDependency.new(dependency.name, :requirement => dependency.version_requirements)
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
def specification
|
75
|
-
# code repeated from Gem.activate. Find a matching spec, or the currently loaded version.
|
76
|
-
# error out if loaded version and requested version are incompatible.
|
77
|
-
@spec ||= begin
|
78
|
-
matches = Gem.source_index.search(self)
|
79
|
-
matches << @@framework_gems[name] if framework_gem?
|
80
|
-
if Gem.loaded_specs[name] then
|
81
|
-
# This gem is already loaded. If the currently loaded gem is not in the
|
82
|
-
# list of candidate gems, then we have a version conflict.
|
83
|
-
existing_spec = Gem.loaded_specs[name]
|
84
|
-
unless matches.any? { |spec| spec.version == existing_spec.version } then
|
85
|
-
raise Gem::Exception,
|
86
|
-
"can't activate #{@dep}, already activated #{existing_spec.full_name}"
|
87
|
-
end
|
88
|
-
# we're stuck with it, so change to match
|
89
|
-
version_requirements = Gem::Requirement.create("=#{existing_spec.version}")
|
90
|
-
existing_spec
|
91
|
-
else
|
92
|
-
# new load
|
93
|
-
matches.last
|
94
|
-
end
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
def requirement
|
99
|
-
r = version_requirements
|
100
|
-
(r == Gem::Requirement.default) ? nil : r
|
101
|
-
end
|
102
|
-
|
103
|
-
def built?
|
104
|
-
# TODO: If Rubygems ever gives us a way to detect this, we should use it
|
105
|
-
false
|
106
|
-
end
|
107
|
-
|
108
|
-
def framework_gem?
|
109
|
-
@@framework_gems.has_key?(name)
|
110
|
-
end
|
111
|
-
|
112
|
-
def frozen?
|
113
|
-
@frozen ||= vendor_rugui? || vendor_gem?
|
114
|
-
end
|
115
|
-
|
116
|
-
def installed?
|
117
|
-
Gem.loaded_specs.keys.include?(name)
|
118
|
-
end
|
119
|
-
|
120
|
-
def load_paths_added?
|
121
|
-
# always try to add load paths - even if a gem is loaded, it may not
|
122
|
-
# be a compatible version (ie random_gem 0.4 is loaded and a later spec
|
123
|
-
# needs >= 0.5 - gem 'random_gem' will catch this and error out)
|
124
|
-
@load_paths_added
|
125
|
-
end
|
126
|
-
|
127
|
-
def loaded?
|
128
|
-
@loaded ||= begin
|
129
|
-
if vendor_rugui?
|
130
|
-
true
|
131
|
-
elsif specification.nil?
|
132
|
-
false
|
133
|
-
else
|
134
|
-
# check if the gem is loaded by inspecting $"
|
135
|
-
# specification.files lists all the files contained in the gem
|
136
|
-
gem_files = specification.files
|
137
|
-
# select only the files contained in require_paths - typically in bin and lib
|
138
|
-
require_paths_regexp = Regexp.new("^(#{specification.require_paths*'|'})/")
|
139
|
-
gem_lib_files = gem_files.select { |f| require_paths_regexp.match(f) }
|
140
|
-
# chop the leading directory off - a typical file might be in
|
141
|
-
# lib/gem_name/file_name.rb, but it will be 'require'd as gem_name/file_name.rb
|
142
|
-
gem_lib_files.map! { |f| f.split('/', 2)[1] }
|
143
|
-
# if any of the files from the above list appear in $", the gem is assumed to
|
144
|
-
# have been loaded
|
145
|
-
!(gem_lib_files & $").empty?
|
146
|
-
end
|
147
|
-
end
|
148
|
-
end
|
149
|
-
|
150
|
-
def vendor_rugui?
|
151
|
-
Gem.loaded_specs.has_key?(name) && Gem.loaded_specs[name].loaded_from.empty?
|
152
|
-
end
|
153
|
-
|
154
|
-
def vendor_gem?
|
155
|
-
specification && File.exists?(unpacked_gem_directory)
|
156
|
-
end
|
157
|
-
|
158
|
-
def build
|
159
|
-
require 'rugui/gem_builder'
|
160
|
-
unless built?
|
161
|
-
return unless File.exists?(unpacked_specification_filename)
|
162
|
-
spec = YAML::load_file(unpacked_specification_filename)
|
163
|
-
RuGUI::GemBuilder.new(spec, unpacked_gem_directory).build_extensions
|
164
|
-
puts "Built gem: '#{unpacked_gem_directory}'"
|
165
|
-
end
|
166
|
-
dependencies.each { |dep| dep.build }
|
167
|
-
end
|
168
|
-
|
169
|
-
def install
|
170
|
-
unless installed?
|
171
|
-
cmd = "#{gem_command} #{install_command.join(' ')}"
|
172
|
-
puts cmd
|
173
|
-
puts %x(#{cmd})
|
174
|
-
end
|
175
|
-
end
|
176
|
-
|
177
|
-
def load
|
178
|
-
return if @loaded || @load_paths_added == false
|
179
|
-
require(@lib || name) unless @lib == false
|
180
|
-
@loaded = true
|
181
|
-
rescue LoadError
|
182
|
-
puts $!.to_s
|
183
|
-
$!.backtrace.each { |b| puts b }
|
184
|
-
end
|
185
|
-
|
186
|
-
def refresh
|
187
|
-
RuGUI::VendorGemSourceIndex.silence_spec_warnings = true
|
188
|
-
real_gems = Gem.source_index.installed_source_index
|
189
|
-
exact_dep = Gem::Dependency.new(name, "= #{specification.version}")
|
190
|
-
matches = real_gems.search(exact_dep)
|
191
|
-
installed_spec = matches.first
|
192
|
-
if frozen?
|
193
|
-
if installed_spec
|
194
|
-
# we have a real copy
|
195
|
-
# get a fresh spec - matches should only have one element
|
196
|
-
# note that there is no reliable method to check that the loaded
|
197
|
-
# spec is the same as the copy from real_gems - Gem.activate changes
|
198
|
-
# some of the fields
|
199
|
-
real_spec = Gem::Specification.load(matches.first.loaded_from)
|
200
|
-
write_specification(real_spec)
|
201
|
-
puts "Reloaded specification for #{name} from installed gems."
|
202
|
-
else
|
203
|
-
# the gem isn't installed locally - write out our current specs
|
204
|
-
write_specification(specification)
|
205
|
-
puts "Gem #{name} not loaded locally - writing out current spec."
|
206
|
-
end
|
207
|
-
else
|
208
|
-
if framework_gem?
|
209
|
-
puts "Gem directory for #{name} not found - check if it's loading before rugui."
|
210
|
-
else
|
211
|
-
puts "Something bad is going on - gem directory not found for #{name}."
|
212
|
-
end
|
213
|
-
end
|
214
|
-
end
|
215
|
-
|
216
|
-
def unpack(options={})
|
217
|
-
unless frozen? || framework_gem?
|
218
|
-
FileUtils.mkdir_p unpack_base
|
219
|
-
Dir.chdir unpack_base do
|
220
|
-
Gem::GemRunner.new.run(unpack_command)
|
221
|
-
end
|
222
|
-
# Gem.activate changes the spec - get the original
|
223
|
-
real_spec = Gem::Specification.load(specification.loaded_from)
|
224
|
-
write_specification(real_spec)
|
225
|
-
end
|
226
|
-
dependencies.each { |dep| dep.unpack } if options[:recursive]
|
227
|
-
end
|
228
|
-
|
229
|
-
def write_specification(spec)
|
230
|
-
# copy the gem's specification into GEMDIR/.specification so that
|
231
|
-
# we can access information about the gem on deployment systems
|
232
|
-
# without having the gem installed
|
233
|
-
File.open(unpacked_specification_filename, 'w') do |file|
|
234
|
-
file.puts spec.to_yaml
|
235
|
-
end
|
236
|
-
end
|
237
|
-
|
238
|
-
def ==(other)
|
239
|
-
self.name == other.name && self.requirement == other.requirement
|
240
|
-
end
|
241
|
-
alias_method :"eql?", :"=="
|
242
|
-
|
243
|
-
private
|
244
|
-
|
245
|
-
def gem_command
|
246
|
-
case RUBY_PLATFORM
|
247
|
-
when /win32/
|
248
|
-
'gem.bat'
|
249
|
-
when /java/
|
250
|
-
'jruby -S gem'
|
251
|
-
else
|
252
|
-
'gem'
|
253
|
-
end
|
254
|
-
end
|
255
|
-
|
256
|
-
def install_command
|
257
|
-
cmd = %w(install) << name
|
258
|
-
cmd << "--version" << %("#{requirement.to_s}") if requirement
|
259
|
-
cmd << "--source" << @source if @source
|
260
|
-
cmd
|
261
|
-
end
|
262
|
-
|
263
|
-
def unpack_command
|
264
|
-
cmd = %w(unpack) << name
|
265
|
-
cmd << "--version" << "= "+specification.version.to_s if requirement
|
266
|
-
cmd
|
267
|
-
end
|
268
|
-
|
269
|
-
def unpack_base
|
270
|
-
RuGUI::GemDependency.unpacked_path
|
271
|
-
end
|
272
|
-
|
273
|
-
def unpacked_gem_directory
|
274
|
-
File.join(unpack_base, specification.full_name)
|
275
|
-
end
|
276
|
-
|
277
|
-
def unpacked_specification_filename
|
278
|
-
File.join(unpacked_gem_directory, '.specification')
|
279
|
-
end
|
280
|
-
|
281
|
-
end
|
282
|
-
end
|
data/lib/rugui/generators/rugui/templates/framework_specific/gtk/app/resources/glade/main_view.glade
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2
|
-
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
|
3
|
-
<!--Generated with glade3 3.4.5 on Wed Mar 25 10:29:59 2009 -->
|
4
|
-
<glade-interface>
|
5
|
-
<widget class="GtkWindow" id="main_window">
|
6
|
-
<property name="visible">True</property>
|
7
|
-
<property name="title" translatable="yes">Hello World!</property>
|
8
|
-
<child>
|
9
|
-
<widget class="GtkVBox" id="main_container">
|
10
|
-
<property name="visible">True</property>
|
11
|
-
<child>
|
12
|
-
<widget class="GtkLabel" id="message_label">
|
13
|
-
<property name="visible">True</property>
|
14
|
-
<property name="label" translatable="yes">Just a simple label</property>
|
15
|
-
</widget>
|
16
|
-
</child>
|
17
|
-
<child>
|
18
|
-
<widget class="GtkButton" id="hello_button">
|
19
|
-
<property name="visible">True</property>
|
20
|
-
<property name="can_focus">True</property>
|
21
|
-
<property name="receives_default">True</property>
|
22
|
-
<property name="label" translatable="yes">Click Me</property>
|
23
|
-
<property name="response_id">0</property>
|
24
|
-
<signal name="clicked" handler="on_hello_button_clicked"/>
|
25
|
-
</widget>
|
26
|
-
<packing>
|
27
|
-
<property name="position">1</property>
|
28
|
-
</packing>
|
29
|
-
</child>
|
30
|
-
</widget>
|
31
|
-
</child>
|
32
|
-
</widget>
|
33
|
-
</glade-interface>
|
@@ -1 +0,0 @@
|
|
1
|
-
--exclude "spec/*,gems/*"
|
@@ -1,12 +0,0 @@
|
|
1
|
-
$:.unshift File.join(File.dirname(__FILE__),'..','lib')
|
2
|
-
|
3
|
-
require 'test/unit'
|
4
|
-
|
5
|
-
# Forcing the 'test' environment.
|
6
|
-
ENV["RUGUI_ENV"] = "test"
|
7
|
-
|
8
|
-
require File.join(File.dirname(__FILE__), '..', 'config', 'environment')
|
9
|
-
|
10
|
-
class Test::Unit::TestCase
|
11
|
-
# Add more helper methods to be used by all tests here...
|
12
|
-
end
|