trigger_switch_d 0.1.0

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.
Files changed (133) hide show
  1. data/COPYING.txt +674 -0
  2. data/LICENSE.txt +54 -0
  3. data/README.rdoc +106 -0
  4. data/bin/teach +44 -0
  5. data/bin/tsd +68 -0
  6. data/bin/turn_off +42 -0
  7. data/bin/turn_on +39 -0
  8. data/doc/classes/Tellstick/Tellstick.html +117 -0
  9. data/doc/classes/Tellstick/TellstickIO.html +265 -0
  10. data/doc/classes/Tellstick/TellstickIO.src/M000020.html +18 -0
  11. data/doc/classes/Tellstick/TellstickIO.src/M000021.html +20 -0
  12. data/doc/classes/Tellstick/TellstickIO.src/M000022.html +26 -0
  13. data/doc/classes/Tellstick/TellstickIO.src/M000023.html +19 -0
  14. data/doc/classes/Tellstick/TellstickIO.src/M000024.html +26 -0
  15. data/doc/classes/Tellstick/TellstickIO.src/M000025.html +16 -0
  16. data/doc/classes/Tellstick/TellstickIO.src/M000026.html +16 -0
  17. data/doc/classes/Tellstick/TellstickIO.src/M000027.html +24 -0
  18. data/doc/classes/Tellstick.html +204 -0
  19. data/doc/classes/Tellstick.src/M000019.html +25 -0
  20. data/doc/classes/TriggerSwitchD/Action.html +165 -0
  21. data/doc/classes/TriggerSwitchD/Action.src/M000015.html +28 -0
  22. data/doc/classes/TriggerSwitchD/Action.src/M000016.html +18 -0
  23. data/doc/classes/TriggerSwitchD/Application.html +203 -0
  24. data/doc/classes/TriggerSwitchD/Application.src/M000017.html +21 -0
  25. data/doc/classes/TriggerSwitchD/Application.src/M000018.html +40 -0
  26. data/doc/classes/TriggerSwitchD/ConfigFactory/Config.html +127 -0
  27. data/doc/classes/TriggerSwitchD/ConfigFactory/Config.src/M000014.html +23 -0
  28. data/doc/classes/TriggerSwitchD/ConfigFactory.html +141 -0
  29. data/doc/classes/TriggerSwitchD/ConfigFactory.src/M000013.html +24 -0
  30. data/doc/classes/TriggerSwitchD/IPC.html +134 -0
  31. data/doc/classes/TriggerSwitchD/IPC.src/M000012.html +32 -0
  32. data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.html +242 -0
  33. data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.src/M000005.html +19 -0
  34. data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.src/M000006.html +18 -0
  35. data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.src/M000007.html +23 -0
  36. data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.src/M000008.html +19 -0
  37. data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.src/M000009.html +19 -0
  38. data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.src/M000010.html +18 -0
  39. data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.src/M000011.html +18 -0
  40. data/doc/classes/TriggerSwitchD/Schedule.html +147 -0
  41. data/doc/classes/TriggerSwitchD/Schedule.src/M000004.html +19 -0
  42. data/doc/classes/TriggerSwitchD/SwitchFactory.html +135 -0
  43. data/doc/classes/TriggerSwitchD/SwitchFactory.src/M000003.html +20 -0
  44. data/doc/classes/TriggerSwitchD.html +212 -0
  45. data/doc/classes/TriggerSwitchD.src/M000001.html +22 -0
  46. data/doc/classes/TriggerSwitchD.src/M000002.html +27 -0
  47. data/doc/created.rid +1 -0
  48. data/doc/files/lib/tellstick/protocol/nexa_rb.html +126 -0
  49. data/doc/files/lib/tellstick/protocol/not_connected_rb.html +126 -0
  50. data/doc/files/lib/tellstick/protocol/null_protocol_rb.html +126 -0
  51. data/doc/files/lib/tellstick/protocol/plain_text_rb.html +126 -0
  52. data/doc/files/lib/tellstick/protocol/proove_rb.html +126 -0
  53. data/doc/files/lib/tellstick/protocol/protocol_loader_rb.html +126 -0
  54. data/doc/files/lib/tellstick/protocol/rising_sun_rb.html +126 -0
  55. data/doc/files/lib/tellstick/protocol/waveman_rb.html +126 -0
  56. data/doc/files/lib/tellstick/tellstick_io_rb.html +135 -0
  57. data/doc/files/lib/tellstick/tellstick_rb.html +135 -0
  58. data/doc/files/lib/tellstick_rb.html +134 -0
  59. data/doc/files/lib/trigger_switch_d/action_rb.html +126 -0
  60. data/doc/files/lib/trigger_switch_d/application_rb.html +136 -0
  61. data/doc/files/lib/trigger_switch_d/config_rb.html +126 -0
  62. data/doc/files/lib/trigger_switch_d/daylight_rb.html +126 -0
  63. data/doc/files/lib/trigger_switch_d/ipc_rb.html +126 -0
  64. data/doc/files/lib/trigger_switch_d/schedule_rb.html +126 -0
  65. data/doc/files/lib/trigger_switch_d/switch_rb.html +126 -0
  66. data/doc/files/lib/trigger_switch_d/trigger_switch_d_helper_rb.html +126 -0
  67. data/doc/files/lib/trigger_switch_d_rb.html +140 -0
  68. data/doc/fr_class_index.html +38 -0
  69. data/doc/fr_file_index.html +46 -0
  70. data/doc/fr_method_index.html +53 -0
  71. data/doc/index.html +24 -0
  72. data/features/execute_schedule.feature +20 -0
  73. data/features/group_aliases.feature +31 -0
  74. data/features/handle_switches.feature +36 -0
  75. data/features/listen_for_client_call.feature +23 -0
  76. data/features/persistent_schedule.feature +70 -0
  77. data/features/proove_protocol.feature +20 -0
  78. data/features/schedule.feature +25 -0
  79. data/features/simple_string_protocol.feature +35 -0
  80. data/features/step_definitions/execute_schedule_steps.rb +16 -0
  81. data/features/step_definitions/group_aliases_steps.rb +24 -0
  82. data/features/step_definitions/handle_switches_steps.rb +21 -0
  83. data/features/step_definitions/listen_for_client_call_steps.rb +34 -0
  84. data/features/step_definitions/persistent_schedule_steps.rb +18 -0
  85. data/features/step_definitions/proove_protocol_steps.rb +3 -0
  86. data/features/step_definitions/schedule_steps.rb +9 -0
  87. data/features/step_definitions/shared_steps.rb +75 -0
  88. data/features/step_definitions/simple_string_protocol_steps.rb +3 -0
  89. data/features/step_definitions/sunrise_steps.rb +22 -0
  90. data/features/step_definitions/tellstick_connected_steps.rb +21 -0
  91. data/features/sunrise.feature +22 -0
  92. data/features/sunset.feature +22 -0
  93. data/features/support/action_helpers.rb +10 -0
  94. data/features/support/env.rb +7 -0
  95. data/features/support/listen_for_client_call_helper.rb +71 -0
  96. data/features/support/proove_helpers.rb +6 -0
  97. data/features/support/sunrise_helper.rb +8 -0
  98. data/features/tellstick_connected.feature +14 -0
  99. data/lib/tellstick/protocol/nexa.rb +48 -0
  100. data/lib/tellstick/protocol/not_connected.rb +42 -0
  101. data/lib/tellstick/protocol/null_protocol.rb +41 -0
  102. data/lib/tellstick/protocol/plain_text.rb +35 -0
  103. data/lib/tellstick/protocol/proove.rb +83 -0
  104. data/lib/tellstick/protocol/protocol_loader.rb +26 -0
  105. data/lib/tellstick/protocol/rising_sun.rb +42 -0
  106. data/lib/tellstick/protocol/waveman.rb +29 -0
  107. data/lib/tellstick/tellstick.rb +73 -0
  108. data/lib/tellstick/tellstick_io.rb +80 -0
  109. data/lib/tellstick.rb +20 -0
  110. data/lib/trigger_switch_d/action.rb +83 -0
  111. data/lib/trigger_switch_d/application.rb +89 -0
  112. data/lib/trigger_switch_d/config.rb +83 -0
  113. data/lib/trigger_switch_d/daylight.rb +114 -0
  114. data/lib/trigger_switch_d/ipc.rb +39 -0
  115. data/lib/trigger_switch_d/schedule.rb +95 -0
  116. data/lib/trigger_switch_d/switch.rb +37 -0
  117. data/lib/trigger_switch_d/trigger_switch_d_helper.rb +44 -0
  118. data/lib/trigger_switch_d.rb +26 -0
  119. data/spec/spec_helper.rb +22 -0
  120. data/spec/tellstick/protocol/nexa_spec.rb +57 -0
  121. data/spec/tellstick/protocol/proove_spec.rb +61 -0
  122. data/spec/tellstick/protocol/rising_sun_spec.rb +56 -0
  123. data/spec/tellstick/protocol/waveman_spec.rb +57 -0
  124. data/spec/tellstick/tellstick_io_spec.rb +31 -0
  125. data/spec/tellstick/tellstick_spec.rb +86 -0
  126. data/spec/trigger_switch_d/application_spec.rb +144 -0
  127. data/spec/trigger_switch_d/config_spec.rb +94 -0
  128. data/spec/trigger_switch_d/daylight_spec.rb +39 -0
  129. data/spec/trigger_switch_d/ipc_spec.rb +119 -0
  130. data/spec/trigger_switch_d/schedule_spec.rb +103 -0
  131. data/spec/trigger_switch_d/trigger_switch_d_spec_helpers.rb +24 -0
  132. data/trigger_switch_d.gemspec +43 -0
  133. metadata +206 -0
@@ -0,0 +1,23 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>next_action_at (TriggerSwitchD::Schedule::InstanceMethods)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
10
+ <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/trigger_switch_d/schedule.rb, line 41</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">next_action_at</span>(<span class="ruby-identifier">hour_minute</span>)
15
+ <span class="ruby-identifier">end_of_day</span> = <span class="ruby-value str">&quot;23:59:59&quot;</span>
16
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">end_of_day</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">hour_minute</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\d{2}:\d{2}/</span>
17
+ <span class="ruby-identifier">time</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">hour_minute</span>)
18
+ <span class="ruby-identifier">cronological</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">sort</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">x</span>,<span class="ruby-identifier">y</span><span class="ruby-operator">|</span> <span class="ruby-constant">Time</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">x</span>) <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-constant">Time</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">y</span>)}.<span class="ruby-identifier">find</span>(<span class="ruby-constant">Proc</span>.<span class="ruby-identifier">new</span> {<span class="ruby-identifier">end_of_day</span>}) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">at</span><span class="ruby-operator">|</span>
19
+ <span class="ruby-identifier">time</span> <span class="ruby-operator">&lt;</span> <span class="ruby-constant">Time</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">at</span>)
20
+ <span class="ruby-keyword kw">end</span>
21
+ <span class="ruby-keyword kw">end</span></pre>
22
+ </body>
23
+ </html>
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>delete (TriggerSwitchD::Schedule::InstanceMethods)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
10
+ <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/trigger_switch_d/schedule.rb, line 51</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">name</span>)
15
+ <span class="ruby-identifier">action</span> = <span class="ruby-identifier">by_name</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">name</span>)
16
+ <span class="ruby-identifier">cronological</span>[<span class="ruby-identifier">action</span>.<span class="ruby-identifier">at</span>].<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">name</span>)
17
+ <span class="ruby-keyword kw">end</span></pre>
18
+ </body>
19
+ </html>
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>execute (TriggerSwitchD::Schedule::InstanceMethods)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
10
+ <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/trigger_switch_d/schedule.rb, line 57</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">execute</span>(<span class="ruby-identifier">at</span>,<span class="ruby-identifier">output</span>)
15
+ <span class="ruby-identifier">cronological</span>[<span class="ruby-identifier">at</span>].<span class="ruby-identifier">values</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">action</span><span class="ruby-operator">|</span> <span class="ruby-identifier">action</span>.<span class="ruby-identifier">execute</span>(<span class="ruby-identifier">output</span>) } <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">cronological</span>[<span class="ruby-identifier">at</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
16
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">_remove_executed_actions_from_schedule_</span>(<span class="ruby-identifier">at</span>)
17
+ <span class="ruby-keyword kw">end</span></pre>
18
+ </body>
19
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>cronological (TriggerSwitchD::Schedule::InstanceMethods)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
10
+ <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/trigger_switch_d/schedule.rb, line 63</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cronological</span>
15
+ <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">:cronological</span>]
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>by_name (TriggerSwitchD::Schedule::InstanceMethods)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
10
+ <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/trigger_switch_d/schedule.rb, line 68</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">by_name</span>
15
+ <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">:all</span>]
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,147 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Module: TriggerSwitchD::Schedule</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Module</strong></td>
53
+ <td class="class-name-in-header">TriggerSwitchD::Schedule</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/trigger_switch_d/schedule_rb.html">
59
+ lib/trigger_switch_d/schedule.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ </table>
66
+ </div>
67
+ <!-- banner header -->
68
+
69
+ <div id="bodyContent">
70
+
71
+
72
+
73
+ <div id="contextContent">
74
+
75
+ <div id="description">
76
+ <p>
77
+ Holds actions organized by name and cronological Use <a
78
+ href="Schedule.html#M000004">create</a> to instasiate
79
+ </p>
80
+
81
+ </div>
82
+
83
+
84
+ </div>
85
+
86
+ <div id="method-list">
87
+ <h3 class="section-bar">Methods</h3>
88
+
89
+ <div class="name-list">
90
+ <a href="#M000004">create</a>&nbsp;&nbsp;
91
+ </div>
92
+ </div>
93
+
94
+ </div>
95
+
96
+
97
+ <!-- if includes -->
98
+
99
+ <div id="section">
100
+
101
+ <div id="class-list">
102
+ <h3 class="section-bar">Classes and Modules</h3>
103
+
104
+ Module <a href="Schedule/InstanceMethods.html" class="link">TriggerSwitchD::Schedule::InstanceMethods</a><br />
105
+
106
+ </div>
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+ <!-- if method_list -->
115
+ <div id="methods">
116
+ <h3 class="section-bar">Public Instance methods</h3>
117
+
118
+ <div id="method-M000004" class="method-detail">
119
+ <a name="M000004"></a>
120
+
121
+ <div class="method-heading">
122
+ <a href="Schedule.src/M000004.html" target="Code" class="method-signature"
123
+ onclick="popupCode('Schedule.src/M000004.html');return false;">
124
+ <span class="method-name">create</span><span class="method-args">()</span>
125
+ </a>
126
+ </div>
127
+
128
+ <div class="method-description">
129
+ <p>
130
+ Creates an instance of a schedule
131
+ </p>
132
+ </div>
133
+ </div>
134
+
135
+
136
+ </div>
137
+
138
+
139
+ </div>
140
+
141
+
142
+ <div id="validator-badges">
143
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
144
+ </div>
145
+
146
+ </body>
147
+ </html>
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>create (TriggerSwitchD::Schedule)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/trigger_switch_d/schedule.rb, line 88</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create</span>
15
+ <span class="ruby-identifier">schedule</span> = {<span class="ruby-identifier">:all</span> =<span class="ruby-operator">&gt;</span> {}, <span class="ruby-identifier">:cronological</span> =<span class="ruby-operator">&gt;</span> {}}
16
+ <span class="ruby-identifier">schedule</span>.<span class="ruby-identifier">extend</span> <span class="ruby-constant">InstanceMethods</span>
17
+ <span class="ruby-keyword kw">end</span></pre>
18
+ </body>
19
+ </html>
@@ -0,0 +1,135 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Module: TriggerSwitchD::SwitchFactory</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Module</strong></td>
53
+ <td class="class-name-in-header">TriggerSwitchD::SwitchFactory</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/trigger_switch_d/switch_rb.html">
59
+ lib/trigger_switch_d/switch.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ </table>
66
+ </div>
67
+ <!-- banner header -->
68
+
69
+ <div id="bodyContent">
70
+
71
+
72
+
73
+ <div id="contextContent">
74
+
75
+
76
+
77
+ </div>
78
+
79
+ <div id="method-list">
80
+ <h3 class="section-bar">Methods</h3>
81
+
82
+ <div class="name-list">
83
+ <a href="#M000003">new</a>&nbsp;&nbsp;
84
+ </div>
85
+ </div>
86
+
87
+ </div>
88
+
89
+
90
+ <!-- if includes -->
91
+
92
+ <div id="section">
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+ <!-- if method_list -->
102
+ <div id="methods">
103
+ <h3 class="section-bar">Public Class methods</h3>
104
+
105
+ <div id="method-M000003" class="method-detail">
106
+ <a name="M000003"></a>
107
+
108
+ <div class="method-heading">
109
+ <a href="SwitchFactory.src/M000003.html" target="Code" class="method-signature"
110
+ onclick="popupCode('SwitchFactory.src/M000003.html');return false;">
111
+ <span class="method-name">new</span><span class="method-args">(values)</span>
112
+ </a>
113
+ </div>
114
+
115
+ <div class="method-description">
116
+ <p>
117
+ Creates the Switch class dynamically from values, which is assumed to be an
118
+ Array of attributes/keys
119
+ </p>
120
+ </div>
121
+ </div>
122
+
123
+
124
+ </div>
125
+
126
+
127
+ </div>
128
+
129
+
130
+ <div id="validator-badges">
131
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
132
+ </div>
133
+
134
+ </body>
135
+ </html>
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>new (TriggerSwitchD::SwitchFactory)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/trigger_switch_d/switch.rb, line 22</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">values</span>)
15
+ <span class="ruby-identifier">definition</span> = <span class="ruby-value str">&quot;class Switch\nattr_reader \#{values.map {|name| \&quot;:\#{name}\&quot;}.join(\&quot;,\&quot;)}\ndef initialize(value)\nvalue.each_pair do |key,value|\ninstance_variable_set(\&quot;@\&quot;+key.to_s,value) if respond_to?(key)\nend\nend\nend\n&quot;</span>
16
+ <span class="ruby-operator">::</span><span class="ruby-constant">TriggerSwitchD</span>.<span class="ruby-identifier">module_eval</span>(<span class="ruby-identifier">definition</span>)
17
+ <span class="ruby-operator">::</span><span class="ruby-constant">TriggerSwitchD</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-value str">&quot;Switch&quot;</span>)
18
+ <span class="ruby-keyword kw">end</span></pre>
19
+ </body>
20
+ </html>
@@ -0,0 +1,212 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Module: TriggerSwitchD</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Module</strong></td>
53
+ <td class="class-name-in-header">TriggerSwitchD</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../files/lib/trigger_switch_d/action_rb.html">
59
+ lib/trigger_switch_d/action.rb
60
+ </a>
61
+ <br />
62
+ <a href="../files/lib/trigger_switch_d/application_rb.html">
63
+ lib/trigger_switch_d/application.rb
64
+ </a>
65
+ <br />
66
+ <a href="../files/lib/trigger_switch_d/config_rb.html">
67
+ lib/trigger_switch_d/config.rb
68
+ </a>
69
+ <br />
70
+ <a href="../files/lib/trigger_switch_d/ipc_rb.html">
71
+ lib/trigger_switch_d/ipc.rb
72
+ </a>
73
+ <br />
74
+ <a href="../files/lib/trigger_switch_d/schedule_rb.html">
75
+ lib/trigger_switch_d/schedule.rb
76
+ </a>
77
+ <br />
78
+ <a href="../files/lib/trigger_switch_d/switch_rb.html">
79
+ lib/trigger_switch_d/switch.rb
80
+ </a>
81
+ <br />
82
+ <a href="../files/lib/trigger_switch_d/trigger_switch_d_helper_rb.html">
83
+ lib/trigger_switch_d/trigger_switch_d_helper.rb
84
+ </a>
85
+ <br />
86
+ </td>
87
+ </tr>
88
+
89
+ </table>
90
+ </div>
91
+ <!-- banner header -->
92
+
93
+ <div id="bodyContent">
94
+
95
+
96
+
97
+ <div id="contextContent">
98
+
99
+ <div id="description">
100
+ <p>
101
+ <a href="TriggerSwitchD.html">TriggerSwitchD</a>, executes commands to
102
+ activate/deactive remote switches. (c) Copyright 2010 Pontus Strömdahl,
103
+ AdhocSkill.
104
+ </p>
105
+ <p>
106
+ This program is free software: you can redistribute it and/or modify it
107
+ under the terms of the GNU General Public License as published by the Free
108
+ Software Foundation, either version 3 of the License, or (at your option)
109
+ any later version.
110
+ </p>
111
+ <p>
112
+ This program is distributed in the hope that it will be useful, but WITHOUT
113
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
114
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
115
+ more details.
116
+ </p>
117
+ <p>
118
+ You should have received a copy of the GNU General Public License along
119
+ with this program. If not, see &lt;<a
120
+ href="http://www.gnu.org/licenses">www.gnu.org/licenses</a>/&gt;.
121
+ </p>
122
+
123
+ </div>
124
+
125
+
126
+ </div>
127
+
128
+ <div id="method-list">
129
+ <h3 class="section-bar">Methods</h3>
130
+
131
+ <div class="name-list">
132
+ <a href="#M000002">load_devices</a>&nbsp;&nbsp;
133
+ <a href="#M000001">load_scheduled_actions</a>&nbsp;&nbsp;
134
+ </div>
135
+ </div>
136
+
137
+ </div>
138
+
139
+
140
+ <!-- if includes -->
141
+
142
+ <div id="section">
143
+
144
+ <div id="class-list">
145
+ <h3 class="section-bar">Classes and Modules</h3>
146
+
147
+ Module <a href="TriggerSwitchD/ConfigFactory.html" class="link">TriggerSwitchD::ConfigFactory</a><br />
148
+ Module <a href="TriggerSwitchD/IPC.html" class="link">TriggerSwitchD::IPC</a><br />
149
+ Module <a href="TriggerSwitchD/Schedule.html" class="link">TriggerSwitchD::Schedule</a><br />
150
+ Module <a href="TriggerSwitchD/SwitchFactory.html" class="link">TriggerSwitchD::SwitchFactory</a><br />
151
+ Class <a href="TriggerSwitchD/Action.html" class="link">TriggerSwitchD::Action</a><br />
152
+ Class <a href="TriggerSwitchD/Application.html" class="link">TriggerSwitchD::Application</a><br />
153
+
154
+ </div>
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+ <!-- if method_list -->
163
+ <div id="methods">
164
+ <h3 class="section-bar">Public Instance methods</h3>
165
+
166
+ <div id="method-M000002" class="method-detail">
167
+ <a name="M000002"></a>
168
+
169
+ <div class="method-heading">
170
+ <a href="TriggerSwitchD.src/M000002.html" target="Code" class="method-signature"
171
+ onclick="popupCode('TriggerSwitchD.src/M000002.html');return false;">
172
+ <span class="method-name">load_devices</span><span class="method-args">(file)</span>
173
+ </a>
174
+ </div>
175
+
176
+ <div class="method-description">
177
+ <p>
178
+ Returns devices loaded from file
179
+ </p>
180
+ </div>
181
+ </div>
182
+
183
+ <div id="method-M000001" class="method-detail">
184
+ <a name="M000001"></a>
185
+
186
+ <div class="method-heading">
187
+ <a href="TriggerSwitchD.src/M000001.html" target="Code" class="method-signature"
188
+ onclick="popupCode('TriggerSwitchD.src/M000001.html');return false;">
189
+ <span class="method-name">load_scheduled_actions</span><span class="method-args">(file,schedule,devices,environment,date=Date.today)</span>
190
+ </a>
191
+ </div>
192
+
193
+ <div class="method-description">
194
+ <p>
195
+ Loads up schedule with the actions in file
196
+ </p>
197
+ </div>
198
+ </div>
199
+
200
+
201
+ </div>
202
+
203
+
204
+ </div>
205
+
206
+
207
+ <div id="validator-badges">
208
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
209
+ </div>
210
+
211
+ </body>
212
+ </html>