RubyApp 0.0.17 → 0.0.18

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.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- RubyApp (0.0.17)
4
+ RubyApp (0.0.18)
5
5
  BlueCloth
6
6
  chronic
7
7
  chronic_duration
@@ -24,9 +24,10 @@ module RubyApp
24
24
 
25
25
  class Event
26
26
 
27
- attr_reader :source
27
+ attr_reader :now, :source
28
28
 
29
29
  def initialize(data)
30
+ @now = Time.parse(data['now'])
30
31
  @source = RubyApp::Element.get_element(data['source_id'])
31
32
  @statements = []
32
33
  end
@@ -6,6 +6,7 @@
6
6
  this.interval = #{self.interval * 1000};
7
7
  this._interval = 0;
8
8
  this.sendEvent = function(event) {
9
+ event.now = new Date().toUTCString();
9
10
  response = $.post(location.href, event);
10
11
  response
11
12
  .success( function(event) {
@@ -25,13 +25,13 @@ module RubyApp
25
25
  @markdown = RubyApp::Elements::Markdown.new
26
26
 
27
27
  self.loaded do |element, event|
28
- event.update_text('li#loaded', self.translate.loaded)
28
+ event.update_text('li#loaded', self.translate.loaded(event.now))
29
29
  end
30
30
  self.triggered do |element, event|
31
- event.update_text('li#triggered', self.translate.triggered)
31
+ event.update_text('li#triggered', self.translate.triggered(event.now))
32
32
  end
33
33
  self.unloaded do |element, event|
34
- event.update_text('li#unloaded', self.translate.unloaded)
34
+ event.update_text('li#unloaded', self.translate.unloaded(event.now))
35
35
  end
36
36
 
37
37
  @input = RubyApp::Elements::Input.new
@@ -154,7 +154,7 @@ ruby_app:
154
154
  rendered: Rendered
155
155
  label:
156
156
  input: Enter a new cookie value
157
- loaded: Loaded
157
+ loaded: Loaded at %1
158
158
  message_dialog:
159
159
  message:
160
160
  title: Cookie Test
@@ -162,8 +162,8 @@ ruby_app:
162
162
  not_loaded: (not loaded)
163
163
  not_triggered: (not triggered)
164
164
  not_unloaded: (not unloaded)
165
- triggered: Triggered
166
- unloaded: Unloaded
165
+ triggered: Triggered at %1
166
+ unloaded: Unloaded at %1
167
167
  default_page:
168
168
  title: Home
169
169
  content:
@@ -1,4 +1,4 @@
1
1
  module RubyApp
2
- VERSION = "0.0.17"
2
+ VERSION = "0.0.18"
3
3
  ROOT = File.expand_path(File.dirname(__FILE__))
4
4
  end
@@ -18,8 +18,9 @@ describe RubyApp::Element do
18
18
  describe 'instance' do
19
19
 
20
20
  let(:element) { RubyApp::Element.new }
21
- let(:event) { RubyApp::Element::Event.new('source_id' => element.element_id) }
21
+ let(:event) { RubyApp::Element::Event.new('now' => Time.now.to_s, 'source_id' => element.element_id) }
22
22
 
23
+ specify { event.should respond_to('now') }
23
24
  specify { event.should respond_to('source') }
24
25
  specify { event.source.should_not be_nil }
25
26
  specify { event.source.should == element }
@@ -44,7 +44,8 @@ describe RubyApp::Elements::Navigation::Breadcrumbs do
44
44
  describe 'event' do
45
45
 
46
46
  before(:all) do
47
- RubyApp::Element::Event.from_hash({ '_class' => 'RubyApp::Elements::Navigation::Base::BaseBreadcrumbs::ClickedEvent',
47
+ RubyApp::Element::Event.from_hash({ 'now' => Time.now.to_s,
48
+ '_class' => 'RubyApp::Elements::Navigation::Base::BaseBreadcrumbs::ClickedEvent',
48
49
  'source_id' => breadcrumbs.element_id,
49
50
  'page_id' => first_page.element_id }).process!
50
51
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: RubyApp
3
3
  version: !ruby/object:Gem::Version
4
- hash: 61
4
+ hash: 59
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 17
10
- version: 0.0.17
9
+ - 18
10
+ version: 0.0.18
11
11
  platform: ruby
12
12
  authors:
13
13
  - Frank G. Ficnar