goat 0.3.12 → 0.3.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/bin/state-srv +9 -7
  2. data/goat.gemspec +1 -2
  3. metadata +3 -4
  4. data/README.md +0 -45
@@ -26,7 +26,7 @@ module Goat
26
26
  @components_by_id = {}
27
27
  @components_by_page = {}
28
28
  @last_connected = {}
29
- @first_connected = {}
29
+ @registration_times = {}
30
30
  @page_connections = {}
31
31
  @channelsrvs = {}
32
32
  @page_versions = {}
@@ -53,7 +53,7 @@ module Goat
53
53
 
54
54
  def initialize_page(pgid)
55
55
  @page_versions[pgid] = 0
56
- @first_connected[pgid] = Time.now
56
+ @registration_times[pgid] = Time.now
57
57
  end
58
58
 
59
59
  def incr_page_version(pgid)
@@ -90,11 +90,11 @@ module Goat
90
90
  end
91
91
  end
92
92
 
93
- def first_connected_delta(pgid)
94
- if connected = @first_connected[pgid]
93
+ def registration_delta(pgid)
94
+ if connected = @registration_times[pgid]
95
95
  Time.now - connected
96
96
  else
97
- $stderr.puts "ERROR: asked for first_connected_delta of #{pgid}, which I don't have"
97
+ $stderr.puts "ERROR: asked for registration_delta of #{pgid}, which I don't have"
98
98
  Time.now - Time.at(0)
99
99
  end
100
100
  end
@@ -213,8 +213,10 @@ module Goat
213
213
  # return newest components first
214
214
  @registry.components_by_class(msg['class']).\
215
215
  select{|c| c.spec == msg['spec']}.\
216
- select{|c| @registry.connected?(c.pgid) || @registry.last_connected_delta(c.pgid) < 120}.\
217
- sort_by{|c| @registry.first_connected_delta(c.pgid)}.\
216
+ select{|c| @registry.connected?(c.pgid) || \
217
+ @registry.last_connected_delta(c.pgid) < 120 || \
218
+ @registry.registration_delta(c.pgid) < 20}.\
219
+ sort_by{|c| @registry.registration_delta(c.pgid)}.\
218
220
  map(&:to_hash)
219
221
  end
220
222
 
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'goat'
3
- s.version = '0.3.12'
3
+ s.version = '0.3.13'
4
4
  s.summary = 'Pre-release beta version of Goat'
5
5
  s.author = 'Patrick Collison'
6
6
  s.email = 'patrick@collison.ie'
@@ -11,7 +11,6 @@ spec = Gem::Specification.new do |s|
11
11
  s.require_paths = %w{lib}
12
12
 
13
13
  s.files = %w{
14
- README.md
15
14
  bin/channel-srv
16
15
  bin/press
17
16
  bin/state-srv
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: goat
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 12
10
- version: 0.3.12
9
+ - 13
10
+ version: 0.3.13
11
11
  platform: ruby
12
12
  authors:
13
13
  - Patrick Collison
@@ -30,7 +30,6 @@ extensions: []
30
30
  extra_rdoc_files: []
31
31
 
32
32
  files:
33
- - README.md
34
33
  - bin/channel-srv
35
34
  - bin/press
36
35
  - bin/state-srv
data/README.md DELETED
@@ -1,45 +0,0 @@
1
- Goat
2
- ===
3
-
4
- <http://goatweb.org>
5
-
6
- Description
7
- -----------
8
-
9
- Goat makes it easier to build complex, data-heavy websites. It's written in Ruby, and aims to be a good tool for building applications in the class of, say, Facebook: data-heavy, interactive, and real-time.
10
-
11
- Web development presents a fairly subtle set of problems:
12
-
13
- - Distributing application logic between the client and the server. (You usually can't put it all on the client, but it's unpleasant to wait twenty seconds for a page to refresh before you find out the value of a form field is invalid.)
14
- - Figuring out how to make changes without interruption -- live data migrations, and code upgrades that (ideally) don't interrupt users.
15
- - Varying browsers.
16
- - Multiple programming languages (CSS, JavaScript, HTML, server-side languages).
17
- - Multiple input devices (touch, mouse, keyboard).
18
- - May have to scale massively at short notice
19
-
20
- Goat
21
- ----
22
-
23
- Goat is page-oriented. Pages are the fundamental building block of the web. Complex data often naturally breaks down into discrete pages. In the URL, pages come with one of the most universally used and understood collaboration tools.
24
-
25
- Figuring out how to combine presenting a significant amount of data presentation with complex user interaction is tough. It's not easy to imagine what Facebook, Wikipedia, Twitter, Gmail or Quora would look like as desktop applications -- and it's unlikely that they'd be better.
26
-
27
- Some applications, such as spreadsheets, probably aren't a good fit for a page-based model, and these applications are not likely to be a good fit for Goat.
28
-
29
- Goat avoids HTML templates, and replaces them with programmatic HTML generation and components: a page is composed of one or more components. Components may persist on the server, if you'd like to be able to update the client-side state of a component in real time. Components also group together the code that may be required for a single UI element: client-side JavaScript, server-side Ruby, and CSS.
30
-
31
- Goat tries to:
32
-
33
- - Make it easy to build pages that don't require refreshing (i.e., live updating of data).
34
- - Optimize for the development cycle (all things being equal, the application that's easier to change will end up better).
35
- - Make writing client-side JavaScript easier. (Intelligent scoping, easy RPC.)
36
- - Make programmatic HTML generation easy.
37
- - Not be all-encompassing, but to make sensible assumptions about most parts of the web application stack.
38
-
39
- Design decisions
40
- ----------------
41
-
42
- - Goat should store JS for some set of components in an external file so that JS can be cached across pages.
43
- - You can't have to load 2mb of JS and have a loading bar when a user visits the site for the first time. URLs should look decent.
44
- - Make site work well for search engines.
45
- - Goat doesn't try to abstract away the fact that the web is built with CSS/HTML/JavaScript.