mireru 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -0
- data/Rakefile +8 -0
- data/lib/mireru/command/mireru.rb +13 -0
- data/lib/mireru/version.rb +1 -1
- data/lib/mireru/widget.rb +1 -1
- data/test/test-mireru.rb +19 -0
- data/test/test-widget.rb +4 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac1e35de74d8cb4f531e906e8a63160ad994296f
|
4
|
+
data.tar.gz: 65fd4237832ccb0b88f44a4a36e122d004192c38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b340d980af27c6f4733c83cf47981b078d98d2933359a10d322f07ca8aa9d44ae66fa39109046faf072528e3087ce3e11748fbe97e1428e809d379fa735a7a5
|
7
|
+
data.tar.gz: 3f6e380aed270fa5243098c15c1ad14b28cbeee18fc6b0309719eedd5088e03800d265aed81321da53b19bfa3a8d2dd4049de74fce1fce353e75b462c5561545
|
data/.travis.yml
ADDED
data/Rakefile
CHANGED
@@ -2,6 +2,7 @@ require 'gtk3'
|
|
2
2
|
require "mireru/logger"
|
3
3
|
require "mireru/window"
|
4
4
|
require "mireru/container"
|
5
|
+
require "mireru/version"
|
5
6
|
|
6
7
|
module Mireru
|
7
8
|
module Command
|
@@ -22,6 +23,9 @@ module Mireru
|
|
22
23
|
if /\A(-h|--help)\z/ =~ arguments[0]
|
23
24
|
write_help_message
|
24
25
|
exit(true)
|
26
|
+
elsif /\A(-v|--version)\z/ =~ arguments[0]
|
27
|
+
write_version_message
|
28
|
+
exit(true)
|
25
29
|
end
|
26
30
|
|
27
31
|
files = files_from_arguments(arguments)
|
@@ -95,11 +99,20 @@ Keybind:
|
|
95
99
|
@logger.info(message)
|
96
100
|
end
|
97
101
|
|
102
|
+
def write_version_message
|
103
|
+
message = <<-EOM
|
104
|
+
#{::Mireru::VERSION}
|
105
|
+
EOM
|
106
|
+
@logger.info(message)
|
107
|
+
end
|
108
|
+
|
98
109
|
def write_empty_message
|
99
110
|
message = <<-EOM
|
100
111
|
Warning: file not found.
|
101
112
|
#{USAGE}
|
102
113
|
If no argument, then search current directory.
|
114
|
+
Options:
|
115
|
+
-d, --deep: deep search
|
103
116
|
EOM
|
104
117
|
@logger.error(message)
|
105
118
|
end
|
data/lib/mireru/version.rb
CHANGED
data/lib/mireru/widget.rb
CHANGED
data/test/test-mireru.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "mireru/command/mireru"
|
2
|
+
require "mireru/container"
|
2
3
|
|
3
4
|
class MireruTest < Test::Unit::TestCase
|
4
5
|
def setup
|
@@ -21,6 +22,24 @@ class MireruTest < Test::Unit::TestCase
|
|
21
22
|
end
|
22
23
|
end
|
23
24
|
|
25
|
+
def test_run_version_option
|
26
|
+
arguments = %w(--version)
|
27
|
+
mock(@mireru).write_version_message
|
28
|
+
assert_raise SystemExit do
|
29
|
+
@mireru.run(arguments)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_run_empty
|
34
|
+
arguments = %w(hoge)
|
35
|
+
stub(@mireru).files_from_arguments { arguments }
|
36
|
+
mock.instance_of(Mireru::Container).empty? { true }
|
37
|
+
mock(@mireru).write_empty_message
|
38
|
+
assert_raise SystemExit do
|
39
|
+
@mireru.run(arguments)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
24
43
|
def test_files_from_arguments_no_argument
|
25
44
|
arguments = %w()
|
26
45
|
expected = %w(dir1 file1 dir2)
|
data/test/test-widget.rb
CHANGED
@@ -4,6 +4,10 @@ class WidgetTest < Test::Unit::TestCase
|
|
4
4
|
def test_image?
|
5
5
|
assert_nil(Mireru::Widget.image?(__FILE__))
|
6
6
|
assert_not_nil(Mireru::Widget.image?("test/fixtures/nijip.png"))
|
7
|
+
assert_not_nil(Mireru::Widget.image?("hoge.PNG"))
|
8
|
+
assert_not_nil(Mireru::Widget.image?("hoge.jpg"))
|
9
|
+
assert_not_nil(Mireru::Widget.image?("hoge.jpeg"))
|
10
|
+
assert_not_nil(Mireru::Widget.image?("hoge.gif"))
|
7
11
|
end
|
8
12
|
|
9
13
|
def test_buffer_from_file_of_text
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mireru
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masafumi Yokoyama
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-04-
|
11
|
+
date: 2013-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gtk3
|
@@ -118,6 +118,7 @@ extensions: []
|
|
118
118
|
extra_rdoc_files: []
|
119
119
|
files:
|
120
120
|
- .gitignore
|
121
|
+
- .travis.yml
|
121
122
|
- Gemfile
|
122
123
|
- LICENSE.txt
|
123
124
|
- README.md
|