bbiff 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 26c8c6112d682990cd4953db4b8f8ab1316da07d
4
- data.tar.gz: 97e82ef8cedab88a41c644f5594692d42d7f775a
3
+ metadata.gz: 592a48d6468295a5d5c58c50ed3e327c4c78e9fd
4
+ data.tar.gz: 140254700a817340e17357c9cc1c7fb1281c6410
5
5
  SHA512:
6
- metadata.gz: cb7109a215f418c9c35db206bb92fa05d17adc1e639f32895067c5ce7f017eb342776bd57dce0de7f0d22b6f39bb649873b30a7a7f6b0a41adbd504823133031
7
- data.tar.gz: f27d304894873de10acb7dfb073bd44349e8b367e5bf5a42fe558b12c30913965874caf8f29b04bc0d22747f6e82b7330437a43885e5e4df4efe715f32bfb279
6
+ metadata.gz: 8b513cc6376a815cc1059c7be06e56f36e8f33d3c2cade2152c80c8099574d6dd3eeea42427399001954180513ece4b4ea2bed75050e9539d3fec7ac3bd1b645
7
+ data.tar.gz: a3d42075ad1d436eca8b340d157b5702fc6932e1f1df134e530d6cc737c7d6aca6b1313a30ed71f243fab355055e91713ced2d05d0d45e65610968cc4be7fdcf
data/Gemfile CHANGED
@@ -2,3 +2,6 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in bbiff.gemspec
4
4
  gemspec
5
+
6
+ gem 'bundler', require: ['net/http', 'uri', 'cgi', 'shellwords']
7
+ gem 'activesupport', require: ['active_support', 'active_support/core_ext/numeric']
data/README.md CHANGED
@@ -22,9 +22,14 @@ notify-send コマンド
22
22
  - .travis.ymlでテストするなら要編集
23
23
  - moduleの中にまとめるべきかも
24
24
 
25
- ## 謝辞
26
-
27
- DoG-peer さんが gem 化を手伝ってくれました。
25
+ ## リリース
26
+
27
+ ver 0.1.0
28
+ * gem 化した。(DoG-peer さん)
29
+
30
+ ver 0.1.2
31
+ * notify-send コマンドがインストールされていない場合は echo コマンド
32
+ を利用するようにした。(raduwen さん)
28
33
 
29
34
  ## 作者
30
35
 
data/bin/bbiff CHANGED
@@ -1,4 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
+
3
+ $LOAD_PATH.unshift File.expand_path( '../../lib', __FILE__)
4
+
2
5
  require 'bbiff'
3
6
 
4
- # load '/usr/local/lib/bbiff/bbiff.rb'
7
+ main
data/lib/bbiff.rb CHANGED
@@ -1,6 +1,8 @@
1
- require 'shellwords'
2
- require_relative 'bbiff/bbs_reader'
3
- require_relative 'bbiff/res_format'
1
+ require 'bundler'
2
+ Bundler.require :default
3
+
4
+ require 'bbiff/bbs_reader'
5
+ require 'bbiff/res_format'
4
6
 
5
7
  def parse_range(str)
6
8
  if str == "all"
@@ -17,7 +19,8 @@ def parse_range(str)
17
19
  end
18
20
 
19
21
  def start_polling(thread, start_no)
20
- notify_send = ENV['BBIFF_NOTIFY_SEND'] || "notify-send"
22
+ default_notify_command = 'notify-send'
23
+ notify_send = ENV['BBIFF_NOTIFY_SEND'] || (system("which #{default_notify_command}") ? default_notify_command : 'echo')
21
24
  loop do
22
25
  thread.posts(parse_range("#{start_no}-")).each do |post|
23
26
  system("#{notify_send} #{Shellwords.escape(render_post(post))}")
@@ -51,9 +54,7 @@ def main
51
54
  sure = $3.to_i
52
55
  end
53
56
 
54
- thread = Bbs::C板.new(*ita).thread(sure)
57
+ thread = Bbs::C板.new(*ita).thread(sure)
55
58
  start_no = ARGV[1] ? ARGV[1].to_i : thread.last + 1
56
59
  start_polling(thread, start_no)
57
60
  end
58
-
59
- main
@@ -1,6 +1,3 @@
1
- require 'net/http'
2
- require 'uri'
3
-
4
1
  module Bbs
5
2
 
6
3
  class C板
@@ -1,8 +1,3 @@
1
- require 'cgi'
2
- require 'active_support'
3
- require 'active_support/core_ext'
4
- require_relative 'bbs_reader'
5
-
6
1
  class Fixnum
7
2
  def em
8
3
  ' ' * (self*2)
data/lib/bbiff/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Bbiff
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bbiff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoteichi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-22 00:00:00.000000000 Z
11
+ date: 2015-12-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
107
  version: '0'
108
108
  requirements: []
109
109
  rubyforge_project:
110
- rubygems_version: 2.2.2
110
+ rubygems_version: 2.4.5
111
111
  signing_key:
112
112
  specification_version: 4
113
113
  summary: notifies new post arrival on the Shitaraba BBS.