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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 30b30b55a62ebb76c00bb13f7f8fd49c80ec6ade
4
- data.tar.gz: 62cf52fd2780daa0e6d9e62a9d666536e64afb6e
3
+ metadata.gz: ac1e35de74d8cb4f531e906e8a63160ad994296f
4
+ data.tar.gz: 65fd4237832ccb0b88f44a4a36e122d004192c38
5
5
  SHA512:
6
- metadata.gz: ff475315e946a1aa82a60a21556899127c111f5b0a025428ded94fbb0c3a9e32dfd87a5de70c46eeff6d8fc69d536b061574e520296866e1522021077e49a509
7
- data.tar.gz: ade0850157b14f64964c4c7d48997a7ec71c30f0bc061772a93651ca178165762559151e28017babab5601d3a0222dda82a2b4d5ea330ef86ced466d96176f5d
6
+ metadata.gz: 7b340d980af27c6f4733c83cf47981b078d98d2933359a10d322f07ca8aa9d44ae66fa39109046faf072528e3087ce3e11748fbe97e1428e809d379fa735a7a5
7
+ data.tar.gz: 3f6e380aed270fa5243098c15c1ad14b28cbeee18fc6b0309719eedd5088e03800d265aed81321da53b19bfa3a8d2dd4049de74fce1fce353e75b462c5561545
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
data/Rakefile CHANGED
@@ -1 +1,9 @@
1
1
  require "bundler/gem_tasks"
2
+
3
+ desc "Run test"
4
+ task :test do
5
+ Bundler::GemHelper.install_tasks
6
+ ruby("-rubygems", "test/run-test.rb")
7
+ end
8
+
9
+ task :default => :test
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Mireru
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/mireru/widget.rb CHANGED
@@ -32,7 +32,7 @@ module Mireru
32
32
  end
33
33
 
34
34
  def image?(file)
35
- /\.(png|jpe?g|gif)\z/i =~ file
35
+ /\.(png|jpe?g|gif|ico|ani|bmp|pnm|ras|tga|tiff|xbm|xpm)\z/i =~ file
36
36
  end
37
37
 
38
38
  private
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.0
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-10 00:00:00.000000000 Z
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