freightrain 0.5.9 → 0.5.10

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 CHANGED
@@ -1,4 +1,17 @@
1
- == freightrain
1
+ ==== freightrain - full speed ahead!
2
+
3
+ == WHAT IS IT?
4
+ Freightrain is a MVVM (model/view/viewmodel) framework for developing desktop applications in ruby
5
+
6
+ == HOW DO I GET IT?
7
+ gem install freightrain
8
+ (also make sure you have the latest ruby/gnome2 bindings installed (=> 0.19.3) )
9
+
10
+ == HOW DO I USE IT?
11
+ For now, you should take a look at http://github.com/bolthar/rubydraulica .
12
+ Documentation coming soon.
13
+
14
+ == WHERE DO I REPORT BUGS/FEATURE REQUESTS?
15
+ andrea@andreadallera.com
16
+
2
17
 
3
- DEV ALPHA
4
- testing
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ require 'rake/testtask'
9
9
 
10
10
  spec = Gem::Specification.new do |s|
11
11
  s.name = 'freightrain'
12
- s.version = '0.5.9'
12
+ s.version = '0.5.10'
13
13
  s.add_dependency('require_all', '>= 1.1.0')
14
14
  s.add_dependency('needle', '>= 1.3.0')
15
15
  s.has_rdoc = false
@@ -18,7 +18,7 @@ spec = Gem::Specification.new do |s|
18
18
  s.author = 'Andrea Dallera'
19
19
  s.email = 'andrea@andreadallera.com'
20
20
  s.files = %w(README Rakefile) + Dir.glob("{bin,lib}/**/*")
21
- s.require_path = "lib"
21
+ s.require_path = "lib"
22
22
  end
23
23
 
24
24
  Rake::GemPackageTask.new(spec) do |p|
@@ -4,9 +4,24 @@ module Freightrain
4
4
  class FreightService
5
5
  extend ContainerHookable
6
6
  extend ServiceHost
7
+ #WARNING! Service, as it is right now, are
8
+ #SINGLETONS by default. That means if you consume
9
+ #the same service from two different hosts, the LAST
10
+ #host hooking to the callback will actually get the calls.
11
+ extend SignalHost
7
12
 
8
13
  def initialize
9
14
  get_services
15
+ create_signals
16
+ services = self.class.instance_variable_get(:@services)
17
+ services ||= []
18
+ services.each do |service_key|
19
+ service = instance_variable_get("@#{service_key}")
20
+ service.signals.each do |signal_key, signal|
21
+ method_name = "#{service_key}_on_#{signal_key}"
22
+ signal.connect(method_name) if self.respond_to?(method_name)
23
+ end
24
+ end
10
25
  end
11
26
 
12
27
  end
@@ -12,9 +12,10 @@ module Freightrain
12
12
  services = self.class.instance_variable_get(:@services)
13
13
  services ||= []
14
14
  services.each do |service|
15
- eval "@#{service} = Freightrain[:#{service.to_s}_service]"
15
+ service_instance = Freightrain["#{service}_service".to_sym]
16
+ instance_variable_set("@#{service}".to_sym, service_instance)
16
17
  end
17
- end
18
+ end
18
19
 
19
20
  end
20
21
  end
@@ -24,6 +24,7 @@ module Freightrain
24
24
  @signals[signal] = FreightSignal.new
25
25
  end
26
26
  end
27
+
27
28
 
28
29
  end
29
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: freightrain
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.9
4
+ version: 0.5.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrea Dallera
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-16 00:00:00 +01:00
12
+ date: 2010-03-01 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency