sinatra-switch 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/README.rdoc CHANGED
@@ -6,7 +6,7 @@ Set and retrieve an arbitrary switch flag via get and post.
6
6
 
7
7
  require "sinatra/switch"
8
8
 
9
- use_switch "light"
9
+ use_switch "light", { :file_location => "/tmp" }
10
10
 
11
11
  == Functionality
12
12
 
@@ -21,11 +21,11 @@ Set and retrieve an arbitrary switch flag via get and post.
21
21
  A route for flicking the switch to OFF:
22
22
  /switch/light/off
23
23
 
24
- The switch state is stored in a file:
25
- /var/light_switch
26
-
27
24
  == Switch state possibilities
28
25
 
26
+ The switch state is stored in a file:
27
+ /tmp/light_switch
28
+
29
29
  File doesn't exist
30
30
  switch is on
31
31
  File contains ON
@@ -7,7 +7,7 @@ module Sinatra
7
7
  def use_switch app_name, options = {}
8
8
  defaults = { :file_location => "/tmp" }
9
9
  options = defaults.merge(options)
10
- file = File.join(options[:file_location], app_name)
10
+ file = File.join(options[:file_location], "#{app_name}_switch")
11
11
  on_message = "ON"
12
12
  off_message = "OFF"
13
13
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "sinatra-switch"
3
- s.version = "0.0.3"
3
+ s.version = "0.0.4"
4
4
  s.date = "2014-10-28"
5
5
  s.summary = "Set and retrieve an arbitrary switch."
6
6
  s.description = "Set and retrieve an arbitrary switch flag via get and post."
data/test/switch_test.rb CHANGED
@@ -12,7 +12,7 @@ end
12
12
 
13
13
  class SinatraSwitchTest < Test::Unit::TestCase
14
14
  def state_file
15
- File.dirname(__FILE__) + "/light"
15
+ File.dirname(__FILE__) + "/light_switch"
16
16
  end
17
17
 
18
18
  def remove_state_file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-switch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -52,7 +52,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
52
52
  version: '0'
53
53
  segments:
54
54
  - 0
55
- hash: 4352394634967517741
55
+ hash: -3401378227648049844
56
56
  required_rubygems_version: !ruby/object:Gem::Requirement
57
57
  none: false
58
58
  requirements: