collin-lucky7 0.0.1
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 +65 -0
- data/Rakefile.rb +55 -0
- data/config/environment.rb +9 -0
- data/lib/jabs.rb +9 -0
- data/lib/jass.rb +23 -0
- data/lib/jsspec/example.html.jass +180 -0
- data/lib/jsspec/layout.html.haml +14 -0
- data/lib/lucky7.rb +5 -0
- data/lib/lucky7/builder.rb +140 -0
- data/lib/lucky7/renders.rb +9 -0
- data/rspec/fixtures/lucky7/build/app/layout.html +4 -0
- data/rspec/fixtures/lucky7/src/app/_category.html.haml +2 -0
- data/rspec/fixtures/lucky7/src/app/_header.html.haml +7 -0
- data/rspec/fixtures/lucky7/src/app/_page_link.html.haml +2 -0
- data/rspec/fixtures/lucky7/src/app/_pagination.html.haml +3 -0
- data/rspec/fixtures/lucky7/src/app/_result.html.haml +3 -0
- data/rspec/fixtures/lucky7/src/app/_result_set.html.haml +4 -0
- data/rspec/fixtures/lucky7/src/app/_side_bar.html.haml +3 -0
- data/rspec/fixtures/lucky7/src/app/behavior.css.sass +3 -0
- data/rspec/fixtures/lucky7/src/app/controller.js.jabs +3 -0
- data/rspec/fixtures/lucky7/src/app/fixture_spec.html.jass +6 -0
- data/rspec/fixtures/lucky7/src/app/layout.html.haml +4 -0
- data/rspec/fixtures/lucky7/src/app/no_results.html.haml +10 -0
- data/rspec/fixtures/lucky7/src/app/results.html.haml +5 -0
- data/rspec/jabs/jabs_engine_spec.rb +3 -0
- data/rspec/jabs/jabs_precompiler_spec.rb +50 -0
- data/rspec/jabs_spec.rb +15 -0
- data/rspec/jabs_spec_helper.rb +2 -0
- data/rspec/jass/jass_engine_spec.rb +1 -0
- data/rspec/jass/jass_precompiler_spec.rb +49 -0
- data/rspec/jass_spec.rb +15 -0
- data/rspec/lucky7/builder_spec.rb +322 -0
- data/rspec/lucky7/renders_spec.rb +13 -0
- data/rspec/lucky7_spec.rb +19 -0
- data/rspec/lucky7_spec_helper.rb +1 -0
- data/rspec/spec_helper.rb +3 -0
- data/templates/environment/[environment].rb +1 -0
- data/templates/skeleton/[application]/README +1 -0
- data/templates/skeleton/[application]/Rakefile.rb +1 -0
- data/templates/skeleton/[application]/environment/environment.rb +1 -0
- data/vendor/jquery/jquery-1.2.6.js +3549 -0
- data/vendor/jquery/jquery-1.2.6.min.js +32 -0
- data/vendor/jquery/jquery-1.2.6.pack.js.gz +11 -0
- data/vendor/jquery/jquery.simulate.js +152 -0
- data/vendor/js_spec/JSSpec.css +224 -0
- data/vendor/js_spec/JSSpec.js +1548 -0
- data/vendor/js_spec/copying +459 -0
- data/vendor/js_spec/demo.html +210 -0
- data/vendor/js_spec/diff_match_patch.js +1 -0
- data/vendor/js_spec/example.spec.html +198 -0
- data/vendor/js_spec/exp/build.properties +1 -0
- data/vendor/js_spec/exp/build.xml +9 -0
- data/vendor/js_spec/exp/lib/diff_match_patch.js +1 -0
- data/vendor/js_spec/exp/lib/js.jar +0 -0
- data/vendor/js_spec/exp/src/JSSpec2.js +356 -0
- data/vendor/js_spec/exp/src/JSSpec2_spec.js +238 -0
- data/vendor/js_spec/sample/datetime/String_Parser.html +22 -0
- data/vendor/js_spec/sample/datetime/datetime.js +24 -0
- data/vendor/orbited/ez_setup.py +272 -0
- data/vendor/orbited/pyevent-0.3/Makefile +18 -0
- data/vendor/orbited/pyevent-0.3/build/lib.linux-i686-2.5/event.so +0 -0
- data/vendor/orbited/pyevent-0.3/build/temp.linux-i686-2.5/event.o +0 -0
- data/vendor/orbited/pyevent-0.3/changes +9 -0
- data/vendor/orbited/pyevent-0.3/cvs/Entries +9 -0
- data/vendor/orbited/pyevent-0.3/cvs/Repository +1 -0
- data/vendor/orbited/pyevent-0.3/cvs/Root +1 -0
- data/vendor/orbited/pyevent-0.3/event.c +2516 -0
- data/vendor/orbited/pyevent-0.3/event.pyx +280 -0
- data/vendor/orbited/pyevent-0.3/license +29 -0
- data/vendor/orbited/pyevent-0.3/readme +12 -0
- data/vendor/orbited/pyevent-0.3/setup.py +61 -0
- data/vendor/orbited/pyevent-0.3/test.py +73 -0
- data/vendor/orbited/ruby-orbited.rb +84 -0
- metadata +188 -0
@@ -0,0 +1,84 @@
|
|
1
|
+
require 'socket'
|
2
|
+
include Socket::Constants
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
BUFFER_SIZE = 4096
|
6
|
+
LINE_END = "\r\n"
|
7
|
+
|
8
|
+
module SimpleOrbit
|
9
|
+
end
|
10
|
+
|
11
|
+
class SimpleOrbit::Client
|
12
|
+
@@version = 'Orbit 1.0'
|
13
|
+
def initialize(addr, port)
|
14
|
+
@addr = addr
|
15
|
+
@port = port
|
16
|
+
@socket = nil
|
17
|
+
@id = 0
|
18
|
+
@connected = false
|
19
|
+
end
|
20
|
+
def connect()
|
21
|
+
@connected = true
|
22
|
+
if @socket
|
23
|
+
# already connected
|
24
|
+
return
|
25
|
+
end
|
26
|
+
@socket = TCPSocket.new(@addr, @port)
|
27
|
+
end
|
28
|
+
def disconnect()
|
29
|
+
if @connected
|
30
|
+
@connected = false
|
31
|
+
@socket.close()
|
32
|
+
@socket = nil
|
33
|
+
end
|
34
|
+
end
|
35
|
+
def reconnect()
|
36
|
+
disconnect()
|
37
|
+
connect()
|
38
|
+
end
|
39
|
+
def sendline(line='')
|
40
|
+
@socket.write(line.to_s + LINE_END)
|
41
|
+
puts line.to_s
|
42
|
+
end
|
43
|
+
def event(recipients, body, json=true, try_again=true)
|
44
|
+
if not @connected
|
45
|
+
connect()
|
46
|
+
end
|
47
|
+
begin
|
48
|
+
if json
|
49
|
+
body = JSON.generate(body)
|
50
|
+
end
|
51
|
+
if not @socket
|
52
|
+
raise ## **Connection-lost**
|
53
|
+
end
|
54
|
+
begin
|
55
|
+
@id = @id + 1
|
56
|
+
sendline(@@version.to_s)
|
57
|
+
sendline('Event')
|
58
|
+
sendline('id: ' + @id.to_s)
|
59
|
+
for recipient in recipients
|
60
|
+
sendline('recipient: ' + recipient.to_s)
|
61
|
+
end
|
62
|
+
sendline('length: ' + body.length.to_s)
|
63
|
+
sendline()
|
64
|
+
@socket.write(body)
|
65
|
+
puts body.to_s
|
66
|
+
return read_response()
|
67
|
+
rescue
|
68
|
+
disconnect()
|
69
|
+
raise
|
70
|
+
end
|
71
|
+
rescue
|
72
|
+
if try_again
|
73
|
+
reconnect()
|
74
|
+
event(recipients, body, json, false)
|
75
|
+
else
|
76
|
+
raise
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
def read_response()
|
81
|
+
# FIXME: this is incorrect. Should read until it gets a \r\n\r\n
|
82
|
+
return @socket.read(15)
|
83
|
+
end
|
84
|
+
end
|
metadata
ADDED
@@ -0,0 +1,188 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: collin-lucky7
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Collin Miller
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-06-25 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rake
|
17
|
+
version_requirement:
|
18
|
+
version_requirements: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: "0"
|
23
|
+
version:
|
24
|
+
- !ruby/object:Gem::Dependency
|
25
|
+
name: rspec
|
26
|
+
version_requirement:
|
27
|
+
version_requirements: !ruby/object:Gem::Requirement
|
28
|
+
requirements:
|
29
|
+
- - ">="
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
version: "0"
|
32
|
+
version:
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: basis
|
35
|
+
version_requirement:
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: "0"
|
41
|
+
version:
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: haml
|
44
|
+
version_requirement:
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: "0"
|
50
|
+
version:
|
51
|
+
description: A Ruby/Javascript web toolkit.
|
52
|
+
email: collintmiller@gmail.com
|
53
|
+
executables: []
|
54
|
+
|
55
|
+
extensions: []
|
56
|
+
|
57
|
+
extra_rdoc_files: []
|
58
|
+
|
59
|
+
files:
|
60
|
+
- README
|
61
|
+
- Rakefile.rb
|
62
|
+
- config/environment.rb
|
63
|
+
- lib/lucky7.rb
|
64
|
+
- lib/jsspec
|
65
|
+
- lib/jsspec/example.html.jass
|
66
|
+
- lib/jsspec/layout.html.haml
|
67
|
+
- lib/lucky7
|
68
|
+
- lib/lucky7/renders.rb
|
69
|
+
- lib/lucky7/builder.rb
|
70
|
+
- lib/jabs.rb
|
71
|
+
- lib/jass.rb
|
72
|
+
- rspec/jabs
|
73
|
+
- rspec/jabs/jabs_precompiler_spec.rb
|
74
|
+
- rspec/jabs/jabs_engine_spec.rb
|
75
|
+
- rspec/jass
|
76
|
+
- rspec/jass/jass_engine_spec.rb
|
77
|
+
- rspec/jass/jass_precompiler_spec.rb
|
78
|
+
- rspec/lucky7_spec.rb
|
79
|
+
- rspec/jass_spec.rb
|
80
|
+
- rspec/spec_helper.rb
|
81
|
+
- rspec/jabs_spec_helper.rb
|
82
|
+
- rspec/fixtures
|
83
|
+
- rspec/fixtures/lucky7
|
84
|
+
- rspec/fixtures/lucky7/src
|
85
|
+
- rspec/fixtures/lucky7/src/app
|
86
|
+
- rspec/fixtures/lucky7/src/app/behavior.css.sass
|
87
|
+
- rspec/fixtures/lucky7/src/app/controller.js.jabs
|
88
|
+
- rspec/fixtures/lucky7/src/app/_page_link.html.haml
|
89
|
+
- rspec/fixtures/lucky7/src/app/_category.html.haml
|
90
|
+
- rspec/fixtures/lucky7/src/app/_header.html.haml
|
91
|
+
- rspec/fixtures/lucky7/src/app/results.html.haml
|
92
|
+
- rspec/fixtures/lucky7/src/app/no_results.html.haml
|
93
|
+
- rspec/fixtures/lucky7/src/app/_result_set.html.haml
|
94
|
+
- rspec/fixtures/lucky7/src/app/layout.html.haml
|
95
|
+
- rspec/fixtures/lucky7/src/app/fixture_spec.html.jass
|
96
|
+
- rspec/fixtures/lucky7/src/app/_pagination.html.haml
|
97
|
+
- rspec/fixtures/lucky7/src/app/_side_bar.html.haml
|
98
|
+
- rspec/fixtures/lucky7/src/app/_result.html.haml
|
99
|
+
- rspec/fixtures/lucky7/build
|
100
|
+
- rspec/fixtures/lucky7/build/app
|
101
|
+
- rspec/fixtures/lucky7/build/app/layout.html
|
102
|
+
- rspec/lucky7
|
103
|
+
- rspec/lucky7/renders_spec.rb
|
104
|
+
- rspec/lucky7/builder_spec.rb
|
105
|
+
- rspec/lucky7_spec_helper.rb
|
106
|
+
- rspec/jabs_spec.rb
|
107
|
+
- templates/skeleton
|
108
|
+
- templates/skeleton/[application]
|
109
|
+
- templates/skeleton/[application]/Rakefile.rb
|
110
|
+
- templates/skeleton/[application]/README
|
111
|
+
- templates/skeleton/[application]/environment
|
112
|
+
- templates/skeleton/[application]/environment/environment.rb
|
113
|
+
- templates/environment
|
114
|
+
- templates/environment/[environment].rb
|
115
|
+
- vendor/js_spec
|
116
|
+
- vendor/js_spec/exp
|
117
|
+
- vendor/js_spec/exp/lib
|
118
|
+
- vendor/js_spec/exp/lib/diff_match_patch.js
|
119
|
+
- vendor/js_spec/exp/lib/js.jar
|
120
|
+
- vendor/js_spec/exp/src
|
121
|
+
- vendor/js_spec/exp/src/JSSpec2.js
|
122
|
+
- vendor/js_spec/exp/src/JSSpec2_spec.js
|
123
|
+
- vendor/js_spec/exp/build.properties
|
124
|
+
- vendor/js_spec/exp/build.xml
|
125
|
+
- vendor/js_spec/copying
|
126
|
+
- vendor/js_spec/JSSpec.js
|
127
|
+
- vendor/js_spec/JSSpec.css
|
128
|
+
- vendor/js_spec/diff_match_patch.js
|
129
|
+
- vendor/js_spec/sample
|
130
|
+
- vendor/js_spec/sample/datetime
|
131
|
+
- vendor/js_spec/sample/datetime/String_Parser.html
|
132
|
+
- vendor/js_spec/sample/datetime/datetime.js
|
133
|
+
- vendor/js_spec/demo.html
|
134
|
+
- vendor/js_spec/example.spec.html
|
135
|
+
- vendor/jquery
|
136
|
+
- vendor/jquery/jquery-1.2.6.min.js
|
137
|
+
- vendor/jquery/jquery-1.2.6.pack.js.gz
|
138
|
+
- vendor/jquery/jquery.simulate.js
|
139
|
+
- vendor/jquery/jquery-1.2.6.js
|
140
|
+
- vendor/orbited
|
141
|
+
- vendor/orbited/ruby-orbited.rb
|
142
|
+
- vendor/orbited/pyevent-0.3
|
143
|
+
- vendor/orbited/pyevent-0.3/cvs
|
144
|
+
- vendor/orbited/pyevent-0.3/cvs/Root
|
145
|
+
- vendor/orbited/pyevent-0.3/cvs/Repository
|
146
|
+
- vendor/orbited/pyevent-0.3/cvs/Entries
|
147
|
+
- vendor/orbited/pyevent-0.3/Makefile
|
148
|
+
- vendor/orbited/pyevent-0.3/build
|
149
|
+
- vendor/orbited/pyevent-0.3/build/temp.linux-i686-2.5
|
150
|
+
- vendor/orbited/pyevent-0.3/build/temp.linux-i686-2.5/event.o
|
151
|
+
- vendor/orbited/pyevent-0.3/build/lib.linux-i686-2.5
|
152
|
+
- vendor/orbited/pyevent-0.3/build/lib.linux-i686-2.5/event.so
|
153
|
+
- vendor/orbited/pyevent-0.3/license
|
154
|
+
- vendor/orbited/pyevent-0.3/test.py
|
155
|
+
- vendor/orbited/pyevent-0.3/event.c
|
156
|
+
- vendor/orbited/pyevent-0.3/event.pyx
|
157
|
+
- vendor/orbited/pyevent-0.3/readme
|
158
|
+
- vendor/orbited/pyevent-0.3/setup.py
|
159
|
+
- vendor/orbited/pyevent-0.3/changes
|
160
|
+
- vendor/orbited/ez_setup.py
|
161
|
+
has_rdoc: false
|
162
|
+
homepage: http://github.com/collin/lucky7
|
163
|
+
post_install_message:
|
164
|
+
rdoc_options: []
|
165
|
+
|
166
|
+
require_paths:
|
167
|
+
- lib
|
168
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
169
|
+
requirements:
|
170
|
+
- - ">="
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: "0"
|
173
|
+
version:
|
174
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
175
|
+
requirements:
|
176
|
+
- - ">="
|
177
|
+
- !ruby/object:Gem::Version
|
178
|
+
version: "0"
|
179
|
+
version:
|
180
|
+
requirements: []
|
181
|
+
|
182
|
+
rubyforge_project:
|
183
|
+
rubygems_version: 1.2.0
|
184
|
+
signing_key:
|
185
|
+
specification_version: 2
|
186
|
+
summary: A Ruby/Javascript web toolkit.
|
187
|
+
test_files: []
|
188
|
+
|