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.
@@ -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,
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- CalMon (0.0.2)
4
+ CalMon (0.0.3)
5
5
  google-api-client
6
6
  jimson
7
7
  rake
data/bin/CalMon CHANGED
@@ -5,17 +5,5 @@ $:.unshift File.dirname(__FILE__)
5
5
  require 'rubygems'
6
6
  require 'CalMon'
7
7
 
8
- class Test
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
@@ -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
-
@@ -30,7 +30,7 @@ EOF
30
30
  )
31
31
  }
32
32
 
33
- gen_json_req sum 1 2 3
33
+ gen_json_req start_time '"2012-01-12 12:15:33"'
34
34
 
35
35
  BODY=${REPLY}
36
36
 
@@ -3,8 +3,8 @@
3
3
  require 'rubygems'
4
4
  require "jimson"
5
5
  require "CalMon/version"
6
+ require "CalMon/Server"
6
7
 
7
8
  module CalMon
8
9
  end
9
10
 
10
-
@@ -0,0 +1,12 @@
1
+
2
+ module CalMon
3
+ class ObserveRPC
4
+ def initialize(rpc_instance)
5
+ rpc_instance.add_observer(self)
6
+ end
7
+
8
+ def update(timestamp, method)
9
+ puts "Successfully received " << timestamp.to_s << " from " << method
10
+ end
11
+ end
12
+ end
@@ -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
+
@@ -1,3 +1,3 @@
1
1
  module CalMon
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
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: 25
5
- prerelease: false
4
+ hash: 23
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
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-04-30 00:00:00 -04:00
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
- has_rdoc: true
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.3.7
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.