snaka-favoraretter 0.0.4 → 0.0.5

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.
@@ -0,0 +1,3 @@
1
+ #! ruby
2
+ SERVICE = 'Favoraretter'
3
+
@@ -1,15 +1,8 @@
1
- @echo off
2
- rem
3
- rem register.bat
4
- rem
5
- rem Copyright (c) 2009 snaka <snaka.gml@gmail.com>
6
- rem
7
-
8
- ruby -x -Ks "%~f0"
9
- pause
10
- exit
11
-
12
- #! ruby
1
+ #
2
+ # register.bat
3
+ #
4
+ # Copyright (c) 2009 snaka <snaka.gml@gmail.com>
5
+ #
13
6
  require "readline"
14
7
 
15
8
  require "rubygems"
@@ -30,10 +23,11 @@ def register(user)
30
23
  :description => "Favoraretter daemon",
31
24
  :start_type => Service::AUTO_START,
32
25
  :error_control => Service::ERROR_NORMAL,
33
- :binary_path_name => %("c:\\Program Files\\ruby-1.8\\bin\\rubyw.exe" -C"#{current_path}" favoraretter.rb #{user}),
26
+ :binary_path_name => binary_path_name(user),
34
27
  :display_name => "Favoraetter daemon!"
35
28
  )
36
29
  puts "�ӂ��ڂ��Ď��T�[�r�X��o�^���܂����B"
30
+ puts ">> #{binary_path_name(user)}"
37
31
  end
38
32
  end
39
33
 
@@ -44,8 +38,16 @@ def user_display_name(user)
44
38
  return user
45
39
  end
46
40
 
47
- def current_path
48
- Dir.pwd.gsub(File::Separator, File::ALT_SEPARATOR)
41
+ def binary_path_name(user)
42
+ ruby = Gem.ruby
43
+ dir = bin_dir
44
+ "\"#{ruby}\" -C\"#{dir}\" favoraretter.rb #{user}".gsub("ruby.exe", "rubyw.exe")
45
+ end
46
+
47
+ def bin_dir
48
+ target = Gem.bin_path("favoraretter", "fav-reg", ">= 0")
49
+ _all_, base_dir, file = target.match(/(.*)\/(.*)/).to_a
50
+ return base_dir
49
51
  end
50
52
 
51
53
  puts <<EOS
@@ -1,14 +1,8 @@
1
- @echo off
2
- rem
3
- rem start-watching.bat
4
- rem
5
- rem Copyright (c) 2009 snaka <snaka.gml@gmail.com>
6
- rem
7
-
8
- ruby -x -Ks "%~f0"
9
- pause
10
- exit
11
-
1
+ #
2
+ # start-watching.bat
3
+ #
4
+ # Copyright (c) 2009 snaka <snaka.gml@gmail.com>
5
+ #
12
6
  #! ruby
13
7
  require "readline"
14
8
 
@@ -27,4 +21,4 @@ rescue Exception => ex
27
21
  puts ex
28
22
  end
29
23
 
30
- # vim: ts=2 sw=2 et
24
+ # vim: ts=2 sw=2 et ft=ruby
@@ -1,15 +1,8 @@
1
- @echo off
2
- rem
3
- rem stop-watching.bat
4
- rem
5
- rem Copyright (c) 2009 snaka <snaka.gml@gmail.com>
6
- rem
7
-
8
- ruby -x -Ks "%~f0"
9
- pause
10
- exit
11
-
12
- #! ruby
1
+ #
2
+ # stop-watching.bat
3
+ #
4
+ # Copyright (c) 2009 snaka <snaka.gml@gmail.com>
5
+ #
13
6
  require "readline"
14
7
 
15
8
  require "rubygems"
@@ -27,4 +20,4 @@ rescue Exception => ex
27
20
  puts ex
28
21
  end
29
22
 
30
- # vim: ts=2 sw=2 et
23
+ # vim: ts=2 sw=2 et ft=ruby
@@ -1,15 +1,8 @@
1
- @echo off
2
- rem
3
- rem unregister.bat
4
- rem
5
- rem Copyright (c) 2009 snaka <snaka.gml@gmail.com>
6
- rem
7
-
8
- ruby -x -Ks "%~f0"
9
- pause
10
- exit
11
-
12
- #! ruby
1
+ #
2
+ # unregister.bat
3
+ #
4
+ # Copyright (c) 2009 snaka <snaka.gml@gmail.com>
5
+ #
13
6
  require "readline"
14
7
 
15
8
  require "rubygems"
@@ -31,4 +24,4 @@ rescue Exception => ex
31
24
  puts ex
32
25
  end
33
26
 
34
- # vim: ts=2 sw=2 et
27
+ # vim: ts=2 sw=2 et ft=ruby
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snaka-favoraretter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - snaka
@@ -45,10 +45,10 @@ dependencies:
45
45
  description: Watch "favorare" status and notify if "favorare" added.
46
46
  email: snaka.gml@gmail.com
47
47
  executables:
48
- - start-watching.bat
49
- - stop-watching.bat
50
- - register.bat
51
- - unregister.bat
48
+ - fav-start
49
+ - fav-stop
50
+ - fav-reg
51
+ - fav-unreg
52
52
  extensions: []
53
53
 
54
54
  extra_rdoc_files: []
@@ -58,10 +58,11 @@ files:
58
58
  - Manifest.txt
59
59
  - README.txt
60
60
  - Rakefile
61
- - bin/start-watching.bat
62
- - bin/stop-watching.bat
63
- - bin/register.bat
64
- - bin/unregister.bat
61
+ - bin/fav-start
62
+ - bin/fav-stop
63
+ - bin/fav-reg
64
+ - bin/fav-unreg
65
+ - bin/constant.rb
65
66
  - bin/favoraretter.rb
66
67
  has_rdoc: false
67
68
  homepage: http://d.hatena.ne.jp/snaka72/