spsleep 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ff308faad655b5ad98192847f9083a6428391df7
4
+ data.tar.gz: ac84f03908a3c5e6ced1dd4475e59ad63bf1eda5
5
+ SHA512:
6
+ metadata.gz: efeaf7511641001bb1dafe241aa447b33be0b3b8f46626951afb24b78b59a3a0aac0908049764fce9d1fd82ecaeaeced6c8c3699e6b5245f011494e2fa1b4952
7
+ data.tar.gz: 551e1ad2f45c0206f870e0b7d70496c474cf2235e146d644851748cf5f4d8e37780c3ad71acf207f852793134f9db6501f78fd48c46bb06dc1482f4dc09c9c8d
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in spsleep.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Masafumi Yokoyama
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,135 @@
1
+ # spsleep
2
+
3
+ A command line tool for sleep by space.
4
+
5
+ ## Installation
6
+
7
+ gem install spsleep
8
+
9
+ ## Usage (for Linux)
10
+
11
+ ### case 1
12
+
13
+ % ls
14
+ foo bar baz
15
+
16
+ % ls | spsleep
17
+ foo
18
+ (pause for a 1 second)
19
+ bar
20
+ (pause for a 1 second)
21
+ baz
22
+ (pause for a 1 second)
23
+
24
+ ### case 2
25
+
26
+ % ls
27
+ foo bar baz
28
+
29
+ % ls | spsleep 0.5
30
+ foo
31
+ (pause for 0.5 seconds)
32
+ bar
33
+ (pause for 0.5 seconds)
34
+ baz
35
+ (pause for 0.5 seconds)
36
+
37
+ ### case 3
38
+
39
+ % cat foo.txt
40
+ foo
41
+ bar
42
+ baz
43
+
44
+ % spsleep foo.txt
45
+ foo
46
+ (pause for a 1 second)
47
+ bar
48
+ (pause for a 1 second)
49
+ baz
50
+ (pause for a 1 second)
51
+
52
+ ### case 4
53
+
54
+ % cat foo.txt
55
+ foo
56
+ bar
57
+ baz
58
+
59
+ % spsleep 0.5 foo.txt
60
+ foo
61
+ (pause for 0.5 seconds)
62
+ bar
63
+ (pause for 0.5 seconds)
64
+ baz
65
+ (pause for 0.5 seconds)
66
+
67
+ ## Usage (for Windows)
68
+
69
+ ### case 1
70
+
71
+ > dir /b
72
+ foo
73
+ bar
74
+ baz
75
+
76
+ > dir /b | spsleep
77
+ foo
78
+ (pause for a 1 second)
79
+ bar
80
+ (pause for a 1 second)
81
+ baz
82
+ (pause for a 1 second)
83
+
84
+ ### case 2
85
+
86
+ > dir /b
87
+ foo
88
+ bar
89
+ baz
90
+
91
+ > dir /b | spsleep 0.5
92
+ foo
93
+ (pause for 0.5 seconds)
94
+ bar
95
+ (pause for 0.5 seconds)
96
+ baz
97
+ (pause for 0.5 seconds)
98
+
99
+ ### case 3
100
+
101
+ > type foo.txt
102
+ foo
103
+ bar
104
+ baz
105
+
106
+ > spsleep foo.txt
107
+ foo
108
+ (pause for a 1 second)
109
+ bar
110
+ (pause for a 1 second)
111
+ baz
112
+ (pause for a 1 second)
113
+
114
+ ### case 4
115
+
116
+ > type foo.txt
117
+ foo
118
+ bar
119
+ baz
120
+
121
+ > spsleep 0.5 foo.txt
122
+ foo
123
+ (pause for 0.5 seconds)
124
+ bar
125
+ (pause for 0.5 seconds)
126
+ baz
127
+ (pause for 0.5 seconds)
128
+
129
+ ## Contributing
130
+
131
+ 1. Fork it
132
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
133
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
134
+ 4. Push to the branch (`git push origin my-new-feature`)
135
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/spsleep ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "spsleep/command"
4
+
5
+ options = []
6
+ if /\A[0-9](?:\.[0-9]+)?\z/ =~ ARGV[0]
7
+ options << ARGV.shift.to_f
8
+ end
9
+
10
+ Spsleep::Command.run(options)
@@ -0,0 +1,21 @@
1
+ module Spsleep
2
+ class Command
3
+ class << self
4
+ def run(options)
5
+ new.run(options)
6
+ end
7
+ end
8
+
9
+ def initialize
10
+ end
11
+
12
+ def run(options)
13
+ sleep_sec = options[0] ? options[0] : 1
14
+
15
+ ARGF.each do |line|
16
+ puts line
17
+ sleep sleep_sec
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,3 @@
1
+ module Spsleep
2
+ VERSION = "0.0.1"
3
+ end
data/lib/spsleep.rb ADDED
@@ -0,0 +1,2 @@
1
+ require "spsleep/version"
2
+ require "spsleep/command"
data/spsleep.gemspec ADDED
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'spsleep/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "spsleep"
8
+ spec.version = Spsleep::VERSION
9
+ spec.authors = ["Masafumi Yokoyama"]
10
+ spec.email = ["myokoym@gmail.com"]
11
+ spec.description = %q{A command line tool for sleep by space.}
12
+ spec.summary = %q{A command line tool for sleep by space.}
13
+ spec.homepage = "https://github.com/myokoym/spsleep"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) {|f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency("bundler", "~> 1.3")
22
+ spec.add_development_dependency("rake")
23
+ end
metadata ADDED
@@ -0,0 +1,84 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: spsleep
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Masafumi Yokoyama
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-06-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: A command line tool for sleep by space.
42
+ email:
43
+ - myokoym@gmail.com
44
+ executables:
45
+ - spsleep
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - .gitignore
50
+ - Gemfile
51
+ - LICENSE.txt
52
+ - README.md
53
+ - Rakefile
54
+ - bin/spsleep
55
+ - lib/spsleep.rb
56
+ - lib/spsleep/command.rb
57
+ - lib/spsleep/version.rb
58
+ - spsleep.gemspec
59
+ homepage: https://github.com/myokoym/spsleep
60
+ licenses:
61
+ - MIT
62
+ metadata: {}
63
+ post_install_message:
64
+ rdoc_options: []
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - '>='
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ requirements: []
78
+ rubyforge_project:
79
+ rubygems_version: 2.0.3
80
+ signing_key:
81
+ specification_version: 4
82
+ summary: A command line tool for sleep by space.
83
+ test_files: []
84
+ has_rdoc: