trigger_switch_d 0.1.1 → 0.1.2
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.rdoc +74 -57
- data/bin/ts_setup +68 -0
- data/bin/{teach → ts_teach} +1 -1
- data/bin/{turn_off → ts_turn_off} +1 -1
- data/bin/{turn_on → ts_turn_on} +1 -1
- data/bin/tsd +1 -1
- data/config/environment.rb.sample +42 -0
- data/config/lookup.dsl +7 -0
- data/lib/tellstick/code_converter.rb +56 -0
- data/lib/tellstick/protocol/nexa.rb +25 -10
- data/lib/tellstick/protocol/not_connected.rb +6 -14
- data/lib/tellstick/protocol/null_protocol.rb +6 -14
- data/lib/tellstick/protocol/proove.rb +60 -35
- data/lib/tellstick/protocol/protocol_loader.rb +2 -3
- data/lib/tellstick/protocol/rising_sun.rb +8 -4
- data/lib/tellstick/proxy_io.rb +32 -14
- data/lib/tellstick/tellstick.rb +4 -12
- data/lib/trigger_switch_d/action.rb +54 -19
- data/lib/trigger_switch_d/application.rb +77 -34
- data/lib/trigger_switch_d/config.rb +85 -35
- data/lib/trigger_switch_d/daylight.rb +135 -52
- data/lib/trigger_switch_d/ipc.rb +44 -12
- data/lib/trigger_switch_d/schedule.rb +20 -13
- data/lib/trigger_switch_d/switch.rb +6 -0
- data/lib/trigger_switch_d/trigger_switch_d_helper.rb +14 -13
- data/samples/devices +14 -0
- data/samples/devices.rising_sun +6 -0
- data/samples/environment.rb +44 -0
- data/samples/lookup.dsl +7 -0
- data/samples/scheduled_actions +6 -0
- data/samples/scheduled_actions.rising_sun +4 -0
- metadata +41 -116
- data/doc/classes/Tellstick/Tellstick.html +0 -117
- data/doc/classes/Tellstick/TellstickIO.html +0 -265
- data/doc/classes/Tellstick/TellstickIO.src/M000020.html +0 -18
- data/doc/classes/Tellstick/TellstickIO.src/M000021.html +0 -20
- data/doc/classes/Tellstick/TellstickIO.src/M000022.html +0 -26
- data/doc/classes/Tellstick/TellstickIO.src/M000023.html +0 -19
- data/doc/classes/Tellstick/TellstickIO.src/M000024.html +0 -26
- data/doc/classes/Tellstick/TellstickIO.src/M000025.html +0 -16
- data/doc/classes/Tellstick/TellstickIO.src/M000026.html +0 -16
- data/doc/classes/Tellstick/TellstickIO.src/M000027.html +0 -24
- data/doc/classes/Tellstick.html +0 -204
- data/doc/classes/Tellstick.src/M000019.html +0 -25
- data/doc/classes/TriggerSwitchD/Action.html +0 -165
- data/doc/classes/TriggerSwitchD/Action.src/M000015.html +0 -28
- data/doc/classes/TriggerSwitchD/Action.src/M000016.html +0 -18
- data/doc/classes/TriggerSwitchD/Application.html +0 -203
- data/doc/classes/TriggerSwitchD/Application.src/M000017.html +0 -21
- data/doc/classes/TriggerSwitchD/Application.src/M000018.html +0 -40
- data/doc/classes/TriggerSwitchD/ConfigFactory/Config.html +0 -127
- data/doc/classes/TriggerSwitchD/ConfigFactory/Config.src/M000014.html +0 -23
- data/doc/classes/TriggerSwitchD/ConfigFactory.html +0 -141
- data/doc/classes/TriggerSwitchD/ConfigFactory.src/M000013.html +0 -24
- data/doc/classes/TriggerSwitchD/IPC.html +0 -134
- data/doc/classes/TriggerSwitchD/IPC.src/M000012.html +0 -32
- data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.html +0 -242
- data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.src/M000005.html +0 -19
- data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.src/M000006.html +0 -18
- data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.src/M000007.html +0 -23
- data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.src/M000008.html +0 -19
- data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.src/M000009.html +0 -19
- data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.src/M000010.html +0 -18
- data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.src/M000011.html +0 -18
- data/doc/classes/TriggerSwitchD/Schedule.html +0 -147
- data/doc/classes/TriggerSwitchD/Schedule.src/M000004.html +0 -19
- data/doc/classes/TriggerSwitchD/SwitchFactory.html +0 -135
- data/doc/classes/TriggerSwitchD/SwitchFactory.src/M000003.html +0 -20
- data/doc/classes/TriggerSwitchD.html +0 -212
- data/doc/classes/TriggerSwitchD.src/M000001.html +0 -22
- data/doc/classes/TriggerSwitchD.src/M000002.html +0 -27
- data/doc/created.rid +0 -1
- data/doc/files/lib/tellstick/protocol/nexa_rb.html +0 -126
- data/doc/files/lib/tellstick/protocol/not_connected_rb.html +0 -126
- data/doc/files/lib/tellstick/protocol/null_protocol_rb.html +0 -126
- data/doc/files/lib/tellstick/protocol/plain_text_rb.html +0 -126
- data/doc/files/lib/tellstick/protocol/proove_rb.html +0 -126
- data/doc/files/lib/tellstick/protocol/protocol_loader_rb.html +0 -126
- data/doc/files/lib/tellstick/protocol/rising_sun_rb.html +0 -126
- data/doc/files/lib/tellstick/protocol/waveman_rb.html +0 -126
- data/doc/files/lib/tellstick/tellstick_io_rb.html +0 -135
- data/doc/files/lib/tellstick/tellstick_rb.html +0 -135
- data/doc/files/lib/tellstick_rb.html +0 -134
- data/doc/files/lib/trigger_switch_d/action_rb.html +0 -126
- data/doc/files/lib/trigger_switch_d/application_rb.html +0 -136
- data/doc/files/lib/trigger_switch_d/config_rb.html +0 -126
- data/doc/files/lib/trigger_switch_d/daylight_rb.html +0 -126
- data/doc/files/lib/trigger_switch_d/ipc_rb.html +0 -126
- data/doc/files/lib/trigger_switch_d/schedule_rb.html +0 -126
- data/doc/files/lib/trigger_switch_d/switch_rb.html +0 -126
- data/doc/files/lib/trigger_switch_d/trigger_switch_d_helper_rb.html +0 -126
- data/doc/files/lib/trigger_switch_d_rb.html +0 -140
- data/doc/fr_class_index.html +0 -38
- data/doc/fr_file_index.html +0 -46
- data/doc/fr_method_index.html +0 -53
- data/doc/index.html +0 -24
- data/features/execute_schedule.feature +0 -20
- data/features/group_aliases.feature +0 -31
- data/features/handle_switches.feature +0 -36
- data/features/listen_for_client_call.feature +0 -23
- data/features/persistent_schedule.feature +0 -70
- data/features/proove_protocol.feature +0 -20
- data/features/schedule.feature +0 -25
- data/features/simple_string_protocol.feature +0 -35
- data/features/step_definitions/execute_schedule_steps.rb +0 -16
- data/features/step_definitions/group_aliases_steps.rb +0 -24
- data/features/step_definitions/handle_switches_steps.rb +0 -21
- data/features/step_definitions/listen_for_client_call_steps.rb +0 -34
- data/features/step_definitions/persistent_schedule_steps.rb +0 -18
- data/features/step_definitions/proove_protocol_steps.rb +0 -3
- data/features/step_definitions/schedule_steps.rb +0 -9
- data/features/step_definitions/shared_steps.rb +0 -75
- data/features/step_definitions/simple_string_protocol_steps.rb +0 -3
- data/features/step_definitions/sunrise_steps.rb +0 -22
- data/features/step_definitions/tellstick_connected_steps.rb +0 -21
- data/features/sunrise.feature +0 -22
- data/features/sunset.feature +0 -22
- data/features/support/action_helpers.rb +0 -10
- data/features/support/env.rb +0 -7
- data/features/support/listen_for_client_call_helper.rb +0 -71
- data/features/support/proove_helpers.rb +0 -6
- data/features/support/sunrise_helper.rb +0 -8
- data/features/tellstick_connected.feature +0 -14
- data/spec/spec_helper.rb +0 -22
- data/spec/tellstick/protocol/nexa_spec.rb +0 -57
- data/spec/tellstick/protocol/proove_spec.rb +0 -61
- data/spec/tellstick/protocol/rising_sun_spec.rb +0 -56
- data/spec/tellstick/protocol/waveman_spec.rb +0 -57
- data/spec/tellstick/proxy_io_spec.rb +0 -34
- data/spec/tellstick/tellstick_spec.rb +0 -86
- data/spec/trigger_switch_d/application_spec.rb +0 -147
- data/spec/trigger_switch_d/config_spec.rb +0 -154
- data/spec/trigger_switch_d/daylight_spec.rb +0 -39
- data/spec/trigger_switch_d/ipc_spec.rb +0 -119
- data/spec/trigger_switch_d/schedule_spec.rb +0 -103
- data/spec/trigger_switch_d/trigger_switch_d_spec_helpers.rb +0 -24
- data/trigger_switch_d.gemspec +0 -43
@@ -1,147 +0,0 @@
|
|
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>
|
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>
|
@@ -1,19 +0,0 @@
|
|
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">></span> {}, <span class="ruby-identifier">:cronological</span> =<span class="ruby-operator">></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>
|
@@ -1,135 +0,0 @@
|
|
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>
|
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>
|
@@ -1,20 +0,0 @@
|
|
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">"class Switch\nattr_reader \#{values.map {|name| \":\#{name}\"}.join(\",\")}\ndef initialize(value)\nvalue.each_pair do |key,value|\ninstance_variable_set(\"@\"+key.to_s,value) if respond_to?(key)\nend\nend\nend\n"</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">"Switch"</span>)
|
18
|
-
<span class="ruby-keyword kw">end</span></pre>
|
19
|
-
</body>
|
20
|
-
</html>
|
@@ -1,212 +0,0 @@
|
|
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 <<a
|
120
|
-
href="http://www.gnu.org/licenses">www.gnu.org/licenses</a>/>.
|
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>
|
133
|
-
<a href="#M000001">load_scheduled_actions</a>
|
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>
|
@@ -1,22 +0,0 @@
|
|
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>load_scheduled_actions (TriggerSwitchD)</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/trigger_switch_d_helper.rb, line 21</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_scheduled_actions</span>(<span class="ruby-identifier">file</span>,<span class="ruby-identifier">schedule</span>,<span class="ruby-identifier">devices</span>,<span class="ruby-identifier">environment</span>,<span class="ruby-identifier">date</span>=<span class="ruby-constant">Date</span>.<span class="ruby-identifier">today</span>)
|
15
|
-
<span class="ruby-identifier">rows</span> = <span class="ruby-identifier">file</span>.<span class="ruby-identifier">readlines</span>
|
16
|
-
<span class="ruby-identifier">rows</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">code_line</span><span class="ruby-operator">|</span>
|
17
|
-
<span class="ruby-identifier">action</span> = <span class="ruby-constant">Action</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">code_line</span>,<span class="ruby-identifier">devices</span>,<span class="ruby-identifier">environment</span>,<span class="ruby-identifier">date</span>)
|
18
|
-
<span class="ruby-identifier">schedule</span>.<span class="ruby-identifier">schedule_action</span>(<span class="ruby-identifier">action</span>) <span class="ruby-comment cmt">#unless Time.parse(action.at) < Time.now</span>
|
19
|
-
<span class="ruby-keyword kw">end</span>
|
20
|
-
<span class="ruby-keyword kw">end</span></pre>
|
21
|
-
</body>
|
22
|
-
</html>
|
@@ -1,27 +0,0 @@
|
|
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>load_devices (TriggerSwitchD)</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/trigger_switch_d_helper.rb, line 30</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_devices</span>(<span class="ruby-identifier">file</span>)
|
15
|
-
<span class="ruby-identifier">devices</span> = <span class="ruby-constant">YAML</span><span class="ruby-operator">::</span><span class="ruby-identifier">load</span>(<span class="ruby-identifier">file</span>)
|
16
|
-
<span class="ruby-constant">SwitchFactory</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">devices</span>[<span class="ruby-value">0</span>][<span class="ruby-value str">"switches"</span>][<span class="ruby-value">0</span>].<span class="ruby-identifier">keys</span>)
|
17
|
-
<span class="ruby-identifier">result</span> = {}
|
18
|
-
<span class="ruby-identifier">devices</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">device</span><span class="ruby-operator">|</span>
|
19
|
-
<span class="ruby-identifier">switches</span> = <span class="ruby-identifier">device</span>[<span class="ruby-value str">"switches"</span>].<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">switch</span><span class="ruby-operator">|</span>
|
20
|
-
<span class="ruby-constant">TriggerSwitchD</span><span class="ruby-operator">::</span><span class="ruby-constant">Switch</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">switch</span>)
|
21
|
-
<span class="ruby-keyword kw">end</span>
|
22
|
-
<span class="ruby-identifier">result</span>[<span class="ruby-identifier">device</span>[<span class="ruby-value str">"name"</span>]] = <span class="ruby-identifier">switches</span>
|
23
|
-
<span class="ruby-keyword kw">end</span>
|
24
|
-
<span class="ruby-identifier">result</span>
|
25
|
-
<span class="ruby-keyword kw">end</span></pre>
|
26
|
-
</body>
|
27
|
-
</html>
|
data/doc/created.rid
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
Wed, 24 Mar 2010 15:19:25 +0100
|