CalMon 0.0.3 → 0.0.4
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/CalMon.gemspec +1 -1
- data/Gemfile.lock +1 -1
- data/bin/CalMon +1 -13
- data/doc/JsonRPC.java +2 -3
- data/doc/bash_only.sh +1 -1
- data/lib/CalMon.rb +1 -1
- data/lib/CalMon/ObserveRPC.rb +12 -0
- data/lib/CalMon/RPC.rb +29 -0
- data/lib/CalMon/Server.rb +20 -0
- data/lib/CalMon/version.rb +1 -1
- metadata +10 -9
data/CalMon.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.version = CalMon::VERSION
|
9
9
|
s.authors = %w{Randy D. Wallace Jr.}
|
10
10
|
s.email = %w{randy@randywallace.com}
|
11
|
-
s.homepage = ""
|
11
|
+
s.homepage = "http://randywallace.github.com/CalMon/"
|
12
12
|
s.summary = %q{Collect timestamp data from services and use that data to add events to google calendar.}
|
13
13
|
s.description = <<EOF
|
14
14
|
With a JSON-RPC server, client services via a myriad of language options,
|
data/Gemfile.lock
CHANGED
data/bin/CalMon
CHANGED
@@ -5,17 +5,5 @@ $:.unshift File.dirname(__FILE__)
|
|
5
5
|
require 'rubygems'
|
6
6
|
require 'CalMon'
|
7
7
|
|
8
|
-
|
9
|
-
extend Jimson::Handler
|
10
|
-
|
11
|
-
def sum(a,b,c)
|
12
|
-
a + b + c
|
13
|
-
end
|
14
|
-
|
15
|
-
def sub(a,b)
|
16
|
-
a - b
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
server = Jimson::Server.new(Test.new)
|
8
|
+
server = CalMon::Server.new
|
21
9
|
server.start
|
data/doc/JsonRPC.java
CHANGED
@@ -7,7 +7,7 @@ import java.util.*;
|
|
7
7
|
public class JsonRPC {
|
8
8
|
|
9
9
|
public static void main(String[] args) {
|
10
|
-
|
10
|
+
|
11
11
|
URL serverURL = null;
|
12
12
|
|
13
13
|
try {
|
@@ -18,7 +18,7 @@ public class JsonRPC {
|
|
18
18
|
}
|
19
19
|
|
20
20
|
JSONRPC2Session mySession = new JSONRPC2Session(serverURL);
|
21
|
-
|
21
|
+
|
22
22
|
mySession.getOptions().setRequestContentType("text/html");
|
23
23
|
mySession.getOptions().setAllowedResponseContentTypes(new String[]{"text/html"});
|
24
24
|
|
@@ -44,4 +44,3 @@ public class JsonRPC {
|
|
44
44
|
|
45
45
|
}
|
46
46
|
}
|
47
|
-
|
data/doc/bash_only.sh
CHANGED
data/lib/CalMon.rb
CHANGED
data/lib/CalMon/RPC.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'observer'
|
2
|
+
|
3
|
+
module CalMon
|
4
|
+
class RPC
|
5
|
+
include Observable
|
6
|
+
extend Jimson::Handler
|
7
|
+
|
8
|
+
jimson_exclude *Observable.public_instance_methods.map {|x| x.to_sym}
|
9
|
+
|
10
|
+
def initialize
|
11
|
+
end
|
12
|
+
|
13
|
+
def start_time timestamp
|
14
|
+
changed
|
15
|
+
notify_observers(Time.parse(timestamp), __method__.to_s)
|
16
|
+
"Success"
|
17
|
+
end
|
18
|
+
|
19
|
+
def sum(a, b, c)
|
20
|
+
a + b + c
|
21
|
+
end
|
22
|
+
|
23
|
+
def sub(a, b)
|
24
|
+
a - b
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
|
2
|
+
require "CalMon/RPC"
|
3
|
+
require "CalMon/ObserveRPC"
|
4
|
+
|
5
|
+
module CalMon
|
6
|
+
class Server
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@rpc = CalMon::RPC.new
|
10
|
+
@observer = CalMon::ObserveRPC.new(@rpc)
|
11
|
+
@server = Jimson::Server.new(@rpc)
|
12
|
+
end
|
13
|
+
|
14
|
+
def start
|
15
|
+
@server.start
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
data/lib/CalMon/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: CalMon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 23
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Randy
|
@@ -18,8 +18,7 @@ autorequire:
|
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
20
|
|
21
|
-
date: 2012-
|
22
|
-
default_executable:
|
21
|
+
date: 2012-05-02 00:00:00 Z
|
23
22
|
dependencies:
|
24
23
|
- !ruby/object:Gem::Dependency
|
25
24
|
name: rake
|
@@ -94,10 +93,12 @@ files:
|
|
94
93
|
- doc/JsonRPC.java
|
95
94
|
- doc/bash_only.sh
|
96
95
|
- lib/CalMon.rb
|
96
|
+
- lib/CalMon/ObserveRPC.rb
|
97
|
+
- lib/CalMon/RPC.rb
|
98
|
+
- lib/CalMon/Server.rb
|
97
99
|
- lib/CalMon/version.rb
|
98
100
|
- test/test_CalMon.rb
|
99
|
-
|
100
|
-
homepage: ""
|
101
|
+
homepage: http://randywallace.github.com/CalMon/
|
101
102
|
licenses:
|
102
103
|
- MIT
|
103
104
|
post_install_message:
|
@@ -126,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
127
|
requirements: []
|
127
128
|
|
128
129
|
rubyforge_project: CalMon
|
129
|
-
rubygems_version: 1.
|
130
|
+
rubygems_version: 1.8.10
|
130
131
|
signing_key:
|
131
132
|
specification_version: 3
|
132
133
|
summary: Collect timestamp data from services and use that data to add events to google calendar.
|