svxbox 0.0.9 → 0.0.10
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/.gitignore +1 -0
- data/Rakefile +27 -0
- data/VERSION +1 -1
- data/lib/svxbox/sinatricus.rb +9 -3
- data/test/svxbox_test.rb +16 -2
- metadata +3 -2
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
OLDVERSION
|
data/Rakefile
CHANGED
@@ -3,6 +3,33 @@ require 'rake'
|
|
3
3
|
require 'shoulda/tasks'
|
4
4
|
|
5
5
|
|
6
|
+
task :pushit do
|
7
|
+
system('git commit -m "pushing" -a && git push origin master')
|
8
|
+
end
|
9
|
+
task :pullgit do
|
10
|
+
system('git pull origin master')
|
11
|
+
end
|
12
|
+
task :pulltest => [:pullgit, :test]
|
13
|
+
|
14
|
+
task :testroll => [:versioncheck, :gemspec]
|
15
|
+
task :rollgem => [:testroll, :buildgem, :pushgem]
|
16
|
+
|
17
|
+
task :versioncheck do
|
18
|
+
@nv = File.open('VERSION') {|f| f.read }
|
19
|
+
@ov = File.open('OLDVERSION') {|f| f.read }
|
20
|
+
raise if @nv == @ov
|
21
|
+
end
|
22
|
+
|
23
|
+
task :buildgem do
|
24
|
+
system('gem1.9.1 build svxbox.gemspec')
|
25
|
+
end
|
26
|
+
|
27
|
+
task :pushgem do
|
28
|
+
system("gem push svxbox-#{@nv}.gem")
|
29
|
+
system('cp VERSION OLDVERSION')
|
30
|
+
system("svxbox-#{@nv}.gem")
|
31
|
+
end
|
32
|
+
|
6
33
|
begin
|
7
34
|
require 'jeweler'
|
8
35
|
Jeweler::Tasks.new do |gem|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.10
|
data/lib/svxbox/sinatricus.rb
CHANGED
@@ -12,9 +12,15 @@ module SvxBox
|
|
12
12
|
redirect settings.uripfx+uri, 301
|
13
13
|
end
|
14
14
|
|
15
|
-
def svx_debug(msg)
|
16
|
-
|
17
|
-
|
15
|
+
def svx_debug(msg=nil)
|
16
|
+
if ENV['RACK_ENV'] == 'development'
|
17
|
+
puts msg unless msg.nil?
|
18
|
+
puts yield if block_given?
|
19
|
+
end
|
20
|
+
end
|
21
|
+
def svx_debug_t(msg=nil)
|
22
|
+
svx_debug(msg) unless msg.nil?
|
23
|
+
svx_debug { yield } if block_given?
|
18
24
|
end
|
19
25
|
end
|
20
26
|
end
|
data/test/svxbox_test.rb
CHANGED
@@ -26,8 +26,22 @@ class SvxBoxTest < Test::Unit::TestCase
|
|
26
26
|
end
|
27
27
|
assert_equal "testing\n", result.string
|
28
28
|
end
|
29
|
-
|
30
|
-
|
29
|
+
|
30
|
+
should "process block as debug output" do
|
31
|
+
ENV['RACK_ENV'] = 'development'
|
32
|
+
result = copy_stdout do
|
33
|
+
svx_debug { 'testing' }
|
34
|
+
end
|
35
|
+
assert_equal "testing\n", result.string
|
36
|
+
end
|
37
|
+
should "process block as debug output via chain" do
|
38
|
+
ENV['RACK_ENV'] = 'development'
|
39
|
+
result = copy_stdout do
|
40
|
+
svx_debug_t { 'testing' }
|
41
|
+
end
|
42
|
+
assert_equal "testing\n", result.string
|
43
|
+
end
|
44
|
+
|
31
45
|
should "not put msg when in production mode" do
|
32
46
|
ENV['RACK_ENV'] = 'production'
|
33
47
|
result = copy_stdout do
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 10
|
9
|
+
version: 0.0.10
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Albert Lash
|
@@ -38,6 +38,7 @@ extensions: []
|
|
38
38
|
extra_rdoc_files:
|
39
39
|
- LICENSE
|
40
40
|
files:
|
41
|
+
- .gitignore
|
41
42
|
- LICENSE
|
42
43
|
- Rakefile
|
43
44
|
- VERSION
|